[gfx1250] Refactor MoE/GEMM kernels with layout/atom API#885
Merged
Conversation
aoli26
force-pushed
the
gfx1250/gemm-refactor
branch
from
July 23, 2026 04:18
6847d9a to
3e812c4
Compare
aoli26
marked this pull request as ready for review
July 23, 2026 13:18
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors gfx1250 MoE/GEMM coverage by removing legacy WMMA/TDM implementations and introducing new layout/atom-based kernels (including MXScale/PTPC/blockscale variants), alongside updated correctness/perf tests for the new paths.
Changes:
- Removed legacy gfx1250 WMMA GEMM and WMMA MoE 2-stage kernel implementations plus their large test harnesses.
- Added new gfx1250 kernels: grouped MoE A8W4 MXScale, GEMM A8W4 MXScale, GEMM A8W8 PTPC, and GEMM A8W8 blockscale.
- Simplified/reshaped shared gfx1250 GEMM utilities to support the new kernels’ raw-LDS + fused activation needs.
Reviewed changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/kernels/test_wmma_gemm_gfx1250.py | Removed legacy WMMA GEMM correctness harness. |
| tests/kernels/test_moe_gemm_wmma_gfx1250.py | Removed legacy WMMA MoE 2-stage test/bench harness. |
| tests/kernels/test_moe_a8w4_mxscale_gfx1250.py | Added correctness/perf coverage for new grouped A8W4 MXScale MoE path. |
| kernels/moe/moe_gemm_2stage_wmma_gfx1250.py | Removed legacy WMMA MoE 2-stage kernel implementation. |
| kernels/moe/moe_a8w4_mxscale_gfx1250.py | Added new grouped contiguous-M MXScale MoE kernel with TDM pipeline and optional cluster multicast. |
| kernels/gemm/wmma_gemm_gfx1250.py | Removed legacy WMMA GEMM kernel implementation. |
| kernels/gemm/gemm_common_gfx1250.py | Updated shared gfx1250 GEMM utilities (raw LDS ops + fused silu/swiglu helper). |
| kernels/gemm/gemm_a8w8_ptpc_gfx1250.py | Added PTPC FP8xFP8 preshuffle GEMM kernel. |
| kernels/gemm/gemm_a8w8_blockscale_gfx1250.py | Added FP8xFP8 blockscale preshuffle GEMM kernel. |
| kernels/gemm/gemm_a8w4_mxscale_gfx1250.py | Added A8W4 MXScale GEMM kernel. |
| kernels/common/mma/pipeline_utils_gfx1250.py | Removed legacy gfx1250 pipeline utilities previously used by WMMA GEMM. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aoli26
force-pushed
the
gfx1250/gemm-refactor
branch
2 times, most recently
from
July 23, 2026 14:56
9623196 to
2717a0b
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
aoli26
force-pushed
the
gfx1250/gemm-refactor
branch
from
July 24, 2026 03:34
2717a0b to
27da078
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Replace legacy gfx1250 MOE/GEMM implementations with focused, layout-based kernels.
Technical Details
Test Plan
Run:
python3 -m pytest tests/kernels/test_moe_a8w4_mxscale_gfx1250.pypython3 -m pytest tests/kernels/test_gemm_fp8fp4_gfx1250.pyTest Result
All tests passed.
Submission Checklist