Fix RoutingMethodType logic#33919
Conversation
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
There was a problem hiding this comment.
Code Review
This pull request correctly fixes the logic for determining RoutingMethodType and adds a necessary fallback for grouped top-k routing. The changes appear to be correct and well-implemented. My main feedback is regarding code duplication for the new routing_method_type property, which has been added to two separate files with identical implementations. I've suggested refactoring this into a shared utility to improve long-term maintainability.
vllm/model_executor/layers/fused_moe/router/fused_topk_bias_router.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
|
@robertgshaw2-redhat feel free to add yourself as reviewer if interested, I don't seem to be able to do that. |
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
|
@mgoin I'm confident that the code is now correct, however it would be good if we could run the tests on all tested models before merging to prevent any side effects. Would it be possible to start such a CI run? |
|
@dbari this error seems related in Fusion E2E TP2 (B200), Kernels (B200), and other B200 tests |
|
That's a bug that snuck in the 0.6.3 release of Flashinfer unrelated to this PR. There's an open issue and PR for it. I'll let you know when there's a fix we can use. By the way, the previous version 0.6.2 was ok, so it did not affect vLLM. However this PR will not run with 0.6.2, so we have to postpone this PR until a post-release or a new release with the fix is out. |
|
It seems maybe we can get past this if we manually specify the argument from the vLLM side, let me try that |
|
You could call it with FYI it only affects the FP8 per-tensor code path, the blockwise and FP4 are not affected. |
Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com> Co-authored-by: mgoin <mgoin64@gmail.com>
Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com> Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com> Co-authored-by: mgoin <mgoin64@gmail.com>
Purpose
This PR contains two fixes for #33792:
RoutingMethodTypeinfused_topk_bias_router.pyandfused_topk_router.pyuse_grouped_topk=True, theGroupedTopKRouterdid not find any valid routing methods and there is only one group, fall back to the non-grouped routersThe latter point covers Mistral Large 3, which has
n_group=1andtopk_group=1but usesRenormalizeinstead ofDeepSeekV3routing, handled by theFusedTopKRouter.After #33858 was merged, Mistral Large 3 is broken. This PR fixes the vLLM part, however Flashinfer PR#2502 is also needed [edit: has been merged and added to 0.6.3].
Test Plan
Will test the accuracy of the models affected by recent relevant PRs: Mistral Large 3, Kimi-K2 and Deepseek V2-Lite.
Test Result
Results for
RedHatAI/DeepSeek-Coder-V2-Lite-Instruct-FP8, using the default MoE backend (FLASHINFER_CUTLASS):Results for
mistralai/Mistral-Large-3-675B-Instruct-2512, using the default MoE backend (FLASHINFER_TRTLLM):Results for
moonshotai/Kimi-K2-Instruct, using the default MoE backend (FLASHINFER_TRTLLM):Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.