Repository navigation
Description
src/ldst.rs is store-only. Its two functions are store_fragment and
stmatrix_m8n8_x2, and its own module doc says so: "The store side of the
swizzled-fragment path." There is no ldmatrix anywhere in src/.
Found by writing the examples (#18), not by reading ThunderKittens' feature
list — which is why no existing issue covers it. GAPS §2 has global<->register
(#11) and register->TMEM (#10) and misses this one entirely.
This blocks any kernel whose input is not already an MMA operand. The
softmax example is four lines of actual algorithm and cannot get past line one:
data reaches shared memory via TMA, and there is no way to get it into
registers. The only register sources today are TmemTile::fragment_tile (an
MMA accumulator) and arithmetic on values already in registers.
That makes this arguably the highest-priority gap in the backlog. Every
elementwise op from #5 and every reduction from #6 operates on registers that,
for a non-GEMM kernel, currently have no way to be filled.
Shape
The inverse of store_fragment: ldmatrix.sync.aligned.m8n8.x2 (and the
.trans form) reading through SharedTile::swizzled_chunk at the same
(row, column) addressing the store side already uses, unpacking E to fp32
into a Fragment.
The address arithmetic is already written and hardware-validated — the
stmatrix round trip device case covers it. This is mostly the same chunk/row
derivation with the data flowing the other way, plus Element::unpack to
mirror Element::pack.
Check cuda-device for which ldmatrix forms are exposed at the pinned rev
before designing; the stmatrix side went through ptx_asm, so this may too.
Also worth doing here
store_fragment's chunk/row derivation is currently untestable on the host
because it calls stmatrix directly. Extracting it into a shared helper that
both directions use would make it host-testable and guarantee the two paths
cannot drift — the same extraction that #10 did for the TMEM interleaving.
Activity
feitreim commentedon Jul 27, 2026
Acceptance: update
examples/as part of closing this.softmaxis blocked before its first line by this. It is the single biggest unblocker in the examples' gap list.The examples crate (#18) exists so that "done" is checkable in the terms a kernel author cares about, rather than as a claim about a primitive nobody has tried to hold. Concretely, on closing this:
GAPfence inexamples/src/that this issue removes the need for, and replace it with the real API.aspirationaltocompiles: flip its header, take it out of its feature gate, and confirmmodal run modal_app.py::buildbuilds it forsm_100a.examples/README.md.If the example still does not compile afterwards, that is a finding worth writing down — say what is still missing rather than leaving the README stale.
examples: the reductions, and what is left after #5 and #6
Reductions: generic row/column/whole-tile folds over a ReduceOp (#37)