Add WarpScan::Sum benchmark covering extended floating-point types #10768
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 497 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10768"
general
weight: 0.35
Wint3rNight
Add WarpScan::Sum benchmark covering extended floating-point types
Addresses the warp-level part of item 2 in #9587.
Device-level Reduce/Scan/RadixSort coverage landed in #9708, and warp-level
Reduce::Sum/Minalready carry
__halfand__nv_bfloat16.WarpScanhad no benchmark at all undercub/benchmarks/bench/, so this adds one.What this adds
cub/benchmarks/bench/scan/warp_scan_base.cuh— the shared harness, mirroringbench/reduce/warp_reduce_base.cuh: samebenchmark_kernel<block_size, unroll_factor, ...>from
device_side_benchmark.cuh, same occupancy-derived grid size, sameblock_size = 256/unroll_factor = 128, sameexec_tag::gpu | exec_tag::no_batch.cub/benchmarks/bench/scan/warp_scan_sum.cu— thecuda::std::plus<>instantiation, with thetype axis copied from
warp_reduce_sum.cuincluding its_CCCL_HAS_NVFP16()/_CCCL_HAS_NVBF16()/_CCCL_CTK_AT_LEAST(12, 2)guards.No CMake change is needed —
cub/benchmarks/CMakeLists.txtglobsbench/*recursively, so thenew file registers itself as
cub.bench.scan.warp_scan_sum.base.WarpScan::InclusiveScanwrites through an out-parameter rather than returning, so the functorholds the result in a local and returns it, keeping the
data = action(data)chain inbenchmark_kernelintact. Theop_tindirection is kept so amin/maxvariant can reuse thesame base header the way
warp_reduce_min.cudoes.One deliberate difference from
warp_reduce_base.cuh: the unusedconst int devicelocal is notcarried over.
Validation
Built and run locally on sm_86, CTK 13.3, g++-15. All 13 types on the axis execute,
F16andBF16included:As a sanity check that the scan is not being optimized away, I ran this and
cub.bench.reduce.warp_reduce_sum.baseback to back and compared GPU times (µs):| | I8 | I32 | I64 | I128 | F16 | BF16 | F32 | F64 |
|---|---|---|---|---|---|---|---|---|
| warp_reduce_sum | 13.0 | 15.1 | 71.6 | 642 | 44.7 | 43.9 | 43.1 | 311 |
| warp_scan_sum | 55.1 | 43.6 | 72.4 | 532 | 45.0 | 44.9 | 43.7 | 310 |
Reduce is 3–4× faster for the small integer types, which lines up with
warp_reduxdispatching toredux.syncon sm_80+ where scan has no equivalent instruction; for the float and complex typesthe two track each other closely, as expected when both fall back to shuffle chains. Cost also
scales with type width (I32 43.6 µs → I128 532 µs).
Caveat on those numbers: this is a laptop GPU whose clocks idle far below nominal, so nvbench's
throttle detector discarded every sample until I passed
--throttle-threshold 0. Both binarieswere measured back to back under identical conditions, so the comparison above is meaningful, but
the absolute figures are not representative of the hardware and shouldn't be read as performance
results. I only have sm_86, so I can't offer measurements on any other architecture.
Question on the rest of #9587
Items 1–3 also list Block-level coverage, but there are no block-level benchmarks in CUB at all
right now — so that would mean adding the harness, not just extending a type axis. Is that intended
to be part of this issue, or would you rather it were separate work? Happy to pick it up either
way, I just didn't want to guess at the scope.