Skip to content

update_dataset CAGRA - #2427

Draft
aamijar wants to merge 2 commits into
NVIDIA:mainfrom
aamijar:update_dataset
Draft

update_dataset CAGRA#2427
aamijar wants to merge 2 commits into
NVIDIA:mainfrom
aamijar:update_dataset

Conversation

@aamijar

@aamijar aamijar commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

This PR introduces the update_dataset function in the cpp api.
update_dataset should swap out the dataset from an index. For instance, from a device_standard_dataset_view -> device_padded_dataset_view.

The major use case here is when a user builds a cagra index with a certain type of dataset. But during search they want to use a different type of dataset. In the future this may look like device_standard_dataset_view -> device_pq_dataset_view.

The type of dataset is coupled to the index type. So we need to construct a new index object altogether. To avoid copying expensive member variables like the cagra graph or source indices we simply move them to the new object instead. This means the user relinquishes the old index object.

A new constructor in cagra.hpp has been introduced to move and take ownership of the resources from an existing cagra index and assign the new dataset.

We intend to remove the attach_dataset and other helper functions such as convert_standard_to_padded_index and convert_host_to_device_index. The callers that use the removed functions should be updated to use update_dataset instead.

Resolves #2404

@copy-pr-bot

copy-pr-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@aamijar aamijar self-assigned this Aug 8, 2026
@aamijar aamijar added non-breaking Introduces a non-breaking change improvement Improves an existing functionality labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA][C++ API] Fix update_dataset at C++ API layer

1 participant