[PR #3163] [CLOSED] [Engine] hip: STRATA_SELECT_SPLIT2=1 - the selection scorer's hi/mid bf16 pieces (3 wmma instead of 6) #4485

Closed
opened 2026-11-07 15:36:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3163
Author: @vlupilin
Created: 10/19/2026
Status: ❌ Closed

Base: main ← Head: pr-split2


📝 Commits (1)

  • 420ef3a hip: STRATA_SELECT_SPLIT2=1 - the selection scorer's hi/mid bf16 pieces (3 wmma instead of 6)

📊 Changes

1 file changed (+35 additions, -14 deletions)

View changed files

📝 src/kernels/cuda/qsa_select.cu (+35 -14)

📄 Description

Problem and result

The QSA selection scorer on gfx11/gfx12 (the WMMA path, STRATA_SELECT_WMMA=1) computes 6 wmma products per block. With STRATA_SELECT_SPLIT2=1 the three products that carry the lo piece are dropped (3 wmma instead of 6): the scorer runs 1.5-2.2x faster, rounding-level accuracy change (~1.5e-5, the class upstream accepts at 254/256).

Companion to the accepted wide top-k (#1749).

Approach

Template parameter bool S2 on block_scores_wmma_kernel; opt-in env. Default off: the 6-product kernel bits are unchanged. One file: src/kernels/cuda/qsa_select.cu (+35/-14).

Validation

Passed:

Kernel benchmark (both arms same session, 5 reps, v0.2.0-beta @ 4caf857c, gfx1151 Radeon 8060S Strix Halo, ROCm 10.1, Linux 7.0.0-38-generic):

LD_LIBRARY_PATH=/opt/rocm/lib STRATA_SELECT_WMMA=1 STRATA_SELECT_SPLIT2=0 ./build-rocm101/qsa_select_bench 32768 256 5 32768
LD_LIBRARY_PATH=/opt/rocm/lib STRATA_SELECT_WMMA=1 STRATA_SELECT_SPLIT2=1 ./build-rocm101/qsa_select_bench 32768 256 5 32768
# (repeated for 131072, 262144, 524288)
context 6-product split2 speedup
32768 0.809 ms 0.525 ms 1.54x
131072 2.674 ms 1.551 ms 1.72x
262144 8.187 ms 3.722 ms 2.20x
524288 12.409 ms 7.488 ms 1.66x

Selections identical: 256/256 at 32K, 253/256 at 262K (cells 0.0013%).

Engine (interleaved 2 rounds, same session, split2 measured alone):

# baseline: STRATA_SELECT_SPLIT2=0, test: STRATA_SELECT_SPLIT2=1
# bench.py --lens 131072,262144,524288 --prod-params --salt 150
depth mainline +split2 delta
131072 946.8 940.7 -0.6%
262144 1002.8 1033.9 +3.1%
524288 928.1 978.7 +5.4%

Failed: none.

Not run: CUDA (kernel is HIP-only, #if defined(__HIPCC__)); gfx12 (maintainer R9700 can verify); long-prompt quality battery (selections gate suffices).

Limits

HIP only; requires STRATA_SELECT_WMMA=1; accuracy 253/256 (upstream gate class 254/256).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3163 **Author:** [@vlupilin](https://github.com/vlupilin) **Created:** 10/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr-split2` --- ### 📝 Commits (1) - [`420ef3a`](https://github.com/Niko1221/Strata/commit/420ef3aae3ff25198326bb906a99bb29453cdc5e) hip: STRATA_SELECT_SPLIT2=1 - the selection scorer's hi/mid bf16 pieces (3 wmma instead of 6) ### 📊 Changes **1 file changed** (+35 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cuda/qsa_select.cu` (+35 -14) </details> ### 📄 Description ## Problem and result The QSA selection scorer on gfx11/gfx12 (the WMMA path, `STRATA_SELECT_WMMA=1`) computes 6 wmma products per block. With `STRATA_SELECT_SPLIT2=1` the three products that carry the lo piece are dropped (3 wmma instead of 6): the scorer runs 1.5-2.2x faster, rounding-level accuracy change (~1.5e-5, the class upstream accepts at 254/256). Companion to the accepted wide top-k (#1749). ## Approach Template parameter `bool S2` on `block_scores_wmma_kernel`; opt-in env. Default off: the 6-product kernel bits are unchanged. One file: `src/kernels/cuda/qsa_select.cu` (+35/-14). ## Validation **Passed:** Kernel benchmark (both arms same session, 5 reps, v0.2.0-beta @ 4caf857c, gfx1151 Radeon 8060S Strix Halo, ROCm 10.1, Linux 7.0.0-38-generic): ``` LD_LIBRARY_PATH=/opt/rocm/lib STRATA_SELECT_WMMA=1 STRATA_SELECT_SPLIT2=0 ./build-rocm101/qsa_select_bench 32768 256 5 32768 LD_LIBRARY_PATH=/opt/rocm/lib STRATA_SELECT_WMMA=1 STRATA_SELECT_SPLIT2=1 ./build-rocm101/qsa_select_bench 32768 256 5 32768 # (repeated for 131072, 262144, 524288) ``` | context | 6-product | split2 | speedup | |---|---:|---:|---:| | 32768 | 0.809 ms | 0.525 ms | 1.54x | | 131072 | 2.674 ms | 1.551 ms | 1.72x | | 262144 | 8.187 ms | 3.722 ms | 2.20x | | 524288 | 12.409 ms | 7.488 ms | 1.66x | Selections identical: 256/256 at 32K, 253/256 at 262K (cells 0.0013%). Engine (interleaved 2 rounds, same session, split2 measured alone): ``` # baseline: STRATA_SELECT_SPLIT2=0, test: STRATA_SELECT_SPLIT2=1 # bench.py --lens 131072,262144,524288 --prod-params --salt 150 ``` | depth | mainline | +split2 | delta | |---|---:|---:|---:| | 131072 | 946.8 | 940.7 | -0.6% | | 262144 | 1002.8 | 1033.9 | +3.1% | | 524288 | 928.1 | 978.7 | +5.4% | **Failed:** none. **Not run:** CUDA (kernel is HIP-only, `#if defined(__HIPCC__)`); gfx12 (maintainer R9700 can verify); long-prompt quality battery (selections gate suffices). ## Limits HIP only; requires `STRATA_SELECT_WMMA=1`; accuracy 253/256 (upstream gate class 254/256). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:36:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4485
No description provided.