faiss icon indicating copy to clipboard operation
faiss copied to clipboard

Faiss-gpu with torch.distributed

Open doctrymtk opened this issue 3 years ago • 2 comments

Summary

I want to use faiss-gpu with torch.distrubuted on the same machine. However, when I launch the program, it complains that there is no available gpu even if I the gpu memories on the machine are nearly empty. What can I do with it?

Running on:

  • [ ] CPU
  • [X] GPU

Interface:

  • [ ] C++
  • [X] Python

Reproduction instructions

doctrymtk avatar Feb 22 '22 07:02 doctrymtk

Maybe you could give a bit more detail ? + code ?

mdouze avatar Feb 28 '22 10:02 mdouze

Summary

I want to use faiss-gpu with torch.distrubuted on the same machine. However, when I launch the program, it complains that there is no available gpu even if I the gpu memories on the machine are nearly empty. What can I do with it?

Running on:

  • [ ] CPU
  • [x] GPU

Interface:

  • [ ] C++
  • [x] Python

Reproduction instructions

Did you solve it?

GlennCGL avatar May 31 '22 05:05 GlennCGL

I'm experiencing similar issues with allocating memory when running KMeans using FAISS. The problem for me seems to originate from trying to allocate memory on multiple GPUs from a child process. I successfully let FAISS to work with me by initiating everything from the main python process instead of from a child one.

This makes me suspect that there are some issues with multiprocessing with Python. I'm running with cudatoolkit=11.3.1.

eugene-yang avatar Dec 21 '22 22:12 eugene-yang