Skip to content

Eplb v2 mega#1691

Draft
JiaoliangYu wants to merge 5 commits into
ROCm:mainfrom
JiaoliangYu:eplb_v2_mega
Draft

Eplb v2 mega#1691
JiaoliangYu wants to merge 5 commits into
ROCm:mainfrom
JiaoliangYu:eplb_v2_mega

Conversation

@JiaoliangYu

Copy link
Copy Markdown
Contributor

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

JiaoliangYu and others added 4 commits July 22, 2026 14:26
…56d)

ATOM_USE_FLYDSL_FUSED=1 replaces the EP experts step (dispatch+gemm1+quant+
gemm2+combine) with FlyDSL MegaMoE. Adapted from PR yanbo/mega to the current
mega_moe_v1 tip (post kernels refactor ROCm#807):

- fp4_utils module removed -> import gemm_common_utils (e8m0_shuffle/
  shuffle_scale_w4 live there now)
- w1/w1_scale use shuffle_weight_w4/shuffle_scale_w4(gate_up=True, moe_gemm=
  True) to match the a8w4 INTERLEAVE(g1u1) gate_mode default; the generic
  shuffle_weight is the SEPARATED layout and mispairs gate/up in swiglu
  (gsm8k ~0.017)
- stash layer._mega_local_E at build; do NOT infer expert count from the
  shuffled _mega_w1 shape (shuffle_weight_w4 + view(-1) breaks the old
  shape[0]//(2*inter) inference -> experts blows up -> ~76GB mori buffer ->
  shmem_malloc failed)
- per-layer weight swap targets mega._s1_w1/_s1_w1_scale (fused stage-1
  runtime pointers); forward_bf16 is aliased to forward
- build MegaMoE and run forward under inference_mode(False)+no_grad so its
  persistent mori buffers are normal tensors (cudagraph capture does in-place
  .zero_() outside inference mode)
- empty_cache after weight build; warmup/dummy token scatter

Validated on DeepSeek-V4-Pro a8w4, 8x MI355X (gfx950), fused ON / EPLB OFF:
gsm8k 3-shot flexible=strict=0.9424 (on par with mori/EPLB baseline ~0.95).

Runtime env: ATOM_USE_FLYDSL=1 ATOM_USE_FLYDSL_FUSED=1
ATOM_FLYDSL_KERNELS_PATH=<FlyDSL mega_moe_v1>; launch with
--max-num-batched-tokens 8192 (keeps mtpr<=8192; larger overflows a stage2
int32 kernel arg).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 1691 --add-label <label>

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.

1 participant