Skip to content

Shared to register load: the missing half of ldst #21

Closed

Description

@feitreim

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

  1. added
    area:memory
    on Jul 27, 2026
  2. feitreim commented on Jul 27, 2026

    @feitreim
    OwnerAuthor

    Acceptance: update examples/ as part of closing this.

    softmax is 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:

    • Delete any workaround or GAP fence in examples/src/ that this issue removes the need for, and replace it with the real API.
    • If a kernel becomes fully unblocked, move it from aspirational to compiles: flip its header, take it out of its feature gate, and confirm modal run modal_app.py::build builds it for sm_100a.
    • Update the status table and the blocked-on lists in 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:memory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions