IVF SQ
Python module: cuvs.neighbors.ivf_sq
Index
IvfSq index object. This object stores the trained IvfSq index state which can be used to perform nearest neighbors searches.
Members
trained
n_lists
The number of inverted lists (clusters)
dim
dimensionality of the cluster centers
centers
Get the cluster centers corresponding to the lists in the original space
IndexParams
Parameters to build index for IvfSq nearest neighbor search
Note: IVF-SQ currently uses fixed 8-bit residual scalar quantization. There are no additional SQ-specific tuning knobs.
Parameters
Constructor
Members
get_handle
metric
metric_arg
add_data_on_build
n_lists
kmeans_n_iters
max_train_points_per_cluster
conservative_memory_allocation
SearchParams
Supplemental parameters to search IVF-SQ index
Parameters
Constructor
Members
get_handle
n_probes
build
@auto_sync_resources
Build the IvfSq index from the dataset for efficient search.
IVF-SQ (Scalar Quantization) uses IVF partitioning together with per-dimension scalar quantization. Each vector’s residual is encoded as one byte per dimension, which can reduce vector-storage memory by about 4x vs IVF-Flat for float32 inputs (about 2x for float16 inputs), excluding IVF structural overhead. Recall and speed trade-offs versus IVF-PQ are dataset and tuning dependent.
Parameters
Returns
Examples
extend
@auto_sync_resources
Extend an existing index with new vectors.
The input array can be either CUDA array interface compliant matrix or array interface compliant matrix in host memory.
Parameters
Returns
Examples
load
@auto_sync_resources
Loads index from file.
Saving / loading the index is experimental. The serialization format is subject to change, therefore loading an index saved with a previous version of cuvs is not guaranteed to work.
Parameters
Returns
save
@auto_sync_resources
Saves the index to a file.
Saving / loading the index is experimental. The serialization format is subject to change.
Parameters
Examples
search
@auto_sync_resources
@auto_convert_output
Find the k nearest neighbors for each query.
Parameters
Examples