fix(inference): RoutedExpertsCapturer for DeepEP MK path + cudagraph …#2440
Draft
fix(inference): RoutedExpertsCapturer for DeepEP MK path + cudagraph …#2440
Conversation
…capture vLLM 0.19's RoutedExpertsCapturer.capture() hardcodes `assert cumsum[-1] == topk_ids.shape[0]`, which only holds when DefaultMoERunner is on its naive dispatch+combine path (DP combine concats all ranks' tokens before select_experts). With DEEPGEMM Fp8 MoE + deepep_high_throughput, supports_internal_mk=True and the modular- kernel path runs instead — DP combine happens inside quant_method.apply, so select_experts sees only this rank's tokens. Every DP worker trips the assert during CUDA-graph warmup and the engine cores die. Patch capture() to mirror the post-refactor behavior on vLLM main (PR vllm-project/vllm#39917): only slice when topk_ids is the cross-DP concatenation; otherwise copy verbatim. Handles both the MK path AND the cudagraph-capture warmup case (where dp_metadata still claims max_num_batched_tokens per rank but the captured batch is one of the cudagraph_capture_sizes), both of which would trip the strict either/or check from the earlier upstream fix (vllm-project/vllm#37879). Verified on a 12-node GLM-5.1-FP8 RL run (DP=16, EP, deepep_high_ throughput): inference comes up cleanly through warmup and into rollout generation. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
…capture
vLLM 0.19's RoutedExpertsCapturer.capture() hardcodes
assert cumsum[-1] == topk_ids.shape[0], which only holds when DefaultMoERunner is on its naive dispatch+combine path (DP combine concats all ranks' tokens before select_experts). With DEEPGEMM Fp8 MoEPatch capture() to mirror the post-refactor behavior on vLLM main (PR vllm-project/vllm#39917): only slice when topk_ids is the cross-DP concatenation; otherwise copy verbatim. Handles both the MK path AND the cudagraph-capture warmup case (where dp_metadata still claims max_num_batched_tokens per rank but the captured batch is one of the cudagraph_capture_sizes), both of which would trip the strict either/or check from the earlier upstream fix (vllm-project/vllm#37879).
Verified on a 12-node GLM-5.1-FP8 RL run (DP=16, EP, deepep_high_ throughput): inference comes up cleanly through warmup and into rollout generation.