Skip to content

MMA: AtB/AtBt walks, mm entry points, generic KIND routing #12

Closed

Description

@feitreim

Shape coverage. ThunderKittens' tcgen05 layer is {mm, mma} x {AB, ABt, AtB, AtBt} x {1-CTA, 2-CTA} — 16 entry points.

We have three: mma_abt, mma_ab (single-CTA), and mma_walk_cg2 (2-CTA, runtime K-major/MN-major via OperandWalk).

Missing:

  • AtB and AtBt walks. Mostly descriptor transpose-bit work inside the existing walk skeleton — the chunk geometry documented in the mma.rs header already covers both operand orders.
  • The mm (zero-initializing) variants as distinct entry points. We thread enable_d by hand, which is the same instruction but puts the accumulator-init invariant on the caller. Making mm its own entry point moves that into the type.

Intrinsic routing. We call tcgen05_mma_f16 / tcgen05_mma_f16_cg2, the f16-specialized wrappers. cuda-device also exposes tcgen05_mma_shared / tcgen05_mma_tensor taking a KIND const (0=f16, 1=tf32, 2=f8f6f4, 3=i8). Switching to the generic form and sourcing KIND from Element (#2) is what makes fp8 a new Element impl rather than a new MMA layer.

Worth confirming the generic intrinsic lowers identically for KIND=0 before switching — it should be the same PTX, but that is an assumption to check rather than assert.

Also available upstream and currently unused: tcgen05_mma_sp_* (sparse), tcgen05_mma_ws_* (weight-stationary, per dtype), tcgen05_shift_down. Not proposed here, noted so they are not rediscovered later.

Depends on #2.

Activity

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

    @feitreim
    OwnerAuthor

    Negative result from the examples work (#18): none of the four example kernels demanded anything in this issue.

    Flash-attention forward, GEMM, softmax, and layernorm were each written against the API we would want, then checked for what they could not express. The MMA layer came through clean — mma_abt, mma_ab, and mma_walk_cg2 covered every multiply those kernels needed. What blocked them was the memory path (#21, #22, #25), the compute layer (#5, #6), and cluster scaffolding (#24).

    That is evidence this issue can sit lower in the order than its number implies. AtB/AtBt walks and generic KIND routing are real gaps against ThunderKittens, but they are gaps no kernel we have tried to write has hit — unlike, say, #21, which stops a four-line softmax at line one.

    Keeping it open, and the FP8 dependency in #16 still points here. Just recording that the priority evidence went the other way.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions