[feat] Add Qwen3 MoE true-on-policy SP/PP support - #26317
Open
maocheng23 wants to merge 47 commits into
Open
Conversation
…per and invoke layers (sgl-project#25233)
Co-authored-by: ybyang <10629930+whybeyoung@users.noreply.github.com> Co-authored-by: Shangming Cai <csmthu@gmail.com>
Co-authored-by: b8zhong <b8zhong@users.noreply.github.com>
…g kv_args (sgl-project#25380) Co-authored-by: JoeLee314 <liqichao@baidu.com>
…gl-project#24704) Co-authored-by: Shangming Cai <csmthu@gmail.com> Co-authored-by: xuyongfei <xuyongfei.xyf@antgroup.com>
layer_mapping was changed from a compact list to a sparse array containing None for out-of-stage layers by PP support (sgl-project#24704), but the HiCache consumer was not updated to handle None entries.
This reverts commit cd09fb9.
This was referenced May 25, 2026
yueming-yuan
force-pushed
the
sglang-miles
branch
from
June 18, 2026 21:02
1dbbf3a to
6a4ffcc
Compare
yueming-yuan
requested review from
AniZpZ,
ByronHsu,
CatherineSue,
FlamingoPg,
JustinTong0323,
Kangyan-Zhou,
Qiaolin-Yu,
ShangmingCai,
alphabetc1,
b8zhong,
bingxche,
fzyzcjy,
hanming-lu,
hzh0425,
key4ng,
mickqian,
slin1237,
sogalin,
yhyang201 and
yuan-luo
as code owners
June 18, 2026 21:02
yueming-yuan
force-pushed
the
sglang-miles
branch
from
July 7, 2026 06:43
f8cfad3 to
fbc2623
Compare
yueming-yuan
force-pushed
the
sglang-miles
branch
from
July 29, 2026 20:58
f7ea06e to
3003d70
Compare
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.
Based on maocheng23#4 and retargeted to
sgl-project/sglang:sglang-miles.Summary
Adds the SGLang rollout-side contract and deterministic kernel plumbing for Qwen3-30B-A3B MoE true-on-policy training, including the SP+PP contract update used by the coupled Miles and Megatron-LM PRs.
This PR is one of three coupled PRs that should be reviewed and landed together because they extend the
qwen3_moe_true_on_policy_v1contract to allow Megatron sequence parallel and pipeline parallel training while preserving exact SGLang rollout parity.Companion PRs:
Main Changes
python/sglang/srt/true_on_policy/.Validation
Cleaned 8-GPU ion7 real-workload run:
moe_sppp_pr_tp2_pp2_ep2_onpolicy_real3_cleaned_noci_nosave_260524_ion7raysubmit_a9NCtiu6K5dRVCscTP=2,PP=2,EP=2,ETP=1, sequence parallel enabled; SGLang 4 rollout engines, eachTP=2,EP=2.0 MiB.train/train_rollout_logprob_abs_diff=0.0,train/train_rollout_kl=0.0,grad_norm=0.0377418305, weight version1.0, mixed version0.0.train/train_rollout_logprob_abs_diff=0.0,train/train_rollout_kl=0.0,grad_norm=0.0389085777, weight version2.0, mixed version0.0.485.2571sand462.8948s, about2.6-2.9%slower than the previous on-policy no-debug timing run and in the same overhead band versus off-policy.Focused checks after cleanup:
git diff --check53 passed3 passedLocal record:
recovery/qwen3_moe_sppp_clean/journal/2026-05-23-sppp-e2e.mdCI States
Latest PR Test (Base): ❌ Missing
run-cilabel -- add it to run CI tests.Latest PR Test (Extra): ❌ Blocked --
run-ciis required first.