Skip to content

[Triton/Gluon] Take the MOE scale layout from shuffle_scale_moe - #5094

Merged
Boss2002n merged 2 commits into
mainfrom
satya/triton-moe-scale-layout-from-helper
Sep 1, 2026
Merged

Boss2002n merged 2 commits into
mainfrom
satya/triton-moe-scale-layout-from-helper

Conversation

@Boss2002n

Copy link
Copy Markdown
Contributor

No description provided.

Per the shuffling rules, callers should not hardcode SWIZZLE_MX_SCALE labels
next to a shuffle_scale_moe call -- `return_layout=True` returns the label the
helper actually applied, so the caller stays arch-agnostic. Four MOE tests
picked the label themselves from an arch branch.

test_moe_gemm_a16w4.py loses the branch entirely: both arms called
shuffle_scale_moe with the same parameters, and the path is already gated by
arch_info.is_mx_scale_preshuffling_avail(), so the helper's own get_arch()
resolves to what the branch was selecting. The other three keep their explicit
arch="gfx950" so behaviour is preserved unconditionally, not just under the
skip guards.

Left alone on purpose: the gfx1250 arms of a8w4 and a4w4 do not call
shuffle_scale_moe at all -- they use preshuffle_moe_wscale, which dispatches to
the kwidth-4 n32k4 layout. Routing that through utils/shuffle.py is a separate
decision.
@Boss2002n
Boss2002n requested review from a team and a lite review from Copilot August 29, 2026 00:32
@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:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
multigpu Aiter multi-GPU tests on the 8-GPU runner
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 5094 --add-label <label>

PR title tags:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf] and op tags like [MLA] are left untouched. Add the no-auto-title label to opt this PR out of title tagging.

@github-actions github-actions Bot changed the title [Triton] Take the MOE scale layout from shuffle_scale_moe [Triton/Gluon] Take the MOE scale layout from shuffle_scale_moe Aug 29, 2026

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 updates MoE GEMM Triton/Gluon test cases to stop hardcoding SWIZZLE_MX_SCALE strings and instead retrieve the layout label directly from shuffle_scale_moe(..., return_layout=True), aligning scale-layout selection with the centralized shuffle utility.

Changes:

  • Update multiple MoE GEMM tests to unpack (shuffled_scale, swizzle_layout) from shuffle_scale_moe(..., return_layout=True).
  • Simplify a16w4 test swizzle handling by removing explicit arch branching in favor of shuffle_scale_moe’s arch-aware behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
op_tests/triton_tests/moe/test_moe_gemm_a8w8.py Uses shuffle_scale_moe(..., return_layout=True) to derive swizzle_mx_scale in the swizzled MX path.
op_tests/triton_tests/moe/test_moe_gemm_a8w4.py Switches gfx950 path to derive layout from shuffle_scale_moe; gfx1250 branch still hardcodes label.
op_tests/triton_tests/moe/test_moe_gemm_a4w4.py Switches gfx950 path to derive layout from shuffle_scale_moe; gfx1250 branch still hardcodes label.
op_tests/triton_tests/moe/test_moe_gemm_a16w4.py Replaces arch-specific label selection with shuffle_scale_moe(..., return_layout=True).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zufayu
zufayu requested review from a team and vgokhale August 31, 2026 01:18
Copilot AI review requested due to automatic review settings August 31, 2026 06:19

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

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

@brunomazzottiamd brunomazzottiamd 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.

I'm assuming that CI will caught any errors on this PR - if CI is green then we can merge.

@Boss2002n
Boss2002n merged commit 27a85a1 into main Sep 1, 2026
68 of 71 checks passed
@Boss2002n
Boss2002n deleted the satya/triton-moe-scale-layout-from-helper branch September 1, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants