Source header: cuvs/neighbors/vamana.hpp
Parameters used to build quantized DiskANN index; to be generated using deserialize_codebooks()
Fields
Parameters used to build DiskANN index
Fields
Vamana index.
The index stores the dataset and the Vamana graph in device memory.
Distance metric used for clustering.
Returns
Total length of the index (number of vectors).
Returns
IdxT
Dimensionality of the data.
Returns
uint32_t
Graph degree
Returns
uint32_t
Dataset [size, dim]
Returns
const cuvs::neighbors::dataset<int64_t>&
Quantized dataset [size, codes_rowlen]
Returns
raft::device_matrix_view<const uint8_t, int64_t, raft::row_major>
vamana graph [size, graph-degree]
Returns
raft::device_matrix_view<const IdxT, int64_t, raft::row_major>
Return the id of the vector selected as the medoid.
Returns
IdxT
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
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
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
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:
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:
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:
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:
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:
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:
Usage example:
Parameters
Returns
cuvs::neighbors::vamana::index<uint8_t, uint32_t>
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
Construct codebook parameters from input codebook files
Expects pq pivots file at “{codebook_prefix}_pq_pivots.bin_rotation_matrix.bin”.
Parameters
Returns