Skip to content

Fix cuvs-bench faiss_gpu_cagra with host dataset - #2951

Merged
rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
aamijar:faiss_cagra_store_dataset
Nov 4, 2026
Merged

rapids-bot[bot] merged 4 commits into
NVIDIA:mainfrom
aamijar:faiss_cagra_store_dataset

Conversation

@aamijar

@aamijar aamijar commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Fixes a bug (introduced in 26.08) where the dataset was always being copied to device, even when users are specifying building with a host dataset in the .yaml. Specific to the cuvs-bench faiss gpu backend.

This PR also sets the store_dataset faiss native parameter to be false. This parameter is used to move the dataset to device after the build is done, so that is ready for searching. However, this is uncessary since, cuvs-bench with --search runs in a separate process. It will reload the index and dataset separately.

Resolves #2936.

@copy-pr-bot

copy-pr-bot Bot commented Oct 26, 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 Oct 26, 2026
@aamijar aamijar added non-breaking Introduces a non-breaking change bug Something isn't working labels Oct 26, 2026
@aamijar aamijar moved this from Todo to In Progress in Unstructured Data Processing Oct 26, 2026
@aamijar
aamijar marked this pull request as ready for review October 26, 2026 21:05
@aamijar
aamijar requested review from a team as code owners October 26, 2026 21:05
@aamijar aamijar moved this from In Progress to Needs Review in Unstructured Data Processing Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Improvements
    • CAGRA indexes can be built without retaining the dataset. The dataset can be attached for use during search.
    • When dataset retention is enabled, host-provided datasets are copied to device storage for index use. Device-provided datasets are also supported during search.

The Faiss wrapper sets CAGRA dataset storage to false. The Faiss patch adds a graph-only training path for host input when storage is disabled, defers dataset attachment until search, and clears the retained dataset copy on reset.

Changes: CAGRA Dataset Handling

Layer / File(s) Summary
Configure and build graph-only indexes
cpp/bench/ann/src/faiss/faiss_gpu_wrapper.h, cpp/cmake/patches/faiss-1.14-cuvs-26.08.diff
The wrapper disables dataset storage. CAGRA training uses padded dataset views and builds a graph-only index for host input when storage is disabled. Dataset attachment is deferred to search, and reset clears the retained host-to-device dataset copy.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • NVIDIA/cuvs#2936: The PR changes the wrapper’s store_dataset setting, but keeps it fixed at false rather than adding the optional build parameter requested by the issue.

Suggested reviewers: cjnolet, achirkin, tarang-jain

Merge Risk: Minimal · up to 59875

No actionable merge-blocking issue remains; the host-dataset build and saved-index search paths are consistent with the intended behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning [#2936] The issue asks to expose store_dataset as an optional Faiss CAGRA build parameter and pass it to GpuIndexCagraConfig in both benchmark paths. The PR does not add an optional parameter. In cpp/… Expose store_dataset as an optional CAGRA build parameter in the Faiss GPU benchmark parameter handling. Parse it from the benchmark YAML. Set config.store_dataset from that parameter instead of a literal. Apply the same value in both bench…
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: fixing host-dataset handling in the cuvs-bench Faiss GPU CAGRA backend.
Description check Passed The description directly explains the host-dataset bug, the store_dataset change, the affected backend, and the linked issue.
Out of Scope Changes check Passed All changed files are the faiss_gpu_wrapper.h store_dataset assignment and the faiss-1.14-cuvs-26.08.diff patch. The patch changes CuvsCagra build and search dataset handling. The PR description state…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Out of Scope Changes check

Explanation

All changed files are the faiss_gpu_wrapper.h store_dataset assignment and the faiss-1.14-cuvs-26.08.diff patch. The patch changes CuvsCagra build and search dataset handling. The PR description states this as the host-dataset bug fix. The new graph-only branch depends on store_dataset_, so it connects to the store_dataset behavior named in #2936. The PR description links the PR to #2936 and describes both changes. No change in the diff is unrelated to the stated objectives. No unrelated files are changed.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Linked Issues check

Explanation

[#2936] The issue asks to expose store_dataset as an optional Faiss CAGRA build parameter and pass it to GpuIndexCagraConfig in both benchmark paths. The PR does not add an optional parameter. In cpp/bench/ann/src/faiss/faiss_gpu_wrapper.h (diff base..head, around line 542), config.store_dataset changed from hardcoded true to hardcoded false, with a TODO comment. The value is still fixed and cannot be selected by the user. The diff contains no change to the parameter struct, YAML/parameter parsing, or the CAGRA-to-HNSW path. The faiss patch cpp/cmake/patches/faiss-1.14-cuvs-26.08.diff changes CuvsCagra::train and search so host-input builds skip the device copy when store_dataset_ is false. That addresses the host-dataset bug described in the PR, but it does not make store_dataset configurable. Requirement unmet.

Resolution

Expose store_dataset as an optional CAGRA build parameter in the Faiss GPU benchmark parameter handling. Parse it from the benchmark YAML. Set config.store_dataset from that parameter instead of a literal. Apply the same value in both benchmark build paths, including the CAGRA-to-HNSW path named in the issue. Keep the host-dataset fix. Remove the unconditional false assignment.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cuvs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 473c880
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: b5cb400d-474d-4945-9dc1-c03e90374483
Commits

Reviewing files that changed from the base of the PR and between fed2e5f and 598752a.

Files selected for processing: 1
  • cpp/bench/ann/src/faiss/faiss_gpu_wrapper.h
Files skipped from review as they are similar to previous changes: 1
  • cpp/bench/ann/src/faiss/faiss_gpu_wrapper.h

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@maestromadman

Copy link
Copy Markdown

Confirmed the saved index search functionality on GPU +  store_dataset=false  behavior during --search.

@tarang-jain tarang-jain 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.

Pre-approving except one docs request.

config.intermediate_graph_degree = param.intermediate_graph_degree;
config.device = this->device_;
config.store_dataset = true;
config.store_dataset = false;

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.

this is temporary. The store_dataset flag has been removed in the latest nightly. Can you just add a note indicating that this needs to be removed? And after that upgrade when the dataset is on host and search is called, the search API does not work as it currently does in 26.08. If you can just add these to the docs here, that would be great.

@github-project-automation github-project-automation Bot moved this from Needs Review to Approved in Unstructured Data Processing Nov 3, 2026
@aamijar

aamijar commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot
rapids-bot Bot merged commit 56ee66d into NVIDIA:main Nov 4, 2026
218 of 228 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Unstructured Data Processing Nov 4, 2026
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

Status: Done

Development

Successfully merging this pull request may close these issues.

store_dataset hardcoded in cuVS Bench Faiss CAGRA build configuration

4 participants