Skip to content

[gfx1250][FlyDSL] Refactor GEMMs with layout-based API#4374

Open
aoli26 wants to merge 4 commits into
mainfrom
gfx1250/refactor-flydsl-gemm
Open

[gfx1250][FlyDSL] Refactor GEMMs with layout-based API#4374
aoli26 wants to merge 4 commits into
mainfrom
gfx1250/refactor-flydsl-gemm

Conversation

@aoli26

@aoli26 aoli26 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

Replace legacy gfx1250 GEMM implementations with focused, layout-based kernels.

Technical Details

Add A8W8 PTPC, and A8W8 blockscale kernels and remove legacy implementations.

Test Plan

Ran a8w8 blockscale/PTPC GEMM correctness tests and AOT pre-compilation on gfx1250.

Test Result

Results match the previous kernel path; AOT compilation passes.

Submission Checklist

@aoli26
aoli26 requested review from a team and Copilot July 24, 2026 10:07
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 4374 --add-label <label>

@aoli26

aoli26 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Depends on #4210

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors and extends gfx1250 FP8 GEMM support by introducing new FlyDSL layout-based WMMA kernels (PTPC and blockscale bpreshuffle), updating quantization scale shuffling semantics, and refreshing tuned-config coverage plus AOT compilation support for the new kernel families.

Changes:

  • Add gfx1250 FlyDSL WMMA kernels for a8w8 PTPC bpreshuffle GEMM and a8w8 blockscale bpreshuffle GEMM, and update gfx1250 bpreshuffle dispatch to use the new launchers.
  • Update quantization kernels/dispatch to distinguish MX-hardware e8m0 swizzle (group_size==32) vs. transpose (other group sizes), and expose an fp8-e8m0 scale output option via scale_type.
  • Update tuned CSVs (new gfx1250 entries) and extend AOT precompile tooling plus op_tests to exercise the fp8-e8m0 scale path.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
op_tests/test_gemm_a8w8_blockscale.py Adds optional fp8-e8m0 scale generation/testing path and a --flydsl flag for blockscale tests.
csrc/kernels/quant_kernels.cu Refines e8m0 scale padding/shuffle behavior to be MX-layout-specific (group_size==32) and uses transpose otherwise.
aiter/ops/quant.py Adds scale_type option to per_group_quant_hip and routes fp8-e8m0 scale requests through per-group quant op.
aiter/ops/gemm_op_a8w8.py Adds gfx1250 support and dispatch for FlyDSL blockscale bpreshuffle path when scales are fp8-e8m0.
aiter/ops/flydsl/kernels/tdm_oob.py Removes vendored OOB-capable TDM descriptor builder fallback.
aiter/ops/flydsl/kernels/gemm_mxscale_gfx1250.py Tightens buffer resource bounds for grouped-contiguous-M metadata loads.
aiter/ops/flydsl/kernels/gemm_a8w8_ptpc_gfx1250.py New FlyDSL WMMA PTPC (per-token/per-channel fp32 scale) preshuffle GEMM kernel for gfx1250.
aiter/ops/flydsl/kernels/gemm_a8w8_blockscale_gfx1250.py New FlyDSL WMMA blockscale (e8m0 scale) preshuffle GEMM kernel for gfx1250.
aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_bpreshuffle_wmma_common.py Reworks gfx1250 PTPC candidate generation and shape-fitting logic.
aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_blockscale_bpreshuffle_wmma_common.py Adds gfx1250 blockscale WMMA candidate catalog and shape-fitting logic.
aiter/ops/flydsl/bpreshuffle_gemm_gfx1250.py Updates gfx1250 PTPC runner to call the new layout-based WMMA launcher and adjusts split-k limits.
aiter/ops/flydsl/blockscale_bpreshuffle_gemm_gfx1250.py New gfx1250 blockscale bpreshuffle runner and kernelName parser/dispatcher.
aiter/configs/model_configs/dsv4_a8w8_blockscale_bpreshuffle_tuned_gemm.csv Adds many gfx1250 flydsl tuned entries for blockscale bpreshuffle GEMM.
aiter/configs/a8w8_bpreshuffle_tuned_gemm.csv Updates gfx1250 flydsl tuned entries for PTPC bpreshuffle GEMM.
aiter/aot/flydsl/gemm.py Extends AOT to detect/compile the new gfx1250 WMMA kernel families and adds optional ARCH-based job filtering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_bpreshuffle_wmma_common.py Outdated
Comment thread aiter/ops/flydsl/gemm_tune/flydsl_gemm_a8w8_blockscale_bpreshuffle_wmma_common.py Outdated
Comment thread aiter/ops/quant.py
Comment thread op_tests/test_gemm_a8w8_blockscale.py
Comment thread aiter/aot/flydsl/gemm.py
@aoli26
aoli26 force-pushed the gfx1250/refactor-flydsl-gemm branch from ff1a0dd to 5c660ff Compare July 24, 2026 10:54
@aoli26
aoli26 force-pushed the gfx1250/refactor-flydsl-gemm branch from 5c660ff to b0d3305 Compare July 24, 2026 11:00
@zufayu
zufayu requested a review from coderfeli July 27, 2026 01:24
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.

2 participants