Skip to content

Faiss cuVS details

Tarang Jain edited this page Jan 6, 2025 · 1 revision

Usage

The use_cuvs=True flag in GPU index configurations can be used to enable cuVS imeplementations for an index. Note that this is automatically set to True for supported index types if -DFAISS_ENABLE_CUVS=ON is set while building Faiss from source or with the faiss-gpu-cuvs conda package.

Building a GPU index:

>>> import faiss
>>> res = faiss.StandardGpuResources()
>>> co = faiss.GpuIndexIVFFlatConfig()
>>> co.use_cuvs = True
>>> index_gpu = faiss.GpuIndexIVFFlat(res, ncols, nlist, faiss.METRIC_L2, co)

Once the index has been initialized with this config, all subsequent operations on the index, such as add and search can be done using the function calls as regular GPU Faiss.

Cloning a CPU index:

>>> co = faiss.GpuClonerOptions()
>>> co.use_cuvs = True
>>> index_gpu = faiss.index_cpu_to_gpu(res, 0, index_cpu, co)

CAGRA + HNSW

  • TODO

Performance

  • TODO
Clone this wiki locally