[PR #1653] [CLOSED] [WIP] cuda: SM75 IQ4_XS four-row reuse and NW3 shape specialization #3583

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/1653
Author: @Unmaple
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: wip/iq4-row-reuse-20261009


📝 Commits (10+)

  • 6226dea cuda: prototype opt-in SM75 IQ4 row reuse and NW3 shapes
  • ba2fe57 cuda: simplify IQ4 reuse and record clean-build parity
  • 3ad662d docs: record current-head IQ4 graph timing ablation
  • 1b2cd60 docs: record NW3 integration prototype on B6 framework
  • f85d4e5 docs: qualify IQ4 reuse with full-model logits at 16K
  • 4d547bb OPUS-MTP-MMVQ multi-colonna con attivazioni riusate fra le righe del blocco (STRATA_B6_MMVQ_ROWS) e micro-bench
  • c97e698 cuda: consolidate IQ4 NW3 specialization onto upstream B6 reuse
  • b0a7fdf docs: record shared B6 convergence and fresh SM75 validation
  • 5d62177 docs: confirm default parity under identical residency
  • 04b9655 docs: qualify final NW3 layer effect with precise paired timing

📊 Changes

6 files changed (+573 additions, -0 deletions)

View changed files

📝 CMakeLists.txt (+6 -0)
➕ docs/SM75_IQ4_REUSE_WIP.md (+132 -0)
📝 include/strata/kernels/native_mmvq.hpp (+6 -0)
➕ src/kernels/b6_mmvq_bench.cpp (+218 -0)
📝 src/kernels/cuda/native_mmvq.cu (+207 -0)
📝 src/kernels/mmvq_multi_parity.cpp (+4 -0)

📄 Description

WIP / 施工中. Default off; not ready for merge or review. Depends on #1418.

This specializes the shared B6 four-row kernel for exact-layout SM75 IQ4_XS projections at T=2–4, K=2560 and R=6144/10240/12288, using three warps instead of four. TSUM must be off. Unsupported calls retain NW4/native; HIP excludes the specialization. STRATA_B6_MMVQ_ROWS=4 selects B6 reuse and STRATA_IQ4_NW3=1 selects this increment. The legacy IQ4 reuse switch remains a compatibility selector. All flags unset retains native defaults.

Generic B6 activation reuse is imanu86's contribution in #1418, imported with original authorship and AI attribution preserved. Our duplicate framework was removed. The incremental comparison here is NW3 versus shared B6 NW4, not all reuse versus release default.

Internal operator performance: significant NW3 increment

Modified RTX 2080 Ti (22 GiB), T=4, six independent rotated process rounds; CUDA-event 100-call graphs with weights rotating beyond L2. Paired Student-t CI95, df=5. Baseline is shared B6 NW4 from #1418; this table measures only this PR's NW3 increment. Latencies are means. Positive reduction means faster.

IQ4_XS matrix (K,R) B6 NW4 μs B6 NW3 μs Latency reduction % Paired CI95 % Significant positive reduction?
2560,6144 26.34 23.73 9.90 [8.72,11.08] Yes
2560,10240 40.19 36.89 8.21 [4.19,12.23] Yes
2560,12288 47.37 42.77 9.71 [9.17,10.25] Yes
6144,2560 (NW4 dispatch control) 24.43 24.41 0.10 [−0.20,0.40] No; unchanged dispatch

All three affected matrices show a significant incremental gain under these conditions. T=1 retains native dispatch; the specialization is eligible at T=2–4, but the performance intervals above are T=4. Clocks were unlocked and CPU was shared. Intervals are per comparison, not adjusted for multiple comparisons. Separate three-pair short-context whole-layer prefix reductions remain inconclusive: GDN0.196 ±0.591%, QSA0.241 ±0.454% (CI95). Operator benefit and end-to-end benefit are reported separately.

End-to-end real-MTP performance

Real MTP T≤4, up to three drafts, 512 output tokens, three topics × three independent process pairs:

Topic B6 NW4 tok/s B6 NW3 tok/s Paired change % CI95 % (n=3, df=2)
Code 34.243 35.916 +5.329 [-15.067, +25.725]
Systems 42.789 43.998 +3.477 [-25.961, +32.915]
16K context 39.171 38.434 −1.633 [-16.010, +12.745]

No topic establishes a significant end-to-end gain. All 18 runs succeeded; all nine pairs have identical output token sequences, verifier rounds, accepted/proposed draft counts, 512 output tokens and 6528 resident expert slots. QSA MMA is off on both sides. CPU experts enabled: 14 participants, default 42 tasks, PCIe=0.14. Adaptive expert swaps/prompt cache/lookup/suffix drafts are disabled; prefill CPU sharing is zero. No oracle/follow or logits export. CPU total includes other work; GPU clocks are unlocked. No slow runs were excluded. This is bounded feature qualification, not the complete adaptive deployment.

Validation: complete CUDA13, HIP7.0.2 and SYCL2026.1 engine compilation passed. No matching AMD/Intel GPU runtime claim. Synthetic comparisons cover 980,113 exact-layout outputs with zero bit differences/nonfinite values; a negative control detects 290,059 differences. Short/16K fixed-input complete logits match within each input. Separately built release/default-off parity passes on one fixed input with matched residency. These checks do not prove equality for every workload.

Remaining: Compute Sanitizer cannot initialize the WDDM debugger interface, so no memcheck/racecheck/synccheck pass exists; independent review and #1418 dependency coordination. Further tests/builds/smoke checks are paused at the user's request. No Ready transition or default change requested.

Full methods, results and backend CI.

AI disclosure

The NW3 specialization and integration 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. The imported #1418 framework retains its original authorship and AI attribution. 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/1653 **Author:** [@Unmaple](https://github.com/Unmaple) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `wip/iq4-row-reuse-20261009` --- ### 📝 Commits (10+) - [`6226dea`](https://github.com/Niko1221/Strata/commit/6226dea762f28ac40fb52a70274a9304b9b39b87) cuda: prototype opt-in SM75 IQ4 row reuse and NW3 shapes - [`ba2fe57`](https://github.com/Niko1221/Strata/commit/ba2fe578bad323d86ebebc63e28c7b807a10fb90) cuda: simplify IQ4 reuse and record clean-build parity - [`3ad662d`](https://github.com/Niko1221/Strata/commit/3ad662d4e2d72a13e410e6305e3ed3ef3148d1e9) docs: record current-head IQ4 graph timing ablation - [`1b2cd60`](https://github.com/Niko1221/Strata/commit/1b2cd600cf73560b56236fd91ca1243f3dea30f0) docs: record NW3 integration prototype on B6 framework - [`f85d4e5`](https://github.com/Niko1221/Strata/commit/f85d4e57d32e9d78f096ed11457d918f477d16ac) docs: qualify IQ4 reuse with full-model logits at 16K - [`4d547bb`](https://github.com/Niko1221/Strata/commit/4d547bbf14e9f31f48d03280e83f1c4a85201ee0) OPUS-MTP-MMVQ multi-colonna con attivazioni riusate fra le righe del blocco (STRATA_B6_MMVQ_ROWS) e micro-bench - [`c97e698`](https://github.com/Niko1221/Strata/commit/c97e69830eee4b92cd4aca0b4456098f1003a764) cuda: consolidate IQ4 NW3 specialization onto upstream B6 reuse - [`b0a7fdf`](https://github.com/Niko1221/Strata/commit/b0a7fdfbe102f4ed0182e078aed055509244f346) docs: record shared B6 convergence and fresh SM75 validation - [`5d62177`](https://github.com/Niko1221/Strata/commit/5d62177f7605d85d3e82796d539c19fc45ce986f) docs: confirm default parity under identical residency - [`04b9655`](https://github.com/Niko1221/Strata/commit/04b96551cde2992e86d9e6723bfdea06e16e19c9) docs: qualify final NW3 layer effect with precise paired timing ### 📊 Changes **6 files changed** (+573 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+6 -0) ➕ `docs/SM75_IQ4_REUSE_WIP.md` (+132 -0) 📝 `include/strata/kernels/native_mmvq.hpp` (+6 -0) ➕ `src/kernels/b6_mmvq_bench.cpp` (+218 -0) 📝 `src/kernels/cuda/native_mmvq.cu` (+207 -0) 📝 `src/kernels/mmvq_multi_parity.cpp` (+4 -0) </details> ### 📄 Description WIP / 施工中. Default off; not ready for merge or review. Depends on #1418. This specializes the shared B6 four-row kernel for exact-layout SM75 IQ4_XS projections at T=2–4, K=2560 and R=6144/10240/12288, using three warps instead of four. TSUM must be off. Unsupported calls retain NW4/native; HIP excludes the specialization. STRATA_B6_MMVQ_ROWS=4 selects B6 reuse and STRATA_IQ4_NW3=1 selects this increment. The legacy IQ4 reuse switch remains a compatibility selector. All flags unset retains native defaults. Generic B6 activation reuse is imanu86's contribution in #1418, imported with original authorship and AI attribution preserved. Our duplicate framework was removed. The incremental comparison here is NW3 versus shared B6 NW4, not all reuse versus release default. ### Internal operator performance: significant NW3 increment Modified RTX 2080 Ti (22 GiB), T=4, six independent rotated process rounds; CUDA-event 100-call graphs with weights rotating beyond L2. Paired Student-t CI95, df=5. Baseline is shared B6 NW4 from #1418; this table measures only this PR's NW3 increment. Latencies are means. Positive reduction means faster. | IQ4_XS matrix (K,R) | B6 NW4 μs | B6 NW3 μs | Latency reduction % | Paired CI95 % | Significant positive reduction? | |---|---:|---:|---:|---:|---| |2560,6144|26.34|23.73|9.90|[8.72,11.08]|Yes| |2560,10240|40.19|36.89|8.21|[4.19,12.23]|Yes| |2560,12288|47.37|42.77|9.71|[9.17,10.25]|Yes| |6144,2560 (NW4 dispatch control)|24.43|24.41|0.10|[−0.20,0.40]|No; unchanged dispatch| All three affected matrices show a significant incremental gain under these conditions. T=1 retains native dispatch; the specialization is eligible at T=2–4, but the performance intervals above are T=4. Clocks were unlocked and CPU was shared. Intervals are per comparison, not adjusted for multiple comparisons. Separate three-pair short-context whole-layer prefix reductions remain inconclusive: GDN0.196 ±0.591%, QSA0.241 ±0.454% (CI95). Operator benefit and end-to-end benefit are reported separately. ### End-to-end real-MTP performance Real MTP T≤4, up to three drafts, 512 output tokens, three topics × three independent process pairs: | Topic | B6 NW4 tok/s | B6 NW3 tok/s | Paired change % | CI95 % (n=3, df=2) | |---|---:|---:|---:|---:| | Code |34.243|35.916|+5.329|[-15.067, +25.725]| | Systems |42.789|43.998|+3.477|[-25.961, +32.915]| | 16K context |39.171|38.434|−1.633|[-16.010, +12.745]| No topic establishes a significant end-to-end gain. All 18 runs succeeded; all nine pairs have identical output token sequences, verifier rounds, accepted/proposed draft counts, 512 output tokens and 6528 resident expert slots. QSA MMA is off on both sides. CPU experts enabled: 14 participants, default 42 tasks, PCIe=0.14. Adaptive expert swaps/prompt cache/lookup/suffix drafts are disabled; prefill CPU sharing is zero. No oracle/follow or logits export. CPU total includes other work; GPU clocks are unlocked. No slow runs were excluded. This is bounded feature qualification, not the complete adaptive deployment. Validation: complete CUDA13, HIP7.0.2 and SYCL2026.1 engine compilation passed. No matching AMD/Intel GPU runtime claim. Synthetic comparisons cover 980,113 exact-layout outputs with zero bit differences/nonfinite values; a negative control detects 290,059 differences. Short/16K fixed-input complete logits match within each input. Separately built release/default-off parity passes on one fixed input with matched residency. These checks do not prove equality for every workload. Remaining: Compute Sanitizer cannot initialize the WDDM debugger interface, so no memcheck/racecheck/synccheck pass exists; independent review and #1418 dependency coordination. Further tests/builds/smoke checks are paused at the user's request. No Ready transition or default change requested. [Full methods, results and backend CI](https://github.com/Unmaple/Strata/blob/wip/iq4-row-reuse-20261009/docs/SM75_IQ4_REUSE_WIP.md). ### AI disclosure The NW3 specialization and integration 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. The imported #1418 framework retains its original authorship and AI attribution. 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#3583
No description provided.