Repository navigation
A map walk's frame is a band that does not fit, and groupnorm_tile streams its own (#166) - #181
Merged
Merged
Conversation
feitreim
added a commit
that referenced
this pull request
Aug 6, 2026
…, and both 256-wide entries take it now (#197) * The warpgroup split lost to a `.local` depot rather than to the lanes, and both 256-wide entries take it now `bench sol-ablate`'s table 6 recorded the epilogue's column split losing 1.4 to 1.8% at 4096³ and winning 0.3 to 0.4% at 8192³, and the reading offered was hardware: warps 0 and 4 own the same 32 tensor-memory lanes, so splitting an accumulator's columns puts two requesters on each of four sub-partitions rather than spreading over eight. That argument is still true and it was not what the table measured. Every row of it was taken through a `.local` depot the library no longer emits — `store_tile_x4` homed each drained band to local memory until the rolled walks were marked (#166, landed in #180/#181/#184), and a band *is* the frame, a `RegTile<32, 64>` being 64 f32 being 256 B. The split pays that frame twice per accumulator where one warpgroup pays it once, so the arm doing more of the broken thing read as the arm that was worse. Re-run at f64a27b, same table, same two round-robin passes, `regcount` reading zero stack and zero spill on every `gemm_sol` rung: 4096³ [256, 256] launch +0.8%, +0.9% drain 3.35 -> 3.10, 3.28 -> 3.17 us 8192³ [512, 256] launch +2.1%, +2.1% drain 4.72 -> 3.05, 4.70 -> 3.04 us The sign reverses at both entries and both passes, and the term that was blamed is the term that moves: the drain gets 35% cheaper at [512, 256] rather than slower. The `no drain` control at its own 320 threads still matches the 192-thread one to a tenth of a percent, so the extra warps remain free when they do nothing. `SHIPPED_GROUPS` is `TWO_WARPGROUPS` for `gemm_sol_m256` and `gemm_sol_m512`. The shared plan is byte-identical either way — eight warps stage half the columns each — so no `dynamic_shared` moves; what moves is the block, to 320, which is why `Variant::threads` now sits beside `Variant::shared_bytes` and the launcher asks the variant instead of reading one `THREADS`. `gemm_sol_m256_n128` keeps one warpgroup. The split is legal there and the asserts cover it; table 6 simply has no `[256, 128]` arm, and shipping it would be shipping a geometry nothing here has timed. The ablation and watch probes are pinned to `ONE_WARPGROUP` explicitly rather than following `SHIPPED_GROUPS`. They were reading the shipped constant to mean "the geometry this ladder is held at", and those are two different facts: with `SHIPPED_GROUPS` flipped, thirty-three probe kernels would have silently reshaped and every historical arm would have stopped comparing to itself. The three entries join `GATED_KERNELS`. Their residency is fixed by the shared plan and no register count can raise it, but at 320 threads a thread may have 168 registers before an SM cannot place one CTA at all — a launch the driver refuses rather than a slow one. They read 82 and 83 against that step. * The PR number the three notes point at is 197
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second of #166's three remainder kernels, and the one whose fix is not unrolling. A
reg.rsmap walk's.localframe is a register tile that does not fit —groupnorm_tileheld its whole[32, 128]band, 128 fp32 a thread against a 168-register cap — so the cure is the onelayernorm_rowsalready proved: stream the band aCHUNKat a time so it never exists whole.First, the check.
groupnorm_tilehad no launcher and no reference ("a rewrite nothing can check is not an improvement" —docs/kernels/layernorm.md), so the first commit buildsrun_group/check_group/bench_groupon the existing seed: three tile statistics cover every grid the way three class statistics cover the row check, and the error is absolute because the outputs are zero-mean unit-variance with nothing holding one away from zero. The unmodified whole-band kernel passes its first-ever check — worst absolute error 7.76e-3, which is 0.99 × 2⁻⁷, half a bf16 ulp at the seed's largest normalized outputs in [2, 4); tolerance 2⁻⁶, one doubling above.Then the rewrite, all measured on B200 in-container:
groupnorm_tileCHUNKA factor of 10.1 at a bit-identical worst error, 8% above
layernorm_rows' 5539 (same traffic minus two parameter vectors), launch floor 21.9 µs → 9.6 µs. The carry across chunks is one scalar per statistic — a chunk'stile_sumis already a number the warp agrees on.launch_boundsmoves 3 → 6: shared memory is the binding term now, same as the sibling, and at 48 registers the 168-vs-236 crate-composition hazard that forced the old cap is gone (both crates read identical 48).The depot census now reads 1 of 12 shipped kernels carry local memory —
flash_forwardalone, whose accumulator band is the algorithm's own live state; its launcher/reference (#85 prerequisite) is in flight separately.Validation:
build,examples(all checks pass, occupancy table shows 6),bench --case groupnorm(table above),regcount(all gates green, occupancy gate reads the new literal: 48 regs against an 80 ceiling).