Skip to content

Duplicate radix sort dispatch to deprecate DispatchRadixSort - #9530

Merged
bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:radix_sort_dispatch
Jun 30, 2026
Merged

bernhardmgruber merged 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
@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

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: ee56a9e5-2cec-494a-852d-efca16285d61

📥 Commits

Reviewing files that changed from the base of the PR and between 7f20e9a and 72a8e7f.

📒 Files selected for processing (1)
  • cub/cub/device/dispatch/dispatch_radix_sort.cuh
🚧 Files skipped from review as they are similar to previous changes (1)
  • cub/cub/device/dispatch/dispatch_radix_sort.cuh

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved radix sort dispatch behavior for more robust handling of different source/destination buffer scenarios.
    • Enhanced the keys-only instantiation path to avoid value-copy work at compile time.
  • New Features
    • None.
  • Chores
    • Marked the older radix sort dispatch interface as deprecated, directing users to the newer device radix sort API.
  • Refactor
    • Reworked the internal radix-sort dispatch logic to simplify and streamline multi-pass execution and temporary-storage handling.

Walkthrough

DispatchRadixSort is marked deprecated. InvokeCopy switches the values-copy guard to if constexpr. detail::radix_sort adds pass_config and dispatch_impl, and dispatch now calls dispatch_impl directly with the renamed overwrite flag.

Changes

Radix Sort Dispatch Refactor

Layer / File(s) Summary
Deprecation attribute and if constexpr fix
cub/cub/device/dispatch/dispatch_radix_sort.cuh
DispatchRadixSort gets an enabled deprecation attribute, and the values-copy path in InvokeCopy becomes if constexpr (!KEYS_ONLY).
New pass_config struct
cub/cub/device/dispatch/dispatch_radix_sort.cuh
detail::radix_sort::pass_config is added with init(...) for kernel configuration and radix-pass sizing.
New dispatch_impl struct and dispatch wiring
cub/cub/device/dispatch/dispatch_radix_sort.cuh
detail::radix_sort::dispatch_impl implements the dispatch paths, dispatch renames is_overwrite_okay to can_overwrite_source_buffer, and the old fake_policy forwarding is removed.

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

This comment has been minimized.

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

Not happy about the duplication but if it allows us to deprecate the old API i am fine

@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) June 29, 2026 11:56
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 03m: Pass: 100%/287 | Total: 3d 04h | Max: 59m 33s | Hits: 94%/210620

See results here.

@bernhardmgruber
bernhardmgruber merged commit 28bf614 into NVIDIA:main Jun 30, 2026
304 of 305 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jun 30, 2026
@bernhardmgruber
bernhardmgruber deleted the radix_sort_dispatch branch July 1, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants