Repository navigation
[gfx1250] [MoE] DeepSeek-R1 EP4 MegaMoE grouped FMoE rows: ep_fused=1 buckets, tuned 8192 and 32768 - #8002
[gfx1250] [MoE] DeepSeek-R1 EP4 MegaMoE grouped FMoE rows: ep_fused=1 buckets, tuned 8192 and 32768#8002JiaoliangYu wants to merge 8 commits into
Conversation
…p_fused=1 buckets and tuned 8192 MegaMoE looks the grouped GEMM up with ep_fused=1 (GEMM2 does the EP scatter). For DeepSeek-R1 EP4 (model_dim 7168, inter_dim 2048, 65 experts per rank, topk -1) the table had ep_fused=1 rows only for tokens 1024, 2048, 4096 and 32768, and the ep_fused=0 rows do not serve the fused path, so the other buckets missed and kept the caller's default tile. - tokens 8..512 and 16384: the existing ep_fused=0 rows, with ep_fused=1. - token 8192: the ep_fused=0 row's tiles with persistent_workers2=512 (233.57 us).
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
…d=1 row Replace the ep_fused=1 token=32768 row from ROCm#7726 (hand-set 128x256x256, w1x4, no measurement) with a measured one: 256x256x256 w2x2, 4/4 buffers, cluster_n 4, waves 2/1, prefetch, LDS SoA interleave, A preshuffle. 4-GPU EP4 MegaMoE layer (12288 tokens/rank): 2361 -> 1994.5 us, bit-identical.
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
… for top-9 The DSR1 rows that carry the 256-tile configs were marked ep_fused=0, so the MegaMoE (ep_fused=1) lookup missed them past token 4096 and fell back to the 64-tile default. Take the ep_fused=1 rows for experts=65 from #8002. With those tiles the S1F receive cap of 4096 sends DSR1 top-9 (shared expert fused) back to dispatch + GEMM1 at 1536 tokens/rank and up. Lift it like the DSV4.1 Flash shapes: 798 vs 899 us/layer at 4096, 384 vs 422 at 1536.
zufayu
left a comment
There was a problem hiding this comment.
AITER SOP code review on current head 5f5c31d:
I did not find an additional row-level logic blocker, but this PR edits dsr1_tuned_grouped_fmoe.csv, which no longer exists on current main, so the change cannot be validated against the current config schema.
Primary reviewer: @yzhou103 (tuning/config owner).
Author action: rebase onto current main, migrate these rows into the current table/schema, then rerun duplicate/lookup checks plus gfx1250 EP4 accuracy/hash and the 8192/32768 performance cases. The current Aiter Gate failure appears unrelated, but the old-tree result is not sufficient after the required migration. CI/conflict status is a merge blocker, not a reason to defer code review.
|
LGTM |
|
Updated in The schema/migration premise in the earlier review is now moot: main still I also updated the stale 32768/512 lookup assertions and the compact helper's The gfx1250 EP4 accuracy/hash and 8192/32768 performance revalidation requests #8092 still has one competing token-512 key. I have retained our current row |
Change
model_configs/dsr1_tuned_grouped_fmoe.csv, DeepSeek-R1 EP4 MegaMoE shape (model_dim 7168, inter_dim 2048, 65 experts/rank, topk -1), looked up withep_fused=1:ep_fused=0rows; 8192 uses theep_fused=0tiles withpersistent_workers2=512(233.57 us).ep_fused=1token-32768 row from [FlyDSL] [gfx1250] Optimize grouped MoE prefill and DSR1 EP tuning #7726 (128x256x256 w1x4, 2/2 buffers, no measurement) with a measured one: 256x256x256 w2x2, 4/4 buffers, cluster_n 4, waves 2/1, prefetch, LDS SoA interleave, A preshuffle (1359.51 us). @yadaish FYI, since it is your row.Results
MI455X (gfx1250) ×4, on our aiter branch rebased on main of 11-13 (a7a7c99e2), outputs bit-identical:
ep_fused=1rows (8192 then a plain copy of theep_fused=0row): MLPerf trace decode step −6.54%.persistent_workers2=512(decode, 1536 tokens/rank): layer 416.2 → 407.3 us (−2.2%, single measurement).Tests
*tuned_grouped_fmoe*.csvreports no duplicate shape;_find_grouped_configwithep_fused=1selects the new rows for 8–512 / 8192 / 16384 / 32768;ep_fused=0lookups are unchanged.PR Self-Review
Reviewed revision
3528e50510dd859e09f1a179ea2f61bc2fece4a3Behavior and intent
DeepSeek-R1 MegaMoE EP4 with a fused shared expert looks up grouped GEMM with
gfx1250, 256 CUs, hidden 7168, intermediate 2048, 65 experts/rank, topk -1,Silu, bf16 output, MXFP4 A/W, per-1x32 quantization and
ep_fused=1. An explicitep_fused=0row does not serve that scatter path. This PR adds the missing8/32/64/128/256/512/8192/16384 buckets and replaces the existing 32768 fused
row. The added/replaced keys have one row each; unrelated configurations retain
their previous selection. The 512 choice remains subject to the common-workload
comparison with #8092; this update does not change either candidate's parameters.
The branch includes main
9eb34ee0bcfc8219ec74f5559a8f40a3954e5f31. No configmigration is needed: main still contains
aiter/configs/model_configs/dsr1_tuned_grouped_fmoe.csvwith the same 48-columnschema. Test updates follow the current compact-dispatch API and the intended
new rows. The earlier one-line
_is_gfx1250fix in the allreduce rank-agreementfixture is dropped at this head: main fixed that test in #8117, and the file now
matches main.
Validation and unverified scope
This head merges main into
c44bd88e72e9ebeb6eba3c6759bc6781222a70f4and drops the fixture line; the grouped-config CSV and its lookup test are unchanged sincec44bd88, where the checks below were run.On the current revision, Windows/Python 3.12, executed the checkout's actual
lookup/padding/compact helper bodies and existing unittest classes through AST,
with import dependencies and chip queries stubbed to gfx1250/256 CUs:
12 tests passed, 0 skipped. The compact helper executes from its new
stages/dispatch_compact.pylocation. The merged grouped-config family has 597rows and zero duplicate keys; this CSV has 72 rows × 48 fields. Non-EP lookups
are identical to main at padded boundaries, including experts 64/65.
Black and Ruff passed on the edited test file, and
git diff --checkpassed.Normal commands for the ROCm environment are:
The new head's CI is being followed separately. Local Windows lacks torch,
FlyDSL Linux wheels and GPUs, so the normal-import/Gloo commands and GPU kernels
have not been reported as local passes.
The earlier November-13 MI455X measurements in Results are historical author
evidence, not a rerun of this SHA. Current-head gfx1250 EP4 reference accuracy,
four-rank output hashes, 8192/32768 performance, 512 A/B and joint S1F validation
remain PENDING. A pinned executable package with exact commands, candidate
diffs, observed GEMM lookups, output dumps and decision rules is at the author's
Z:\jiaolyu\dsr1_pr_validation\20261118\aiter-8002\(local backup retained).It compares this head with main 9eb34ee, and joint candidates from #8092
4cd3f6c6037538654814951ce7d9595762cc406d, using FlyDSL 0.5.0. No machine resultis inferred from that package's preparation or dry run. Non-uniform routing,
other EP sizes and current production MLPerf traces also remain unverified.
PR-specific question
Consumers use
expert=65, topk=-1, ep_fused=1with the shape/dtype/quant fieldsabove; only tokens 8/32/64/128/256/512/8192/16384/32768 change. CPU duplicate and
boundary lookup checks compare the whole grouped family with main, and confirm
that
ep_fused=0selection is unchanged. Compact dispatch and grouped GEMM usethe same fused row and
max(tile_m, tile_m2)alignment: 16 at token 512, 256 at32768. Token 512 is the sole overlapping key in #8092's current diff; the key
does not encode S1F mode. Its timing claim cannot resolve the choice without
the same-S1F correctness/hash and performance A/B. The machine package records
actual GEMM lookups so a historical tpr value is not assumed to hit token 32768.
Changed op tests
op_tests/tuning_tests/test_grouped_ep_fused_lookup.py: extends existing CSVselection coverage to the intended fused rows, updates 32768 tile/buffer
expectations, removes the obsolete/redundant "512 stays default" assertion,
and executes the relocated compact helper with its current config interface.
It restores temporary environment overrides and keeps existing model/top-k,
CU preference and token-overflow tests. This is configuration/API consistency
coverage, not another GPU performance suite.