bclavie / RAGatouille

Easily use and train state of the art late-interaction retrieval methods (ColBERT) in any RAG pipeline. Designed for modularity and ease-of-use, backed by research.
Apache License 2.0
2.45k stars 173 forks source link

faiss-cpu faiss-gpu issue #184

Open jmnian opened 2 months ago

jmnian commented 2 months ago

I encountered this issue when I was trying to index colbert-ir/colbertv2.0:

WARNING! You have a GPU available, but onlyfaiss-cpuis currently installed. This means that indexing will be slow. To make use of your GPU. Please installfaiss-gpuby running: pip uninstall --y faiss-cpu & pip install faiss-gpu

I then run the pip command to uninstall faiss-cpu and install faiss-gpu. Then I got module not found:

File "/WAVE/users/unix/jnian/.local/lib/python3.9/site-packages/ragatouille/models/colbert.py", line 313, in index import faiss ModuleNotFoundError: No module named 'faiss'

bclavie commented 2 months ago

Hey, thank you for flagging!

There seems to be a lot of these issues with faiss and faiss-gpu on PyPi. The root issue being that the latest faiss-gpu wheels on there are aging and not well supported anymore.

The only surefire workaround currently seems to be to make sure they're all uninstalled (pip uninstall faiss-cpu pip uninstall faiss pip uninstall faiss-gpu until there's nothing to uninstall) and then installing faiss-gpu with one of the two officially supported ways: either building from source or installing via conda, as detailed here.

We're looking on transitioning further and further away from faiss due to those quirks and many others, but right now I'm afraid I can't provide a better solution!

HugoCS2002 commented 2 weeks ago

Does this problem still exist?