Repository navigation
fused_moe: remove incorrect topk adjustment in get_2stage_cfgs for EP - #5734
Conversation
…or EP Removes `topk -= int(is_ep)` from `get_2stage_cfgs`. When VLLM_ROCM_USE_AITER_FUSED_MOE_SHARED_EXPERT is enabled with EP, this subtraction incorrectly strips the Fused Shared Expert column from the config lookup key, causing wrong tuned-config selection. Fixes ROCm#5595 Co-Authored-By: Claude Sonnet 4 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
|
Validation on GLM-5.3-FP8 DP8+EP8 — MI300X (gfx942) — vLLM v0.28.0 Node: 8× MI300X, gfx942 | vLLM: v0.28.0+rocm723 | ROCm: 7.2.3 Launch Command Reasoning Test Output: ✅ Correct answer | ✅ Clean finish_reason: stop | ✅ All 8 DP workers completed warmup without GPU faults | ✅ VLLM_ROCM_USE_AITER_FUSED_MOE_SHARED_EXPERT=1 accepted without errors Without PR#5734, the topk -= int(is_ep) line would silently corrupt the config lookup key when the fused shared expert path is active on EP, causing wrong tuned-config selection. With the patch, config selection is correct on gfx942 + DP8+EP8. |
|
LGTM @valarLip topk -= int(is_ep) should be applied to fake expert mode. Remove it . |
…rows that lose to the CK 2-stage default (#6681) The Qwen3-235B-A22B FP8 TP8+EP rows (cu_num 256, model_dim 4096, inter_dim 1536, 16 local experts, top-8, per_1x128) at token=1 and token=2 select the 1-stage ASM fmoe_bf16_blockscaleFp8_g1u1_vs_pf2_silu_16x128, which is slower than the CK 2-stage default used when no row matches. These rows only became reachable under EP with #5734, which removed `topk -= int(is_ep)` from get_2stage_cfgs (before that the lookup used topk=7 and fell back to the default). That made Qwen3-235B FP8 EP about 6% slower at conc 1 between the vLLM v0.30.0 and v0.31.0 ROCm images. On aiter main (MI350X): token=1 32.2 -> 26.7 us, token=2 32.1 -> 30.6 us. The token=4 and token=8 rows are kept because the tuned ASM kernel beats the default there (36.5 vs 41.6 us, 37.8 vs 46.5 us). Claude-Session: https://claude.ai/code/session_012XYVab4mQWCMPp2QoPkThy Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
Removes
topk -= int(is_ep)fromget_2stage_cfgsinaiter/fused_moe.py.Root Cause
When
VLLM_ROCM_USE_AITER_FUSED_MOE_SHARED_EXPERT=1is set together with EP (expert_mask is not None), the removed line incorrectly reducestopkby 1 before building the config lookup key. This strips the Fused Shared Expert column from the key, causing a wrong tuned-config to beselected (or a cache miss falling back to untuned defaults).
The adjustment was originally intended to strip the fake always-masked expert slot that EP callers append to
topk_ids. That convention no longerapplies uniformly — fused shared expert uses the last expert slot as a real expert, so subtracting 1 is invalid in that path.
Change
Removes 4 lines from
get_2stage_cfgs— the comment block and thetopk -= int(is_ep)mutation.Test Plan
VLLM_ROCM_USE_AITER_FUSED_MOE_SHARED_EXPERT=1and confirm correct config is selectedop_tests/test_moe_2stage.pyto verify no regression on standard EP pathFixes #5595