Skip to content

Generalize the global layout beyond PanelMap #8

Closed

Description

@feitreim

ThunderKittens' gl is a template over element type and up to 4 dims, with each extent independently compile-time or runtime, generating its matching TMA descriptor as a member. cgl and pgl wrap it for complex and multi-GPU.

What we have. PanelMap — bf16, 3-D, tiled, fixed box shape — built by encode_bf16_panels. It is correct, and it is the only shape the kernels use. But the agreement between descriptor and SharedTile is enforced by that single builder happening to be generic over the tile, not by a layout type that can describe anything else.

Why it matters beyond generality. #9 (TMA store) and #11 (global<->register) both need to describe a global buffer, and neither is a "panel map." Building them against PanelMap means three ad-hoc descriptor builders instead of one layout type. This is the prerequisite, which is why it sits above them.

Shape

  • GlobalLayout<E: Element, const RANK: usize> holding extents and strides, with a const-generic marker per dim for compile-time vs runtime extent.
  • Descriptor construction as a method, box shape derived from the SharedTile it is being paired with (keeping today's by-construction agreement).
  • PanelMap becomes a thin alias/constructor over it so existing call sites keep working.
  • Stays behind feature = "host" — cuTensorMapEncodeTiled needs cuda-core.

Depends on #2 for the element parameterization.

Activity

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

    @feitreim
    OwnerAuthor

    Acceptance: update examples/ as part of closing this.

    This is why the crate ships no host launcher, so it gates running any example rather than compiling one. gemm's 2-D operands and layernorm's parameter vectors each want a tensor map shape encode_bf16_panels cannot build.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions