[sglang-miles] Support INT4 QAT for RL - #18565
Merged
Merged
Conversation
yueming-yuan
requested review from
AniZpZ,
BBuf,
CatherineSue,
Edwardf0t1,
FlamingoPg,
Fridge003,
HaiShaw,
JustinTong0323,
Ying1123,
ch-wan,
hnyls2002,
ispobock,
merrymercy,
slin1237 and
xiezhq-hermann
as code owners
February 10, 2026 21:48
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
yueming-yuan
added a commit
that referenced
this pull request
Feb 13, 2026
yueming-yuan
added a commit
that referenced
this pull request
Mar 5, 2026
yueming-yuan
added a commit
that referenced
this pull request
Mar 27, 2026
yueming-yuan
added a commit
that referenced
this pull request
Apr 6, 2026
zyzshishui
pushed a commit
to zyzshishui/sglang
that referenced
this pull request
Apr 25, 2026
5 tasks
yueming-yuan
added a commit
that referenced
this pull request
May 21, 2026
This was referenced Jun 17, 2026
JessicaJiang-123
pushed a commit
to JessicaJiang-123/sglang
that referenced
this pull request
Jun 21, 2026
nanjiangwill
pushed a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…sgl-project#18565, sgl-project#22663, sgl-project#28001, sgl-project#29675) Combined weight-processing machinery, folding the general post-process plumbing from the INT4 QAT work (sgl-project#18565), the P2P post_load_weights extension (sgl-project#22663), the weight-processing refactor (sgl-project#28001), and the pause-aware weight locking fix (sgl-project#29675) into its final form: - Begin/EndWeightUpdate request chain: engine/http_server/ tokenizer_control_mixin (pause-aware locking) -> scheduler -> weight_updater sessions with {target,draft,all} runner selectors - loader.py: public post_load_weights, restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers) - model_runner begin/end_weight_update + receive_weights_from_distributed - iter_runners() on tp_worker and all spec v2 workers (incl. port to DFlashWorkerV2; v1 dflash/frozen-kv workers no longer exist) - CompressedTensorsFusedMoEMethod.restore_weights_before_loading dispatch - weight_checker ComparableWeight refactor + weight_checker_comparator 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 14, 2026
…sessions + spec-draft weight check (#18565, #22663, #28001, #29675, #27750) Combined weight-processing machinery, folding the general post-process plumbing from the INT4 QAT work (#18565), the P2P post_load_weights extension (#22663), the weight-processing refactor (#28001), and the pause-aware weight locking fix (#29675) into its final form, plus the extension of the weight checker to speculative draft worker(s) (#27750): - Begin/EndWeightUpdate request chain: engine/http_server/ tokenizer_control_mixin (pause-aware locking) -> scheduler -> weight_updater sessions with {target,draft,all} runner selectors - loader.py: public post_load_weights, restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers) - model_runner begin/end_weight_update + receive_weights_from_distributed - iter_runners() on tp_worker and all spec v2 workers (incl. DFlashWorkerV2) - CompressedTensorsFusedMoEMethod.restore_weights_before_loading dispatch - weight checker: selector + skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner Kept v0.5.15's upstreamed ComparableWeight weight_checker_comparator (incl. the #29623 ue8m0 scale-unpack fix); adapted the weight_checker caller to its public compare_weights/CHUNK_NUMEL API. Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com> Co-authored-by: Jiajun Li <jiajun.li@radixark.ai>
yueming-yuan
added a commit
that referenced
this pull request
Jul 14, 2026
…sessions + spec-draft weight check (#18565, #22663, #28001, #29675, #27750) Combined weight-processing machinery, folding the general post-process plumbing from the INT4 QAT work (#18565), the P2P post_load_weights extension (#22663), the weight-processing refactor (#28001), and the pause-aware weight locking fix (#29675) into its final form, plus the extension of the weight checker to speculative draft worker(s) (#27750): - Begin/EndWeightUpdate request chain: engine/http_server/ tokenizer_control_mixin (pause-aware locking) -> scheduler -> weight_updater sessions with {target,draft,all} runner selectors - loader.py: public post_load_weights, restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers) - model_runner begin/end_weight_update + receive_weights_from_distributed - iter_runners() on tp_worker and all spec v2 workers (incl. DFlashWorkerV2) - CompressedTensorsFusedMoEMethod.restore_weights_before_loading dispatch - weight checker: selector + skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner Kept v0.5.15's upstreamed ComparableWeight weight_checker_comparator (incl. the #29623 ue8m0 scale-unpack fix); adapted the weight_checker caller to its public compare_weights/CHUNK_NUMEL API. Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com> Co-authored-by: Jiajun Li <jiajun.li@radixark.ai>
yueming-yuan
added a commit
that referenced
this pull request
Jul 14, 2026
…sessions + spec-draft weight check (#18565, #22663, #28001, #29675, #27750) Combined weight-processing machinery, folding the general post-process plumbing from the INT4 QAT work (#18565), the P2P post_load_weights extension (#22663), the weight-processing refactor (#28001), and the pause-aware weight locking fix (#29675) into its final form, plus the extension of the weight checker to speculative draft worker(s) (#27750): - Begin/EndWeightUpdate request chain: engine/http_server/ tokenizer_control_mixin (pause-aware locking) -> scheduler -> weight_updater sessions with {target,draft,all} runner selectors - loader.py: public post_load_weights, restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers) - model_runner begin/end_weight_update + receive_weights_from_distributed - iter_runners() on tp_worker and all spec v2 workers (incl. DFlashWorkerV2) - CompressedTensorsFusedMoEMethod.restore_weights_before_loading dispatch - weight checker: selector + skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner Kept v0.5.15's upstreamed ComparableWeight weight_checker_comparator (incl. the #29623 ue8m0 scale-unpack fix); adapted the weight_checker caller to its public compare_weights/CHUNK_NUMEL API. Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com> Co-authored-by: Jiajun Li <jiajun.li@radixark.ai>
yueming-yuan
added a commit
that referenced
this pull request
Jul 14, 2026
…sessions + spec-draft weight check (#18565, #22663, #28001, #29675, #27750) Combined weight-processing machinery, folding the general post-process plumbing from the INT4 QAT work (#18565), the P2P post_load_weights extension (#22663), the weight-processing refactor (#28001), and the pause-aware weight locking fix (#29675) into its final form, plus the extension of the weight checker to speculative draft worker(s) (#27750): - Begin/EndWeightUpdate request chain: engine/http_server/ tokenizer_control_mixin (pause-aware locking) -> scheduler -> weight_updater sessions with {target,draft,all} runner selectors - loader.py: public post_load_weights, restore_weight/postprocess_weight via _apply_quant_method_hook (skips LoRA wrappers) - model_runner begin/end_weight_update + receive_weights_from_distributed - iter_runners() on tp_worker and all spec v2 workers (incl. DFlashWorkerV2) - CompressedTensorsFusedMoEMethod.restore_weights_before_loading dispatch - weight checker: selector + skip_tensor_list + role-prefixed overall_checksum over get_model_runners(selector), replacing _get_draft_model_runner Kept v0.5.15's upstreamed ComparableWeight weight_checker_comparator (incl. the #29623 ue8m0 scale-unpack fix); adapted the weight_checker caller to its public compare_weights/CHUNK_NUMEL API. Co-authored-by: JD-ETH <jaedon.guo@gmail.com> Co-authored-by: maocheng23 <35615230+maocheng23@users.noreply.github.com> Co-authored-by: Jiajun Li <jiajun.li@radixark.ai>
5 tasks
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
post_process_weightsAPI for Marlin↔GPTQ weight format conversion during RL training rolloutmoe_awq_to_marlin_zero_pointsChanges
restore_weights_before_loadingfor rollbackis_symmetricrequirement from_is_wNa16_group_channelPostProcessWeightsReqInput/ReqOutputdataclassespost_process_weightsAPI through the full request pipeline