Skip to content

[Kernel] Add optimized 4-wave MXFP8 GEMM kernel for gfx950#872

Open
aris134 wants to merge 3 commits into
mainfrom
amartin/mxfp8-4wave
Open

[Kernel] Add optimized 4-wave MXFP8 GEMM kernel for gfx950#872
aris134 wants to merge 3 commits into
mainfrom
amartin/mxfp8-4wave

Conversation

@aris134

@aris134 aris134 commented Jul 18, 2026

Copy link
Copy Markdown

Motivation

Add an optimized 4-wave MXFP8 GEMM kernel for gfx950 targeting training workloads, where operand B is not pre-shuffled. The implementation follows the HipKittens 4-wave execution schedule while adapting it to FlyDSL, including a dedicated scale pipeline with host-prepacked MFMA-ready scale operands, explicit hot-loop schedulers, and ROCDL scheduling controls to preserve the intended memory/compute overlap.

Technical Details

  • Add a new 4-wave MXFP8 GEMM kernel for gfx950.
  • Implement a two-page ping-pong LDS pipeline for A/B operands.
  • Implement a separate scale pipeline using host-prepacked MFMA-ready scale operands loaded directly into VGPRs.
  • Add dedicated hot-loop schedulers to guide instruction ordering through the steady-state pipeline.
  • Pin accumulators to fixed AGPRs to eliminate unnecessary AGPR↔VGPR transfers and reduce spills.
  • Use explicit ROCDL scheduling controls (sched_vmem, sched_dsrd, sched_mfma, sched_barrier, s_waitcnt) to preserve the intended instruction schedule.

Test Plan

  • Run the full MXFP8 shape sweep by invoking the test harness with --sweep.
  • Each shape performs a standalone correctness check before its timed benchmark.
  • Benchmark performance on MI355X (gfx950) using the same sweep.

Test Result

  • Correctness: 68/68 benchmark shapes passed.
  • Performance (MI355X / gfx950):
    • Mean: 2209.22 TFLOPS
    • Median: 2223.65 TFLOPS
    • Max: 2554.10 TFLOPS

Submission Checklist

@aris134 aris134 self-assigned this Jul 18, 2026
@aris134
aris134 marked this pull request as ready for review July 18, 2026 00:38
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.

1 participant