Skip to content

Re-enable RTX 5090 fill tuning for 8-byte stores - #11555

Merged
bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
bernhardmgruber:cub-transform-fill-sm120-tuning-clean
Sep 21, 2026
Merged

bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
bernhardmgruber:cub-transform-fill-sm120-tuning-clean

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Widen the vectorized fill policy (vec_size 1 -> 4) for 8-byte stores on sm_120 (RTX 5090), instead of falling back to the generic B200/H200 formula, which leaves 8-byte stores scalar there.

Fixes: #7628.

cub.bench.transform.fill.base on an RTX 5090, full before/after diff:

## [0] NVIDIA GeForce RTX 5090

|  T{ct}  |  Aligned  |  Elements{io}  |   Ref Time |   Ref Noise |   Cmp Time |   Cmp Noise |       Diff |   %Diff |  Status  |
|---------|-----------|----------------|------------|-------------|------------|-------------|------------|---------|----------|
|   I8    |    yes    |      2^16      |   4.096 us |       0.39% |   4.096 us |       0.34% |   0.000 us |   0.00% |   SAME   |
|   I8    |    no     |      2^16      |   4.096 us |       0.34% |   4.097 us |       0.36% |   0.001 us |   0.01% |   SAME   |
|   I8    |    yes    |      2^20      |   4.096 us |       0.37% |   4.097 us |       0.36% |   0.001 us |   0.02% |   SAME   |
|   I8    |    no     |      2^20      |   5.841 us |      12.41% |   5.838 us |      12.49% |  -0.003 us |  -0.06% |   SAME   |
|   I8    |    yes    |      2^24      |   8.285 us |       5.27% |   8.296 us |       5.42% |   0.011 us |   0.13% |   SAME   |
|   I8    |    no     |      2^24      |  32.967 us |       1.88% |  33.123 us |       2.37% |   0.156 us |   0.47% |   SAME   |
|   I8    |    yes    |      2^28      | 158.205 us |       0.68% | 158.239 us |       0.71% |   0.034 us |   0.02% |   SAME   |
|   I8    |    no     |      2^28      | 489.162 us |       0.15% | 489.305 us |       0.11% |   0.143 us |   0.03% |   SAME   |
|   I8    |    yes    |      2^32      |   2.557 ms |       0.29% |   2.558 ms |       0.26% |   0.819 us |   0.03% |   SAME   |
|   I8    |    no     |      2^32      |   7.769 ms |       0.13% |   7.767 ms |       0.01% |  -1.699 us |  -0.02% |   FAST   |
|   I16   |    yes    |      2^16      |   4.096 us |       0.00% |   4.096 us |       0.00% |   0.000 us |   0.00% |   SAME   |
|   I16   |    no     |      2^16      |   4.097 us |       0.37% |   4.095 us |       0.37% |  -0.001 us |  -0.03% |   SAME   |
|   I16   |    yes    |      2^20      |   4.095 us |       0.28% |   4.100 us |       2.73% |   0.005 us |   0.12% |   SAME   |
|   I16   |    no     |      2^20      |   5.453 us |      17.70% |   5.627 us |      15.78% |   0.174 us |   3.18% |   SAME   |
|   I16   |    yes    |      2^24      |  18.525 us |       2.36% |  18.508 us |       2.10% |  -0.017 us |  -0.09% |   SAME   |
|   I16   |    no     |      2^24      |  34.314 us |       2.58% |  34.395 us |       2.42% |   0.081 us |   0.24% |   SAME   |
|   I16   |    yes    |      2^28      | 318.055 us |       0.38% | 317.939 us |       0.36% |  -0.116 us |  -0.04% |   SAME   |
|   I16   |    no     |      2^28      | 489.467 us |       0.03% | 489.470 us |       0.00% |   0.003 us |   0.00% |   SAME   |
|   I16   |    yes    |      2^32      |   5.077 ms |       0.20% |   5.078 ms |       0.29% |   0.500 us |   0.01% |   SAME   |
|   I16   |    no     |      2^32      |   7.788 ms |       0.13% |   7.788 ms |       0.04% |   0.376 us |   0.00% |   SAME   |
|   I32   |    yes    |      2^16      |   4.096 us |       0.00% |   4.096 us |       0.00% |   0.000 us |   0.00% |   SAME   |
|   I32   |    no     |      2^16      |   4.096 us |       0.00% |   4.092 us |       0.40% |  -0.004 us |  -0.09% |   FAST   |
|   I32   |    yes    |      2^20      |   4.099 us |       0.23% |   4.097 us |       0.17% |  -0.002 us |  -0.04% |   SAME   |
|   I32   |    no     |      2^20      |   5.463 us |      17.61% |   5.524 us |      17.01% |   0.061 us |   1.13% |   SAME   |
|   I32   |    yes    |      2^24      |  38.979 us |       0.94% |  38.970 us |       0.88% |  -0.008 us |  -0.02% |   SAME   |
|   I32   |    no     |      2^24      |  38.950 us |       0.71% |  38.989 us |       1.01% |   0.039 us |   0.10% |   SAME   |
|   I32   |    yes    |      2^28      | 634.170 us |       0.22% | 634.411 us |       0.23% |   0.241 us |   0.04% |   SAME   |
|   I32   |    no     |      2^28      | 633.307 us |       0.18% | 633.365 us |       0.16% |   0.058 us |   0.01% |   SAME   |
|   I32   |    yes    |      2^32      |  10.152 ms |       0.07% |  10.155 ms |       0.16% |   2.259 us |   0.02% |   SAME   |
|   I32   |    no     |      2^32      |  10.226 ms |       0.23% |  10.227 ms |       0.21% |   0.929 us |   0.01% |   SAME   |
|   I64   |    yes    |      2^16      |   4.096 us |       0.00% |   4.096 us |       0.00% |   0.000 us |   0.00% |   SAME   |
|   I64   |    no     |      2^16      |   4.098 us |       0.85% |   4.096 us |       0.00% |  -0.002 us |  -0.05% |   FAST   |
|   I64   |    yes    |      2^20      |   6.145 us |       0.24% |   6.145 us |       0.24% |   0.000 us |   0.01% |   SAME   |
|   I64   |    no     |      2^20      |   6.146 us |       0.21% |   6.144 us |       0.23% |  -0.002 us |  -0.03% |   SAME   |
|   I64   |    yes    |      2^24      |  81.587 us |       0.92% |  78.362 us |       1.15% |  -3.225 us |  -3.95% |   FAST   |
|   I64   |    no     |      2^24      |  83.597 us |       1.04% |  78.236 us |       1.05% |  -5.361 us |  -6.41% |   FAST   |
|   I64   |    yes    |      2^28      |   1.281 ms |       0.21% |   1.274 ms |       0.15% |  -6.672 us |  -0.52% |   FAST   |
|   I64   |    no     |      2^28      |   1.301 ms |       0.24% |   1.276 ms |       0.25% | -24.476 us |  -1.88% |   FAST   |

🤖 Generated with Claude Code

Widen the vectorized fill policy (vec_size 1 -> 4) for 8-byte stores on
sm_120, instead of falling back to the generic B200/H200 formula, which
leaves 8-byte stores scalar there. Non-8-byte stores keep using the
B200/H200 tuning, which already performs well on RTX 5090.

Tracked by NVIDIA#7628.
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Sep 21, 2026
@bernhardmgruber
bernhardmgruber requested a review from a team as a code owner September 21, 2026 11:45
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/cccl/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c3faf690-5df3-406f-8388-eeb251925408

📥 Commits

Reviewing files that changed from the base of the PR and between d7e464e and 9f15e39.

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

Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Performance
    • Improved vectorized data handling on RTX 5090-class GPUs and newer architectures (compute capability 12.0+) when using 8-byte stores.
    • Preserved existing tuning behavior for other store sizes and supported GPU configurations.
    • These updates can improve data-processing efficiency for workloads using the optimized vectorized storage path.

Walkthrough

tuned_vectorized_policy now selects {256, 8, 4} for compute capability 12.0 and later when store_size == 8. Other store sizes retain the B200/H200 tuning path.

Changes

Vectorized fill tuning

Layer / File(s) Summary
Compute capability 12 fill policy
cub/cub/device/dispatch/tuning/tuning_transform.cuh
tuned_vectorized_policy returns {256, 8, 4} for compute capability 12.0 and later when store_size == 8. Other store sizes continue to use the existing B200/H200 tuning path.

Assessment Against Linked Issues

Objective Addressed Explanation
Tune cub::DeviceTransform algorithms for sm120 [#7628] ✅

Suggested reviewers: davebayer, miscco

Priority: ⬇️ Low

Change: Bug fix


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

Remove "also used on RTX 5090 except for 8-byte stores (see below)" from
the B200/H200 comment; the RTX 5090 override right above it already makes
this clear.
@github-actions

Copy link
Copy Markdown
Contributor

🔬 CUB benchmark SASS comparison

⚠️ The SASS changed for 2 of 88 CUB benchmark target(s). A benchmark run may be necessary

How to request a benchmark run
Request a CUB benchmark run for this PR:

1. Replace the `benchmarks:` block of ci/bench.yaml with exactly this:

benchmarks:
  filters:
    cub:
      - '^cub\.bench\.find_if\.base\.base$'
      - '^cub\.bench\.transform\.fill\.base$'
  gpus:
    - "h100"   # pick the GPUs that this change can affect

2. Commit with `[bench-only]` at the end of the commit summary, so that
   the unrelated CI jobs are skipped. Then push.

ci/bench.yaml must match ci/bench.template.yaml before the PR can merge.
Reset it once the measurement is done.
Run Value
Baseline b45cc79cb1fcb0e9eeaa0c00e3c6d9b3fddeaa1e
Tested HEAD
Architectures 75-real;80-real;90-real;100-real;110-real;120-real;120-virtual
Targets with a SASS change
Target Architectures with a SASS change
cub.bench.find_if.base.base sm_120
cub.bench.transform.fill.base sm_120

‼️ Summary of Differences ‼️

Showing 2/2 summaries.

cub.bench.find_if.base.base - sm_120

Showing 40/1513 diff lines, 1157 changes. - ⬇️ Full diff

--- base/cub.bench.find_if.base.base.sm_120
+++ test/cub.bench.find_if.base.base.sm_120
@@ -5231,116 +5231,123 @@ void cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::transform_kernel<cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::policy_selector_from_types<(bool)0, (bool)1, cuda::std::__4::tuple<>, thrust::_V_300600_SM_750_800_900_1000_1100_1200::detail::normal_iterator<thrust::_V_300600_SM_750_800_900_1000_1100_1200::device_ptr<double>>>, long, cuda::__4::always_true, cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::__return_constant<double>, double *, >(T2, int, bool, T3, T4, T5, cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::kernel_arg<T6>...)
 IADD.64 R2, -R2, UR10 ;
 IMNMX.S64 PT, PT, R2, R2, 0x800, PT, !PT ;
 ISETP.NE.U32.AND P0, PT, R2, 0x800, PT ;
-@!P0 BRA P1, <+0xd30> ;
+@!P0 BRA P1, <+0xda0> ;
 LDCU UR6, c[0x0][0x30] ;
+LDC.64 R8, c[0x0][0x40] ;
 ACQBULK ;
-USHF.L.U32 UR4, UR6, 0x7, URZ ;
+USHF.L.U32 UR4, UR6, 0x8, URZ ;
 USHF.R.S32.HI UR5, URZ, 0x1f, UR4 ;
 IMAD.WIDE.U32 R4, R7, UR4, RZ ;
 IMAD R7, R7, UR5, RZ ;
 IADD R5, R5, R7 ;
 IADD.64 R2, -R4, UR10 ;
-LDCU.64 UR10, c[0x0][0x40] ;
 IMNMX.S64 PT, PT, R2, R2, UR4, PT, !PT ;
-SHF.L.U64.HI R3, R4, 0x3, R5 ;
 MOV R0, R2 ;
-IMAD.SHL.U32 R2, R4, 0x8, RZ ;
+LEA R2, P1, R4, R8, 0x3 ;
 ISETP.NE.U32.AND P0, PT, R0, UR4, PT ;
-IADD.64 R2, R2, UR10 ;
-@!P0 BRA <+0x850> ;
+LEA.HI.X R3, R4, R9, R5, 0x3, P1 ;
+@!P0 BRA <+0x8d0> ;
 UISETP.GE.AND UP0, UPT, UR6, 0x1, UPT ;
-BRA.U !UP0, 0xdd0 ;
+BRA.U !UP0, 0xe40 ;
 S2R R5, SR_TID.X ;
 UISETP.GE.U32.AND UP0, UPT, UR6, 0x8, UPT ;
 HFMA2 R4, -RZ, RZ, 0, 0 ;
 ULOP3.LUT UR5, UR6, 0x7, URZ, 0xc0, !UPT ;
-BRA.U !UP0, 0x710 ;
+BRA.U !UP0, 0x780 ;
 ISETP.GE.AND P6, PT, R5.reuse, R0.reuse, PT ;
-IADD R7, R5.reuse, 0x100 ;
cub.bench.transform.fill.base - sm_120

Showing 40/417 diff lines, 329 changes. - ⬇️ Full diff

--- base/cub.bench.transform.fill.base.sm_120
+++ test/cub.bench.transform.fill.base.sm_120
@@ -395,128 +395,134 @@ void cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::transform_kernel<cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::policy_selector_from_types<(bool)0, (bool)1, cuda::std::__4::tuple<>, thrust::_V_300600_SM_750_800_900_1000_1100_1200::detail::normal_iterator<thrust::_V_300600_SM_750_800_900_1000_1100_1200::device_ptr<long>>>, long, cuda::__4::always_true, return_constant<long>, long *, >(T2, int, bool, T3, T4, T5, cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::kernel_arg<T6>...)
 BRA <+0x0>;
 Function : void cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::transform_kernel<cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::policy_selector_from_types<(bool)0, (bool)1, cuda::std::__4::tuple<>, thrust::_V_300600_SM_750_800_900_1000_1100_1200::detail::normal_iterator<thrust::_V_300600_SM_750_800_900_1000_1100_1200::device_ptr<long>>>, long, cuda::__4::always_true, return_constant<long>, long *, >(T2, int, bool, T3, T4, T5, cub::_V_300600_SM_750_800_900_1000_1100_1200::detail::transform::kernel_arg<T6>...)
 LDC R1, c[0x0][0x24] ;
-S2UR UR4, SR_CTAID.X ;
-LDCU.64 UR10, c[0x0][0x0] ;
-LDC.64 R4, c[0x0][0x28] ;
+S2R R7, SR_CTAID.X ;
 LDC.U8 R0, c[0x0][0x34] ;
-UIMAD.WIDE.U32 UR6, UR4, 0x800, URZ ;
-IADD.64 R2, R4, -UR6 ;
+LDCU.64 UR10, c[0x0][0x28] ;
+LDCU.64 UR8, c[0x0][0x0] ;
+PRMT R0, R0, 0x8880, RZ ;
+PRMT R0, R0, 0x7710, RZ ;
+IMAD.WIDE.U32 R2, R7, 0x800, RZ ;
+ISETP.NE.U32.AND P1, PT, R0, RZ, PT ;
+IADD.64 R2, -R2, UR10 ;
 IMNMX.S64 PT, PT, R2, R2, 0x800, PT, !PT ;
-PRMT R0, R0, 0x8880, RZ ;
 ISETP.NE.U32.AND P0, PT, R2, 0x800, PT ;
-PRMT R0, R0, 0x7710, RZ ;
-ISETP.NE.U32.AND P1, PT, R0, RZ, PT ;
-@!P0 BRA P1, <+0xd40> ;
+@!P0 BRA P1, <+0xda0> ;
 LDCU UR6, c[0x0][0x30] ;
-LDC.64 R6, c[0x0][0x40] ;
+LDC.64 R8, c[0x0][0x40] ;
 ACQBULK ;
-USHF.L.U32 UR8, UR6, 0x7, URZ ;
-USHF.R.S32.HI UR9, URZ, 0x1f, UR8 ;
-UIMAD.WIDE.U32 UR12, UR8, UR4, URZ ;
-UIMAD UR4, UR9, UR4, URZ ;
-UIADD3 UR5, UPT, UPT, UR13, UR4, URZ ;
-UMOV UR4, UR12 ;
-IADD.64 R2, R4, -UR4 ;
-USHF.L.U32 UR4, UR12, 0x3, URZ ;
-USHF.L.U64.HI UR5, UR12, 0x3, UR5 ;

@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) September 21, 2026 14:31
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 59m: Pass: 100%/201 | Total: 9d 15h | Max: 2h 58m | Hits: 39%/726690

See results here.

@bernhardmgruber
bernhardmgruber merged commit 465a32f into NVIDIA:main Sep 21, 2026
223 of 225 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Sep 21, 2026
@bernhardmgruber
bernhardmgruber deleted the cub-transform-fill-sm120-tuning-clean branch September 21, 2026 16:10
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.

Tune cub::DeviceTransform algorithms for sm120

2 participants