-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faiss GPU return different result than CPU #2273
Comments
No this is not normal. |
I have tested this:
Next the same search
D matrix if GPU is used
D matrix if CPU is used:
Values are quite differents. Do you think this could be solve manually? |
Did you any progress? |
Could you repro with self-contained code? |
Sure. Give me until tomorrow :). Thanks! |
Hello @mdouze I updated a self-contained code. There you just need to execute the main.py for running the tests. Let me know if you can access properly. https://github.com/mjack3/FAISS_GPU_TEST Note: I am using the torch+CUDA==11.3 although requeriments.txt has the torch+CUDA==10.2. I think that won't make difference. Thank you so much |
Running your test on Faiss 1.7.2 and torch 1.10.1 yields https://gist.github.com/mdouze/df42bd8ad8c74c42fedd3fd1043e83b7 NB that the Cuda version does matter and that pip is not a supported way of installing Faiss (use conda). |
|
For my cace, I was experiencing the cpu-gpu difference issue with faiss-gpu==1.7.2 that I installed with pip. After uninstalling it, and reintalling faiss-gpu by conda using |
Summary
I have a code that return higher performance running FAISS on CPU than GPU. The difference is huge.
Platform
Ubuntu 20.04 lTS
Faiss version: 1.7.2
Installed from: pip install faiss-gpu
https://pypi.org/project/faiss-gpu/
Running on:
Interface:
Reproduction instructions
I am using AUROC to meassure the performance of certain code. The "faiss part" of the code looks like this:
Next, I do my search
If I use CPU my AUROC performance is 0.9754
If I use the GPU, my AUROC score is 0.4675
There is something wrong? The code is always the same :S
The text was updated successfully, but these errors were encountered: