Skip to content

Fix benchmark regressions from #1846 - #2384

Open
achirkin wants to merge 7 commits into
NVIDIA:mainfrom
achirkin:fix-dataset-api-benchmark-regressions
Open

Fix benchmark regressions from #1846#2384
achirkin wants to merge 7 commits into
NVIDIA:mainfrom
achirkin:fix-dataset-api-benchmark-regressions

Conversation

@achirkin

@achirkin achirkin commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fix a few issues introduced to the benchmark executables limiting the functionality:

  • Reinstate the dropped support for CAGRA-Q (compression_* parameters)
  • Avoid multiple copies of the data and the graph on device in various code paths
  • Avoid copying the data if it is device-accessible
  • Make logical merge reuse one buffer slot per split and free it before reallocating, instead of appending new split copies on every set_search_dataset call.
  • Make multi-GPU CAGRA benchmarks use the padded index and dataset view, which CAGRA search requires.
  • Revert copy() to the shallow copy-constructor form used before, so all shared state is forwarded to per-thread wrappers.

The changeset is limited to C++ benchmarks, thus doesn't affect the library or any dependencies.

@achirkin achirkin self-assigned this Jul 31, 2026
@achirkin achirkin added bug Something isn't working non-breaking Introduces a non-breaking change labels Jul 31, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 31, 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.

@achirkin

Copy link
Copy Markdown
Contributor Author

/ok to test

@achirkin

Copy link
Copy Markdown
Contributor Author

/ok to test

@cjnolet

cjnolet commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@achirkin its too late for anything to be merged into 26.08. You'll need to retarget to main.

achirkin added 2 commits July 31, 2026 16:14
…enchmark-provided dataset to avoid ambiguity w.r.t. data residence
@achirkin achirkin changed the title WIP Fix dataset API PR regressions Fix benchmark regressions from #1846 Jul 31, 2026
@achirkin

Copy link
Copy Markdown
Contributor Author

Sure. I'll just finish it up today and let you decide whether to re-target and whether to optionally backport the fixes later if necessary.

@achirkin
achirkin marked this pull request as ready for review July 31, 2026 15:41
@achirkin
achirkin requested a review from a team as a code owner July 31, 2026 15:41
@cjnolet
cjnolet changed the base branch from release/26.08 to main July 31, 2026 23:01
@cjnolet
cjnolet requested review from a team as code owners July 31, 2026 23:01
@cjnolet
cjnolet requested a review from msarahan July 31, 2026 23:01
@achirkin
achirkin removed request for a team August 3, 2026 09:59
@achirkin
achirkin removed request for a team and msarahan August 3, 2026 09:59

@tfeher tfeher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Artem, most of it looks good, but I have some questions.

Comment thread cpp/bench/ann/src/cuvs/cuvs_cagra_wrapper.h
host_index_ = std::make_shared<host_index_type>(cuvs::neighbors::cagra::build(
handle_, host_params, cuvs::neighbors::make_host_standard_dataset_view(dataset_view_host)));
index_ =
std::make_shared<index_type>(detail::to_graph_only_index<T, IdxT>(handle_, *host_index_));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the differnece betweenhost_index_and index_? Isn't host_index_ already a graph_only index? (due to add_dataset_on_build=false?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

host_index_ (host_standard_index) is introduced as a workaround in this PR alongside index_ (device_padded_index, searchable) to support various input dataset types with minimum number of copies.

staging = raft::make_device_matrix<T, int64_t>(handle_, rows, dim_);
raft::copy(staging.data_handle(),
dataset,
static_cast<size_t>(rows) * dim_,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this is called on the whole dataset, then we might run OOM. We should have a vpq quantization method that takes host input data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants