Skip to content

Add value-threaded TF32 m64n64k8 full-drain WGMMA lowering #1076

Closed

Description

@uurl

Summary

Add support for Hopper TF32 WGMMA

wgmma.mma_async.sync.aligned.m64n64k8.f32.tf32.tf32

for the canonical linear full-drain case:

wgmma.fence
mma+
commit_group
wait_group<0>

TF32 uses the same 32 × f32 per-thread accumulator carrier as the existing BF16 and F16 m64n64 paths.

Unlike BF16/F16, the PTX TF32 hardware shape uses K=8, and its instruction form does not carry the two transpose immediates used by the F16/BF16 forms.

Proposed scope

Add a new public device intrinsic:

pub unsafe fn wgmma_mma_m64n64k8_f32_tf32(
    acc: &mut [[f32; 8]; 4],
    desc_a: u64,
    desc_b: u64,
)

Support only canonical linear full-drain regions.

The compiler should fuse the complete asynchronous accumulator lifetime into one convergent inline-PTX statement so LLVM cannot observe or spill an in-flight WGMMA accumulator.

Required compiler support

Device API / importer

  • Add wgmma_mma_m64n64k8_f32_tf32.
  • Import it to a dedicated NVVM pointer-form operation.
  • Keep the existing legacy wgmma_mma_m64n64k16_f32_tf32 compatibility entry unsupported.

NVVM dialect

Add:

  • WgmmaMmaM64N64K8F32Tf32Op
  • WgmmaMmaGroupValuesM64N64K8F32Tf32Op

The value-form group should carry exactly 32 f32 accumulator operands/results.

MIR lowering

Recognize:

fence
one or more homogeneous TF32 m64n64k8 MMA operations
commit_group
wait_group<0>

for a canonical [[f32; 8]; 4] accumulator and rewrite it to the value-threaded carrier.

Emit:

wgmma.mma_async.sync.aligned.m64n64k8.f32.tf32.tf32

with the TF32 operand form:

accumulators, desc_a, desc_b, scale_d, imm_scale_a, imm_scale_b

without the F16/BF16 transpose immediates.

Fail-closed cases

Do not add support for:

  • TF32 counted K-loops
  • TF32 partial-wait pipelines
  • TF32 counted pipelines
  • non-canonical TF32 accumulator pointer fallback
  • mixed BF16/TF32 or F16/TF32 linear regions
  • the legacy m64n64k16_f32_tf32 compatibility entry

These should continue to be rejected.

Acceptance criteria

  • Canonical TF32 linear full-drain lowering succeeds.
  • One and multiple TF32 MMA instructions can be fused under one fence/commit/final wait.
  • Generated PTX contains wgmma.mma_async.sync.aligned.m64n64k8.f32.tf32.tf32.
  • ptxas -arch=sm_90a accepts the generated PTX.
  • The 32-value carrier remains spill-free.
  • BF16 and F16 behavior remains unchanged.
  • Unsupported TF32 control-flow and accumulator shapes remain fail-closed.

Activity

  1. changed the title [-]feat(wgmma): add TF32 m64n64k8 value-threaded full-drain lowering[/-] [+]Add value-threaded TF32 m64n64k8 full-drain WGMMA lowering[/+] on Aug 20, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions