Repository navigation
Description
pipeline::run maps work items to tiles linearly — item i becomes tile i,
walked in row-major order across the output. For a GEMM that is close to the
worst case for L2 locality, and L2 is where this kernel already lives.
The traffic argument
At 8192³ the GEMM pulls A+B at roughly 12.7 TB/s: a [256, 128] pair tile
is M·N/(M+N) = 85.3 FLOP per byte, against 1081 TFLOP/s measured. B200 HBM is
about 8 TB/s. The unique input is 268 MB and the total read is ~12.9 GB, so
the kernel is running at roughly 48x reuse and the majority of its traffic is
already L2 hits — not by design, just by whatever locality row-major
traversal happens to give.
To reach the 1.7–1.9 PFLOP/s bf16 target that becomes ~20–22 TB/s at today's
intensity, or ~13–15 TB/s at the [256, 256] tile of #87. Every path to the
target runs through L2 hit rate, which makes traversal order a first-class
lever rather than a micro-optimization.
The standard fix, and why it is cheap here
Grouped or swizzled traversal — CUTLASS calls it a threadblock swizzle. Walk the
output in blocks of a few tile-columns at a time so the A panel stays resident
across a group, instead of streaming the whole B panel between reuses of A.
#83 is what makes this a one-place change. It moved the item → tile mapping
into pipeline::run, so this is a change to the scaffold rather than surgery on
the kernel's grid math. That is a payoff from #83 that its own dead-heat
benchmark could not show, and it is worth noting in the PR: the parity result
bought optionality.
Scope
- A traversal the scaffold can express — group width as a parameter, not a
hardcoded swizzle — and a default that is a measurement rather than a
preference. - Sweep the group width. The optimum depends on L2 capacity and tile shape, so
it will move with Sweep the GEMM's pair tile and pipeline depth: [256,256] at three stages should dominate on paper #87's tile decision; do not hardcode a winner found at one
shape. - Compose with Cluster Launch Control: hardware work-stealing exists in cuda-oxide and pipeline::run schedules statically #88 if that lands first: CLC hands back grid coordinates, so the
swizzle applies to the coordinates rather than replacing the scheduler.
Sequencing
Behind #86, which is measuring whether the kernel is bandwidth- or
latency-bound and what the L2 hit rate actually is. If it turns out the kernel
is latency-bound, this issue is worth much less than the traffic argument above
suggests, and #87 or #15's lcsf should go first. Do not start this on the
strength of the arithmetic alone — the arithmetic says L2 matters, not that
its hit rate is currently bad.
Acceptance
Exact at every size before timing, a swept group width with the losing values
kept, and before/after at 8192³ and 16384³. Report the L2 hit rate either side,
not only the throughput — a throughput win with an unchanged hit rate means the
cause was something else and the change is not what it claims.
Related: #86 (the bound and the hit rate — the prerequisite), #87 (the tile,
which moves the optimum), #88 (CLC, which composes), #83 (which put the mapping
in one place).
Activity
The K-depth fit describes the pre-#89 kernel; say so, and flag the 14…
The item map walks in groups, and the 23% the aspect ratio cost is re…