Skip to content

Fix launch_kernel handling of restricted and partially specified kernel arguments - #3117

Merged
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
dantegd:fix-runkern
Aug 13, 2026
Merged

Fix launch_kernel handling of restricted and partially specified kernel arguments#3117
rapids-bot[bot] merged 1 commit into
NVIDIA:mainfrom
dantegd:fix-runkern

Conversation

@dantegd

@dantegd dantegd commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fix downstream compilation failures introduced by the raft::launch_kernel migration.

Some sparse symmetrization launches combine:

  • partially specified kernel templates,
  • implicit argument conversions such as T* to const T*, and
  • __restrict__-qualified pointer parameters.

The dispatcher preserved __restrict__ in its explicit parameter packs and later attempted to convert addresses of those parameter copies to void const*, which NVCC rejects. In addition, the conversion overload cannot resolve a partially specified kernel template.

This change:

  • lets dispatch deduce its by-value parameter types so outermost extended qualifiers such as __restrict__ are dropped before arguments are staged for cudaLaunchKernelExC;
  • performs required conversions before that deduction in the converting overload;
  • fully specializes the affected COO/from-KNN symmetrization kernels; and
  • adds regression coverage for restricted pointers, restricted pointers requiring conversion, the legacy COO API, and from_knn_symmetrize_matrix.

This fixes the UMAP and t-SNE compilation failures observed when building cuML against current RAFT.

@dantegd dantegd self-assigned this Aug 13, 2026
@dantegd dantegd added bug Something isn't working non-breaking Non-breaking change labels Aug 13, 2026
@copy-pr-bot

copy-pr-bot Bot commented Aug 13, 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.

@dantegd
dantegd marked this pull request as ready for review August 13, 2026 19:07
@dantegd
dantegd requested a review from a team as a code owner August 13, 2026 19:07
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6b5803ca-b3ce-4bb8-9952-a73c449f4baf

📥 Commits

Reviewing files that changed from the base of the PR and between f633a16 and 479aea4.

📒 Files selected for processing (4)
  • cpp/include/raft/sparse/linalg/detail/symmetrize.cuh
  • cpp/include/raft/util/kernel_launch.hpp
  • cpp/tests/sparse/symmetrize.cu
  • cpp/tests/util/kernel_launch.cu

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved sparse matrix symmetrization reliability when using restricted device-memory pointers.
    • Improved kernel execution compatibility by handling qualified pointer arguments correctly during launches.
    • Preserved existing behavior and public interfaces.
  • Tests

    • Added coverage for legacy COO symmetrization, KNN symmetrization, and restricted-pointer kernel operations.

Walkthrough

Changes

Kernel launch and symmetrization updates

Layer / File(s) Summary
Dispatch qualifier handling
cpp/include/raft/util/kernel_launch.hpp, cpp/tests/util/kernel_launch.cu
Typed launch overloads convert arguments before dispatch. Tests cover restricted input and output pointers.
Symmetrization kernel instantiation
cpp/include/raft/sparse/linalg/detail/symmetrize.cuh, cpp/tests/sparse/symmetrize.cu
Symmetrization launches now specify kernel template arguments. Tests cover legacy COO output and restricted-pointer KNN input.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to 479ae

The PR fixes kernel argument handling for restricted and partially specified arguments and adds regression coverage; no actionable merge-blocking risk remains.

Possibly related PRs

  • NVIDIA/raft#3104: Both PRs update symmetrize.cuh and kernel_launch.hpp; this PR refines related typed dispatch and kernel instantiation changes.

Suggested reviewers: achirkin, divyegala

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change to launch_kernel handling of restricted and partially specified kernel arguments.
Description check ✅ Passed The description directly explains the compilation fix, affected kernels, and added regression tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@divyegala

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 05a5aa7 into NVIDIA:main Aug 13, 2026
156 of 158 checks passed
@achirkin

Copy link
Copy Markdown
Contributor

Thanks Dante for handling this!

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 Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants