Skip to main content

Module neighbors

Module neighbors 

Source
Expand description

Nearest neighbor search algorithms.

Mirrors the C++ cuvs::neighbors namespace: each submodule wraps one index type. Build an Index from a dataset, then search it with device-resident queries and output buffers; see the dlpack module for the tensor model.

Modules§

brute_force
Brute-force (exact) k-NN.
cagra
CAGRA: a graph-based approximate nearest neighbors algorithm with state-of-the-art query throughput for both small and large batch sizes.
filters
Shared filter payloads for nearest-neighbor search APIs.
ivf_flat
IVF-Flat: an inverted-file index over uncompressed (“flat”) vectors. It partitions the dataset into n_lists clusters and, at query time, scans only the n_probes closest clusters — a simple knob to trade recall for speed.
ivf_pq
IVF-PQ: an inverted-file index that product-quantizes the vectors. Like IVF-Flat it partitions the dataset into n_lists clusters and scans the n_probes closest at query time, but compresses each vector into pq_dim codes of pq_bits bits — much smaller, slightly less accurate.
vamana
Vamana: builds a DiskANN-style Vamana graph over a dataset.