Neighbors Vamana Index Module

View as Markdown

Rust module: cuvs::neighbors::vamana::index

Source: rust/cuvs/src/neighbors/vamana/index.rs

Index

1#[derive(Debug)]
2pub struct Index(ffi::cuvsVamanaIndex_t); {
3 /* private fields */
4}

Vamana ANN index.

Methods

NameSource
buildrust/cuvs/src/neighbors/vamana/index.rs:33
serializerust/cuvs/src/neighbors/vamana/index.rs:65

build

1pub fn build<T>(res: &Resources, params: &IndexParams, dataset: &T) -> Result<Index>
2where
3T: AsDlTensor + ?Sized,

Builds a Vamana index for efficient DiskANN search.

The build uses the Vamana insertion-based algorithm: starting from an empty graph it iteratively inserts batches of nodes, performing a greedy search for each inserted vector and connecting it to all nodes traversed; reverse edges are added and robustPrune is applied to improve quality. [IndexParams] controls the degree of the final graph.

dataset is a row-major matrix on the host or device implementing [AsDlTensor]; it is copied into the index, so Index carries no lifetime.

Source: rust/cuvs/src/neighbors/vamana/index.rs:33

serialize

1pub fn serialize(
2&self,
3res: &Resources,
4filename: impl AsRef<Path>,
5include_dataset: bool,
6) -> Result<()>

Saves the Vamana index to a file.

Matches the on-disk format used by the DiskANN open-source repository, so the serialized index can be consumed there for graph search.

filename is the file prefix under which the index is saved; include_dataset controls whether the dataset is embedded.

Source: rust/cuvs/src/neighbors/vamana/index.rs:65

Source: rust/cuvs/src/neighbors/vamana/index.rs:19