Skip to content

Add value-threaded F16 full-drain WGMMA lowering #1024

Closed

Description

@uurl

Summary

Extend the existing value-threaded WGMMA lowering to support the Hopper

wgmma.mma_async.sync.aligned.m64n64k16.f32.f16.f16

variant for the canonical linear full-drain shape.

The implementation should reuse the existing BF16 value-carrier model where the accumulator remains in SSA/register form across the complete asynchronous WGMMA lifetime:

wgmma.fence
mma+
commit_group
wait_group<0>

The scope is intentionally narrow.

Motivation

The existing WGMMA lowering already protects BF16 accumulators from LLVM spill boundaries by carrying the 32 f32 accumulator values through one convergent inline-PTX region.

F16 has the same accumulator shape and the same descriptor/control structure for m64n64k16.f32.f16.f16, so the canonical linear full-drain case can use the same value-threaded strategy instead of exposing an in-flight accumulator through a pointer.

Scope

Support:

  • m64n64k16.f32.f16.f16
  • canonical [[f32; 8]; 4] accumulator
  • linear full-drain sequences
  • one or more homogeneous F16 MMAs between fence and commit
  • final wait_group<0>
  • 32 tied f32 accumulator values in convergent inline PTX

Keep unsupported:

  • F16 counted K-loops
  • F16 partial waits / pipelined groups
  • non-canonical F16 accumulator layouts
  • mixed BF16/F16 MMAs within one linear full-drain region
  • TF32

F16 should fail closed for unsupported shapes rather than falling back to the
deferred pointer carrier.

Acceptance criteria

  • Add importer support for the F16 WGMMA intrinsic.
  • Add NVVM pointer and linear value-carrier operations for F16.
  • Lower the F16 value carrier to wgmma.mma_async.sync.aligned.m64n64k16.f32.f16.f16.
  • Reuse the existing 32-value tied-register lowering structure.
  • Fuse canonical pointer-form F16 full-drain sequences into the value carrier.
  • Reject non-canonical F16 accumulators.
  • Reject mixed BF16/F16 full-drain sequences.
  • Keep F16 partial waits unsupported.
  • Keep F16 counted-loop/pipeline recognition unsupported.
  • Preserve all existing BF16 lowering behavior.
  • Add structural/verifier/lowering tests.
  • Add an sm_90a PTXAS test proving the F16 32-value carrier is spill-free.
  • Update the WGMMA documentation.

Validation target

The end-to-end PTX probe should demonstrate that both one-MMA and chained-MMA
F16 carriers assemble successfully for sm_90a with:

  • 32 tied f32 accumulator values
  • 0 bytes spill stores
  • 0 bytes spill loads

Activity

  1. added
    enhancement
    intrinsics
    IR-lowering
    codegen
    cuda-feature
    on Aug 19, 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

    IR-loweringcodegencuda-featureenhancementintrinsics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions