Cagra Index Module
Rust module: cuvs::cagra::index
Source: rust/cuvs/src/cagra/index.rs
Index
CAGRA ANN Index
Methods
build
Builds a new Index from the dataset for efficient search.
Arguments
res- Resources to useparams- Parameters for building the indexdataset- A row-major matrix on either the host or device to index
Source: rust/cuvs/src/cagra/index.rs:38
new
Creates a new empty index
Source: rust/cuvs/src/cagra/index.rs:52
search
Perform a Approximate Nearest Neighbors search on the Index
Arguments
res- Resources to useparams- Parameters to use in searching the indexqueries- A matrix in device memory to query forneighbors- Matrix in device memory that receives the indices of the nearest neighborsdistances- Matrix in device memory that receives the distances of the nearest neighbors
Source: rust/cuvs/src/cagra/index.rs:69
search_with_filter
Perform a filtered Approximate Nearest Neighbors search on the Index
Like search, but accepts a bitset filter to exclude
vectors during graph traversal. Filtered vectors are never visited,
giving better recall than post-filtering.
Arguments
res- Resources to useparams- Parameters to use in searching the indexqueries- A matrix in device memory to query forneighbors- Matrix in device memory that receives the indices of the nearest neighborsdistances- Matrix in device memory that receives the distances of the nearest neighborsbitset- A 1-Duint32device tensor withceil(n_rows / 32)elements. Each bit corresponds to a dataset row: bit 1 = include, bit 0 = exclude.
Source: rust/cuvs/src/cagra/index.rs:107
serialize
Save the CAGRA index to file.
Experimental, both the API and the serialization format are subject to change.
Arguments
res- Resources to usefilename- The file path for saving the indexinclude_dataset- Whether to write out the dataset to the file
Source: rust/cuvs/src/cagra/index.rs:143
serialize_to_hnswlib
Save the CAGRA index to file in hnswlib format.
NOTE: The saved index can only be read by the hnswlib wrapper in cuVS, as the serialization format is not compatible with the original hnswlib.
Experimental, both the API and the serialization format are subject to change.
Arguments
res- Resources to usefilename- The file path for saving the index
Source: rust/cuvs/src/cagra/index.rs:166
deserialize
Load a CAGRA index from file.
Experimental, both the API and the serialization format are subject to change.
Arguments
res- Resources to usefilename- The path of the file that stores the index
Source: rust/cuvs/src/cagra/index.rs:179
Source: rust/cuvs/src/cagra/index.rs:17