[sglang-miles] Cherry-pick #22911: return_routed_experts with overlap scheduling#23854
Closed
ByronHsu wants to merge 1 commit into
Closed
Conversation
…ject#22911) Cherry-pick of upstream c560326 onto sglang-miles. Resolved conflicts in routed_experts_capturer.py and model_runner.py to keep the miles draft-worker guard, the bs * num_tokens_per_bs cuda_graph fix, and the DeepEP all-gather path on top of upstream's _get_local_range / no_copy_to_cpu refactor. Verified on H200 TP=4 Qwen3-30B-A3B (batch=64, in=1024, out=512): output throughput 7453.48 -> 8609.21 tok/s (+15.5%). Router replay accuracy test (test_return_routed_experts) passes 3/3 with 0 mismatches across ~26.7M expert IDs. Co-authored-by: Yuzhen Zhou <82826991+zyzshishui@users.noreply.github.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Summary
Cherry-pick of upstream #22911 (
c5603268— "[perf] support return_routed_experts with overlap scheduling") ontosglang-miles.Resolved two conflicts to keep
sglang-miles-specific bits on top of upstream's refactor:routed_experts_capturer.py: kept the DeepEPgather_buffer/ all-gather path incapture(). Added_get_local_range()from upstream but with the DeepEP-awarenot get_moe_a2a_backend().is_deepep()guard so we don't slice by DP rank whencapture()already all-gathered.model_runner.py: kept the milesif not self.is_draft_worker:guard and thecuda_graph_num_tokens = bs * num_tokens_per_bsfix for speculative decoding, on top of upstream'sno_copy_to_cpu = not server_args.disable_overlap_scheduleplumbing andoutput.routed_experts_outputassignment.Auto-merged:
scheduler_output_processor_mixin.py,tp_worker.py,managers/utils.py,eagle_worker_v2.py,multi_layer_eagle_worker_v2.py.Verification
Throughput —
python -m sglang.bench_one_batch_server --model Qwen/Qwen3-30B-A3B --tp 4 --enable-return-routed-experts --batch-size 64 --input-len 1024 --output-len 512on 4xH200:e0790b54f)Accuracy —
python test/registered/rl/test_return_routed_experts.py(TP=2 DP=2, baseline = overlap OFF / sync DtoH, reference = overlap ON / new async path):Test plan
test_return_routed_expertspasses (3/3 endpoints, 0 mismatches across ~26.7M expert IDs)🤖 Generated with Claude Code