Skip to content

Duplicate radix sort dispatch to deprecate DispatchRadixSort#9530

Open
bernhardmgruber wants to merge 2 commits into
NVIDIA:mainfrom
bernhardmgruber:radix_sort_dispatch
Open

Duplicate radix sort dispatch to deprecate DispatchRadixSort#9530
bernhardmgruber wants to merge 2 commits into
NVIDIA:mainfrom
bernhardmgruber:radix_sort_dispatch

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Jun 17, 2026

Copy link
Copy Markdown
Contributor
  • No SASS changes for cub.bench.radix_sort.pairs.base on SM75;80;90;100

@copy-pr-bot

copy-pr-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Jun 17, 2026
Comment thread cub/cub/device/dispatch/dispatch_radix_sort.cuh Outdated
@bernhardmgruber bernhardmgruber marked this pull request as ready for review June 29, 2026 08:12
@bernhardmgruber bernhardmgruber requested a review from a team as a code owner June 29, 2026 08:12
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved radix sort dispatch behavior to better handle different input/output buffer scenarios.
    • Optimized the keys-only path so unnecessary value handling is removed at compile time.
  • Chores

    • Marked the older radix sort dispatch interface as deprecated in favor of the newer device radix sort API.

Walkthrough

DispatchRadixSort gets its deprecation attribute enabled. InvokeCopy gains if constexpr on the values-copy path. A new pass_config struct and a new dispatch_impl struct are introduced under detail::radix_sort, replacing the fake_policy/DispatchRadixSort::__invoke forwarding path. The overwrite parameter is renamed can_overwrite_source_buffer.

Radix Sort Dispatch Refactor

Layer / File(s) Summary
Deprecation and if constexpr fix
cub/cub/device/dispatch/dispatch_radix_sort.cuh
DispatchRadixSort deprecation attribute is uncommented; values-copy guard changed to if constexpr (!KEYS_ONLY).
pass_config struct
cub/cub/device/dispatch/dispatch_radix_sort.cuh
New pass_config<UpsweepKernelT, ScanKernelT, DownsweepKernelT, OffsetT> struct with init(...) that configures upsweep/scan/downsweep kernels and computes max_downsweep_grid_size and even_share.
dispatch_impl and dispatch wiring
cub/cub/device/dispatch/dispatch_radix_sort.cuh
New dispatch_impl struct implements invoke_single_tile, invoke_pass/invoke_passes, invoke_onesweep, and top-level invoke(PolicyGetter). detail::radix_sort::dispatch renames the overwrite parameter to can_overwrite_source_buffer and constructs dispatch_impl directly instead of using the fake_policy path.

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

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

🧹 Nitpick comments (1)
cub/cub/device/dispatch/dispatch_radix_sort.cuh (1)

1413-1429: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: mark the new non-mutated locals const where applicable, e.g. pass_bits, pass_spine_length, max_grid_size, spine_length, num_bits, is_num_passes_odd, max_alt_passes, alt_end_bit, num_passes, num_portions, max_num_blocks, value_size, histogram_kernel, portion_num_items, num_blocks, and onesweep_kernel. As per coding guidelines, “All variables that are not modified must use const.”

Also applies to: 1588-1623, 1703-1708, 1766-1766, 1851-1858, 1897-1897

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3f483d68-1ebf-4929-8706-48d14f76152a

📥 Commits

Reviewing files that changed from the base of the PR and between 47e0576 and 7f20e9a.

📒 Files selected for processing (1)
  • cub/cub/device/dispatch/dispatch_radix_sort.cuh

@github-actions

Copy link
Copy Markdown
Contributor

😬 CI Workflow Results

🟥 Finished in 1h 27m: Pass: 99%/287 | Total: 6d 17h | Max: 1h 05m | Hits: 46%/462539

See results here.

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

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant