You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Deduce raft::linalg::gemm template arguments in scann_soar.cuh - #3145
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.
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.
The header adds <optional>. The GEMM call uses type deduction and optional-wrapped alpha and beta views. The copyright attribution now includes NVIDIA affiliates.
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: 4
Check name
Status
Explanation
Title check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingnon-breakingIntroduces a non-breaking change
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NVIDIA/raft#3205 added an
OutputTypetemplate parameter to the mdspan overloads ofraft::linalg::gemm, shiftingScalarIdxTypeandScalarViewTypeby one position.compute_soar_labelsinscann_soar.cuhpreviously worked around template deduction forstd::optional<ScalarViewType>by explicitly passing all seven old template arguments, which now bindsuint32_ttoOutputTypeand breaks thescann_build_float.cubuild.Because C++ template argument deduction does not consider implicit conversions from
raft::host_scalar_viewtostd::optional<ScalarViewType>, this wrapsalpha.view()andbeta.view()withstd::make_optionaland removes the explicit template argument list. That lets the compiler deduce all template parameters directly, matches thestd::make_optionalidiom used across RAFT'sgemmcallers and other optional-mdspan APIs, and remains compatible with both pre- and post-NVIDIA/raft#3205 headers.