Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CAGRA index building without adding dataset to the index #2126

Merged

Conversation

tfeher
Copy link
Contributor

@tfeher tfeher commented Jan 24, 2024

We can build a CAGRA graph even for datasets that do not fit GPU mem. The IVF-PQ build method only requires that the temporary IVF-PQ index (that we use for creating the knn-graph) fits the GPU. But once the CAGRA graph is constructed, we try to initialize the CAGRA index which would copy the dataset to device memory.

This PR adds a build flag, that would disable copying the dataset into the index. That enables building CAGRA graph for large datasets, and also allows users to customize allocator used for storing the data.

@github-actions github-actions bot added the cpp label Jan 24, 2024
@tfeher tfeher added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Vector Search and removed cpp labels Jan 24, 2024
@@ -296,7 +296,8 @@ index<T, IdxT> build(
std::optional<experimental::nn_descent::index_params> nn_descent_params = std::nullopt,
std::optional<float> refine_rate = std::nullopt,
std::optional<ivf_pq::index_params> pq_build_params = std::nullopt,
std::optional<ivf_pq::search_params> search_params = std::nullopt)
std::optional<ivf_pq::search_params> search_params = std::nullopt,
bool construct_index_with_dataset = true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently only cagra::detail::build is changed. This is enough to unblock benchmarking with RAFT-ANN-Bench, but ideally we should have such an option in the public API. Opinions?

@tfeher tfeher changed the title Enable index building without actually addin dataset to the index Enable CAGRA index building without adding dataset to the index Jan 24, 2024
@cjnolet cjnolet self-assigned this Jan 24, 2024
@github-actions github-actions bot added the cpp label Jan 25, 2024
@tfeher tfeher changed the base branch from branch-24.02 to branch-24.04 February 1, 2024 16:37
@tfeher tfeher force-pushed the cagra_build_without_adding_dataset branch from 4fc8723 to 707547a Compare February 1, 2024 16:45
@tfeher tfeher marked this pull request as ready for review February 1, 2024 16:45
@tfeher tfeher requested a review from a team as a code owner February 1, 2024 16:45
@cjnolet
Copy link
Member

cjnolet commented Feb 2, 2024

/merge

@rapids-bot rapids-bot bot merged commit d403ab4 into rapidsai:branch-24.04 Feb 2, 2024
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Vector Search
Projects
Development

Successfully merging this pull request may close these issues.

2 participants