Skip to content

Deprecate cub::ChainedPolicy#9744

Merged
bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
bernhardmgruber:depr_chainedpolicy
Jul 9, 2026
Merged

Deprecate cub::ChainedPolicy#9744
bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
bernhardmgruber:depr_chainedpolicy

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes part of: #9378

@bernhardmgruber bernhardmgruber requested a review from a team as a code owner July 8, 2026 08:19
@bernhardmgruber bernhardmgruber requested a review from pauleonix July 8, 2026 08:19
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 8, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 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: 427c878e-56af-4a16-a026-5e1c207bcf3b

📥 Commits

Reviewing files that changed from the base of the PR and between 2838af4 and 9445559.

📒 Files selected for processing (34)
  • cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh
  • cub/cub/device/dispatch/tuning/tuning_for.cuh
  • cub/cub/device/dispatch/tuning/tuning_histogram.cuh
  • cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_radix_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_rle_encode.cuh
  • cub/cub/device/dispatch/tuning/tuning_rle_non_trivial_runs.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_select_if.cuh
  • cub/cub/device/dispatch/tuning/tuning_three_way_partition.cuh
  • cub/cub/device/dispatch/tuning/tuning_unique_by_key.cuh
  • cub/cub/util_device.cuh
  • cub/test/catch2_test_device_adjacent_difference_custom_policy_hub.cu
  • cub/test/catch2_test_device_histogram_custom_policy_hub.cu
  • cub/test/catch2_test_device_merge_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_radix_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_reduce_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_reduce_dispatcher.cu
  • cub/test/catch2_test_device_rle_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_radix_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_reduce_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_if_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_unique_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_three_way_partition_custom_policy_hub.cu
  • cub/test/catch2_test_util_device.cu
  • cub/test/catch2_test_vsmem.cu
✅ Files skipped from review due to trivial changes (7)
  • cub/test/catch2_test_device_three_way_partition_custom_policy_hub.cu
  • cub/test/catch2_test_device_merge_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_unique_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_if_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_radix_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_sort_custom_policy_hub.cu
🚧 Files skipped from review as they are similar to previous changes (27)
  • cub/cub/device/dispatch/tuning/tuning_for.cuh
  • cub/test/catch2_test_device_rle_custom_policy_hub.cu
  • cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_rle_encode.cuh
  • cub/test/catch2_test_device_reduce_dispatcher.cu
  • cub/cub/device/dispatch/tuning/tuning_rle_non_trivial_runs.cuh
  • cub/test/catch2_test_device_histogram_custom_policy_hub.cu
  • cub/test/catch2_test_device_adjacent_difference_custom_policy_hub.cu
  • cub/test/catch2_test_device_reduce_by_key_custom_policy_hub.cu
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan_by_key.cuh
  • cub/test/catch2_test_util_device.cu
  • cub/test/catch2_test_vsmem.cu
  • cub/test/catch2_test_device_radix_sort_custom_policy_hub.cu
  • cub/cub/device/dispatch/tuning/tuning_three_way_partition.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_sort.cuh
  • cub/test/catch2_test_device_segmented_reduce_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_by_key_custom_policy_hub.cu
  • cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan.cuh
  • cub/cub/device/dispatch/tuning/tuning_histogram.cuh
  • cub/cub/device/dispatch/tuning/tuning_select_if.cuh
  • cub/cub/util_device.cuh
  • cub/cub/device/dispatch/tuning/tuning_unique_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_radix_sort.cuh

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved internal tuning/dispatch policy chaining consistency across adjacent difference, scan, sort, reduce, histogram, and related algorithms to ensure the intended chained-policy wiring is used.
  • Chores
    • Introduced a deprecated compatibility alias for the older chained-policy interface, pointing to the newer internal chaining type.
  • Tests
    • Updated device and custom policy-hub tests to use the newer chained-policy form.

Walkthrough

This PR renames the internal chained-policy implementation to detail::chained_policy, makes ChainedPolicy a deprecated alias, and updates tuning policy hubs and test policy helpers to use the new type. TODO comments were added in test code for future cleanup.

Changes

ChainedPolicy to detail::chained_policy migration

Layer / File(s) Summary
Core chained_policy refactor and deprecated public alias
cub/cub/util_device.cuh
Restructures namespace boundaries, renames the internal chained-policy struct and friend references to detail::chained_policy, and replaces the public ChainedPolicy struct with a deprecated alias.
Tuning policy_hub updates across device algorithms
cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh, tuning_for.cuh, tuning_histogram.cuh, tuning_merge_sort.cuh, tuning_radix_sort.cuh, tuning_reduce.cuh, tuning_reduce_by_key.cuh, tuning_rle_encode.cuh, tuning_rle_non_trivial_runs.cuh, tuning_scan.cuh, tuning_scan_by_key.cuh, tuning_segmented_reduce.cuh, tuning_segmented_sort.cuh, tuning_select_if.cuh, tuning_three_way_partition.cuh, tuning_unique_by_key.cuh
Updates Policy500 through Policy1000 (and SM-tier variants) inheritance across all tuning policy hubs to use detail::chained_policy instead of ChainedPolicy.
Test custom policy hubs and GEN_POLICY macro
cub/test/catch2_test_device_*_custom_policy_hub.cu, cub/test/catch2_test_device_reduce_dispatcher.cu, cub/test/catch2_test_util_device.cu, cub/test/catch2_test_vsmem.cu
Updates test policy definitions (MaxPolicy, policy_t, policy_500) and the GEN_POLICY macro to inherit from detail::chained_policy, and adds TODO comments for future cleanup.

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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
cub/cub/util_device.cuh (1)

788-790: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

suggestion: Stale comment—references old ChainedPolicy name and a nonexistent find_and_invoke_policy call site wording. Update to match the rename.

   template <int, typename, typename>
-  friend struct chained_policy; // let us call find_and_invoke_policy of other ChainedPolicy instantiations
+  friend struct chained_policy; // let us call find_and_invoke_policy of other chained_policy instantiations

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c702c4ea-7371-4e9a-9edb-feca0a05ac43

📥 Commits

Reviewing files that changed from the base of the PR and between 9e381d4 and 60392b1.

📒 Files selected for processing (34)
  • cub/cub/device/dispatch/tuning/tuning_adjacent_difference.cuh
  • cub/cub/device/dispatch/tuning/tuning_for.cuh
  • cub/cub/device/dispatch/tuning/tuning_histogram.cuh
  • cub/cub/device/dispatch/tuning/tuning_merge_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_radix_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_rle_encode.cuh
  • cub/cub/device/dispatch/tuning/tuning_rle_non_trivial_runs.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan.cuh
  • cub/cub/device/dispatch/tuning/tuning_scan_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_reduce.cuh
  • cub/cub/device/dispatch/tuning/tuning_segmented_sort.cuh
  • cub/cub/device/dispatch/tuning/tuning_select_if.cuh
  • cub/cub/device/dispatch/tuning/tuning_three_way_partition.cuh
  • cub/cub/device/dispatch/tuning/tuning_unique_by_key.cuh
  • cub/cub/util_device.cuh
  • cub/test/catch2_test_device_adjacent_difference_custom_policy_hub.cu
  • cub/test/catch2_test_device_histogram_custom_policy_hub.cu
  • cub/test/catch2_test_device_merge_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_radix_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_reduce_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_reduce_dispatcher.cu
  • cub/test/catch2_test_device_rle_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_scan_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_radix_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_reduce_custom_policy_hub.cu
  • cub/test/catch2_test_device_segmented_sort_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_if_custom_policy_hub.cu
  • cub/test/catch2_test_device_select_unique_by_key_custom_policy_hub.cu
  • cub/test/catch2_test_device_three_way_partition_custom_policy_hub.cu
  • cub/test/catch2_test_util_device.cu
  • cub/test/catch2_test_vsmem.cu

Comment thread cub/cub/util_device.cuh
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 08m: Pass: 100%/287 | Total: 12d 10h | Max: 2h 38m | Hits: 18%/1045483

See results here.

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

LGTM

@bernhardmgruber bernhardmgruber merged commit bec6074 into NVIDIA:main Jul 9, 2026
608 of 613 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jul 9, 2026
@bernhardmgruber bernhardmgruber deleted the depr_chainedpolicy branch July 9, 2026 20: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