Skip to content

Deduce raft::linalg::gemm template arguments in scann_soar.cuh - #3145

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
bdice:fix-scann-soar-gemm-call
Dec 4, 2026
Merged

rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
bdice:fix-scann-soar-gemm-call

Conversation

@bdice

@bdice bdice commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

NVIDIA/raft#3205 added an OutputType template parameter to the mdspan overloads of raft::linalg::gemm, shifting ScalarIdxType and ScalarViewType by one position. compute_soar_labels in scann_soar.cuh previously worked around template deduction for std::optional<ScalarViewType> by explicitly passing all seven old template arguments, which now binds uint32_t to OutputType and breaks the scann_build_float.cu build.

Because C++ template argument deduction does not consider implicit conversions from raft::host_scalar_view to std::optional<ScalarViewType>, this wraps alpha.view() and beta.view() with std::make_optional and removes the explicit template argument list. That lets the compiler deduce all template parameters directly, matches the std::make_optional idiom used across RAFT's gemm callers and other optional-mdspan APIs, and remains compatible with both pre- and post-NVIDIA/raft#3205 headers.

@bdice bdice added bug Something isn't working non-breaking Introduces a non-breaking change labels Dec 4, 2026
@copy-pr-bot

copy-pr-bot Bot commented Dec 4, 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.

@bdice

bdice commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 010882c

@aamijar aamijar moved this to Needs Review in Unstructured Data Processing Dec 4, 2026

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

Thanks for the fix!

@github-project-automation github-project-automation Bot moved this from Needs Review to Approved in Unstructured Data Processing Dec 4, 2026
@viclafargue
viclafargue marked this pull request as ready for review December 4, 2026 14:48
@viclafargue
viclafargue requested a review from a team as a code owner December 4, 2026 14:48
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Refactor
    • Updated internal score calculation handling. No changes to user-facing features or behavior are expected. This update does not add or remove functionality, and there are no visible changes to report for end users.

The SOAR score GEMM call now uses type deduction and optional-wrapped alpha and beta views. The header includes <optional> and updates the copyright attribution.

Changes: SOAR GEMM call

Layer / File(s) Summary
Update SOAR score GEMM call
cpp/src/neighbors/scann/detail/scann_soar.cuh
The header adds <optional>. The GEMM call uses type deduction and optional-wrapped alpha and beta views. The copyright attribution now includes NVIDIA affiliates.

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

Change: Bug fix

Suggested reviewers: rmaschal

Merge Risk: Minimal · up to 01088

This updates the SOAR scoring GEMM call so it builds against RAFT headers both before and after the RAFT API change. No behavior change is expected, and no merge-blocking risk was identified. The PR still needs its category and breaking labels added.

Architecture risk: Low · up to 01088

The SOAR scoring caller now uses the GEMM call shape with deduced types and optional-wrapped alpha and beta views.

The SOAR scoring caller now supplies alpha and beta as optional-wrapped views, allowing the GEMM invocation to rely on template type deduction.

Changed areas: cpp

Review details

Systems and components

  • observed — 1 changed file mapped to cpp.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing the explicit template argument list from the raft::linalg::gemm call in scann_soar.cuh so the arguments are deduced. The raw summary and objectives both descr…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is specific and on-topic. It names the upstream RAFT change (NVIDIA/raft#3205) that added an OutputType template parameter to the mdspan gemm overloads. It explains that the explicit s…
Full details: Title check

Explanation

The title names the main change: removing the explicit template argument list from the raft::linalg::gemm call in scann_soar.cuh so the arguments are deduced. The raw summary and objectives both describe this same change, so the title matches the changeset.

Full details: Description check

Explanation

The description is specific and on-topic. It names the upstream RAFT change (NVIDIA/raft#3205) that added an OutputType template parameter to the mdspan gemm overloads. It explains that the explicit seven-argument template list in compute_soar_labels in scann_soar.cuh now binds uint32_t to OutputType and breaks the scann_build_float.cu build. It states the fix: wrap alpha.view() and beta.view() with std::make_optional and drop the explicit template arguments so the compiler deduces them. This matches the raw summary's description of the changes to scann_soar.cuh.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/cuvs
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: fb9a43d
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 9c94b747-40fe-4e74-a8a4-03aa2645c5f8
Commits

Reviewing files that changed from the base of the PR and between fb9a43d and 010882c.

Files selected for processing: 1

  • cpp/src/neighbors/scann/detail/scann_soar.cuh

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

@viclafargue

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 269075b into NVIDIA:main Dec 4, 2026
328 of 334 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Unstructured Data Processing Dec 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.

4 participants