Skip to content

[gfx1250] Refactor MoE/GEMM kernels with layout/atom API#885

Merged
coderfeli merged 8 commits into
mainfrom
gfx1250/gemm-refactor
Jul 24, 2026
Merged

[gfx1250] Refactor MoE/GEMM kernels with layout/atom API#885
coderfeli merged 8 commits into
mainfrom
gfx1250/gemm-refactor

Conversation

@aoli26

@aoli26 aoli26 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Motivation

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

Technical Details

  • Add A8W4 MXScale, A8W8 PTPC, and A8W8 blockscale kernels.
  • Add A8W4 MXScale MoE kernel.
  • Support TDM/WMMA pipelining, cluster multicast, ragged M, and strided tensors.
  • Remove legacy implementations and simplify correctness tests.

Test Plan

Run:

python3 -m pytest tests/kernels/test_moe_a8w4_mxscale_gfx1250.py
python3 -m pytest tests/kernels/test_gemm_fp8fp4_gfx1250.py

Test Result

All tests passed.

Submission Checklist

@aoli26
aoli26 force-pushed the gfx1250/gemm-refactor branch from 6847d9a to 3e812c4 Compare July 23, 2026 04:18
@aoli26 aoli26 changed the title [WIP][gfx1250] Refactor GEMM kernels with layout/atom API [gfx1250] Refactor MoE/GEMM kernels with layout/atom API Jul 23, 2026
@aoli26
aoli26 marked this pull request as ready for review July 23, 2026 13:18
@aoli26
aoli26 requested review from coderfeli and Copilot July 23, 2026 13:18
@aoli26
aoli26 requested a review from XingerZhu July 23, 2026 13:19
@aoli26 aoli26 assigned yadaish and aoli26 and unassigned yadaish Jul 23, 2026
@aoli26
aoli26 requested a review from yadaish July 23, 2026 13:20

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

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.

Comment thread kernels/moe/moe_a8w4_mxscale_gfx1250.py
@aoli26
aoli26 force-pushed the gfx1250/gemm-refactor branch 2 times, most recently from 9623196 to 2717a0b Compare July 23, 2026 14:56
@aoli26
aoli26 force-pushed the gfx1250/gemm-refactor branch from 2717a0b to 27da078 Compare July 24, 2026 03:34
@coderfeli
coderfeli merged commit 33efd75 into main Jul 24, 2026
11 of 13 checks passed
@coderfeli
coderfeli deleted the gfx1250/gemm-refactor branch July 24, 2026 04:47
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