Repository navigation
Conversation
Use router logits for expert dimensions and check the top-k capacity of the selected groups. Fall back when the aligned experts exceed the gating operator limit. Signed-off-by: Yujian Guo <guoyujian8@hotmail.com>
There was a problem hiding this comment.
Code Review
This pull request updates the is_fused_supported logic in fused_topk_router.py to evaluate routing constraints using router_logits instead of hidden_states. It introduces alignment and maximum expert limits using round_up and adds corresponding parameterized unit tests in test_fused_moe.py to validate both fused and fallback routing paths. No review comments were provided, so there is no additional feedback.
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. 🤖 How to trigger CI
Note Until the CI gate has run on a commit, the required Tip 💡 Consider Linking a Related Issue or RFCYour PR title contains the [BugFix] tag, indicating a bug fix or new feature. Linking a related issue or RFC in the PR description is strongly encouraged — it gives reviewers helpful context and speeds up the review. You can use any of these keywords:
🙏 Thanks for helping us keep the project well-organized! |
Signed-off-by: Yujian Guo <guoyujian8@hotmail.com>
|
/run |
Coverage
More info see: Summary |
|
Last updated: 2026-11-26 09:24 UTC+8 for commit ci-gate failed. Reason:
See the workflow run for full logs. This comment is updated in place on each new failure and marked as passed once the gate passes (it is kept for history, not deleted). Missing owner approvals. Every changed file needs one approval from its CODEOWNERS owner(s):
|
Allow the test to mock the gating operator when the CPU torch_npu stub does not define it. Signed-off-by: Yujian Guo <guoyujian8@hotmail.com>
|
/run |
What this PR does / why we need it?
Fixes #23037.
The fused MoE router checked the hidden size even though the gating op receives expert logits. It also divided the capacity of an expert group by the number of selected groups. Valid configurations could fall back unnecessarily, and unsupported configurations could reach CANN and fail in tiling.
Check the expert dimension of the router logits, count all experts in the selected groups, and use the grouped fallback when CANN's aligned expert limit is exceeded. The hardware and vision-routing branches retain their existing dispatch behavior.
Does this PR introduce any user-facing change?
Yes. Grouped MoE inference falls back for layouts outside the fused operator's supported capacity. Valid grouped layouts can use fused routing. Release note included in
release_notes/fragments/23139.yaml.How was this patch tested?
9b8c54e0with the vLLM v0.34.0 source overlay. The same focused suite passed all 224 tests with the fix on each vLLM source pin (v0.34.0andc410543d9ffff03f5f6c4a8c0ae1d3ad082c4a15).python -m pytest -q tests/ut/ops/test_fused_moe.py tests/ut/ops/test_moe_gating_map_router.py tests/ut/models/test_deepseek_v41_routing_ids.pyaclnnMoeGatingTopKand failed with error 561103 on main (2560 aligned experts). The fix used the grouped fallback. Two valid 64-expert grouped layouts switched from fallback to the NPU fused op. An ungrouped 128-expert control stayed fused. All four patched cases matched the CPU reference expert IDs exactly, with maximum routing-weight difference below 2.3e-8.torch_npustub. Reproduced all three failures with that stub. Onbeeb3fca, the mock is installed even when the stub lacks the attribute, and the focused CPU suite passes 224 tests on each of the two vLLM source pins.bash format.sh ciandgit diff --checkpassed. DCO, pre-commit, and both CPU lanes passed in the latest CI run. The merge gate is waiting for CODEOWNERS approval andready-precise. A3 and full-model generation remain pending. The ungrouped control covers a Qwen-MoE-style routing shape with synthetic inputs.Checklist
Testing