Revert #27749 and re-impl mtp update weight from distributed - #28575
Merged
yueming-yuan merged 2 commits intoJun 19, 2026
Conversation
guapisolo
requested review from
Fridge003,
Qiaolin-Yu,
Ying1123,
hnyls2002,
ispobock,
kpham-sgl,
merrymercy,
pyc96 and
xiezhq-hermann
as code owners
June 17, 2026 23:19
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…orker(s) (sgl-project#27749)" This reverts commit a0ff690.
guapisolo
force-pushed
the
fix/draft_weight_upd_pr
branch
from
June 18, 2026 22:13
9c3eaa5 to
e4b245b
Compare
Re-implement distributed weight-update for speculative draft worker(s) on the v2 worker layout, on top of the preceding revert of sgl-project#27749's earlier design. Centralize the weight-update fan-out in SchedulerWeightUpdaterManager: an UpdateWeightsFrom{Distributed,Tensor}ReqInput `selector` ({target, draft, both}) resolves to the (role, ModelRunner) pairs to update. For distributed updates the target model receives the broadcast once and the weights are loaded into every selected runner locally; tensor updates deserialize once and fan out the same way. Draft workers expose their runner(s) via iter_draft_runners(); the per-worker update_weights_from_{distributed,tensor} methods and the `disable_draft_model` flag are gone. Combines sglang-miles sgl-project#27749 and sgl-project#28548. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
guapisolo
force-pushed
the
fix/draft_weight_upd_pr
branch
from
June 18, 2026 22:31
e4b245b to
b29c5e4
Compare
yueming-yuan
approved these changes
Jun 18, 2026
yueming-yuan
merged commit Jun 19, 2026
22b6497
into
sgl-project:sglang-miles
37 of 42 checks passed
nanjiangwill
pushed a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…worker(s) (sgl-project#27749, sgl-project#28575) Squash of sgl-project#27749 and its revert/re-impl sgl-project#28575: draft workers expose iter_draft_runners() and the target runner receives the broadcast once via receive_weights_from_distributed, then loads into each draft runner locally. v1 dflash/frozen-kv-mtp workers were removed in v0.5.14; their hunks are dropped (spec v2 is the only path).
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 14, 2026
…e draft worker(s) (#27749, #28575) Squash of #27749 and its revert/re-impl #28575: draft workers expose iter_draft_runners() and the target runner receives the broadcast once via receive_weights_from_distributed, then loads into each draft runner locally. v1 dflash/frozen-kv-mtp workers were removed in v0.5.14; their hunks are dropped (spec v2 is the only path). Reconciled distributed-update return onto v0.5.15's kw_only ReqOutput (error logged once in the except path).
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 14, 2026
…e draft worker(s) (#27749, #28575) Squash of #27749 and its revert/re-impl #28575: draft workers expose iter_draft_runners() and the target runner receives the broadcast once via receive_weights_from_distributed, then loads into each draft runner locally. v1 dflash/frozen-kv-mtp workers were removed in v0.5.14; their hunks are dropped (spec v2 is the only path). Reconciled distributed-update return onto v0.5.15's kw_only ReqOutput (error logged once in the except path).
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 14, 2026
…e draft worker(s) (#27749, #28575) Squash of #27749 and its revert/re-impl #28575: draft workers expose iter_draft_runners() and the target runner receives the broadcast once via receive_weights_from_distributed, then loads into each draft runner locally. v1 dflash/frozen-kv-mtp workers were removed in v0.5.14; their hunks are dropped (spec v2 is the only path). Reconciled distributed-update return onto v0.5.15's kw_only ReqOutput (error logged once in the except path).
yueming-yuan
added a commit
that referenced
this pull request
Jul 25, 2026
… for spec draft worker(s) (#27749, #28575, #18565, #22663, #28001, #29675, #27750) Squash of the spec-draft distributed-update work and the weight-processing session work: the latter rewrites iter_draft_runners()/get_model_runners() the former introduces, so they cannot be applied independently. - Draft runners never join the update group, so the target receives the broadcast once and the weights are loaded into every selected runner. - Begin/EndWeightUpdate session chain: engine / http_server / tokenizer_control_mixin (pause-aware locking) -> scheduler -> SchedulerWeightUpdaterManager, with {target,draft,all} runner selectors. - loader.py: public post_load_weights plus restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers). - weight checker: skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner. Reimplemented onto v0.5.16, which had already extracted weight updating into ModelRunner.weight_updater (WeightUpdater): the receive/load split lands there as receive_weights_from_distributed() + load_weights() rather than on ModelRunner, and the scheduler fan-out drives runner.weight_updater.*. The worker-level update_weights_from_{distributed,tensor} entry points on TpModelWorker / EAGLEWorkerV2 / NGRAMWorker are dropped: the scheduler now owns the fan-out, and leaving them would be a second path that updates one runner only. iter_runners() replaces the ad-hoc draft-runner discovery on every spec v2 worker (incl. DFlashWorkerV2). The unit test moves to test/registered/rl/, since v0.5.16 retired test/srt/ from CI collection. Co-authored-by: Yueming Yuan <yym022502@gmail.com> Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com>
yueming-yuan
added a commit
that referenced
this pull request
Jul 25, 2026
… for spec draft worker(s) (#27749, #28575, #18565, #22663, #28001, #29675, #27750) Squash of the spec-draft distributed-update work and the weight-processing session work: the latter rewrites iter_draft_runners()/get_model_runners() the former introduces, so they cannot be applied independently. - Draft runners never join the update group, so the target receives the broadcast once and the weights are loaded into every selected runner. - Begin/EndWeightUpdate session chain: engine / http_server / tokenizer_control_mixin (pause-aware locking) -> scheduler -> SchedulerWeightUpdaterManager, with {target,draft,all} runner selectors. - loader.py: public post_load_weights plus restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers). - weight checker: skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner. Reimplemented onto v0.5.16, which had already extracted weight updating into ModelRunner.weight_updater (WeightUpdater): the receive/load split lands there as receive_weights_from_distributed() + load_weights() rather than on ModelRunner, and the scheduler fan-out drives runner.weight_updater.*. The worker-level update_weights_from_{distributed,tensor} entry points on TpModelWorker / EAGLEWorkerV2 / NGRAMWorker are dropped: the scheduler now owns the fan-out, and leaving them would be a second path that updates one runner only. iter_runners() replaces the ad-hoc draft-runner discovery on every spec v2 worker (incl. DFlashWorkerV2). The unit test moves to test/registered/rl/, since v0.5.16 retired test/srt/ from CI collection. Co-authored-by: Yueming Yuan <yym022502@gmail.com> Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com>
yueming-yuan
added a commit
that referenced
this pull request
Jul 25, 2026
… for spec draft worker(s) (#27749, #28575, #18565, #22663, #28001, #29675, #27750) Squash of the spec-draft distributed-update work and the weight-processing session work: the latter rewrites iter_draft_runners()/get_model_runners() the former introduces, so they cannot be applied independently. - Draft runners never join the update group, so the target receives the broadcast once and the weights are loaded into every selected runner. - Begin/EndWeightUpdate session chain: engine / http_server / tokenizer_control_mixin (pause-aware locking) -> scheduler -> SchedulerWeightUpdaterManager, with {target,draft,all} runner selectors. - loader.py: public post_load_weights plus restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers). - weight checker: skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner. Reimplemented onto v0.5.16, which had already extracted weight updating into ModelRunner.weight_updater (WeightUpdater): the receive/load split lands there as receive_weights_from_distributed() + load_weights() rather than on ModelRunner, and the scheduler fan-out drives runner.weight_updater.*. The worker-level update_weights_from_{distributed,tensor} entry points on TpModelWorker / EAGLEWorkerV2 / NGRAMWorker are dropped: the scheduler now owns the fan-out, and leaving them would be a second path that updates one runner only. iter_runners() replaces the ad-hoc draft-runner discovery on every spec v2 worker (incl. DFlashWorkerV2). The unit test moves to test/registered/rl/, since v0.5.16 retired test/srt/ from CI collection. Co-authored-by: Yueming Yuan <yym022502@gmail.com> Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com>
yueming-yuan
added a commit
that referenced
this pull request
Jul 25, 2026
… for spec draft worker(s) (#27749, #28575, #18565, #22663, #28001, #29675, #27750) Squash of the spec-draft distributed-update work and the weight-processing session work: the latter rewrites iter_draft_runners()/get_model_runners() the former introduces, so they cannot be applied independently. - Draft runners never join the update group, so the target receives the broadcast once and the weights are loaded into every selected runner. - Begin/EndWeightUpdate session chain: engine / http_server / tokenizer_control_mixin (pause-aware locking) -> scheduler -> SchedulerWeightUpdaterManager, with {target,draft,all} runner selectors. - loader.py: public post_load_weights plus restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers). - weight checker: skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner. Reimplemented onto v0.5.16, which had already extracted weight updating into ModelRunner.weight_updater (WeightUpdater): the receive/load split lands there as receive_weights_from_distributed() + load_weights() rather than on ModelRunner, and the scheduler fan-out drives runner.weight_updater.*. The worker-level update_weights_from_{distributed,tensor} entry points on TpModelWorker / EAGLEWorkerV2 / NGRAMWorker are dropped: the scheduler now owns the fan-out, and leaving them would be a second path that updates one runner only. iter_runners() replaces the ad-hoc draft-runner discovery on every spec v2 worker (incl. DFlashWorkerV2). The unit test moves to test/registered/rl/, since v0.5.16 retired test/srt/ from CI collection. Co-authored-by: Yueming Yuan <yym022502@gmail.com> Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com>
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
Centralize speculative weight-update fan-out in the scheduler behind a
selectorfield.Motivation
sglang-milescarries #27749 (a0ff6904) as the first cut of distributed weight-update for speculative draft worker(s). That version fans out through adisable_draft_modelflag, per-workerupdate_weights_from_distributed/update_weights_from_tensormethods, andModelRunner.update_weights_from_distributed_to_model_runners([...]). Each spec worker reimplements its own runner-list assembly, anddisable_draft_modelonly expresses all-or-nothing. The observable capability — pushing updated weights to the target and draft runners over the existing_model_update_group— is unchanged.Before / After
update_weights_from_distributed.SchedulerWeightUpdaterManagerfans out once for every worker.receive_weights_from_distributed.weightsload into each runner fromget_model_runners(selector).update_weights_from_{distributed,tensor}are removed.iter_draft_runners().ModelRunner.update_weights_from_distributedsplits intoreceive_weights_from_distributedplusload_weights.disable_draft_model: Optional[bool]becomesselector: {target, draft, all}(defaultall).Behavior Preservation
test/srt/test_distributed_weight_update_spec_worker.pyasserts receive-once-on-target / load-into-each-runner.selector="target"never enumerates the draft worker.Verification
test/srt/test_distributed_weight_update_spec_worker.py— 2 passed locally.Review Focus
SchedulerWeightUpdaterManager.update_weights_from_distributed: oneweightsobject loads into every runner fromget_model_runners(selector).dflash_worker.iter_draft_runners()returns the real draft, not the target via__getattr__.ngram_worker.iter_draft_runners()returns[]since it shares the target runner.CI States
Latest PR Test (Base): ❌ Run #27793336996
Latest PR Test (Extra): ❌ Run #27793336669