Skip to content
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

Migrate from RAFT to CUVS #3549

Open
wants to merge 182 commits into
base: main
Choose a base branch
from

Conversation

tarang-jain
Copy link
Contributor

@tarang-jain tarang-jain commented Jun 25, 2024

Remove the dependency on raft::compiled and modify GPU implementations to use cuVS backend in place of RAFT.

A deeper insight into the dependency:
FAISS gets the ANN algorithm implementations such as IVF-Flat and IVF-PQ from cuVS. RAFT is meant to be a lightweight C++ header-only template library that cuVS relies on for the more fundamental / low-level utilities. Some examples of these are RAFT's device mdarray and mdspan objects; the RAFT resource object (raft::resource) that takes care of the stream ordering of device functions; linear algebra functions such as mapping, reduction, BLAS routines etc. A lot of the cuVS functions take the RAFT mdspan objects as arguments (for example raft::device_matrix_view). Therefore FAISS relies on both cuVS and RAFT. FAISS gets RAFT headers through cuVS and uses them to create the function arguments that can be consumed by cuVS. Note that we are not explicitly linking FAISS against raft::raft or raft::compiled. Only the required headers are included and compiled rather than compiling the whole RAFT shared library. This is the reason we still see mentions of raft in FAISS.

@tarang-jain
Copy link
Contributor Author

@asadoughi can the system glibc version be updated for running the cuvs github action? The cmake seg fault went away when I downgrade to cmake 3.26.4, but I see this error https://github.com/facebookresearch/faiss/actions/runs/11239339471/job/31246908895?pr=3549 which might mean a libc version mismatch.

@asadoughi
Copy link
Contributor

AFAICT, this CI is running on ubuntu-latest so you can try amending the shell commands in build_cmake/action.yaml to run ldd --version and the relevant sudo apt-get -y install command to install the specific glibc version.

@facebook-github-bot
Copy link
Contributor

@asadoughi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@asadoughi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Copy link
Contributor

@asadoughi asadoughi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks like unpinned CMake with 24.08 works.

In addition to the torch CPU tensor issue, let's track

faiss/gpu/test/torch_test_contrib_gpu.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.