Skip to content

The MMA instruction descriptor is unchecked against the walk it is paired with #30

Closed

Description

@feitreim

mma_abt, mma_ab and mma_walk_cg2 each take instruction: u32 — a
descriptor the caller built by hand — and each requires a different transpose
configuration to match its operand walk:

  • mma_abt — no transpose bits
  • mma_ab — transpose_b
  • mma_walk_cg2, MN-major — both bits

mma.rs's module header documents this pairing in prose ("The instruction
descriptor caller-side must match the walk"), which is the strongest guarantee
available today: nothing checks it.

Mismatching them does not fault. The MMA reads the operands under the wrong
interpretation and produces a fully-populated, entirely wrong accumulator. There
is no diagnostic and no crash — it looks exactly like a correct kernel with bad
numerics, which is the most expensive kind of bug to chase in this codebase.

The shape and transpose bits are already determined by which walk you called and
by the operand tile types it took. They could come from the same place rather
than being re-asserted by the caller — e.g. the walk constructs the descriptor
from M/N plus its own known transpose configuration, leaving the caller to
supply only what is genuinely free.

Not covered by #12, which is about KIND routing and the AtB/AtBt walks.
The two should probably be designed together, since both are "the descriptor
should be derived from the operands rather than passed alongside them" — but
this half is useful on its own and does not need FP8 or new walks to land.

Surfaced by the examples (#18), §9.

Activity

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

    @feitreim
    OwnerAuthor

    Acceptance: update examples/ as part of closing this.

    gemm builds its instruction descriptor by hand and relies on prose to keep it matched to the walk.

    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:mma

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions