Repository navigation
Description
Tracking issue for closing the training-step GEMM gap vs cuBLASLt, measured by the 14-shape A/B harness merged in #79 (gpu/gemm/src/bin/model_shapes.rs, FEATURES=cublas ./run.sh gemm model_shapes). Baseline: main @ cebec1c profile, 472.4 ms full step, tcgen05 GEMMs 188.7 ms at an average 1.18 PF/s.
Measured state (B200, cuBLASLt 13.0, two runs within 2%)
| shape M×K×N | step row | mode | ours TF/s | cuBLASLt TF/s | ratio | gap ms/step |
|---|---|---|---|---|---|---|
| 3072×6144×8192 | bwd gate_up dW | f32 acc-T | 1162 | 1746 | 0.666 | 8.5 |
| 4096×6144×3072 | bwd down dW | f32 acc-T | 964 | 1639 | 0.588 | 6.3 |
| 6144×3072×8192 | gate_up fwd | f32 store | 1323 | 1850 | 0.715 | 6.4 |
| 6144×3072×4096 | bwd down dx | f32 store | 1214 | 1652 | 0.735 | 3.2 |
| 24576×3072×9216 | qkv fwd | f32 store | 1477 | 1915 | 0.771 | 2.6 |
| 6144×4096×3072 | down fwd | f32 store | 1409 | 1803 | 0.781 | 2.3 |
| 3072×24576×9216 | bwd qkv dW | f32 acc-T | 1738 | 1973 | 0.881 | 1.2 |
| 6144×8192×3072 | bwd gate_up dx | f32 store | 1706 | 1844 | 0.925 | 1.3 |
| 24576×3072×3072 | o_proj fwd | f32 store | 1396 | 1848 | 0.756 | 1.0 |
| 24576×3072×50432 | lm_head fwd | bf16 store | 1552 | 1927 | 0.806 | 1.0 |
| 24576×9216×3072 | bwd qkv dx | f32 store | 1736 | 1867 | 0.929 | 0.7 |
| 24576×50432×3072 | bwd lm_head dx | bf16 store | 1707 | 1855 | 0.920 | 0.4 |
| 3072×24576×3072 | bwd o_proj dW | f32 acc-T | 1754 | 1966 | 0.892 | 0.3 |
| 3072×24576×50432 | bwd lm_head dW | bf16 acc-T | 1721 | 1837 | 0.937 | 0.3 |
Full-parity gap: ~35 ms/step (472 → ~437 ms, ≈ +1.9 pp MFU).
Diagnosis (one mechanism, established in #79)
The ratio is a function of K depth and drain kind, not shape family. Every mode converges to 0.92–0.94× at K ≥ 8k and decays at shallow K: pipeline::run serializes the per-[256,256]-tile epilogue against the next tile's MMA — ~6–7 µs (bf16 drain), ~10–13 µs (f32 scattered), ~30 µs (f32 accumulate fold) against ~26 µs of MMA per 3072 of K. Refuted along the way: the MN-major transposed walk costs nothing (it slightly wins everywhere); the 144-tile bwd o_proj dW underfill is worth ≤3% (cuBLASLt wins that shape with the same single wave, split-K off).
Remedies, in leverage order
- Delete the accumulate fold's read of C — the fold is +25–29% at K=6144 and is why the two worst rows are per-expert dW. Route: ferro-kittens#42 reduction TMA stores (
cp.reduce.async.bulk.tensor.add); the epilogue then stores-with-add and never reads C. Addresses ~15 ms (rows 1, 2, 7, 13; also unblocks split-K if ever wanted). fp32 add at the copy engine keeps weight-grad accumulation fp32 (SPEC decision Optimize RMSNorm with block-parallel kernels #20) and stays one-writer-per-tile deterministic. - Drain–MMA overlap — the rest of the gap at shallow K, all store rows. Blocked on TMEM: overlapping needs a second 256-column accumulator slot that 2 CTAs/SM cannot allocate today. Related: ferro-kittens#105 (second tile), ferro GAPS §2.6 / ferro-kittens#174 (fp32 staging drain, re-measure condition: an epilogue affording a [32,64] fp32 staging tile).
- Per-shape tile selection — not a const flip (
BLOCK_N=128breaksHALF_N == BLOCK_M,MmaShape::M256_N256, theSHARED_BYTES/MAX_CLUSTERSasserts atgpu/gemm/src/optimized.rs:182-185, and TMEM-pinned residency). ferro-kittens#87/The batch the B200 holds is 21, and the one worth taking is 16 #105 territory. Only worth revisiting after 1 and 2.
Acceptance
Per remedy shipped: model_shapes ratios re-measured same-container, the affected step rows re-profiled via --baseline-ref A/B, parity suites green, KernelBudget ratchets updated in the same PR. Done when every row ≥ 0.90× or the residual is attributed to a documented blocked remedy (item 2).
Measurement logs: #79 thread (model_shapes_run1.log / run2.log).
Activity
Merge pull request #82 from feitreim/80-reduction-store-epilogue
feitreim commentedon Aug 4, 2026
Remedy 1 shipped: ferro-kittens#187 (reduction TMA store, add @ rank 2 — #42's sanctioned fallback; catalog omission confirmed as a generator-input gap, upstream filed as NVIDIA/cuda-rust#660) + #82 (fold-free accumulate epilogue, both pins on ferro main @ 9b58025).
Measured (same-container A/B): full step −17.3 ms; acc-T rows 0.666→0.886, 0.588→0.777, 0.881→0.952, 0.892→0.944; every f32 store row also improved (0.72–0.78 → 0.75–0.87) because dropping the fold's monomorphization shed 18 registers and the store kernel's whole 512 B local frame (budgets ratcheted 120/512 → 102/0; new accumulate kernel 80/0). Decompose sweep: fold premium +25–29% → +0.3…+9.8%, negative on the worst shape — bwd down dW's accumulate is now cheaper than its own store.
Residual: the money rows' remaining sub-0.90 is entirely the shallow-K store baseline, i.e. remedy 2 (drain–MMA overlap, blocked on a second 256-col TMEM slot). Numerics caveat recorded in #82: engine-side fp32 reduce-add flushes subnormals where an FADD would not; irrelevant at gradient magnitudes, all gates green.
feitreim commentedon Aug 4, 2026
Remedy 2 progress — two candidate routes measured and killed, both informative:
1 CTA/SM with double-buffered TMEM (ferro
gemm_ws, the structure that already exists): dead in the shallow-K regime too. ferro-kittens#188 / #189 added the shallow-K arm the warp-specialized A/B never had. At the money geometries (bf16, one container, checked-then-timed):ws staged8loses togemm staged84by 7.3–7.9% at every K=3072 shape, and — the kill criterion — thews no drainfloor loses too (0.822/0.880/0.884 of cuBLASLt vs the 2-CTA kernel's 0.828/0.896/0.909 with its exposed epilogue). At 1 CTA/SM the feed+MMA alone costs more than the entire drain exposure the second accumulator would remove. The −7.3% of ferro#112 was never a deep-K artifact; route closed in both regimes. One number to keep: solono drainvs dualno drainat 8192³ = 0.6620/0.5944 ms — a lone M256_N256 chain sustains ~0.90 of two chains' aggregate.Anti-phase stagger at 2 CTAs/SM (branch
80-stagger-probe,bin/stagger_probe.rs): a transient, not an equilibrium. Premise: #114 measured the epilogue fully exposed (1.01×) and the 0.90 above says a co-resident CTA's MMA could absorb most of a draining neighbour's freed tensor core — so delay half the clusters once at launch and let identical item periods hold the offset. Measured (sweep 4–20 µs × two co-residency rules, six model_shapes rows, cuBLASLt in-container): best case +2.8% at 4 µs, monotonically worse at every larger delay (to −11%), same shape both rules. Reading: in-phase is an attractor — the cluster that gets solo tensor time finishes its MMA early and catches its neighbour, so a one-time nudge buys ~one item of overlap and relapses. Anti-phase would need per-item enforcement across clusters that share no barrier, and the 4 µs row caps what that could honestly win.Both null results point the same way: nothing outside the cluster will cover the drain, and the second accumulator is not affordable. What remains of remedy 2 is intra-cluster overlap with the single accumulator: the accumulator is only TMEM-busy until the drain's last
tcgen05.ldretires, so a drain that hoists its loads (two bands live, ~+64 registers), releases TMEM through a cluster semaphore, and only then issues its stores lets the next item's MMA start while ~half the store issue (and all store completion) is still in flight — plus the whole TMA refill. That needs the deferred-drain formpipeline::Jobexplicitly sanctions and a fifth warp for produce/MMA so the drain warps never block the schedule. Building that next on this branch's successor; it helps every mode, and deep K too (~6.5 µs/tile of drain is fixed at all K), so the square gates should gain rather than merely survive.Merge pull request #83 from feitreim/80-deferred-drain
feitreim commentedon Aug 4, 2026
Remedy 2 shipped and closed: #83 (deferred drain — the epilogue runs beside the next item's MMA; two role warps; drains hoist loads a pass ahead of stores). Same-container full-step A/B both orders: −2.6/−2.7 ms. Deep-K model rows 0.92–0.93 → 0.955–0.967; shallow-K store rows +1–8 pts. Known tradeoff on record in the PR: 16384³ square-bench store cells −2–3% (L2 term from deferred C writeback vs operand streaming; the model has no such shape). Routes killed with data: 1 CTA/SM double-buffered TMEM (ferro#188/#189 — the design's epilogue-free floor loses to the shipped kernel at every shallow shape; #189 merged as the standing control), anti-phase stagger (branch 80-stagger-probe, +2.8% best then relapses), fp32 store via copy engine (ferro#123's finding survives deferral).
Residual attribution after remedies 1+2 (~15 ms, 9 rows still <0.90):
Remaining open remedy: 3 (per-shape tiles, ferro #87/#105) — now carrying both the wave-quantization rows and, via a smaller tile, potentially the drain-release cap.
feitreim commentedon Aug 5, 2026
Remedy 3 measured and closed as a documented negative: the
[256,128]pair tile loses to[256,256]on all fourteen model rows, in both increments — wave-math alone, and fully double-buffered with the release barrier deleted. Branch80-narrow-tilepreserves both increments as separate commits; nothing merged, the dispatch never shipped.What was built (parity green on every mode × layout × tile, both increments)
7779b2f—[256,128] @ STAGES = 4as a second compiled variant of the deferred-drain kernel. Same 114 816 B plan, same 2 CTAs/SM, same 148 clusters — the narrower B ring pays for the fourth stage exactly, so the A/B moves the tile and nothing else. Host-side per-shape dispatch (TcTile+Tcgen05Launch), a[64, 64]-box tensor-map twin forB's K-major 64-row stage (TmaOperand; A's box is tile-indifferent), andmodel_shapestimes the forced other tile on every row, so the dispatch rule is accountable to the same table that would change it.5bf1991— the same kernel double-buffered:alloc_cluster(256)= two[128,128]slots (2 slots × 2 CTAs/SM = the 512-column budget, exactly — the door Training-step GEMMs vs cuBLASLt: ~35 ms/step gap, one epilogue mechanism #80 recorded as blocked at 256 columns). The MMA of item i writes slotcycle & 1while the band warps drain item i−1 out of the other slot, loads included;acc_freeand the wholeReleasediscipline are deleted, becausepipeline::run's item boundary (tcgen05 fence + cluster sync) already proves a slot's last reader retired. One trap worth recording: slot parity must be a per-cluster counter — the static schedule strides items by the cluster count, which is even, so a global item index's parity would park every cluster on one slot forever.No ferro-kittens work was needed:
MmaShape::M256_N128,TmemTile::columns_right, and the[64,64]box path all exist at pin9b58025. ferro #87 is satisfied by the sweep it already ran; this is ferro #105's dispatch question answered on the training shapes.Numbers (model_shapes, same-container cuBLASLt, B200)
"narrow-1 / narrow-2" are the forced-
[256,128]ratios in each increment's session; "wide" is the[256,256]ratio from the increment-2 session (its increment-1 session agrees to ±0.02).Registers for the record: narrow 132–136 / 115–117 / 127 (bf16 / f32 store / accumulate) across the two increments, zero spill; wide unchanged at 137 / 118 / 127. The wide rows match #83's post-merge sessions, so the dual-descriptor plumbing did not disturb the control.
Reading
M·N/(M+N)falls 128 → 85.3 (+50% operand traffic per output), and the deficit tracks it — worst on the big-N bf16 rows (−23 to −28 points), mildest where wave math pays most. The neighboring rungs are not untuned territory: ferro Every AdamW write-back reads a pair before writing it, and the router's zeroing walks the dead tail (#99) #104 priced[256,128]@ s2 (4 CTAs/SM) at −35%, and @ s4 — this kernel's occupancy twin — at −7.7% / +2.1% on squares. There is no adjacent configuration left that its sweep did not already rank below the wide tile.Residual attribution, revised
#83 attributed the remaining ~15 ms to (a) wave quantization at the
[256,256]tile and (b) the serial load half of its drain. Remedy 3 built the one configuration that fixes both — the wave arithmetic improves and the drain serialization goes to zero — and it loses every row, because the fix costs more in feed than (a) and (b) are worth combined at every training shape. Both mechanisms stand as descriptions of the wide kernel's residual, but neither is recoverable by tiling. With remedies 1 and 2 shipped and remedy 3 measured closed, #80's open remedies are exhausted; the residual gap is bounded below by the wide tile's wave quantization (down dW's 0.649 last-wave term above all) plus a drain-release path already cut to its two-LDTM floor per pass.feitreim commentedon Aug 5, 2026
Closing per the acceptance clause: every row is either ≥0.90× or its residual is attributed with a measured, closed remedy. Final state: remedies 1 (#82, −17.3 ms) and 2 (#83, −2.6 ms) shipped; remedy 3 measured through full double-buffering on branch 80-narrow-tile and closed as a documented negative (narrow loses all 14 rows; feed-boundedness — intensity 128 → 85.3 — outweighs the wave and drain terms combined at every training shape; ferro #104's sweep prices all adjacent rungs). The ~15 ms residual vs cuBLASLt is attributed and, on current evidence, not recoverable at this kernel architecture: cuBLASLt's remaining edge is epilogue overlap depth we cannot buy without paying more in feed or occupancy than it returns. Preserved controls: 80-stagger-probe, 80-narrow-tile, ferro ws shallow arm (#189).
feitreim commentedon Aug 5, 2026
Reopened by owner direction: the residual is attributed but not accepted. Revised acceptance: every model_shapes row ≥ 0.90× cuBLASLt, architectural changes in scope if needed — 'attributed to a closed remedy' is no longer a done-state. One observation motivating the reopen: the narrow-tile experiment inadvertently showed the standing attribution under-explains the gap — it priced the wave-quantization and residual-drain terms at only a few points combined, yet the shallow-K store rows sit 10–17 points below cuBLASLt. Something else is being paid at shallow K (pipeline fill per tile? feed steady-state? K-loop tail?) that the store-vs-fold decomposition never isolated. Next step is forensic: decompose the remaining per-item time against what cuBLASLt actually runs at these shapes before designing anything.
feitreim commentedon Aug 5, 2026
Phase 1, forensics before design. Two instruments on branch
80-forensics(bin/budget.rs+src/phase_probe.rs), one B200 container,--features cublas.The standing attribution is wrong, and so was my own first guess. The shallow-K deficit is not the epilogue, not the wave term, not the pipeline fill, and not the feed. It is a fixed per-item cost of ~15 100 SM ticks (~8.6 µs) that cuBLASLt does not pay at all — and our steady state is already better than cuBLASLt's.
Instrument 1 — the depth sweep
Fix the output geometry (so tile count, wave quantization and the
groupedwalk are all held still), sweepK, and fitper-item time = fixed + per_block · K/64for both sides.us/tileis ms × 148 / tiles.24576 × K × 9216(qkv fwd's geometry), 3456 tiles, 23.35 waves:6144 × K × 8192(gate_up fwd's geometry), 768 tiles, 5.19 waves — 0.689 / 0.733 / 0.786 / 0.817 / 0.877 / 0.901 / 0.976 at the same depths. Every row of this geometry carries an 86.5 % last-wave efficiency that the qkv geometry (97.3 %) does not, so the qkv fit below is the clean one.Fits over the six depths where cuBLASLt keeps one tile (it switches at 12288, so including that point flatters us):
Our per-K-block cost is 8.5 % lower than cuBLASLt's. The entire deficit is the intercept, and the intercept is why the ratio walks 0.69 → 0.84 → 1.01 → 1.11 as K deepens: it is a constant divided by a growing item.
Instrument 2 — the phase probe
src/phase_probe.rsis the fp32 store path with aclock64on each phase of an item, its entry points declared inoptimized::kernels(a binary gets one device artifact) and itsCchecked bit-for-bit against the shipped kernel before any tick is believed. Instrumented time is +0.4 % over the shipped kernel, so the ticks are trustworthy. Median cluster, per item, qkv geometry:inval+initand the openingcluster_synccluster_syncThree things fall out, and each kills a candidate:
The MMA span is exactly proportional to K: 48 066 / 48 = 1001.4 ticks a block, 144 211 / 144 = 1001.5. At the measured 1.76 GHz that is 0.569 µs for
2·256·256·64FLOP a cluster — 2182 TFLOP/s aggregate over 148 clusters, 97 % of the B200's 2250 dense bf16 peak. The steady state is not the problem and has ~3 % of headroom in it. "Feed steady-state inefficiency" is refuted as the deficit even though FEED is half the issuer's loop — that is a balanced ring, not a stall, and cuBLASLt's own slope is worse.FILL is 160 ticks — 0.09 µs, 0.25 % of the item. "Per-tile pipeline fill" is refuted outright. The stage-0 TMA has already landed when the issuer reaches it, because the issuer spent 5 µs on ACC first.
Everything else is K-independent: PRE + POST + ACC = 15 324 ticks at K=3072 and 14 905 at K=9216. That is the intercept, and it closes the arithmetic exactly —
48·1001 / (48·1001 + 15 100) = 0.761, and the measured 1660 TFLOP/s at K=3072 over the 2182 steady state is0.761. Nothing else is missing.The 15 100 ticks are two things:
pipeline::runre-arms all eight mbarriers on one thread and takes twocluster_syncs per item, and by construction nothing may cross it: the producer cannot issue item i+1's first TMA until item i's barriers have been invalidated and re-initialized behind two cluster barriers.tcgen05.ld, but the fp32 store drain interleaves load/store/load/store — three complete load-and-store passes sit ahead of the release, so what actually overlaps the next MMA is one store pass, not the store half. Theno drainarm agrees: deleting the epilogue is −14.2 % of the item at this shape, and the drain is 14.6 % of it.What cuBLASLt actually runs
describenow also reads theuint16_tINNER_SHAPE_ID/CLUSTER_SHAPE_ID. Identical at every depth of both geometries up to 9216:with
waves=46.70at the qkv geometry — exactly twice our 23.35, so its tile covers half the area ours does. At K=12288 it switches totile=513,waves=23.35, our tile's area, and that is the row where it loses by 11 %.splitk=1throughout: still no split-K story, at any depth.That comparison is the retrospective explanation of remedy 3. cuBLASLt runs a narrower tile at shallow K and wins with it; the
[256, 128]branch ran the same halving and lost 5–28 points. The reason is now measurable: a smaller tile doubles the item count, and every item costs us 15 100 ticks that cuBLASLt's costs it nothing. The narrow tile was not losing to arithmetic intensity alone — it was paying our item boundary twice as often. Which also says the tile question is not settled until the per-item cost is gone.What this changes
The residual is not "attributed to a closed remedy". It is a schedule artifact of
pipeline::run's per-item barrier lifecycle plus a release point three passes too late, and both are ours to move:gemm_solalready shows the shape: arm the barriers once per launch, index the operand ring by a globalsequence · k_blocks + k, gate items on their ownfull/emptysemaphore rings, and nevercluster_syncinside the loop. Our schedule is static, so this needs no CLC and no mailbox — every warp computes its own item index. Worth ~3.6 µs an item at every K, and it helps the deep-K and square rows too.tcgen05.ld, not after its fourth load-and-store pass. The drain runs beside the next item's MMA, not in front of it (#80 remedy 2) #83 measured the two-band hoist at 181 registers and the 2→1 CTA cliff, so this needs a form that holds fewer registers past the release than "two bands live" — that is the design question phase 2 opens with, not a closed door.Predicted at qkv K=3072 if only (1) lands: 36.39 → 32.8 µs against cuBLASLt's 31.25, i.e. 0.838 → ~0.93. With (2) it goes past parity. Building it next.
feitreim commentedon Aug 5, 2026
Phase 2 shipped as #84: the item boundary is deleted and the drain lifts half-rows behind one wait. Thirteen of the fourteen model rows improve and ten of twelve square cells do, but the bar is not met: six rows sit below 0.90, and the account of why is now much sharper than "attributed to a closed remedy".
Squares gained too — f32 store 0.865 → 0.954 at 8192³, bf16 store 0.950 → 0.986 at 16384³ — and the depth fit at the qkv geometry went from 6.32 µs fixed + 0.6264 µs a K block to 2.75 + 0.6570, against a cuBLASLt that fits at −1.61 + 0.6846.
The full step is −8.49 ms, mean of both build orders on
compare_profile's measured pairs — 418.983 → 411.867 with main as baseline, 391.002 vs 400.867 with this branch as baseline. The fifteen GEMM rows account for −3.93 ms of that, and that is the figure I would defend: this diff can only move GEMM kernels, and the remainder reproduces in both containers but is unattributed. (An earlier revision of this comment quoted the harness's warm-up runs by mistake and reported a +1.78 ms regression; see the correction on #84.)The residual, in two terms and no others
1. The accumulator handoff — 8 310 SM ticks, 14% of a K = 3072 item. After the boundary is gone the item is
ACC + MMAwith nothing else in it, andACCis the drain, entire: one batchedtcgen05.ldof the top half-row, one store pass, one batched load of the bottom half-row. Its floor is two facts about the register file, not about the epilogue:Everything that was on #80's candidate list is now excluded by measurement rather than by argument: the pipeline fill is 160 ticks (0.25% of an item), the feed steady state is 1001 ticks a K block — hardware peak, and 8.5% ahead of cuBLASLt's own depth slope — and the store issue is worth 1%.
2. Wave quantization, on exactly two rows.
gate_up fwdruns 768 tiles at 86.5% last-wave efficiency against cuBLASLt's 94.4%;bwd down dWruns 192 tiles over 148 clusters at 64.9% against 86.4%. Ondown dWthat term alone is larger than the whole 21-point deficit, which is why it is the one row this PR does not move: nothing in the item stream can help a launch that spends a second wave on 44 tiles.What cuBLASLt is doing, since we now know
id=66 tile=23 splitk=1 stages=35 cluster=3at every depth of both geometries up to K = 9216, switching totile=513at 12288.waves=46.70at the qkv geometry against our 23.35 — its tile covers exactly half the area ours does. So the library answers both of our residual terms the same way: a smaller tile quantizes better and leaves tensor memory for a second accumulator. It pays for that in arithmetic intensity, and at K = 12288, where our fixed term has amortized away, we beat it by 6–11%.That reframes remedy 3.
[256, 128]was measured losing all fourteen rows — but it was measured paying the item boundary twice as often, against a kernel whose per-item cost was 15 100 ticks instead of 8 300. Both of the terms above are things a narrower tile improves, and what it was compared against no longer exists. The dispatch machinery is preserved on80-narrow-tile.The two increments this leaves on the table
M256_N128chains over column sub-ranges of the same accumulator, and the next item's first chain can start after half the drain — halvingACCwithout a second TMEM slot, which is what closed every double-buffer route (remedy 3, ferro #188/#189). It is not free: N is split across the cluster's two ranks, so which rank stages which 64 columns ofBchanges, and the tensor map, the operand walk and the drain's column mapping move with it.[16, STAGE_N]half-bands one issue at a time, because its staging tile is[16, STAGE_N]and nothing slices a wider batch back into that shape. The same change was worth −8.8% onlm_head fwdwhen the bf16 drain got it. ARegTilecolumn-group slice in ferro would unlock it for the acc-T rows; the fourth held band is the only thing that does not fit (177 registers).Preserved controls, none deleted:
80-forensics(the two instruments on main's kernel),80-phase-probe(the same probe on this kernel),80-narrow-tile,80-stagger-probe, ferro #189.Merge pull request #84 from feitreim/80-continuous-pipeline
feitreim commentedon Aug 5, 2026
Both increments #84 left on the table turn out to be one change, and it loses on thirteen of fourteen rows. Reporting it as a negative with the mechanism measured rather than argued. Diffs preserved on
80-column-halvesand80-split-chain-probe.Increment A and increment B are the same change
Increment A wanted the drain of one column half to run while the other half's chain accumulates. For a column half to be drainable on its own it has to complete on its own, so the pair MMA splits into two
M256_N128chains — and a chain covering half the accumulator's columns still needs all ofA. Whether the two halves are then called one item (A) or two items (B, the[256, 128]tile), the operand bill is the same:[256, 256], oneM256_N256[256, 128], oneM256_N128There is no form of increment A that costs less than increment B, so I measured the strongest form of both at once: a
[256, 128]tile whose accumulator is the same 256 tensor-memory columns run as a depth-2 ping-pong. Residency stays 2 CTAs/SM (512 / 256), the release moves fromempty(i + 1)toempty(i + 2), and the drain leaves the critical path entirely — itemi + 1waits on itemi − 1's drain, which has had a whole item to finish. The[32, BLOCK_N]fp32 band also becomes exactlyISSUE_LIMITissues and exactly 128 registers, so the whole band leaves TMEM in one wait with every store owed behind the release.It is correct (model_shapes validates all fourteen shapes numerically) and it is cheaper in registers than main: 136 / 161 / 141 against the pinned 133 / 168 / 145, zero spill,
STAGESraised 3 → 4 on the bytes the half-widthBring freed.It loses
model_shapes,--features cublas, one B200 container, against #84's post-merge session mean:[256, 128]The wave-quantization prediction was exactly right and it does not matter.
bwd down dWis the one row whose deficit #84 attributed to wave quantization, and it is the one row that improves: 192 tiles at 64.9% last-wave efficiency became 384 at 86.5% — cuBLASLt's own 86.4% on that shape, on the nose — and the row moved +3.5 points. Every other row paid the operand bill and lost 5–28.So the tile question is settled in the direction remedy 3 already pointed, and #84's retrospective explanation of remedy 3 was wrong:
[256, 128]was not losing because it paid the item boundary twice. The boundary is gone, the accumulator handoff is gone with it, and the narrow tile still loses by the same order.Where the ×1.50 goes
The fill rate each configuration sustains, from the measured TFLOP/s and the bytes/FLOP above:
Two regimes, and the last row names the mechanism. Everywhere else the kernel does push more bytes — 12.6–14.6 TB/s becomes 17.4–19.4 — and pays about 10% of its time for the privilege. On
bwd lm_head dxit cannot: the fill rate is the same 14 TB/s in both kernels, so the time scales exactly with the bytes and the throughput ratio is 0.682 against the 0.667 that a perfectly bandwidth-bound row would give. That row is the calibration point: it says the fill path saturates somewhere in the high teens of TB/s, that #84's kernel already runs at 10–15 of it, and that ×1.50 on the fill is not affordable out of that headroom.Which also answers the question #84 left open about cuBLASLt. It runs a tile of exactly half our area (
tile=23,waves=46.70against our 23.35) and reaches 1850–1970 TFLOP/s doing it, so it is not paying ×1.50 on the fill — at that tile and that rate it would need well over 20 TB/s. Itscluster=3is the difference: a cluster wider than thecta_group::2pair, with theApanel multicast to the pairs that share its rows, is how a half-area tile keeps a whole-area tile's fill.What that leaves
The residual is no longer the accumulator handoff. Both terms #84 named are now measured and both are closed by structures this kernel cannot reach:
The accumulator handoff (8 310 ticks, 14% of a K = 3072 item). The ping-pong removes it completely — that part works. It cannot be had without splitting
N, splittingNcannot be had without re-readingA, and re-readingAcosts more than the handoff is worth. The only way to splitNwithout re-readingAis to keep both column halves' chains on the same stagedA, which needs the two chains lagged by ~10 K blocks to cover a drain — a 13-deepAring at 16 KiB a stage, against the 116 736 B an SM leaves a CTA at 2 CTAs/SM. Shared memory closes it the way tensor memory closed the double buffer.Wave quantization (64.9% on
bwd down dW, 86.5% ongate_up fwd). The narrow tile fixes it exactly as predicted and cannot be afforded at ×1.50 fill.Both exits are the same structure: a 4-CTA cluster with a multicast
A. Twocta_group::2pairs in one cluster, working adjacent[256, 128]tiles of the same tile-row, with each rank'sAboxtma_load_2d_multicast_cg2'd to the matching rank of both pairs. Per two narrow tiles that isAonce andBtwice — exactly[256, 256]'s fill — with the narrow tile's wave quantization and, since each pair then owns a 128-column accumulator inside its 256, the ping-pong for free. It is what the measurements above say cuBLASLt is doing, and it is the one remaining structure that answers both residual terms at once. Not attempted here: it moves the cluster launch, the barrier accounting and the multicast masks together.Gates
Only the ones a negative needs.
model_shapestwo sessions, square bench, the full-step A/B and the parity suites were not run for a branch that is not shipping.model_shapes, one session: table above, and its own numerical validation green on all fourteen shapes — the kernel is correct, it is slower.ptxas: 136 / 161 / 141 registers, zero spill on all three. The bf16 entry point is 3 over its pinned 133 (the f32 store is 7 under its 168 and the accumulate 4 under its 145), which is why--kernel gemmstops at the budget gate rather than at a parity failure. Budgets left un-ratcheted, since nothing here ships.Controls preserved
80-column-halves— the measured kernel. It also carries aPAIREDconst that pairs the two column halves back into a[2·BLOCK_M, 2·BLOCK_N]tile in the item walk, so the ping-pong can be re-measured with wave quantization held at the old tile's. Not run: with the fill bill identical either way, it separates the wave term from nothing that is in question.80-split-chain-probe— the control that would price theM256_N128split itself with the bytes held at main's: a[256, 256]tile,Bstaged as two 64-row half-boxes so the accumulator's columns still come out inC's order, and two chains issued back to back per K block. It compiles and launches; it did not return. The binary printed its header and then produced no row in 75 minutes on a live container, which is a stall in the first shape rather than a slow one. Stopped rather than left running. Not diagnosed, and so the split between "the two chains cost tensor-core throughput" and "the extra bytes cost bandwidth" is not established here — thebwd lm_head dxcalibration above is what carries the bandwidth claim, and it carries it on its own.feitreim commentedon Aug 5, 2026
Phase 0 of the multicast route, and it clears the way: the
M256_N128chain split costs nothing. The stalled probe from the last comment is diagnosed, fixed and measured on80-split-chain-fixed.Why it never returned
One constant, and it was not the barrier arithmetic.
A
cta_group::2MMA readsN / 2columns ofBfrom each rank, so anM256_N128chain reads 64 — a quarter of the item's 256 columns, not a half. The kernel staged exactly that (HALF_B = HALF_N / 2 = 64). The host encoded the B-operand box atTC_N_ITEM / 2= 128 rows.So every one of the two half-boxes landed 128 rows in the 64-row stage reserved for it — half 0 overrunning into half 1, half 1 past the end of the stage — and the stage barrier was charged 8 192 bytes against the 16 384 the engine delivered.
loadcould never complete, and the launch sat there. The 75 minutes were a barrier waiting for bytes that had already been written somewhere else.Both files now derive the same rectangle and a
constassert holds them together, which is what the original diff was missing: the box a map hands out and the stage it lands in were named in two places and nothing said they were the same thing.The number it was built for
model_shapes,--features cublas, against a same-daymain@ 30ca522 run (separate container — see the caveat):Mean −0.005, median −0.006. Twelve of fourteen rows land inside ±0.018, which is inside the session spread #84 itself recorded (its own C1/C2 pair differ by 0.039 on
bwd lm_head dW). The two rows outside it are both bf16 store and they disagree in sign —lm_head fwd+0.038 againstbwd lm_head dx−0.057 — which is what session noise looks like and not what a mechanism looks like.lm_head fwd's cuBLASLt denominator alone moved 2009.89 → 1851.97 TF/s between the two containers, 7.9%, which is most of that +0.038 on its own.Caveat, stated rather than buried: two containers, not one. The ratio self-normalizes for clock and contention, which is why it is the column to read, but this bounds the split's cost at "under session noise" rather than measuring it. That is the resolution the decision needed.
What it settles
The narrow tile's 5–28 point loss is the operand bill and not the split. Two
M256_N128chains where oneM256_N256used to be, at identical bytes, identical tile and identical everything else, are free — so the multicast route, which also runsM256_N128per pair, does not inherit a tensor-core cost from the shape of its MMA. It only has to pay for what it fetches.Going on to phase 1 with that. Branch preserved, nothing deleted.
feitreim commentedon Aug 5, 2026
The 4-CTA cluster with multicast
Ais built, correct, and loses by a factor of two — and the reason is not the thing anyone was worried about. The replication works perfectly and costs nothing; the cluster width is what the device will not pay for. Reporting it as a negative with the mechanism bisected rather than argued. Diff preserved on80-mcast-cluster.First: the unknown that blocked it is now known, and it works
tma_load_2d_multicast_cg2has always taken an arbitrarycta_mask, and ferro's own doc said outright that nobody had established what that mask does to the barrier. Every multicast in this repo and in cuda-oxide'sgemm_sol_finaluses a one-bit mask, so the replicating form had never run.gpu/gemm/src/mcast_probe.rs— five variants over one 4-CTA cluster, every wait against aglobaltimerdeadline so a wrong answer is a table row and not a launch that never returns — measured it:So an
n-bit mask givesncompletions of one tile each, atndifferent barriers; an even-rank address means "each destination's pair leader" rather than "rank 0" (mask{1,3}withat_rank(0)charges ranks 0 and 2); and the named barrier is not charged once per destination — charging itntiles hangs the block. That last one is the trap, and it is silent.That is the whole reason the kernel needs no peer-progress signal: one instruction feeds and accounts for both pairs, and the single-barrier-per-pair structure of the two-CTA kernel survives intact. Upstreamed to ferro as feitreim/ferro-kittens#190 (documentation only — the surface was already there and its charge was already the right unit).
tma_load_2d_multicast_cg2also comes off GAPS §2.4's cluster-ops ask, where it was wrongly listed as hardcoding the pair.The kernel
Four CTAs, two
cta_group::2pairs, adjacent[256,128]tiles of one tile-row, each pair leader multicasting oneAhalf to the two CTAs that owe the MMA those rows. Per regionAis fetched twice andBfour times:[256, 256], oneM256_N256[256, 128]alone[256, 128]× 2, multicastAExactly what the last comment asked for: the narrow tile's wave quantization at the wide tile's arithmetic intensity, with the ping-pong drain for free. It is correct —
model_shapesvalidates all fourteen shapes numerically — at 138 / 168 / 142 registers, zero spill.It loses by two
model_shapes,--features cublas, against a same-daymain@ 30ca522:AFlat at ~0.5 across every row — every depth, every drain kind, every tile count. Nothing shape-dependent is doing this.
It is not the multicast
The control keeps the 4-CTA cluster, the region walk, the two accumulators and the per-pair barriers, and changes only that every rank fetches its own
Ahalf — back to the narrow tile's ×1.50 operand bill, withfreeback to a per-pair release. Column 3 above. It is the same number, row for row.So the replication is free and saves nothing measurable. Whatever the 4-CTA kernel loses, it loses with or without the one feature it exists for.
What the driver says
cuOccupancyMaxActiveClustersfor the compiled shape, and the same query swept against the dynamic plan:main)Two things. The four-CTA shape is capped at 132 of the device's 148 CTAs — 11% of the machine lost to cluster-width quantization (33 clusters ≈ 8 GPCs × 4). And the number does not move as the plan goes to zero bytes, so this is the cluster's shape and not anything this kernel spends. Shrinking
STAGEScannot buy it back.Sizing the persistent grid to that 33, rather than to the 74 the per-CTA arithmetic allows, is column 4 — measured, and not the fix: 0.42–0.51 against 0.46–0.60, no better and mostly worse. Over-subscription is not what this loses to either.
Where that leaves it, honestly
Three independent variations of the 4-CTA kernel — replicating, unicast, and grid-matched — all land in the same 0.42–0.62 band against a
mainat 0.79–0.98. The cluster width is the cost, and the 11% residency deficit is real but does not account for a factor of two. I did not isolate the remaining term, and I would rather say so than name a mechanism I have not measured. The instrument that would split it is the one #84 already built:80-phase-probe's per-phaseclock64on this kernel, to say whether the issuer is waitingload— a feed that now crosses pairs — orempty.One correction to the record this forces
The last comment inferred that cuBLASLt's
cluster=3is "a cluster wider than thecta_group::2pair, with theApanel multicast to the pairs that share its rows", and that this is how it affords a half-area tile. That inference is now doubtful. A wider cluster is measurably unaffordable on this device — 132 of 148 CTAs before anything else goes wrong — so whateverCLUSTER_SHAPE_ID = 3decodes to, "4 CTAs" is an unlikely reading of it. The half-area tile at 1850–1970 TFLOP/s still needs an explanation, and cluster-multicast is no longer the leading one.Gates
Only the ones a negative needs;
model_shapestwo sessions, the square bench, the full-step A/B and the parity suites were not run for a branch that is not shipping.--kernel gemm: parity green, all shapes, both layouts, store and accumulate.ptxas: 138 / 168 / 142 registers, zero spill on all three. The budget pins inmain.rswere moved to those measured counts on the branch only; nothing here ships andmain's 133 / 168 / 145 are untouched.model_shapes: the four columns above, one session each.Preserved
80-mcast-cluster— the kernel, plusMULTICAST: bool(the unicast control),RESIDENT_CLUSTERS(the grid control),mcast_probe(the semantics instrument) andreport_residencyinmain.rs(the occupancy query, which is generally useful and cheap — it is the thing that would have caught this on day one).80-split-chain-fixed— phase 0, above.feitreim commentedon Aug 5, 2026
Both anomalies are resolved, and the second one overturns the model of cuBLASLt that every remedy since #84 was designed against. Instruments on
80-residency:src/residency_probe.rs+src/bin/residency.rs(the residency measurement, beside every occupancy query the driver will answer) andbaselines/cublas_decode.cu(the library's own launches, read through CUPTI).Anomaly 1 — residency is 2 CTAs/SM. The driver query is not a residency oracle.
Measured, one B200,
%smid+%globaltimerper CTA, each holding its SM for a fixed 2.00 ms wall interval so that a grid the device runs in one wave takes 2 ms and one it runs in two takes 4:All 296 CTAs of
main's persistent launch are co-resident, two an SM, at the full shared plan. Every wave-quantization number on this issue stands exactly as written;down dW's 192 tiles really are 1.30 waves over 148 clusters, not 2.6 over 74.cuOccupancyMaxActiveClustersis simply answering a different question. On this branch it reports 74 for every kernel and every plan — 114 816 B, 96 000 B, 1 024 B alike — for the 133-register bf16 entry, the 168-register store, the 145-register accumulate, and an 18-register probe.cuOccupancyMaxActiveBlocksPerMultiprocessorreports 1 block/SM for all of them, at 1 024 bytes and 18 registers, which cannot be a physical statement. Neither number moves with the L1/shared carveout (-1 → 100: no change) or with the grid it is handed (37, 74, 148, 296, 592 clusters → 74 every time). For a required-cluster function these queries returnfloor(SMs / cluster CTAs)and one CTA of this cluster per SM; they do not model two clusters sharing an SM.The shipped kernel agrees. Timed across grid widths (fp32 store, same container, its real 168 registers):
Monotone in the grid all the way to 148. If 74 had been the resident width, 148 would have cost nothing.
And the arithmetic is right at the edge, which is worth writing down: at 2 CTAs/SM the plan uses 229 632 of 233 472 B (98.4%), the registers 64 512 of 65 536 (98.4%), and tensor memory 512 of 512 (100%). Three limits at once, all satisfied. That is also why #83's two-band hoist at 181 registers fell off a cliff —
181 × 192 × 2 = 69 504 > 65 536— which was read correctly at the time.What this reinterprets: the multicast negative's missing factor of two
The 4-CTA kernel launched
MAX_CLUSTERS = 74clusters = 296 CTAs. Measured at that exact shape:A four-CTA cluster grid reaches 142 SMs, not 148, and holds two CTAs on each: 284 CTAs, 71 clusters, and the 72nd costs a whole second wave. It is placement and nothing this kernel spends — the same 2.01 waves appear at a 1 024-byte plan and at 128 tensor-memory columns.
So the multicast kernel ran two waves for a 296-CTA grid that only 284 CTAs fit, and that is the factor of two the last comment could not isolate. Its own control went the wrong way: 33 clusters (from the driver query) is 132 CTAs, under half the machine. 71 was never tried, and it is 96% of
main's 296.Anomaly 2 — cuBLASLt runs our tile.
cluster=3is 2×1×1 andtile=23is [256, 256].Nsight Compute will not initialise on the Modal container (
Failed to initialize the profiler: LibraryNotLoaded— the driver's profiling support, not an image package;ncuitself is already at/usr/local/cuda/bin/ncu). A launch configuration needs no performance counters, sobaselines/cublas_decode.cureads it from CUPTI's callback API instead —cuLaunchKernelExparameters pluscuOccupancyMaxActiveBlocksPerMultiprocessoron the handle the library is passing. Identical at all three shapes:The symbol decodes the whole thing, and the launch confirms it independently:
main128x2562cta)64x62x1= 2×1×1Outputs over clusters confirms the tile without trusting the name: 24576×9216 / 3456 = 65 536; 6144×8192 / 768 = 65 536; 24576×50432 / 18 912 = 65 536. [256, 256] at every shape.
Three things on the record are now wrong
waves=46.70against our 23.35 was never a like-for-like comparison: cuBLASLt'swavesCountcounts CTAs over SMs (6912/148 = 46.70) while our 23.35 counted tiles over clusters (3456/148). In tiles the two kernels are identical — 3456 apiece. Every argument built on the half-area reading falls with it: remedy 3's retrospective explanation, the ping-pong's motivation, and the multicast route's premise.cluster=3is not four CTAs. It is2×1×1, the samecta_group::2pair we run. The doubt recorded last comment is now decided, andtma_load_2d_multicast_cg2's semantics (ferro#190) stand on their own as the only durable thing that route produced.What the difference actually is, and why it is the whole residual
The kernels differ in four things, and three of them are consequences of the fourth:
cuBLASLt runs one CTA per SM. With the second CTA gone it takes the SM whole:
Those are, one for one, the three floors this issue has been reporting as unmovable:
STAGES = 3— they have 6.Every one of them binds because we chose two CTAs an SM. cuBLASLt chose one, and bought all three at once.
The rung that was never tested
#80 did test 1 CTA/SM — ferro
gemm_ws(#188/#189), which lost by 7.3–7.9% at every shallow shape, and that result closed the route. Butgemm_wsisSTAGES = 4andSHARED_BYTES = 131 176; its own module doc says it "has the whole 233 472 B to spend and spends 131 176". It has the double accumulator and the register headroom, and it runs its operand ring two thirds as deep as the kernel it was being compared to, leaving 100 KB of the SM unused.The K depth is exactly what a lone MMA chain needs to stay fed, and it is the one thing that arm did not have.
STAGES = 6is 196 608 B of ring — the rung cuBLASLt picked, and the last one that fits.Next
Measuring
gemm_wsatSTAGES = 6before anything is designed, and re-pricing the 4-CTA multicast kernel at its measured 71-cluster knee, since both are one constant each and both were closed on a number that is now known to be wrong.80-residencycarries the two instruments; a PR follows for the residency one, which belongs inmainwhatever happens next — with the driver query kept beside the measurement rather than instead of it, since on its own it says 74.feitreim commentedon Aug 5, 2026
First increment on the decoded configuration, measured and preserved rather than shipped:
80-deep-ring, two constants —STAGES3 → 6 andCTAS_PER_SM2 → 1. Shared memory now binds residency where tensor memory used to, and the plan lands at 213 120 B against cuBLASLt's 213 280.It is a wash on the mean and it moves
bwd down dW, the row this issue has never moved, by ten points.model_shapes,
--features cublas, two sessionsAgainst
main@ 30ca522's same-day session (the one the split-chain comment used).deepis the mean of two sessions of this branch; both are in the branch's logs and they agree to ±0.02 except on the three bf16 rows, whose cuBLASLt denominators moved 2–4% between containers.Mean −0.005. Parity green; ptxas 133 / 168 / 145, zero spill — unchanged, so nothing here is a register story.
The two columns on the right are the whole result
Sort the rows by whether the wave efficiency moved and the table stops being noisy:
bwd down dW0.649 → 0.865 buys +0.093;gate_up fwd0.865 → 0.943 buys +0.032;qkv fwd0.973 → 0.994 buys +0.002. The gain tracks the wave arithmetic row for row.And 0.865 and 0.943 are not arbitrary numbers: they are exactly the 86.4% and 94.4% #84 recorded as cuBLASLt's own last-wave efficiencies on those two rows. That is the anomaly-2 prediction landing — cuBLASLt quantizes better because its resident unit is 74 clusters, not because its tile is smaller. It never was smaller.
What this changes about the standing account
#80 closed the 1-CTA/SM route on ferro
gemm_wslosing 7.3–7.9% at every shallow shape, and every double-buffer route since has been closed by "no second 256-column TMEM slot at 2 CTAs/SM".gemm_wsrunsSTAGES = 4and spends 131 176 B — its own doc says it "has the whole 233 472 B to spend and spends 131 176". At six stages the same residency costs 2–5 points, not 7–8, and pays for a third of the rows on its own.So the halving is roughly self-financing at the right depth, and neither thing it actually buys has been spent yet:
alloc_cluster(256)still takes half of 512 and leaves the rest idle. The second accumulator — the ping-pong that remedy 2, remedy 3 and ferro#188/#189 were each closed for lacking — is now simply available, and80-column-halvesalready carries a working depth-2 ping-pong to lift the discipline from.Both were closed by the same constraint, and the constraint was a consequence of choosing two CTAs an SM. The eleven losing rows are the bill for that choice with neither purchase made.
Also on the record
80-mcast-clusterand it would settle that negative honestly, but the route's premise is gone — cuBLASLt is not multicasting and its tile is not narrow — so it is a record-keeping run rather than a candidate.Merge pull request #85 from feitreim/80-residency
feitreim commentedon Aug 5, 2026
The decoded configuration, with the freed resources spent: PR #86, from
80-wide-stage. The mean goes 0.906 → 0.939 against a same-daymain, twelve of fourteen rows clear 0.90, and the accumulator handoff is measured at 4 815 → 100 SM ticks.bwd down dW— the row this issue has never moved — goes 0.797 → 0.928.It is three constants and 16 KiB:
STAGES3 → 6,ACCUM_COLS256 → 512 (two accumulators,SLOTS = 2),STAGE_N64 → 128.CTAS_PER_SMkeeps its old formula512 / ACCUM_COLSand reads 1;MAX_CLUSTERSfalls out at 74.Increment 1 — the ping-pong, and the probe that prices it
80-pingpong-probecarries #84'sclock64instrument on this kernel with the ping-pong itself behind a const, so before and after are one binary at the same residency, ring depth and plan — onlySLOTSdiffers. Per item, rank-0 SM ticks:Four shapes agree: ACC 4 289 → 114 and 4 244 → 114 at gate_up, 4 679 → 100 at K = 9216. The handoff is not smaller, it is off the critical path — the drain gets slower (7 990 → 10 470; it now contends with a running MMA) and the item is 14% shorter anyway. That is the term #84 left as the entire residual, and it is gone.
What replaces it is the feed.
FEED— the issuer waiting stages 1.. — is 3 411 of 27 736 ticks at K = 3072 and 9 422 of 81 045 at K = 9216. Twelve percent either way, againstFILLat 118 andACCat 100. Six stages is 196 608 B and a seventh does not fit, so this structure has no more depth to give it.Increment 2 — the bf16 drain's wide staging tile, which was the other thing the halving bought
Not the register hoist. #83's two-band hoist was the named candidate, and the probe says it would buy nothing: at ACC = 100 the fp32 drain is already fully covered. What was still costing is that the bf16 band was
(32/16)·(64/64) = 2.x8issues a pass and four exposed TMEM latencies a band, where #84 got the fp32 store down to two — and it was stuck there because four[32, 128]staging tiles are 32 768 B against 16 384, and at two CTAs an SM the plan had no such 16 KiB.At one CTA an SM it does.
STAGE_N = 128makes a band exactlyISSUE_LIMITissues behind one wait and exactly the 128 registers a thread holds. Measured on the two bf16 store rows, in absolute throughput (their ratios are the noisiest in the table):So two of the three freed resources paid — shared memory twice over (the ring and the staging tile) and tensor memory once. The register file did not, and the honest statement is that it did not need to: at one CTA an SM a thread is granted the architecture's 255 rather than the ~170 twelve warps left it, the ceiling that closed #83's hoist is gone, and the kernel came out at 134 / 168 / 146 — two counts up by one register, nothing else asking.
model_shapes, two sessions, against a same-day
main@ 0b652deThe
80-deep-ringcontrol's prediction lands exactly. The three rows whose wave efficiency moved gain (bwd down dW64.9% → 86.5% over 74 clusters, which is cuBLASLt's own 86.4% on that shape); the eleven that paid the control's uniform 2–5 points get it all back and more, because the ping-pong is what the 2–5 points were buying and the control had not bought it yet.Where it does not close
lm_head fwdis at 0.895 on the session mean. It is the one row still under the bar, by half a point, and the two bf16 store rows are also the noisiest in the table — 0.933 / 0.888 / 0.863 across three sessions of increment 1 alone, because they are the biggest matrices in the model and their cuBLASLt denominators move 3–5% between containers. Both rows are up onmainin absolute throughput in every session measured; the acceptance criterion as written (every row ≥ 0.90) is not met on the mean, and I would rather say that than pick the session where it is.The two
dWrows that lose 2 points (bwd qkv dW,bwd o_proj dW) are 432 and 144 tiles — they quantized well over 148 clusters and quantize no better over 74, so they pay the halving and are handed nothing back by it.Gates
main: nine of twelve cells improve by 3–7 points, three within ±0.01. No per-shape dispatch was needed — the halving refunds at every square size including 16384³. One caveat: increment 1 alone measured 16384³ f32 store at 0.875 and One CTA an SM, six K stages and two accumulators: the configuration cuBLASLt runs (#80) #86 measures 0.913 for the same fp32 code, 5.955 ms against 5.612 — that cell is worth ±0.04 between containers and should be read loosely.--baseline-ref 0b652de: GEMM rows −4.663 and −3.787 ms, mean −4.22 of 166 ms (−2.5%). The full-step column reads −2.62 / +0.33, which disagrees by 2.9 ms because the ~60 non-GEMM rows carry that much container noise — the GEMM-row sum is the measurement here, and unlike The item stream has no boundary, and the drain lifts half-rows behind one wait (#80) #84 the second-position penalty does not come out consistent between the orders.--kernel gemmgreen,--kernel opsgreen,--kernel modelgreen on rerun (first run took the known stochastic MoE overfit miss at 0.0597 against the 0.05 bound — the same value The drain runs beside the next item's MMA, not in front of it (#80 remedy 2) #83 and The item stream has no boundary, and the drain lifts half-rows behind one wait (#80) #84 recorded).GROUPstays 8, and now for a reason rather than by inheritanceMeasured at 16 on this branch: neutral to worse in absolute throughput on every row, and nothing at all on the two bf16 rows it was aimed at. The arithmetic says why.
groupedwalksGROUPtile-rows down a column, so a wave ofMAX_CLUSTERSclusters covers aGROUP × (MAX_CLUSTERS / GROUP)rectangle and the operand footprint in flight is smallest when it is square. At 148 clustersGROUP = 8gave 8 × 18.5 — lopsided. At 74 it gives 8 × 9.25, and√74 = 8.60. The constant was tuned against the wrong residency and the new one is what it wanted.Preserved
80-ping-pong— increment 1 alone, three model_shapes sessions, the point the two increments separate at.80-pingpong-probe— the phase probe on this kernel plusgemm_probe_f32_noping, the one-slot control. A stopwatch does not belong in the shipped module.What is left, at probe evidence grade
ACCis 100 ticks,FILLis 118,PRE/POSTare gone since #84. The item isMMAand inside itFEEDat 12% — the issuer waiting an operand stage that six stages of 64-deep K did not cover. That is the whole of the remaining distance now, and it is a bandwidth question rather than a scheduling one: this kernel already runs its ring at cuBLASLt's own depth, at cuBLASLt's own tile, on cuBLASLt's own cluster, at one CTA an SM.Merge pull request #86 from feitreim/80-wide-stage
feitreim commentedon Aug 5, 2026
Closing at owner direction. Final state: model_shapes mean 0.939 of cuBLASLt, 12/14 rows ≥0.90 (#86: 1 CTA/SM, six-stage ring, TMEM ping-pong — cuBLASLt's decoded config composed with the continuous pipeline). Residual work moves to a new low-priority issue.