Vamana Index Module

View as Markdown

Rust module: cuvs::vamana::index

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

Index

1#[derive(Debug)]
2pub struct Index(ffi::cuvsVamanaIndex_t);

Vamana ANN Index

Methods

NameSource
buildrust/cuvs/src/vamana/index.rs:33
newrust/cuvs/src/vamana/index.rs:47
serializerust/cuvs/src/vamana/index.rs:66

build

1pub fn build<T: Into<ManagedTensor>>(
2res: &Resources,
3params: &IndexParams,
4dataset: T,
5) -> Result<Index> { ... }

Builds Vamana Index for efficient DiskANN search

The build uses the Vamana insertion-based algorithm to create the graph. The algorithm starts with an empty graph and iteratively inserts 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.

Arguments

  • res - Resources to use
  • params - Parameters for building the index
  • dataset - A row-major matrix on either the host or device to index

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

new

1pub fn new() -> Result<Index> { ... }

Creates a new empty index

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

serialize

1pub fn serialize(self, res: &Resources, filename: &str, include_dataset: bool) -> Result<()> { ... }

Save Vamana index to file

Matches the file format used by the DiskANN open-source repository, allowing cross-compatibility.

Serialized Index is to be used by the DiskANN open-source repository for graph search.

Arguments

  • res - Resources to use
  • filename - The file prefix for where the index is sazved
  • include_dataset - whether to include the dataset in the serialized index

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

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