Repository navigation
Description
The GEMM does 1081 TFLOP/s at 8192³ bf16 on a B200 (#83's table). Against a
dense bf16 peak of roughly 2.25 PFLOP/s that is about 48%, and the target is
1.7–1.9 PFLOP/s at bf16 before precision changes.
Nothing is known about what binds it. Every performance finding in this repo
so far came from putting a clock on something (#47, #63, #67, #76, #83, #84),
and four times the static counters ordered time backwards. So this is the
diagnostic that has to come before any tile or schedule change, exactly as #47's
discipline demands: rule causes out one at a time, each with a measurement that
would have moved if it were the cause.
The curve has not flattened, which is the first thing to settle
| shape | ms | TFLOP/s |
|---|---|---|
| 1024³ | 0.0283 | 75.9 |
| 2048³ | 0.0451 | 380.9 |
| 4096³ | 0.1891 | 726.8 |
| 8192³ | 1.0169 | 1081.2 |
727 → 1081 from 4096³ to 8192³ is a steep climb, not an asymptote. Run
16384³. It is a bench.rs constant and no kernel change, and it decides
whether 1081 is the kernel or the size.
There is a prediction attached, so the run can confirm or refute it
The static stride runs MAX_CLUSTERS = 222 clusters over ceil(tiles/222)
waves, and the last wave is partly empty:
| shape | tiles | waves | wave efficiency | measured | ÷ efficiency |
|---|---|---|---|---|---|
| 2048³ | 128 | 1 | 57.7% | 381 | 660 |
| 4096³ | 512 | 3 | 76.9% | 727 | 945 |
| 8192³ | 2048 | 10 | 92.3% | 1081 | 1171 |
| 16384³ | 8192 | 37 | 99.7% | — | — |
So quantization alone predicts ~1171 TFLOP/s at 16384³. Landing near that
means ragged waves were the story. Landing materially higher means something
else amortizes with size and should be named. Landing lower is the most
interesting outcome of the three.
Note the normalized column still climbs (660 → 945 → 1171), so ragged waves are
not the whole of it even at the sizes measured.
What binds it
The question to answer, with evidence:
- Bandwidth or latency? At 8192³ the kernel pulls A+B at roughly
12.7 TB/s —(M+N)/(M·N)bytes per FLOP at a[256,128]pair tile is
1/85.3, times 1081 TFLOP/s. B200 HBM is ~8 TB/s, so the majority is already
being served by L2 at ~48x reuse over the 268 MB of unique input. Measure
the L2 hit rate and the achieved HBM bandwidth rather than inferring them. - If it is bandwidth, is it HBM or L2? Those want opposite fixes — a bigger
tile cuts total traffic, an L2-aware traversal order cuts misses. - If it is latency, what is not in flight?
STAGES = 3over a[128,64]/
[64,64]operand pair; the drain at the item boundary is the other suspect,
and lcsf and the rest of the prototype layer #15'slcsfis what would overlap it. - The small end is a floor, not a compute result. 0.0224 ms at 256x128x256
and 0.0283 at 1024³ is near-identical wall clock for 128x the work — a fixed
~22–28 us. layernorm_rows sits at 255 registers with spills and gets 2 blocks/SM where softmax gets 6 #67 established this is not launch overhead, sincelayernorm
reaches 8.4 us on the same harness. Nobody has chased what it is for the
GEMM. Name it, even if fixing it is a separate issue.
Scope
Diagnosis, plus the bench.rs size. Do not tune the kernel here — the tile
and stage sweep is its own issue, and committing to a shape before knowing the
bound is the mistake #47 made and #76 had to undo.
Acceptance
A named bound with a measurement that would have moved had it been something
else, and a 16384³ row in the table with the prediction above either confirmed
or refuted. Every timed figure goes through the checked path in bench.rs —
there is no route that prints a throughput for a launch it did not verify.
Related: #83 (the table and the cap), #84 (residency is 3 CTAs/SM, capped by
shared memory), #47, #63.
Activity
State the depth fit's point selection, and report the boundary as a r…
The item boundary is roughly a third of 8192 cubed, and the curve sto…
The item boundary was the epilogue, and BLOCK_K was already right (#114)