rom1504 / clip-retrieval

Easily compute clip embeddings and build a clip retrieval system with them
https://rom1504.github.io/clip-retrieval/
MIT License
2.25k stars 203 forks source link

add instructions / code for one machine multi gpus #115

Open rom1504 opened 2 years ago

rom1504 commented 2 years ago

possibilities:

should be much easier to setup than multinode

rom1504 commented 2 years ago

tried this:

            spark = (
                SparkSession.builder.config("spark.driver.memory", "16G")
                .config("spark.task.resource.gpu.amount", "1")
                .config("spark.executor.resource.gpu.amount", "2")
                .config("spark.worker.resource.gpu.amount", "2")
                .config("spark.driver.resource.gpu.amount", "2")
                .config("spark.driver.resourcesFile", "/home/ubuntu/gpufile")
                .config("spark.executor.resourcesFile", "/home/ubuntu/gpufile")
                .config("spark.worker.resourcesFile", "/home/ubuntu/gpufile")
                .config("spark.executor.resource.gpu.discoveryScript", "/home/ubuntu/clip-retrieval/getGpusResources.sh")
                .config("spark.worker.resource.gpu.discoveryScript", "/home/ubuntu/clip-retrieval/getGpusResources.sh")
                .config("spark.driver.resource.gpu.discoveryScript", "/home/ubuntu/clip-retrieval/getGpusResources.sh")
                .master("local[" + str(2) + "]")
                .appName("spark-stats")
                .getOrCreate()
            )

but not working

there's probably a way with spark

probably possible to just do a multiprocessing strategy as well

mmderakhshani commented 3 months ago

Hi @rom1504, is there any solution for a one-node multiple GPUs scenario for distributed inference?

rom1504 commented 3 months ago

Yes advise to follow the same instructions as for multi machines

On Sun, Mar 24, 2024, 9:17 PM Mohammad Mahdi Derakhshani < @.***> wrote:

Hi @rom1504 https://github.com/rom1504, is there any solution for a one-node multiple GPUs scenario for distributed inference?

— Reply to this email directly, view it on GitHub https://github.com/rom1504/clip-retrieval/issues/115#issuecomment-2016931192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437SJQPUH7RR643YQ4JTYZ4YGHAVCNFSM5O32I7GKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBRGY4TGMJRHEZA . You are receiving this because you were mentioned.Message ID: @.***>

mmderakhshani commented 3 months ago

Thanks for the reply, @rom1504. Where can I get access to the /home/ubuntu/gpufile file? Any link would be appreciated.

rom1504 commented 3 months ago

https://github.com/rom1504/clip-retrieval/blob/main/docs/distributed_clip_inference.md#download-spark-on-workers has the instruction to create it

On Sun, Mar 24, 2024, 9:45 PM Mohammad Mahdi Derakhshani < @.***> wrote:

Thanks for the reply, @rom1504 https://github.com/rom1504. Where can I get access to the /home/ubuntu/gpufile file? Any link would be appreciated.

— Reply to this email directly, view it on GitHub https://github.com/rom1504/clip-retrieval/issues/115#issuecomment-2016937771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAR437WROOFALD53GYGAENTYZ43NLAVCNFSM5O32I7GKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBRGY4TGNZXG4YQ . You are receiving this because you were mentioned.Message ID: @.***>