Skip to content

[gfx1250][FlyDSL] Unify&Rename GEMM kernels and refactor LDS load - #4527

Merged
coderfeli merged 3 commits into
mainfrom
gfx1250/flydsl-unify-0803
Aug 3, 2026
Merged

[gfx1250][FlyDSL] Unify&Rename GEMM kernels and refactor LDS load#4527
coderfeli merged 3 commits into
mainfrom
gfx1250/flydsl-unify-0803

Conversation

@aoli26

@aoli26 aoli26 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

Unify the FlyDSL GEMM kernels for gfx1250 into one implementation to remove code duplication. Rename blockscale to mxfp8_128. Refactor LDS load in gemm_common, and clean some useless codes.

Technical Details

Merge gemm_a8w8_ptpc_gfx1250.py and gemm_a8w8_blockscale_gfx1250.py into a single launch_gemm_a8w8 in gemm_a8w8_gfx1250.py, selected via a new is_bsc compile-time flag, and update all call sites accordingly.

Test Plan

Ran op_tests/test_gemm_a8w8.py and op_tests/test_gemm_a8w8_blockscale.py on gfx1250.

Test Result

All tests pass with no accuracy or performance regression.

Submission Checklist

@aoli26
aoli26 requested review from a team and Copilot August 3, 2026 07:57
@aoli26
aoli26 force-pushed the gfx1250/flydsl-unify-0803 branch from fc96d75 to 13fbfae Compare August 3, 2026 07:57
@github-actions

github-actions Bot commented Aug 3, 2026

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 4527 --add-label <label>

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 consolidates gfx1250 FlyDSL a8w8 GEMM kernels into a single unified implementation, renames the gfx1250 “blockscale” bpreshuffle path to “mxfp8_128”, and refactors gfx1250 LDS load/store helpers to use a shared copy-atom utility.

Changes:

  • Unified gfx1250 FlyDSL a8w8 preshuffle kernels (PTPC + mxfp8_128) under launch_gemm_a8w8(..., is_bsc=...) and updated call sites.
  • Renamed the FlyDSL gfx1250 “blockscale bpreshuffle” kernel family/prefix to mxfp8_128 and updated tuned kernelName parsing + AOT compilation logic.
  • Replaced raw LDS load/store helpers with make_lds_copy_ops() and removed now-unused helper modules.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
aiter/ops/gemm_op_a8w8.py Updates gfx1250 FlyDSL dispatch and renames the bpreshuffle FlyDSL entrypoint to mxfp8_128.
aiter/ops/flydsl/mxfp8_128_bpreshuffle_gemm_gfx1250.py Switches to unified launcher, renames public dispatch helpers, and updates kernelName prefix parsing.
aiter/ops/flydsl/kernels/pipeline_utils.py Removes shared pipeline utility module (no longer referenced).
aiter/ops/flydsl/kernels/mxfp4_preshuffle_gfx1250_tdm.py Migrates LDS load/store usage to make_lds_copy_ops() helpers.
aiter/ops/flydsl/kernels/gfx1250_cluster.py Removes vendored cluster MCAST helper module (no longer referenced).
aiter/ops/flydsl/kernels/gemm_common_gfx1250.py Replaces raw LLVM LDS helpers with make_lds_copy_ops() and trims unused exports.
aiter/ops/flydsl/kernels/gemm_a8w8_ptpc_gfx1250.py Removes the standalone PTPC kernel (functionality moved into unified kernel).
aiter/ops/flydsl/kernels/gemm_a8w8_gfx1250.py Introduces unified gfx1250 a8w8 preshuffle kernel with is_bsc compile-time selection and refactored LDS reads.
aiter/ops/flydsl/gemm_tune/flydsl_gemm_mxfp8_128_bpreshuffle_wmma_common.py Renames candidate kernel prefix and related helpers to mxfp8_128.
aiter/ops/flydsl/bpreshuffle_gemm_gfx1250.py Updates PTPC runtime wrapper to call unified launcher with is_bsc=False.
aiter/configs/model_configs/dsv4_a8w8_blockscale_bpreshuffle_tuned_gemm.csv Updates tuned gfx1250 FlyDSL kernelName entries to the new mxfp8_128 prefix.
aiter/aot/flydsl/gemm.py Updates AOT parsing/compilation routing for the renamed mxfp8_128 kernel family and unified launcher.

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

@aoli26
aoli26 requested a review from coderfeli August 3, 2026 09:23
@coderfeli
coderfeli merged commit 61b0d27 into main Aug 3, 2026
43 of 44 checks passed
@coderfeli
coderfeli deleted the gfx1250/flydsl-unify-0803 branch August 3, 2026 14:14
yanboshao added a commit that referenced this pull request Aug 4, 2026
…to updated main

Reapply the gfx1250 fused-MoE ep_scatter feature (combine_mode="scatter_fused":
gemm2's TDM epilogue P2P-writes each route-weighted output row into peers'
comb_inp, so combine just sums -- no gather-reduce) onto the updated origin/main,
which meanwhile landed #4482 (real SiTUv2 + >512-expert chunked psum scan),
#4527 (LDS API refactor: lds_*_raw -> make_lds_copy_ops) and #4463 (fused_moe
SiTUv2 path). Squashed to a single commit.

Per-file resolution:
- dispatch_combine_v2/*: vendored cco-LSA v2 intranode dispatch/combine op-layer.
- mxfp4_preshuffle_gfx1250_tdm.py: on upstream's make_lds_copy_ops LDS API +
  SiTUv2 epilogue, add the TDM gather-store ep epilogue (tdm_scatter with
  in-kernel global_view/lds_view). tdm_scatter is vendored locally
  (tdm_gather_shim.py, on the stock FlyDSL wheel's low-level TDM intrinsics)
  so this branch needs no FlyDSL-side patch; route weight hoisted per wm row (_wf_rows).
- moe_contiguous_psum.py: adopt upstream's chunked scan (E>512 correct) for the
  non-EP remap; keep the multi-block grid-stride remap + ep_rowmap kernels for EP.
- grouped_moe_gfx1250.py: keep upstream SiTUv2 (stage1_act=3, situ_beta); add the
  ep_scatter dispatch wiring (ep_rowmap build, _ep_gemm2_kwargs, ep_scatter return).
- batched_gemm_mxfp4.py / fused_moe.py: thread both situ_* and ep_* params.
- tuned_grouped_fmoe.csv: tuning points (99 rows).

Dropped only the full-subtile PF prefetch pipeline (da8d794): loaders and
lds_addr_keepalive stay at upstream. lalala-sh's ds-read hoist is kept.

gfx1250-only; not run in this environment. Compile-verify the LDS-API migration +
ep/SiTUv2 epilogue and re-run test_mega_moe --combine on hardware.

Co-authored-by: lalala-sh <Jiaxing.Wen@amd.com>
Co-authored-by: zhimding <zhimding@amd.com>
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.

3 participants