[PR #1654] [CLOSED] [WIP] cuda: optional SM75 main-model QSA padded MMA #3584

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1654
Author: @Unmaple
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: wip/sm75-qsa-mma-20261009


📝 Commits (9)

  • 6108ef9 cuda: prototype optional SM75 main-model QSA padded MMA
  • d115ed7 cuda: qualify QSA MMA image and add capture parity fixtures
  • 832bc0a docs: record QSA GPU timing and controlled model quality checks
  • a1ce870 docs: expand MMA quality checks to true 16K context
  • d62d1ad docs: quantify MMA quality on three WikiText segments
  • 0eedc17 docs: qualify final QSA layers, corpus subset and failure fallback
  • 589b12f docs: report real MTP throughput and CUDA12 fallback qualification
  • 3b9cd43 docs: record SYCL compile pass and complete three-draft production pairs
  • 5b0a0b9 docs: clarify completed QSA MTP evidence and draft-head scope

📊 Changes

7 files changed (+428 additions, -1 deletions)

View changed files

📝 CMakeLists.txt (+8 -0)
➕ docs/SM75_QSA_MMA_WIP.md (+213 -0)
📝 include/strata/kernels/qsa_decode_attn.hpp (+4 -0)
📝 src/core/verify.cpp (+1 -1)
📝 src/kernels/cuda/qsa_decode_attn.cu (+59 -0)
➕ src/kernels/cuda/qsa_padded_mma.cuh (+58 -0)
➕ src/kernels/qsa_mma_parity.cpp (+85 -0)

📄 Description

WIP / 施工中. Default off; not ready for merge or review.

Add optional padded FP16 QK/PV MMA with FP32 accumulation for explicitly marked main-model QSA verifier calls on SM75 at T=2–4 (STRATA_QSA_SM75_MMA=1). The existing function signature is preserved. T=1, the MTP draft head, prefill, other architectures and HIP retain native attention. Main-model verification of MTP drafts can use the candidate when eligible. Insufficient compiled-image PTX or shared-memory configuration failure falls back to native.

Internal attention and layer-prefix performance: significant QSA gain

Modified RTX 2080 Ti (22 GiB), exact 16K prompt, T=4 fixed oracle/follow continuation and captured graphs. CPU experts enabled with six participants, PCIe=0; equal resident expert counts verified. First four rounds excluded. Means aggregate QSA/12 and GDN/36 layers, rather than a single layer. Three independent process pairs in AB/BA/AB order; paired Student-t CI95, df=2. Positive reduction means faster.

Metric Native mean μs/layer MMA mean μs/layer Reduction % ± CI95 half-width Print-rounding sensitivity envelope % Significant positive reduction?
QSA attention 137.50 72.22 47.475 ± 0.869 [45.124, 49.541] Yes
QSA prefix: layer start → cold-route publication 537.22 472.22 12.099 ± 0.027 [5.987, 18.160] Yes
GDN prefix: unaffected control 353.89 354.07 −0.052 ± 0.297 [−2.852, 2.690] No

Both QSA reductions remain positive under the conservative print-rounding sensitivity envelope. Ordinary CI95 does not include coarse print rounding; the envelope propagates that rounding and is not a second independent confidence interval. Intervals are per comparison, without multiple-comparison adjustment. Device clocks were unlocked and CPU was shared. Stage timing includes execution and inter-kernel gaps. Three pairs are a small sample. The prefix excludes expert execution and must not be described as whole-layer or production throughput improvement. Forced-follow uses 100% acceptance by construction; real-MTP end-to-end results are reported separately below.

End-to-end real-MTP performance

Real MTP throughput gain is not established. Each T cap has a separate completed batch: three topics × three balanced independent process pairs,512 output tokens/run,18/18 successful processes. Paired changes and Student-t CI95 (n=3/topic,df=2):

Verification cap Topic Native tok/s MMA tok/s Paired change % CI95 %
T≤3 Code 39.145 37.556 −4.041 [-7.682,−0.401]
T≤3 Systems 45.500 44.309 −2.569 [-14.730,+9.591]
T≤3 16K context 44.272 43.427 −1.890 [-6.676,+2.896]
T≤4 Code 30.615 32.371 +6.138 [-17.468,+29.744]
T≤4 Systems 37.831 36.790 −2.859 [-14.829,+9.111]
T≤4 16K context 33.606 36.276 +7.934 [-8.385,+24.253]

T≤3 code has an observed workload throughput regression; other intervals include zero. Outputs and draft acceptance differ between native/MMA in every pair, so these are not identical-work causal kernel comparisons. CPU total includes external work and GPU clocks are unlocked. The T-cap batches ran in different time blocks and are not an optimal-cap comparison. No runs were excluded. Greedy seed20261009;14 CPU participants,default42 tasks,PCIe=0.14,actual6528 expert slots. Dynamic expert swapping/prompt cache/lookup/suffix drafts are disabled, prefill CPU sharing zero. No oracle/follow or logits export. This is bounded feature qualification rather than complete adaptive deployment.

Numerical results change. Six additional disjoint WikiText subset spans give pooled PPL change −0.308% at T2 (exploratory segment-level CI95 [−1.276%,+0.669%]) and −0.472% at T4 ([−2.101%,+1.185%]); mean Top-1 agreement96.419%/96.810%,mean KL0.010715/0.010810. This is a corpus subset, not a full benchmark or proof of quality equivalence. Largest absolute logit difference4.743; largest per-position KL0.886. No equivalence margin was prespecified. Keep opt-in.

Validation: complete CUDA13,HIP7.0.2 and SYCL/oneAPI2026.1 engine builds;240-case fixtures spanning four KV formats,T1–5,pagination/masking and graph capture/replay; flags-off complete logits parity against separately built v0.1.41 on one fixed input with matched residency. Actual CUDA12 compute70 PTX-only JIT on SM75 passes240 cases with bit-exact native fallback;compute75 positive control passes240 cases. These are standalone CUDA12 fixture results, not full-engine CUDA12 or matching AMD/Intel GPU runtime qualification.

Remaining: Compute Sanitizer could not initialize the WDDM debugger interface, so memcheck/racecheck/synccheck are not passed. Independent review and an explicit numerical acceptance decision remain. Further tests/builds/smoke checks are paused at the user's request. No default change or Ready transition requested.

Full methods, numbers, limitations and backend CI.

AI disclosure

Changes in this PR were written by GPT-6.1-sol. Discovery, experiments, testing and validation were carried out by GPT-6.1-sol through Codex on the author's machine. This is not independent reviewer sign-off; validation remains incomplete.


🔄 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/1654 **Author:** [@Unmaple](https://github.com/Unmaple) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `wip/sm75-qsa-mma-20261009` --- ### 📝 Commits (9) - [`6108ef9`](https://github.com/Niko1221/Strata/commit/6108ef9b7ba7c51a63bbd7688858ee971c20bee5) cuda: prototype optional SM75 main-model QSA padded MMA - [`d115ed7`](https://github.com/Niko1221/Strata/commit/d115ed7a1cfbb627a1d5163e3810dffa061d7459) cuda: qualify QSA MMA image and add capture parity fixtures - [`832bc0a`](https://github.com/Niko1221/Strata/commit/832bc0a0ab39ebfaebdb9d72bb5d41520f15e5ce) docs: record QSA GPU timing and controlled model quality checks - [`a1ce870`](https://github.com/Niko1221/Strata/commit/a1ce870a3de4f69eded61abc1f669b4985f8462a) docs: expand MMA quality checks to true 16K context - [`d62d1ad`](https://github.com/Niko1221/Strata/commit/d62d1ad9a389bc05e7c7519fe822e781be643664) docs: quantify MMA quality on three WikiText segments - [`0eedc17`](https://github.com/Niko1221/Strata/commit/0eedc17c608c99bc583b8c5290cae4bb078ba919) docs: qualify final QSA layers, corpus subset and failure fallback - [`589b12f`](https://github.com/Niko1221/Strata/commit/589b12fb1e3fd87782f289dfb6bd594a98488943) docs: report real MTP throughput and CUDA12 fallback qualification - [`3b9cd43`](https://github.com/Niko1221/Strata/commit/3b9cd43c864b6d403a9ac119340b92f2ea76b1df) docs: record SYCL compile pass and complete three-draft production pairs - [`5b0a0b9`](https://github.com/Niko1221/Strata/commit/5b0a0b9b5ed703a8a0679aac3dd87abe16a4900b) docs: clarify completed QSA MTP evidence and draft-head scope ### 📊 Changes **7 files changed** (+428 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+8 -0) ➕ `docs/SM75_QSA_MMA_WIP.md` (+213 -0) 📝 `include/strata/kernels/qsa_decode_attn.hpp` (+4 -0) 📝 `src/core/verify.cpp` (+1 -1) 📝 `src/kernels/cuda/qsa_decode_attn.cu` (+59 -0) ➕ `src/kernels/cuda/qsa_padded_mma.cuh` (+58 -0) ➕ `src/kernels/qsa_mma_parity.cpp` (+85 -0) </details> ### 📄 Description WIP / 施工中. Default off; not ready for merge or review. Add optional padded FP16 QK/PV MMA with FP32 accumulation for explicitly marked main-model QSA verifier calls on SM75 at T=2–4 (STRATA_QSA_SM75_MMA=1). The existing function signature is preserved. T=1, the MTP draft head, prefill, other architectures and HIP retain native attention. Main-model verification of MTP drafts can use the candidate when eligible. Insufficient compiled-image PTX or shared-memory configuration failure falls back to native. ### Internal attention and layer-prefix performance: significant QSA gain Modified RTX 2080 Ti (22 GiB), exact 16K prompt, T=4 fixed oracle/follow continuation and captured graphs. CPU experts enabled with six participants, PCIe=0; equal resident expert counts verified. First four rounds excluded. Means aggregate QSA/12 and GDN/36 layers, rather than a single layer. Three independent process pairs in AB/BA/AB order; paired Student-t CI95, df=2. Positive reduction means faster. | Metric | Native mean μs/layer | MMA mean μs/layer | Reduction % ± CI95 half-width | Print-rounding sensitivity envelope % | Significant positive reduction? | |---|---:|---:|---:|---:|---| | QSA attention | 137.50 | 72.22 | 47.475 ± 0.869 | [45.124, 49.541] | Yes | | QSA prefix: layer start → cold-route publication | 537.22 | 472.22 | 12.099 ± 0.027 | [5.987, 18.160] | Yes | | GDN prefix: unaffected control | 353.89 | 354.07 | −0.052 ± 0.297 | [−2.852, 2.690] | No | Both QSA reductions remain positive under the conservative print-rounding sensitivity envelope. Ordinary CI95 does not include coarse print rounding; the envelope propagates that rounding and is not a second independent confidence interval. Intervals are per comparison, without multiple-comparison adjustment. Device clocks were unlocked and CPU was shared. Stage timing includes execution and inter-kernel gaps. Three pairs are a small sample. The prefix excludes expert execution and must not be described as whole-layer or production throughput improvement. Forced-follow uses 100% acceptance by construction; real-MTP end-to-end results are reported separately below. ### End-to-end real-MTP performance **Real MTP throughput gain is not established.** Each T cap has a separate completed batch: three topics × three balanced independent process pairs,512 output tokens/run,18/18 successful processes. Paired changes and Student-t CI95 (n=3/topic,df=2): | Verification cap | Topic | Native tok/s | MMA tok/s | Paired change % | CI95 % | |---|---|---:|---:|---:|---:| |T≤3|Code|39.145|37.556|−4.041|[-7.682,−0.401]| |T≤3|Systems|45.500|44.309|−2.569|[-14.730,+9.591]| |T≤3|16K context|44.272|43.427|−1.890|[-6.676,+2.896]| |T≤4|Code|30.615|32.371|+6.138|[-17.468,+29.744]| |T≤4|Systems|37.831|36.790|−2.859|[-14.829,+9.111]| |T≤4|16K context|33.606|36.276|+7.934|[-8.385,+24.253]| T≤3 code has an observed workload throughput regression; other intervals include zero. Outputs and draft acceptance differ between native/MMA in every pair, so these are not identical-work causal kernel comparisons. CPU total includes external work and GPU clocks are unlocked. The T-cap batches ran in different time blocks and are not an optimal-cap comparison. No runs were excluded. Greedy seed20261009;14 CPU participants,default42 tasks,PCIe=0.14,actual6528 expert slots. Dynamic expert swapping/prompt cache/lookup/suffix drafts are disabled, prefill CPU sharing zero. No oracle/follow or logits export. This is bounded feature qualification rather than complete adaptive deployment. **Numerical results change.** Six additional disjoint WikiText subset spans give pooled PPL change −0.308% at T2 (exploratory segment-level CI95 [−1.276%,+0.669%]) and −0.472% at T4 ([−2.101%,+1.185%]); mean Top-1 agreement96.419%/96.810%,mean KL0.010715/0.010810. This is a corpus subset, not a full benchmark or proof of quality equivalence. Largest absolute logit difference4.743; largest per-position KL0.886. No equivalence margin was prespecified. Keep opt-in. Validation: complete CUDA13,HIP7.0.2 and SYCL/oneAPI2026.1 engine builds;240-case fixtures spanning four KV formats,T1–5,pagination/masking and graph capture/replay; flags-off complete logits parity against separately built v0.1.41 on one fixed input with matched residency. Actual CUDA12 compute70 PTX-only JIT on SM75 passes240 cases with bit-exact native fallback;compute75 positive control passes240 cases. These are standalone CUDA12 fixture results, not full-engine CUDA12 or matching AMD/Intel GPU runtime qualification. Remaining: Compute Sanitizer could not initialize the WDDM debugger interface, so memcheck/racecheck/synccheck are not passed. Independent review and an explicit numerical acceptance decision remain. Further tests/builds/smoke checks are paused at the user's request. No default change or Ready transition requested. [Full methods, numbers, limitations and backend CI](https://github.com/Unmaple/Strata/blob/wip/sm75-qsa-mma-20261009/docs/SM75_QSA_MMA_WIP.md). ### AI disclosure Changes in this PR were written by GPT-6.1-sol. Discovery, experiments, testing and validation were carried out by GPT-6.1-sol through Codex on the author's machine. This is not independent reviewer sign-off; validation remains incomplete. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:20 +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#3584
No description provided.