mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
Summary: 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. Pull Request resolved: https://github.com/facebookresearch/faiss/pull/3549 Reviewed By: ramilbakhshyiev Differential Revision: D62041013 Pulled By: asadoughi fbshipit-source-id: 7230dcc06cf47baf95873adc1dec2adca4a8f82a
25 lines
759 B
Bash
Executable File
25 lines
759 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
set -e
|
|
|
|
|
|
# Build swigfaiss.so/swigfaiss_avx2.so/swigfaiss_avx512.so
|
|
cmake -B _build_python_${PY_VER} \
|
|
-Dfaiss_ROOT=_libfaiss_stage/ \
|
|
-DFAISS_OPT_LEVEL=avx512 \
|
|
-DFAISS_ENABLE_GPU=ON \
|
|
-DFAISS_ENABLE_CUVS=OFF \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DPython_EXECUTABLE=$PYTHON \
|
|
faiss/python
|
|
|
|
make -C _build_python_${PY_VER} -j$(nproc) swigfaiss swigfaiss_avx2 swigfaiss_avx512
|
|
|
|
# Build actual python module.
|
|
cd _build_python_${PY_VER}/
|
|
$PYTHON setup.py install --single-version-externally-managed --record=record.txt --prefix=$PREFIX
|