Skip to content

Fixes various issues in partial tile merge sort - #10733

Merged
elstehle merged 6 commits into
NVIDIA:mainfrom
elstehle:fix/block-merge-sort-partial-tile
Aug 20, 2026
Merged

Fixes various issues in partial tile merge sort#10733
elstehle merged 6 commits into
NVIDIA:mainfrom
elstehle:fix/block-merge-sort-partial-tile

Conversation

@elstehle

@elstehle elstehle commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #5327

The core of the issue was that we were previously conflating two code paths in BlockMergeSort, a version that: (a) pre-pads oob items with MAX_KEY (oob_default, i.e., something that compares GEQ than any provided item) and subsequently simply do a full sort and (b) a code path for an interface that only takes valid_items and introduces the oob-guards where needed - for that code path, no oob_default is needed here. This is basically the design that WarpBitonicSort follows, I like, and that I introduce the distinction for in this PR.

A more detailed assessment of the underlying issues, I've shared in #5327 (comment).

  • Benchmark chnages (note, this is a correctness fix, hence we're willing to take a tolerable perf hit)

@elstehle
elstehle requested a review from a team as a code owner August 10, 2026 08:33
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Aug 10, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added sorting support for partially filled data tiles without requiring out-of-bounds sentinel values.
    • Added valid-item-count options for regular and stable sorting, with or without associated values.
  • Bug Fixes
    • Improved handling of partial tiles to prevent invalid memory access and ensure only valid data is sorted.
    • Preserved correct merge behavior when processing incomplete tile data.
  • Tests
    • Added coverage for sentinel and no-sentinel sorting of partial key and key-value tiles.

Walkthrough

Changes

Block merge sort now supports partial tiles without sentinel values. It adds padded shared-memory storage, clamped merge rounds, valid-item-only Sort and StableSort overloads, final-tile integration, and expanded key and pair tests. Custom type storage now validates policy-driven sizing.

Partial tile merge sort

Layer / File(s) Summary
Padded storage and merge rounds
cub/cub/block/block_merge_sort.cuh
Shared storage and merge rounds now initialize padding and clamp processing to valid_items.
Sentinel-free sort overloads
cub/cub/block/block_merge_sort.cuh
Valid-item-only Sort and StableSort overloads are added. Existing sentinel contracts are clarified.
Final-tile integration and validation
cub/cub/agent/agent_merge_sort.cuh, cub/test/catch2_test_block_merge_sort.cu
The final tile sorts only its valid prefix. Tests cover sentinel and sentinel-free key and pair sorting.
Policy-aware storage validation
c2h/include/c2h/custom_type.h
A compile-time check prevents insufficient or underflowing custom type filler storage.

Assessment against linked issues

Objective Addressed Explanation
[5327] Prevent uninitialized or out-of-bounds vsmem reads in affected CUB algorithms The changes address partial-tile DeviceMergeSort paths, but they do not modify DeviceReduceByKey or DeviceScanByKey, and no sanitizer result is provided.

Out-of-scope changes

Code Change Explanation
Policy-aware custom type storage validation (c2h/include/c2h/custom_type.h) The linked issue concerns uninitialized or out-of-bounds vsmem reads in CUB device algorithms. It does not state an objective for custom type storage validation.

Suggested reviewers: jrhemstad, srinivasyadav18

Merge Risk: 🔵 Low · up to 3ccab

The sorting fix is localized, but test helpers still need to follow required API conventions, and the custom-type size check is weaker than intended. The PR is mergeable with explicit owner awareness and follow-up on these bounded issues.


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 (5)
cub/cub/block/block_merge_sort.cuh (5)

225-233: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

suggestion: the padding looks larger than required. Runs are tile-aligned, so keys1_end <= start + size <= ITEMS_PER_TILE - size and size >= ItemsPerThread. serial_merge advances at most ItemsPerThread positions past keys1_beg_loc, so the largest key index read is ITEMS_PER_TILE, and keys2 reads stop at keys2_end <= ITEMS_PER_TILE. ITEMS_PER_TILE + 1 then covers every read, and the extra ItemsPerThread - 1 slots increase shared memory for all BlockMergeSort users, including full-tile sorts. If you keep the larger padding, state in the comment which access actually needs more than one slot.

Source: Path instructions


468-502: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

suggestion: add the @rst .. versionadded:: block used by every neighboring overload, so the new public entry points carry a version marker in the generated docs.


844-890: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

suggestion: honor _Unroll and mark the index const. The merge loops use _CCCL_PRAGMA_UNROLL(_Unroll ? ItemsPerThread : 1), but these loops force full unrolling and ignore the policy.unroll knob. idx is never modified at lines 849 and 871.

Proposed change
-    _CCCL_PRAGMA_UNROLL_FULL()
+    _CCCL_PRAGMA_UNROLL(_Unroll ? ItemsPerThread : 1)
     for (int item = 0; item < ItemsPerThread; ++item)
     {
-      int idx                       = ItemsPerThread * linear_tid + item;
+      const int idx                 = ItemsPerThread * linear_tid + item;
       temp_storage.keys_shared[idx] = keys[item];
     }

As per coding guidelines: "All variables that are not modified must be declared const".

Source: Coding guidelines


895-898: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

suggestion: MergeRounds and MergeRoundsClamped duplicate roughly 50 lines that differ only in the run and diagonal clamping. Consider one implementation parameterized by a bool Clamped non-type template parameter, with the clamped boundary computation behind if constexpr. That keeps the two paths from drifting apart in later fixes.


954-986: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

suggestion: exit the round loop early for small valid_items. Once ItemsPerThread * merged_threads_number >= valid_items, run 2 of the only non-empty group is empty, so the round is an identity copy plus two Sync() calls, and all later rounds are identical. valid_items and size are uniform across the block, so the exit is block-uniform and does not create a barrier divergence hazard. For a nearly empty final tile this removes most rounds.

Proposed change
       const int merged_threads_number = target_merged_threads_number / 2;
       const int mask                  = target_merged_threads_number - 1;
+
+      // All remaining rounds merge a single non-empty run with an empty one: nothing left to do.
+      if (ItemsPerThread * merged_threads_number >= valid_items)
+      {
+        break;
+      }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 108c0304-ec7e-4a04-8f80-d43b449aba44

📥 Commits

Reviewing files that changed from the base of the PR and between 04a6df4 and b623edc.

📒 Files selected for processing (2)
  • cub/cub/agent/agent_merge_sort.cuh
  • cub/cub/block/block_merge_sort.cuh

Comment thread cub/cub/block/block_merge_sort.cuh Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@elstehle
elstehle marked this pull request as draft August 11, 2026 16:37
@copy-pr-bot

copy-pr-bot Bot commented Aug 11, 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 In Review to In Progress in CCCL Aug 11, 2026
elstehle added a commit to elstehle/cccl that referenced this pull request Aug 19, 2026
- proto_ballot_merge.cu + BALLOT_MERGE_RESULTS.md: three-way stable-merge
  comparison on B200 (umbriel-b200-022). Rank-augmented bitonic merger wins
  both axes at all sizes (stable 64-elem merge in 341 cyc keys / 518 pairs,
  4-5x the smem co-rank baseline); the ballot-routed merge-path design works
  and beats smem on latency but is collective-issue-bound and strictly
  dominated - documented as a principled negative. Recommendation: rank
  augmentation is the route to WarpStableMerge / stable WarpBitonicSort.
- WMS_STATIC_SWITCH_RESULTS.md + proto_wms_static.cu + wms_static/: the
  MERGE_SORT_SEARCH_STATIC switch productization study (warp -14..-24%
  latency, block -10..-14% for tiles <= 512, occupancy cost quantified;
  default stays dynamic).
- MERGE_SORT_IMPLEMENTATION_REPORT.md + MERGE_SORT_PARTIAL_TILE_UNINIT_READS.md:
  walkthrough and analysis behind PR NVIDIA#10733 / issue NVIDIA#5327.
- proto_merge_fix.cu + merge_fix/: dual-build validation harness and patched
  headers for the partial-tile fix branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@elstehle
elstehle force-pushed the fix/block-merge-sort-partial-tile branch from b623edc to 05a0af2 Compare August 19, 2026 15:25
elstehle added a commit to elstehle/cccl that referenced this pull request Aug 19, 2026
… and B

Real-header three-way on B200 (umbriel-b200-037), today's main. Full and
near-full tiles: all three within +-3-7% (no regression; FIX-A even leads
full-tile throughput slightly). Overload A pays for its now-delivered
suffix contract on partials (full-tile work regardless of valid_items:
~1.5x latency, ~0.5x throughput at valid=N/8 vs old impl). Overload B
beats the old implementation outright on partials (-9..-30% latency, up
to +60% valid-normalized throughput at N/8; early exit) and ties at full.
Correctness gate green on both builds; FIX-A delivers suffix==oob
everywhere, BASE does not (stock gap reconfirmed vs today's main).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@elstehle
elstehle marked this pull request as ready for review August 20, 2026 06:21
@elstehle
elstehle requested a review from a team as a code owner August 20, 2026 06:21
@elstehle
elstehle requested a review from jrhemstad August 20, 2026 06:21
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Aug 20, 2026
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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 (3)
c2h/include/c2h/custom_type.h (1)

58-71: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

suggestion: Add compile-time layout checks for huge_data policy packs.

Current instantiations use one huge_data policy and one-byte remaining policies. A second huge_data policy or a larger policy makes object_bytes differ from sizeof(custom_type_t<...>). Add compile-time size assertions or enforce this policy-pack restriction.

Source: Coding guidelines

cub/test/catch2_test_block_merge_sort.cu (2)

195-200: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy lift

suggestion: Keep the no-sentinel parameterizations independent of sentinel construction. The new actions ignore oob_default, but both block_merge_sort helpers still evaluate cuda::std::numeric_limits<KeyT>::max() at lines 168 and 182. A key type without a sentinel value cannot instantiate these tests. Add a no-sentinel helper and kernel path that does not construct or accept oob_default.
As per path instructions, this CUB test should verify the real API contract and relevant correctness coverage. The supplied production contract states that the no-sentinel overload does not require a sentinel value.

Also applies to: 216-221, 266-273

Source: Path instructions


195-200: 🩺 Stability & Availability | 🔵 Trivial

important: Run the targeted key and pair partial-tile tests with compute-sanitizer --tool initcheck. Confirm that the compute_init_lid0 CI job passes. Also run the linked DeviceReduceByKey and DeviceScanByKey tests before merge. As per coding guidelines, build and run relevant tests, prefer targeted builds, and report the results.

Also applies to: 216-221, 232-232, 266-273, 303-303

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6ceb6a24-531b-4197-8bce-1020e384d448

📥 Commits

Reviewing files that changed from the base of the PR and between 915456f and 6637f46.

📒 Files selected for processing (4)
  • c2h/include/c2h/custom_type.h
  • cub/cub/agent/agent_merge_sort.cuh
  • cub/cub/block/block_merge_sort.cuh
  • cub/test/catch2_test_block_merge_sort.cu
🚧 Files skipped from review as they are similar to previous changes (2)
  • cub/cub/agent/agent_merge_sort.cuh
  • cub/cub/block/block_merge_sort.cuh

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

Comment thread cub/test/catch2_test_block_merge_sort.cu
@github-actions

Copy link
Copy Markdown
Contributor

⏱️ CCCL compile-time benchmark comparison: Public headers compile-time bench

Result: 0 regression row(s), 3 improvement row(s) above threshold.

Run Value
Config public-headers-gcc13
Baseline origin/main
Preset all-dev
Targets cub.headers.base, thrust.cpp.cuda.headers.base, libcudacxx.test.public_headers
GPU / launch args rtx2080 / --cuda 13.3 --host gcc13

Artifacts: reports and traces

Direct file processing

-f file-processing exclusive --sort total

🟢 Direct file processing — Improvements
Rank Improvement impact Selected Δ Baseline Current Event Matched traces
1 6.103207 -6.103207 15.707210 9.604003 Processing Header File: libcudacxx/include/cuda/__device/physical_device.h 93
2 0.643885 -0.643885 5.416479 4.772594 Processing Header File: libcudacxx/include/cuda/std/__cccl/prologue.h 554
3 0.208375 -0.208375 1.676226 1.467851 Processing Header File: libcudacxx/include/cuda/std/__cccl/epilogue.h 554

// ordering relative to the valid keys therefore cannot affect the sorted prefix, so callers
// that violate the documented ordering requirement still get their valid items sorted. Keys
// beyond the boundary are left unspecified.
SortPartialTile<true>(keys, items, compare_op, valid_items, oob_default);

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.

To be sure, its intentional that this now calls MergeRounds<true> in the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's intentional - for now - (even though I dislike it).

After discussing with Georgii, we agreed to separate the two concerns:
a. Fix compute-sanitizer of DeviceMergeSort by introducing the new BlockMergeSort interface that does not take an oob_default - as that may not be generally available, e.g., for custom comparators (as you had pointed out.
b. For the existing overload that takes an oob_default, i.e., Sort(..., valid_items, oob_default). We would like to apply our typical pad-oob-with-oob_default then run the algorithm on the full tile.

We agreed to defer (b) for now, even though I would really like to do it. But it's not as as pressing as (a) - plus, we would change the behavior for existing users. Though, worth noting, we would only change behavior for existing users that did not comply with our existing contract(!). So that may give us the freedom to do (b) - but as follow-up.

@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)
c2h/include/c2h/custom_type.h (1)

70-75: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

suggestion: Enforce the size-contributing-policy invariant instead of checking only the estimated filler bound. A pack such as custom_type_t<huge_data<512>::type, huge_data<1024>::type> can pass this assertion because each huge_data counts the other policy as one byte, while object_bytes no longer matches the composed type size. Reject additional size-contributing policies or validate their actual layout with a compile-time check.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1111fa38-ac11-45cf-b0d7-ec1b8221a530

📥 Commits

Reviewing files that changed from the base of the PR and between 6637f46 and 3ccabb2.

📒 Files selected for processing (2)
  • c2h/include/c2h/custom_type.h
  • cub/test/catch2_test_block_merge_sort.cu

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

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 14m: Pass: 100%/272 | Total: 13d 05h | Max: 3h 13m | Hits: 9%/1503668

See results here.

elstehle added a commit to elstehle/cccl that referenced this pull request Aug 20, 2026


640 configs (keys+pairs, 7-8 types, 2^16..2^28, 2 entropies) on B200:
mean -0.06%/-0.17%, median ~0 - no systematic regression. Wins up to
-5.7% on expensive-comparator/small types at 2^24-2^28 (clamp-free
full-tile path); +1-3% at 2^16 from overload B on nearly-full last
tiles (bounded by tile-count dilution; the partial-tile wins need
non-pow2 sizes, covered by the collective eval). ncu: block-sort
kernel unchanged (40 regs, 75% occ, +0.49% cycles) - attribution
closes against the +0.12% end-to-end at F32 2^28.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@elstehle

Copy link
Copy Markdown
Contributor Author
|  T{ct}  |  OffsetT{ct}  |  Elements{io}  |  Entropy  |   Ref Time |   Ref Noise |   Cmp Time |   Cmp Noise |         Diff |   %Diff |  Status  |
|---------|---------------|----------------|-----------|------------|-------------|------------|-------------|--------------|---------|----------|
|   I8    |      I32      |      2^16      |     1     |  50.534 us |       1.54% |  50.432 us |       1.35% |    -0.102 us |  -0.20% |   SAME   |
|   I8    |      I32      |      2^20      |     1     | 105.270 us |       0.41% | 104.914 us |       0.77% |    -0.356 us |  -0.34% |   SAME   |
|   I8    |      I32      |      2^24      |     1     | 626.718 us |       0.19% | 620.568 us |       0.20% |    -6.150 us |  -0.98% |   FAST   |
|   I8    |      I32      |      2^28      |     1     |  10.038 ms |       0.03% |   9.948 ms |       0.02% |   -90.601 us |  -0.90% |   FAST   |
|   I8    |      I32      |      2^16      |   0.201   |  48.186 us |       0.76% |  48.143 us |       0.47% |    -0.043 us |  -0.09% |   SAME   |
|   I8    |      I32      |      2^20      |   0.201   | 101.281 us |       0.32% | 101.249 us |       0.24% |    -0.032 us |  -0.03% |   SAME   |
|   I8    |      I32      |      2^24      |   0.201   | 592.338 us |       0.16% | 584.932 us |       0.12% |    -7.406 us |  -1.25% |   FAST   |
|   I8    |      I32      |      2^28      |   0.201   |   9.383 ms |       0.02% |   9.264 ms |       0.02% |  -118.420 us |  -1.26% |   FAST   |
|   I8    |      I64      |      2^16      |     1     |  50.171 us |       0.17% |  50.170 us |       0.17% |    -0.000 us |  -0.00% |   SAME   |
|   I8    |      I64      |      2^20      |     1     | 105.403 us |       0.33% | 104.881 us |       0.88% |    -0.522 us |  -0.50% |   FAST   |
|   I8    |      I64      |      2^24      |     1     | 636.955 us |       0.19% | 630.686 us |       0.18% |    -6.269 us |  -0.98% |   FAST   |
|   I8    |      I64      |      2^28      |     1     |  10.173 ms |       0.03% |  10.082 ms |       0.02% |   -91.034 us |  -0.89% |   FAST   |
|   I8    |      I64      |      2^16      |   0.201   |  49.466 us |       1.95% |  49.035 us |       2.06% |    -0.431 us |  -0.87% |   SAME   |
|   I8    |      I64      |      2^20      |   0.201   | 103.413 us |       0.05% | 103.417 us |       0.06% |     0.004 us |   0.00% |   SAME   |
|   I8    |      I64      |      2^24      |   0.201   | 603.972 us |       0.17% | 596.870 us |       0.12% |    -7.102 us |  -1.18% |   FAST   |
|   I8    |      I64      |      2^28      |   0.201   |   9.546 ms |       0.02% |   9.428 ms |       0.01% |  -118.312 us |  -1.24% |   FAST   |
|   I16   |      I32      |      2^16      |     1     |  52.220 us |       0.12% |  52.218 us us |  -0.01% |   SAME   |
|   I16   |      I32      |      2^20      |     1     | 109.852 us |      24.40% | 109.403 us us |  -0.41% |   SAME   |
|   I16   |      I32      |      2^24      |     1     | 650.640 us |       0.30% | 650.779 us us |   0.02% |   SAME   |
|   I16   |      I32      |      2^28      |     1     |  10.630 ms |       0.05% |  10.636 ms us |   0.06% |   SLOW   |
|   I16   |      I32      |      2^16      |   0.201   |  52.052 us |       1.08% |  52.223 us |       0.17% |     0.171 us |   0.33% |   SLOW   |
|   I16   |      I32      |      2^20      |   0.201   | 105.471 us |       0.16% | 105.516 us |       0.27% |     0.045 us |   0.04% |   SAME   |
|   I16   |      I32      |      2^24      |   0.201   | 603.196 us |       0.13% | 603.255 us |       0.13% |     0.059 us |   0.01% |   SAME   |
|   I16   |      I32      |      2^28      |   0.201   |   9.365 ms |       0.04% |   9.368 ms us |   0.04% |   SAME   |
|   I16   |      I64      |      2^16      |     1     |  52.217 us |       0.19% |  52.243 us |       0.46% |     0.027 us |   0.05% |   SAME   |
|   I16   |      I64      |      2^20      |     1     | 111.597 us |       0.15% | 111.599 us |       0.14% |     0.001 us |   0.00% |   SAME   |
|   I16   |      I64      |      2^24      |     1     | 665.979 us |       0.19% | 666.419 us |       0.18% |     0.440 us |   0.07% |   SAME   |
|   I16   |      I64      |      2^28      |     1     |  10.950 ms |       0.06% |  10.956 ms us |   0.05% |   SAME   |
|   I16   |      I64      |      2^16      |   0.201   |  52.224 us |       0.12% |  52.224 us |       0.13% |    -0.001 us |  -0.00% |   SAME   |
|   I16   |      I64      |      2^20      |   0.201   | 107.615 us |       0.41% | 107.682 us |       0.54% |     0.067 us |   0.06% |   SAME   |
|   I16   |      I64      |      2^24      |   0.201   | 624.081 us |       0.15% | 624.433 us |       0.17% |     0.352 us |   0.06% |   SAME   |
|   I16   |      I64      |      2^28      |   0.201   |   9.836 ms |       0.04% |   9.838 ms us |   0.02% |   SAME   |
|   I32   |      I32      |      2^16      |     1     |  52.166 us |       0.64% |  52.192 us |       0.51% |     0.026 us |   0.05% |   SAME   |
|   I32   |      I32      |      2^20      |     1     | 107.786 us |       0.53% | 107.818 us |       0.52% |     0.031 us |   0.03% |   SAME   |
|   I32   |      I32      |      2^24      |     1     | 681.222 us |       0.50% | 682.007 us |       0.52% |     0.785 us |   0.12% |   SAME   |
|   I32   |      I32      |      2^28      |     1     |  10.076 ms |       0.09% |  10.090 ms us |   0.14% |   SLOW   |
|   I32   |      I32      |      2^16      |   0.201   |  52.085 us |       0.97% |  52.096 us |       0.94% |     0.011 us |   0.02% |   SAME   |
|   I32   |      I32      |      2^20      |   0.201   | 106.434 us |       0.90% | 106.774 us us |   0.32% |   SAME   |
|   I32   |      I32      |      2^24      |   0.201   | 617.868 us |       0.23% | 618.414 us |       0.22% |     0.546 us |   0.09% |   SAME   |
|   I32   |      I32      |      2^28      |   0.201   |   8.709 ms |       0.11% |   8.722 ms |       0.12% |    12.692 us |   0.15% |   SLOW   |
|   I32   |      I64      |      2^16      |     1     |  52.221 us |       0.11% |  52.222 us |       0.17% |     0.001 us |   0.00% |   SAME   |
|   I32   |      I64      |      2^20      |     1     | 110.203 us |       0.75% | 110.576 us us |   0.34% |   SAME   |
|   I32   |      I64      |      2^24      |     1     | 686.052 us |       0.21% | 687.047 us |       0.19% |     0.995 us |   0.14% |   SAME   |
|   I32   |      I64      |      2^28      |     1     |  10.268 ms |       0.06% |  10.282 ms |       0.05% |    13.907 us |   0.14% |   SLOW   |
|   I32   |      I64      |      2^16      |   0.201   |  52.217 us |       0.16% |  52.225 us us |   0.02% |   SAME   |
|   I32   |      I64      |      2^20      |   0.201   | 107.761 us |       0.45% | 108.200 us |       0.67% |     0.439 us |   0.41% |   SAME   |
|   I32   |      I64      |      2^24      |   0.201   | 640.217 us |       0.18% | 641.313 us |       0.16% |     1.095 us |   0.17% |   SLOW   |
|   I32   |      I64      |      2^28      |   0.201   |   9.132 ms |       0.05% |   9.147 ms us |   0.17% |   SLOW   |
|   I64   |      I32      |      2^16      |     1     |  60.219 us |       0.74% |  60.401 us |       0.20% |     0.182 us |   0.30% |   SLOW   |
|   I64   |      I32      |      2^20      |     1     | 157.366 us |       0.36% | 157.695 us us |   0.21% |   SAME   |
|   I64   |      I32      |      2^24      |     1     |   1.465 ms |       0.39% |   1.466 ms |       0.38% |     1.226 us |   0.08% |   SAME   |
|   I64   |      I32      |      2^28      |     1     |  24.634 ms |       0.05% |  24.652 ms us |   0.07% |   SLOW   |
|   I64   |      I32      |      2^16      |   0.201   |  60.413 us |       0.07% |  60.513 us |       0.77% |     0.099 us |   0.16% |   SLOW   |
|   I64   |      I32      |      2^20      |   0.201   | 164.192 us |       0.35% | 164.356 us us |   0.10% |   SAME   |
|   I64   |      I32      |      2^24      |   0.201   |   1.539 ms |       0.16% |   1.541 ms us |   0.12% |   SAME   |
|   I64   |      I32      |      2^28      |   0.201   |  26.096 ms |       0.04% |  26.115 ms us |   0.07% |   SLOW   |
|   I64   |      I64      |      2^16      |     1     |  60.675 us |       1.16% |  62.188 us us |   2.49% |   SLOW   |
|   I64   |      I64      |      2^20      |     1     | 159.790 us |       0.20% | 159.898 us us |   0.07% |   SAME   |
|   I64   |      I64      |      2^24      |     1     |   1.465 ms |       0.36% |   1.467 ms |       0.36% |     1.581 us |   0.11% |   SAME   |
|   I64   |      I64      |      2^28      |     1     |  24.770 ms |       0.06% |  24.795 ms |       0.07% |    24.584 us |   0.10% |   SLOW   |
|   I64   |      I64      |      2^16      |   0.201   |  61.407 us |       1.58% |  62.432 us us |   1.67% |   SLOW   |
|   I64   |      I64      |      2^20      |   0.201   | 165.340 us |       0.44% | 165.628 us |       0.35% |     0.288 us |   0.17% |   SAME   |
|   I64   |      I64      |      2^24      |   0.201   |   1.543 ms |       0.14% |   1.545 ms us |   0.12% |   SAME   |
|   I64   |      I64      |      2^28      |   0.201   |  26.194 ms |       0.04% |  26.210 ms |       0.05% |    16.597 us |   0.06% |   SLOW   |
|  I128   |      I32      |      2^16      |     1     |  70.667 us |       0.26% |  70.661 us us |  -0.01% |   SAME   |
|  I128   |      I32      |      2^20      |     1     | 250.293 us |       1.28% | 247.962 us |       0.89% |    -2.331 us |  -0.93% |   FAST   |
|  I128   |      I32      |      2^24      |     1     |   3.136 ms |       0.17% |   3.138 ms us |   0.06% |   SAME   |
|  I128   |      I32      |      2^28      |     1     |  56.831 ms |       0.01% |  56.883 ms us |   0.09% |   SLOW   |
|  I128   |      I32      |      2^16      |   0.201   |  70.900 us |       0.93% |  71.292 us us |   0.55% |   SAME   |
|  I128   |      I32      |      2^20      |   0.201   | 251.699 us |       1.22% | 249.536 us us |  -0.86% |   FAST   |
|  I128   |      I32      |      2^24      |   0.201   |   3.050 ms |       0.14% |   3.053 ms us |   0.10% |   SAME   |
|  I128   |      I32      |      2^28      |   0.201   |  53.753 ms |       0.01% |  53.801 ms |       0.02% |    47.885 us |   0.09% |   SLOW   |
|  I128   |      I64      |      2^16      |     1     |  71.031 us |       0.99% |  71.324 us us |   0.41% |   SAME   |
|  I128   |      I64      |      2^20      |     1     | 251.608 us |       1.23% | 249.693 us |       0.75% |    -1.916 us |  -0.76% |   FAST   |
|  I128   |      I64      |      2^24      |     1     |   3.139 ms |       0.12% |   3.142 ms us |   0.10% |   SAME   |
|  I128   |      I64      |      2^28      |     1     |  57.086 ms |       0.01% |  57.136 ms |       0.01% |    50.196 us |   0.09% |   SLOW   |
|  I128   |      I64      |      2^16      |   0.201   |  71.929 us |       1.34% |  72.125 us us |   0.27% |   SAME   |
|  I128   |      I64      |      2^20      |   0.201   | 252.793 us |       1.23% | 251.118 us us |  -0.66% |   FAST   |
|  I128   |      I64      |      2^24      |   0.201   |   3.055 ms |       0.14% |   3.058 ms us |   0.08% |   SAME   |
|  I128   |      I64      |      2^28      |   0.201   |  53.956 ms |       0.01% |  54.008 ms us |   0.10% |   SLOW   |
|   F32   |      I32      |      2^16      |     1     |  52.220 us |       0.10% |  52.221 us us |   0.00% |   SAME   |
|   F32   |      I32      |      2^20      |     1     | 109.690 us |       0.36% | 109.809 us us |   0.11% |   SAME   |
|   F32   |      I32      |      2^24      |     1     | 681.104 us |       0.54% | 681.925 us us |   0.12% |   SAME   |
|   F32   |      I32      |      2^28      |     1     |  10.085 ms |       0.10% |  10.097 ms |       0.11% |    11.752 us |   0.12% |   SLOW   |
|   F32   |      I32      |      2^16      |   0.201   |  51.281 us |       1.97% |  51.942 us us |   1.29% |   SAME   |
|   F32   |      I32      |      2^20      |   0.201   | 105.548 us |       0.34% | 105.702 us |       0.58% |     0.154 us |   0.15% |   SAME   |
|   F32   |      I32      |      2^24      |   0.201   | 619.442 us |       0.24% | 620.417 us us |   0.16% |   SAME   |
|   F32   |      I32      |      2^28      |   0.201   |   8.724 ms |       0.11% |   8.732 ms us |   0.10% |   SAME   |
|   F32   |      I64      |      2^16      |     1     |  52.218 us |       0.12% |  52.222 us us |   0.01% |   SAME   |
|   F32   |      I64      |      2^20      |     1     | 111.099 us |       0.55% | 111.071 us us |  -0.03% |   SAME   |
|   F32   |      I64      |      2^24      |     1     | 687.334 us |       0.19% | 687.916 us us |   0.08% |   SAME   |
|   F32   |      I64      |      2^28      |     1     |  10.272 ms |       0.06% |  10.283 ms us |   0.10% |   SLOW   |
|   F32   |      I64      |      2^16      |   0.201   |  51.994 us |       1.23% |  51.958 us |       1.31% |    -0.035 us |  -0.07% |   SAME   |
|   F32   |      I64      |      2^20      |   0.201   | 107.611 us |       0.37% | 107.637 us |       0.41% |     0.026 us |   0.02% |   SAME   |
|   F32   |      I64      |      2^24      |   0.201   | 642.392 us |       0.17% | 642.904 us us |   0.08% |   SAME   |
|   F32   |      I64      |      2^28      |   0.201   |   9.152 ms |       0.05% |   9.162 ms |       0.06% |     9.402 us |   0.10% |   SLOW   |
|   F64   |      I32      |      2^16      |     1     |  58.635 us |       0.99% |  59.951 us us |   2.24% |   SLOW   |
|   F64   |      I32      |      2^20      |     1     | 155.710 us |       0.22% | 155.768 us |       0.27% |     0.057 us |   0.04% |   SAME   |
|   F64   |      I32      |      2^24      |     1     |   1.471 ms |       0.39% |   1.473 ms us |   0.15% |   SAME   |
|   F64   |      I32      |      2^28      |     1     |  24.628 ms |       0.06% |  24.657 ms |       0.07% |    29.100 us |   0.12% |   SLOW   |
|   F64   |      I32      |      2^16      |   0.201   |  60.044 us |       1.14% |  60.408 us us |   0.61% |   SLOW   |
|   F64   |      I32      |      2^20      |   0.201   | 161.851 us |       0.20% | 162.026 us us |   0.11% |   SAME   |
|   F64   |      I32      |      2^24      |   0.201   |   1.528 ms |       0.20% |   1.530 ms us |   0.14% |   SAME   |
|   F64   |      I32      |      2^28      |   0.201   |  26.050 ms |       0.04% |  26.077 ms us |   0.10% |   SLOW   |
|   F64   |      I64      |      2^16      |     1     |  60.520 us |       0.56% |  61.041 us us |   0.86% |   SLOW   |
|   F64   |      I64      |      2^20      |     1     | 157.811 us |       0.28% | 158.246 us us |   0.28% |   SAME   |
|   F64   |      I64      |      2^24      |     1     |   1.477 ms |       0.40% |   1.479 ms us |   0.08% |   SAME   |
|   F64   |      I64      |      2^28      |     1     |  24.777 ms |       0.06% |  24.793 ms us |   0.06% |   SLOW   |
|   F64   |      I64      |      2^16      |   0.201   |  60.491 us |       0.54% |  60.545 us |       0.85% |     0.054 us |   0.09% |   SAME   |
|   F64   |      I64      |      2^20      |   0.201   | 163.978 us |       0.32% | 164.232 us |       0.49% |     0.254 us |   0.15% |   SAME   |
|   F64   |      I64      |      2^24      |   0.201   |   1.532 ms |       0.18% |   1.534 ms |       0.18% |     1.579 us |   0.10% |   SAME   |
|   F64   |      I64      |      2^28      |   0.201   |  26.153 ms |       0.05% |  26.182 ms us |   0.11% |   SLOW   |
|   C32   |      I32      |      2^16      |     1     | 189.270 us |       0.37% | 190.363 us |       0.52% |     1.093 us |   0.58% |   SLOW   |
|   C32   |      I32      |      2^20      |     1     | 381.931 us |       0.29% | 382.461 us |       0.29% |     0.530 us |   0.14% |   SAME   |
|   C32   |      I32      |      2^24      |     1     |   4.356 ms |       0.19% |   4.329 ms |       0.18% |   -26.900 us |  -0.62% |   FAST   |
|   C32   |      I32      |      2^28      |     1     |  82.620 ms |       0.02% |  82.064 ms us |  -0.67% |   FAST   |
|   C32   |      I32      |      2^16      |   0.201   | 259.841 us |       0.38% | 259.072 us |       0.13% |    -0.769 us |  -0.30% |   FAST   |
|   C32   |      I32      |      2^20      |   0.201   | 589.748 us |       0.51% | 589.226 us |       0.51% |    -0.522 us |  -0.09% |   SAME   |
|   C32   |      I32      |      2^24      |   0.201   |   6.942 ms |       0.15% |   6.735 ms |       0.13% |  -206.333 us |  -2.97% |   FAST   |
|   C32   |      I32      |      2^28      |   0.201   | 113.202 ms |       0.03% | 109.712 ms us |  -3.08% |   FAST   |
|   C32   |      I64      |      2^16      |     1     | 189.759 us |       0.40% | 191.306 us |       0.33% |     1.547 us |   0.82% |   SLOW   |
|   C32   |      I64      |      2^20      |     1     | 383.032 us |       0.29% | 383.376 us |       0.29% |     0.343 us |   0.09% |   SAME   |
|   C32   |      I64      |      2^24      |     1     |   4.338 ms |       0.18% |   4.316 ms us |  -0.53% |   FAST   |
|   C32   |      I64      |      2^28      |     1     |  82.165 ms |       0.02% |  81.725 ms |       0.02% |  -440.324 us |  -0.54% |   FAST   |
|   C32   |      I64      |      2^16      |   0.201   | 259.414 us |       0.31% | 260.410 us |       0.38% |     0.996 us |   0.38% |   SLOW   |
|   C32   |      I64      |      2^20      |   0.201   | 588.461 us |       0.48% | 588.213 us us |  -0.04% |   SAME   |
|   C32   |      I64      |      2^24      |   0.201   |   6.876 ms |       0.16% |   6.719 ms |       0.14% |  -156.823 us |  -2.28% |   FAST   |
|   C32   |      I64      |      2^28      |   0.201   | 112.153 ms |       0.04% | 109.532 ms |       0.03% | -2621.145 us |  -2.34% |   FAST   |

@elstehle
elstehle merged commit bad9766 into NVIDIA:main Aug 20, 2026
299 checks passed
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.

[BUG]: Potentially uninitialized/oob reads of vsmem in DeviceMergeSort, DeviceReduceByKey, and DeviceScanByKey

2 participants