Skip to content

[Dialect] Add FP8 support to GFX120X WMMA atom - #1074

Merged
coderfeli merged 4 commits into
ROCm:mainfrom
big-yellow-duck:codex/gfx120x-fp8-wmma-atom
Sep 3, 2026
Merged

coderfeli merged 4 commits into
ROCm:mainfrom
big-yellow-duck:codex/gfx120x-fp8-wmma-atom

Conversation

@big-yellow-duck

Copy link
Copy Markdown
Contributor

Motivation

The GFX120X WMMA atom added in #943 currently exposes the RDNA4 wave32 FP16 and BF16 paths, but not the hardware FP8 path. As a result, FlyDSL kernels targeting gfx1200/gfx1201 cannot use the regular MMA atom API for E4M3FN WMMA and must bypass it with a raw ROCDL operation.

This completes the floating-point surface of the existing GFX120X atom by adding E4M3FN inputs with FP32 accumulation.

Technical Details

  • Accept f8E4M3FN x f8E4M3FN -> f32 for the GFX120X 16x16x16 WMMA atom.
  • Lower both memref and SSA atom calls to rocdl.wmma.f32.16x16x16.fp8_fp8.
  • Use the RDNA4 v8 operand ABI: eight FP8 values per lane packed as vector<2xi32>.
  • Retain validation that GFX120X supports only 16x16x16, matched operand types, FP32 accumulation, and no floating-point sign/clamp controls.
  • Document the supported FP8 path and extend positive and negative lowering coverage.

This is compiler/atom support only. Optimized block-scaled GEMM kernels and shape routing are intentionally left for a separate follow-up.

Test Plan

  • Build FlyDSL with cmake --build build-fly -j2.
  • Run the positive GFX120X WMMA lowering test through fly-opt and FileCheck.
  • Run the split-input negative verifier test through fly-opt and FileCheck.
  • Run pytest -q tests/kernels/test_rdna4_wmma_atom.py on gfx1201.
  • Run Python/C++ formatting checks and git diff --check.

Test Result

  • Build passed.
  • Positive and negative MLIR tests passed.
  • GFX120X device atom tests passed: 3 tests.
  • Targeted RDNA4 FP8 suite passed: 34 tests.
  • Formatting and whitespace checks passed.

Submission Checklist

  • Looked over the contributing guidelines.
  • Added tests for the new behavior.
  • Updated relevant documentation.

@coderfeli
coderfeli requested a review from sjfeng1999 August 27, 2026 11:16
@big-yellow-duck

Copy link
Copy Markdown
Contributor Author

For extra context, a real kernel flydsl for rdna4 has been implemented here https://github.com/big-yellow-duck/vllm/tree/rdna4-fp8-blockscale-pure-flydsl
The Rdna4Fp8BlockScaleMM is implemented fully in Flydsl that beats the default triton one on 2x R9700 AI Pro.

sjfeng1999
sjfeng1999 previously approved these changes Aug 31, 2026
@Geramy

Geramy commented Sep 2, 2026

Copy link
Copy Markdown

Great work @big-yellow-duck! Cant wait for this to land.

Signed-off-by: big_yellow_duck <83417790+big-yellow-duck@users.noreply.github.com>
@big-yellow-duck

Copy link
Copy Markdown
Contributor Author

Added fp8 e5m2 for completeness. can we get it merged ?

@coderfeli coderfeli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coderfeli
coderfeli merged commit 3c03e97 into ROCm:main Sep 3, 2026
13 checks passed
@big-yellow-duck
big-yellow-duck deleted the codex/gfx120x-fp8-wmma-atom branch September 4, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants