Skip to content

Commit bd8e091

Browse files
tarang-jainfacebook-github-bot
authored andcommitted
Link cuVS Docs (facebookresearch#4084)
Summary: Small updates to the ReadMe files. More detailed description in a follow up PR for the wiki. Remove the cuvs conda CI checks Pull Request resolved: facebookresearch#4084 Reviewed By: mengdilin Differential Revision: D67602013 Pulled By: mnorris11 fbshipit-source-id: f7c40440d278f00195bcad2dbdd2187325f40662
1 parent b74644c commit bd8e091

5 files changed

Lines changed: 34 additions & 41 deletions

File tree

.github/workflows/build-pull-request.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -143,36 +143,6 @@ jobs:
143143
fetch-tags: true
144144
- name: Build and Package (conda)
145145
uses: ./.github/actions/build_conda
146-
linux-x86_64-GPU-CUVS-CUDA11-8-0-conda:
147-
name: Linux x86_64 GPU w/ cuVS conda (CUDA 11.8.0)
148-
runs-on: 4-core-ubuntu-gpu-t4
149-
env:
150-
CUDA_ARCHS: "70-real;72-real;75-real;80;86-real"
151-
steps:
152-
- name: Checkout
153-
uses: actions/checkout@v4
154-
with:
155-
fetch-depth: 0
156-
fetch-tags: true
157-
- uses: ./.github/actions/build_conda
158-
with:
159-
cuvs: "ON"
160-
cuda: "11.8.0"
161-
linux-x86_64-GPU-CUVS-CUDA12-4-0-conda:
162-
name: Linux x86_64 GPU w/ cuVS conda (CUDA 12.4.0)
163-
runs-on: 4-core-ubuntu-gpu-t4
164-
env:
165-
CUDA_ARCHS: "70-real;72-real;75-real;80;86-real"
166-
steps:
167-
- name: Checkout
168-
uses: actions/checkout@v4
169-
with:
170-
fetch-depth: 0
171-
fetch-tags: true
172-
- uses: ./.github/actions/build_conda
173-
with:
174-
cuvs: "ON"
175-
cuda: "12.4.0"
176146
windows-x86_64-conda:
177147
name: Windows x86_64 (conda)
178148
needs: linux-x86_64-cmake

INSTALL.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pre-release nightly builds.
66

77
- The CPU-only faiss-cpu conda package is currently available on Linux (x86-64 and aarch64), OSX (arm64 only), and Windows (x86-64)
88
- faiss-gpu, containing both CPU and GPU indices, is available on Linux (x86-64 only) for CUDA 11.4 and 12.1
9-
- faiss-gpu-raft containing both CPU and GPU indices provided by NVIDIA RAFT, is available on Linux (x86-64 only) for CUDA 11.8 and 12.1.
9+
- faiss-gpu-raft [^1] package containing GPU indices provided by [NVIDIA RAFT](https://github.com/rapidsai/raft/) version 24.06, is available on Linux (x86-64 only) for CUDA 11.8 and 12.4.
1010

1111
To install the latest stable release:
1212

@@ -23,10 +23,9 @@ $ conda install -c pytorch -c nvidia -c rapidsai -c conda-forge faiss-gpu-raft=1
2323
# GPU(+CPU) version using AMD ROCm not yet available
2424
```
2525

26-
For faiss-gpu, the nvidia channel is required for CUDA, which is not
27-
published in the main anaconda channel.
26+
For faiss-gpu, the nvidia channel is required for CUDA, which is not published in the main anaconda channel.
2827

29-
For faiss-gpu-raft, the nvidia, rapidsai and conda-forge channels are required.
28+
For faiss-gpu-raft, the rapidsai, conda-forge and nvidia channels are required.
3029

3130
Nightly pre-release packages can be installed as follows:
3231

@@ -37,8 +36,11 @@ $ conda install -c pytorch/label/nightly faiss-cpu
3736
# GPU(+CPU) version
3837
$ conda install -c pytorch/label/nightly -c nvidia faiss-gpu=1.9.0
3938

40-
# GPU(+CPU) version with NVIDIA RAFT
41-
conda install -c pytorch -c nvidia -c rapidsai -c conda-forge faiss-gpu-raft=1.9.0 pytorch pytorch-cuda numpy
39+
# GPU(+CPU) version with NVIDIA cuVS (package built with CUDA 12.4)
40+
conda install -c pytorch -c rapidsai -c conda-forge -c nvidia pytorch/label/nightly::faiss-gpu-cuvs 'cuda-version>=12.0,<=12.5'
41+
42+
# GPU(+CPU) version with NVIDIA cuVS (package built with CUDA 11.8)
43+
conda install -c pytorch -c rapidsai -c conda-forge -c nvidia pytorch/label/nightly::faiss-gpu-cuvs 'cuda-version>=11.4,<=11.8'
4244

4345
# GPU(+CPU) version using AMD ROCm not yet available
4446
```
@@ -68,7 +70,7 @@ $ conda install -c conda-forge faiss-cpu
6870
# GPU version
6971
$ conda install -c conda-forge faiss-gpu
7072

71-
# AMD ROCm version not yet available
73+
# NVIDIA cuVS and AMD ROCm version not yet available
7274
```
7375

7476
You can tell which channel your conda packages come from by using `conda list`.
@@ -95,6 +97,8 @@ The optional requirements are:
9597
- the CUDA toolkit,
9698
- for AMD GPUs:
9799
- AMD ROCm,
100+
- for using NVIDIA cuVS implementations:
101+
- libcuvs=24.12
98102
- for the python bindings:
99103
- python 3,
100104
- numpy,
@@ -103,6 +107,19 @@ The optional requirements are:
103107
Indications for specific configurations are available in the [troubleshooting
104108
section of the wiki](https://github.com/facebookresearch/faiss/wiki/Troubleshooting).
105109

110+
### Building with NVIDIA cuVS
111+
112+
The libcuvs dependency should be installed via conda:
113+
1. With CUDA 12.0 - 12.5:
114+
```
115+
conda install -c rapidsai -c conda-forge -c nvidia libcuvs=24.12 'cuda-version>=12.0,<=12.5'
116+
```
117+
2. With CUDA 11.4 - 11.8
118+
```
119+
conda install -c rapidsai -c conda-forge -c nvidia libcuvs=24.12 'cuda-version>=11.4,<=11.8'
120+
```
121+
For more ways to install cuVS 24.12, refer to the [RAPIDS Installation Guide](https://docs.rapids.ai/install).
122+
106123
## Step 1: invoking CMake
107124

108125
``` shell
@@ -118,9 +135,9 @@ Several options can be passed to CMake, among which:
118135
values are `ON` and `OFF`),
119136
- `-DFAISS_ENABLE_PYTHON=OFF` in order to disable building python bindings
120137
(possible values are `ON` and `OFF`),
121-
- `-DFAISS_ENABLE_CUVS=ON` in order to enable building the cuVS implementations
122-
of the IVF-Flat and IVF-PQ GPU-accelerated indices (default is `OFF`, possible
123-
values are `ON` and `OFF`)
138+
- `-DFAISS_ENABLE_CUVS=ON` in order to use the NVIDIA cuVS implementations
139+
of the IVF-Flat, IVF-PQ and [CAGRA](https://arxiv.org/pdf/2308.15136) GPU-accelerated indices (default is `OFF`, possible, values are `ON` and `OFF`).
140+
Note: `-DFAISS_ENABLE_GPU` must be set to `ON` when enabling this option.
124141
- `-DBUILD_TESTING=OFF` in order to disable building C++ tests,
125142
- `-DBUILD_SHARED_LIBS=ON` in order to build a shared library (possible values
126143
are `ON` and `OFF`),
@@ -302,3 +319,5 @@ and you can run
302319
$ python demos/demo_auto_tune.py
303320
```
304321
to test the GPU code.
322+
323+
[^1]: The vector search and clustering algorithms in NVIDIA RAFT have been formally migrated to [NVIDIA cuVS](https://github.com/rapidsai/cuvs). This package is being renamed to `faiss-gpu-cuvs` in the next stable release, which will use these GPU implementations from the pre-compiled `libcuvs=24.12` binary.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The GPU implementation can accept input from either CPU or GPU memory. On a serv
1616

1717
## Installing
1818

19-
Faiss comes with precompiled libraries for Anaconda in Python, see [faiss-cpu](https://anaconda.org/pytorch/faiss-cpu) and [faiss-gpu](https://anaconda.org/pytorch/faiss-gpu). The library is mostly implemented in C++, the only dependency is a [BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) implementation. Optional GPU support is provided via CUDA or AMD ROCm, and the Python interface is also optional. It compiles with cmake. See [INSTALL.md](INSTALL.md) for details.
19+
Faiss comes with precompiled libraries for Anaconda in Python, see [faiss-cpu](https://anaconda.org/pytorch/faiss-cpu), [faiss-gpu](https://anaconda.org/pytorch/faiss-gpu) and [faiss-gpu-cuvs](https://anaconda.org/pytorch/faiss-gpu-cuvs). The library is mostly implemented in C++, the only dependency is a [BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) implementation. Optional GPU support is provided via CUDA or AMD ROCm, and the Python interface is also optional. The backend GPU implementations of NVIDIA [cuVS](https://github.com/rapidsai/cuvs) can also be enabled optionally. It compiles with cmake. See [INSTALL.md](INSTALL.md) for details.
2020

2121
## How Faiss works
2222

faiss/gpu/impl/CuvsIVFFlat.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ void CuvsIVFFlat::searchPreassigned(
291291
Tensor<idx_t, 2, true>& outIndices,
292292
bool storePairs) {
293293
// TODO: Fill this in!
294+
// Reference issue: https://github.com/facebookresearch/faiss/issues/3243
295+
FAISS_THROW_MSG("searchPreassigned is not implemented for cuVS index");
294296
}
295297

296298
void CuvsIVFFlat::updateQuantizer(Index* quantizer) {

faiss/gpu/impl/CuvsIVFPQ.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ void CuvsIVFPQ::searchPreassigned(
229229
Tensor<idx_t, 2, true>& outIndices,
230230
bool storePairs) {
231231
// TODO: Fill this in!
232+
// Reference issue: https://github.com/facebookresearch/faiss/issues/3243
233+
FAISS_THROW_MSG("searchPreassigned is not implemented for cuVS index");
232234
}
233235

234236
size_t CuvsIVFPQ::getGpuListEncodingSize_(idx_t listId) {

0 commit comments

Comments
 (0)