Round 34 Track C Audit: mm_gu3 T_IQ3_S & Super-Block / Loop-Invariant Hoisting on M5 #
1. Executive Summary #
- Patch:
/tmp/argon_r34_moemm/argon_r34_moemm.patch(git -C vendor/strata apply --checkpasses with exit code0). - Bitwise Parity: 100% bitwise identical (
HS_memcmp=PASS YE_memcmp=PASS Y_memcmp=PASS) acrossT_IQ3_S,T_IQ2_S,T_IQ2_XXS, andT_IQ2_XSatT = 512, 1024, 2048. - Key Architectural Finding (M5 Cooperative Matrix VGPR Cliff in
mm_gu3):- In
mm_gu3, each SIMD lane simultaneously holds two FP32 destination cooperative tensors (accg,accu:2 x 16 = 3232-bit registers) plus the FP16 right-input cooperative tensor (rw:32halves =1632-bit registers) acrossop.run(tA, rw, accg)andop.run(tA, rw, accu). - At
TM=16, TN=32, TK=32, SG=4(128threads/threadgroup),mm_gu3sits at the exact M5 VGPR occupancy cliff:- Adding
F == T_IQ3_Stosb(cachingfloat dg[4], du[4]= 8 extra 32-bit VGPRs live across all 8kisteps and 16op.runcalls) or evenhalf dg[4], du[4]spills/drops occupancy, regressingT_IQ3_Sby+1.55%to+5.39%. - Similarly, hoisting
l = kl >> 3,sh0,sh1,sh,th, or per-laneg0_l/u0_lpointer increments acrossop.runextends their live ranges across the matrix accumulate instructions, regressingT_IQ2_S(+13.8%to+67.3%) andT_IQ2_XXS(+25.2%to+28.8%). Recomputingland shifts insideW8<F>::blockallows those temporaries to die beforeop.run.
- Adding
- In
- What Shipped (Proven Net Wins with Zero Occupancy Penalty):
W8<T_IQ3_S>::block+F == T_IQ3_SVectorizedhalf4Epilogue Store:- Added
W8<T_IQ3_S>::block(bl, k, d, tab, hh, a, b)and dispatched it inmm_gu3with inlinerdh(rgw)/rdh(ruw)and the already-livehh(zero extra registers live acrossop.run), eliminating redundantrow + (j_in >> 8) * 110,(k & 255)masks, and(k & 7) >> 2recomputations on every inner-loop step. - Added
F == T_IQ3_Stomm_gu3's vectorized*(device half4*)hs_pepilogue store (line 1028), which executes after the K loop whenrwandaccuare dead.
- Added
F == T_IQ2_XSSuper-Block Offset (sboff) Reuse:- Unlike
T_IQ2_SandT_IQ2_XXS,W8<T_IQ2_XS>::blockhas a lower internal register footprint (nolorqhtemporaries), leaving headroom to reusesboff = uint(kb >> 8) * fmt<F>::BBacross thedg/dupreload and all 8kisteps (const uint boff = F == T_IQ2_XS ? sboff : ...).
- Unlike
gdn_prompt.metalCheck:- Verified
gdn_prompt_parity --abatT = 2048(f32 = 0);gdn_pre(47.32 ms),gdn_scanr_4(187.46 ms), andgdn_post(34.93 ms) are already at their register optimum (268.76 mstotal across 36 layers), sogdn_prompt.metalwas left untouched.
- Verified
2. Quiet-GPU A/B Benchmark Results (moe_mm_parity --v3 --dn Q2_0 --tile 16,32,32,4 --dtile 64,32,2 --gu-bench) #
| Format | T |
Bitwise Parity (HS / YE / Y) |
Baseline Med (Min) us |
Candidate Med (Min) us |
Med Diff | Min Diff |
|---|---|---|---|---|---|---|
IQ3_S |
512 | PASS / PASS / PASS |
9864.6 (9814.7) |
9844.9 (9797.7) |
-0.20% | -0.17% |
IQ3_S |
1024 | PASS / PASS / PASS |
16247.3 (16210.3) |
16144.0 (16134.4) |
-0.64% | -0.47% |
IQ3_S |
2048 | PASS / PASS / PASS |
27632.6 (27613.1) |
27535.3 (27490.0) |
-0.35% | -0.45% |
IQ2_XS |
512 | PASS / PASS / PASS |
7726.8 (7696.6) |
7728.9 (7698.7) |
+0.03% | +0.03% |
IQ2_XS |
1024 | PASS / PASS / PASS |
12758.6 (12377.6) |
12670.6 (12271.4) |
-0.69% | -0.86% |
IQ2_XS |
2048 | PASS / PASS / PASS |
22241.0 (21177.6) |
21962.3 (20952.1) |
-1.25% | -1.06% |
IQ2_S |
512 | PASS / PASS / PASS |
8846.8 (8797.6) |
8866.7 (8796.8) |
+0.22% | -0.01% |
IQ2_S |
1024 | PASS / PASS / PASS |
14642.3 (14624.9) |
14644.5 (14629.9) |
+0.02% | +0.03% |
IQ2_S |
2048 | PASS / PASS / PASS |
25110.4 (25040.7) |
25114.6 (25019.1) |
+0.02% | -0.09% |
IQ2_XXS |
512 | PASS / PASS / PASS |
7530.3 (7521.9) |
7543.7 (7518.6) |
+0.18% | -0.04% |
IQ2_XXS |
1024 | PASS / PASS / PASS |
12481.9 (12457.5) |
12493.6 (12471.8) |
+0.09% | +0.11% |
IQ2_XXS |
2048 | PASS / PASS / PASS |
21520.8 (21184.5) |
21586.4 (21177.1) |
+0.30% | -0.03% |