Skip to content

wire GUGU - act+quant fusion into triton decode #1570

Open
Boss2002n wants to merge 1 commit into
mainfrom
satya/atom_gugu_decode
Open

wire GUGU - act+quant fusion into triton decode #1570
Boss2002n wants to merge 1 commit into
mainfrom
satya/atom_gugu_decode

Conversation

@Boss2002n

Copy link
Copy Markdown
Contributor

No description provided.

Adds the GUGU (interleaved) fused decode path alongside the existing GGUU:
- triton_kernel_fused_experts_a8w4_silu: GEMM1 fuses SiLU*up + MXFP8 quant
  (apply_swiglu + out_mx_quant), consuming the interleaved preshuffled weights
  moe_shuffle_weight already produces on gfx1250.
- apply() dispatches is_guinterleave -> GUGU fused decode, else GGUU external.
- __init__: allow GUGU with ATOM_USE_TRITON_MOE_DECODE (was GGUU-only).
- decode a8w4 scale: interleave the w13 gate/up rows for GUGU to match the weight.

Requires the aiter GUGU fusion (satya/gugu_act_quant: out_mx_quant MXFP8 emit in
the gfx1250 gluon decode kernel). DECODE-ONLY: gfx1250 prefill (FlyDSL) is
GGUU-only, so GUGU prefill on gfx1250 is out of scope here.
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every eligible PR before approval:

  • ✅ Pre Checkin: Black, Ruff, catalog schema validation, non-GPU unit tests

Heavy model tests:

  • ✅ Run after the PR is approved and Pre Checkin passes
  • ✅ Run immediately when an approval review is submitted
  • ✅ Can be requested before approval with labels
Label Tests
ci:full Run all heavy PR model tests: native ATOM, vLLM, and SGLang
ci:atom Run native ATOM model accuracy tests
ci:vllm Run ATOM vLLM OOT model accuracy tests
ci:sglang Run ATOM SGLang model accuracy tests

Heavy jobs are skipped when the PR is not approved and no matching ci:* label is present.
Add labels via the sidebar or gh pr edit 1570 --add-label <label>

@Boss2002n Boss2002n changed the title wire GUGU in-GEMM act+quant fusion into triton decode (decode-only) wire GUGU - act+quant fusion into triton decode Jul 12, 2026
@Boss2002n Boss2002n marked this pull request as ready for review July 12, 2026 18:22
Copilot AI review requested due to automatic review settings July 12, 2026 18:22

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 extends the Triton decode path for MXFP4/A8W4 MoE to support the GUGU (gate/up interleaved) layout by using a fused act+quant GEMM1, alongside the existing GGUU (separated) decode path.

Changes:

  • Enable Triton MoE decode for both GGUU and GUGU layouts (env-var gated).
  • Interleave the w13 decode scales when GU-interleaving is enabled to match the decode weight layout.
  • Add a new decode-only Triton kernel (triton_kernel_fused_experts_a8w4_silu) for the GUGU fused act+quant path and dispatch to it from moe.py.

Reviewed changes

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

File Description
atom/model_ops/moe.py Enables Triton decode for GUGU and adjusts decode-scale preparation + kernel dispatch.
atom/model_ops/fused_moe_triton.py Adds a GUGU decode-only A8W4 SiLU kernel using GEMM1 fused SiLU*up + MXFP8 out quant.

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

Comment thread atom/model_ops/moe.py
Comment on lines +1096 to +1103
if self.is_guinterleave:
E_s, N_s, K_s = orig_w13_weight_scale.shape
orig_w13_weight_scale = (
orig_w13_weight_scale.view(E_s, 2, N_s // 2, K_s)
.permute(0, 2, 1, 3)
.reshape(E_s, N_s, K_s)
.contiguous()
)
Comment thread atom/model_ops/moe.py
@@ -1146,8 +1159,10 @@ def apply(
activation: ActivationType = ActivationType.Silu,
) -> torch.Tensor:
if self.use_triton_decode and not get_forward_context().context.is_prefill:
Comment thread atom/model_ops/moe.py
Comment on lines +1187 to +1191
decode_experts = (
triton_kernel_fused_experts_a8w4_silu
if self.is_guinterleave
else triton_kernel_fused_experts_a8w4_silu_gguu
)
@zufayu zufayu requested a review from ZhangLirong-amd July 13, 2026 01:37
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