fix(plugin): gate dual-stream MoE by runtime graph mode - #1790
Closed
wuhuikx wants to merge 1 commit into
Closed
Conversation
Use the frontend's per-forward graph decision so FULL decode can retain overlap while PIECEWISE capture remains safely single-stream. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
Contributor
There was a problem hiding this comment.
Import block is un-sorted or un-formatted
ATOM/atom/utils/forward_context.py
Lines 4 to 14 in 0c66975
Collaborator
Author
|
Closing to resubmit the change from @XiaobingSuper. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In vLLM plugin mode, CUDA/HIP graph capture is owned by vLLM and the concrete runtime mode is selected per forward (
FULL,PIECEWISE, orNONE). ATOM's MoE dispatcher instead checked its static compilation config.For
FULL_AND_PIECEWISE, the plugin maps vLLM's compile mode to ATOM level 3, which initializes the ATOM-side static graph mode asPIECEWISE. As a result, decode forwards that vLLM actually dispatches asFULLare incorrectly forced onto the single-stream MoE path. This was observed while validating Kimi-K3 dual-stream shared/routed expert overlap in #1752.Solution
PIECEWISEforward; preserve it for eager/NONEand whole-modelFULLcapture._use_dual_streamgate.Validation
python -m pytest -q tests/test_module_dispatch_ops.py tests/plugin/test_plugin_config_translation.py tests/plugin/test_vllm_kimi_k3.py— 22 passedFULL_DECODE_ONLYandFULL_AND_PIECEWISEMade with Cursor