[CUB] DeviceReduce with device resident problem size#9722
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds deferred device-resident ChangesDeferred num_items for DeviceReduce
Assessment against linked issues
Out-of-scope changes
Suggested reviewers: Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cub/cub/detail/deferred_parameter.cuh (1)
50-50: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winsuggestion:
resolve_parameteris device-only and cannot throw, but is missingnoexceptwhile its siblingsnormalize_parameterandresolve_num_itemshave it. Mark itnoexcept.- [[nodiscard]] _CCCL_DEVICE _CCCL_FORCEINLINE TargetT resolve_parameter(ParameterT parameter) + [[nodiscard]] _CCCL_DEVICE _CCCL_FORCEINLINE TargetT resolve_parameter(ParameterT parameter) noexceptAs per coding guidelines: "Functions that do not throw exceptions must be marked
noexcept."Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 305953b0-8b67-4c17-943a-5463e090b0b1
📒 Files selected for processing (9)
c/parallel/src/reduce.cucub/benchmarks/bench/reduce/deferred_nondeterministic.cucub/benchmarks/bench/reduce/deferred_sum.cucub/cub/detail/deferred_parameter.cuhcub/cub/device/device_reduce.cuhcub/cub/device/dispatch/dispatch_reduce.cuhcub/cub/device/dispatch/kernels/kernel_reduce.cuhcub/test/catch2_test_device_reduce_deferred.cucub/test/catch2_test_device_reduce_env.cu
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🥳 CI Workflow Results🟩 Finished in 4h 28m: Pass: 100%/291 | Total: 12d 05h | Max: 2h 34m | Hits: 20%/972783See results here. |
Description
closes #9561
No SASS changes to any existing benchmarks.
We expect the device-resident problem size to be slightly slower: the host cannot read the problem size, so it must assume it is large, launching a worst-case grid and always taking the two-pass path. Compared to the host-provided num_items, the results show an overhead of at most ~6 us, which is most noticeable at the smallest problem sizes.
Additionally, on the run-to-run path, when the problem-size element is 64-bit we observe larger overheads: the work partitioning that the host normally computes once from the immediate value must instead be recomputed by each block on device (where 64-bit integer division is expensive), and carrying the 64-bit problem size widens the kernel's register footprint relative to the 32-bit instantiation (40 vs. 32 registers on SM90), which can reduce occupancy. The not-guaranteed (atomic) kernel absorbs the deferred machinery with no register increase and shows no 64-bit overhead, as its table below confirms. Users whose problem sizes fit in 32 bits should prefer a 32-bit element for the deferred source.
Run-to-run reduce
Not-guaranteed reduce
Checklist