Cagra
Python module: cuvs.neighbors.cagra
AceParams
Parameters for ACE (Augmented Core Extraction) graph building algorithm.
ACE enables building indexes for datasets too large to fit in GPU memory by partitioning the dataset using balanced k-means and building sub-indexes for each partition independently.
Parameters
Constructor
Members
npartitions
ef_construction
build_dir
use_disk
max_host_memory_gb
max_gpu_memory_gb
get_handle
CompressionParams
Parameters for VPQ Compression
Parameters
Constructor
Members
pq_bits
pq_dim
vq_n_centers
kmeans_n_iters
vq_kmeans_trainset_fraction
pq_kmeans_trainset_fraction
get_handle
ExtendParams
Supplemental parameters to extend CAGRA Index
Parameters
Constructor
Members
max_chunk_size
Index
Members
trained
dim
graph_degree
dtype
dataset
graph
IndexParams
Parameters to build index for CAGRA nearest neighbor search
Parameters
Constructor
Members
get_handle
metric
intermediate_graph_degree
graph_degree
build_algo
nn_descent_niter
refinement_rate
SearchParams
CAGRA search parameters
Parameters
Constructor
Members
get_handle
max_queries
itopk_size
max_iterations
algo
team_size
search_width
min_iterations
thread_block_size
hashmap_mode
hashmap_min_bitlen
hashmap_max_fill_rate
num_random_samplings
rand_xor_mask
build
@auto_sync_resources
Build the CAGRA index from the dataset for efficient search.
The build performs two different steps- first an intermediate knn-graph is constructed, then it’s optimized it to create the final graph. The index_params object controls the node degree of these graphs.
It is required that both the dataset and the optimized graph fit the GPU memory.
Note: When using ACE (Augmented Core Extraction) build algorithm, the dataset must be in host memory (CPU). The ACE algorithm is designed for datasets too large to fit in GPU memory.
The following distance metrics are supported:
- L2
- InnerProduct
- Cosine
Parameters
Returns
Examples
extend
@auto_sync_resources
Extend a CAGRA index with additional vectors
Parameters
from_graph
@auto_sync_resources
Construct a cagra index from an existing graph and dataset
Parameters
Returns
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