Vamana
Source header: cuvs/neighbors/vamana.hpp
Vamana index build parameters
neighbors::vamana::codebook_params
Parameters used to build quantized DiskANN index; to be generated using
deserialize_codebooks()
Fields
neighbors::vamana::index_params
Parameters used to build DiskANN index
Fields
Vamana index type
neighbors::vamana::index
Vamana index.
The index stores the dataset and the Vamana graph in device memory.
neighbors::vamana::index::metric
Distance metric used for clustering.
Returns
neighbors::vamana::index::size
Total length of the index (number of vectors).
Returns
IdxT
neighbors::vamana::index::dim
Dimensionality of the data.
Returns
uint32_t
neighbors::vamana::index::graph_degree
Graph degree
Returns
uint32_t
neighbors::vamana::index::data
Dataset [size, dim]
Returns
const cuvs::neighbors::dataset<int64_t>&
neighbors::vamana::index::quantized_data
Quantized dataset [size, codes_rowlen]
Returns
raft::device_matrix_view<const uint8_t, int64_t, raft::row_major>
neighbors::vamana::index::graph
vamana graph [size, graph-degree]
Returns
raft::device_matrix_view<const IdxT, int64_t, raft::row_major>
neighbors::vamana::index::medoid
Return the id of the vector selected as the medoid.
Returns
IdxT
neighbors::vamana::index::index
Parameters
Returns
void
Additional overload: neighbors::vamana::index::index
Construct an empty index.
Parameters
Returns
void
Additional overload: neighbors::vamana::index::index
Construct an index from dataset and vamana graph
Parameters
Returns
void
neighbors::vamana::index::update_graph
Replace the graph with a new graph.
Since the new graph is a device array, we store a reference to that, and it is the caller’s responsibility to ensure that knn_graph stays alive as long as the index.
Parameters
Returns
void
Additional overload: neighbors::vamana::index::update_graph
Replace the graph with a new graph.
We create a copy of the graph on the device. The index manages the lifetime of this copy.
Parameters
Returns
void
neighbors::vamana::index::update_quantized_dataset
Replace the current quantized dataset with a new quantized dataset.
We create a copy of the quantized dataset on the device. The index manages the lifetime of this copy.
Parameters
Returns
void
Vamana index build functions
neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<float, uint32_t>
Additional overload: neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<float, uint32_t>
Additional overload: neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<int8_t, uint32_t>
Additional overload: neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<int8_t, uint32_t>
Additional overload: neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<uint8_t, uint32_t>
Additional overload: neighbors::vamana::build
Build the index from the dataset for efficient DiskANN search.
The build utilities the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively iserts batches of nodes. Each batch involves performing a greedy search for each vector to be inserted, and inserting it with edges to all nodes traversed during the search. Reverse edges are also inserted and robustPrune is applied to improve graph quality. The index_params struct controls the degree of the final graph.
The following distance metrics are supported:
- L2
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<uint8_t, uint32_t>
Vamana serialize functions
neighbors::vamana::serialize
Save the index to file.
Matches the file format used by the DiskANN open-source repository, allowing cross-compatibility.
Parameters
Returns
void
Additional overload: neighbors::vamana::serialize
Save the index to file.
Matches the file format used by the DiskANN open-source repository, allowing cross-compatibility.
Parameters
Returns
void
Additional overload: neighbors::vamana::serialize
Save the index to file.
Matches the file format used by the DiskANN open-source repository, allowing cross-compatibility.
Parameters
Returns
void
Vamana codebook functions
neighbors::vamana::deserialize_codebooks
Construct codebook parameters from input codebook files
Expects pq pivots file at “{codebook_prefix}_pq_pivots.bin_rotation_matrix.bin”.
Parameters
Returns