[3/n] Disaggregated rollout: engine-side /pull_weights#2181
Merged
Conversation
nanjiangwill
force-pushed
the
delta-pull-weights
branch
3 times, most recently
from
July 6, 2026 18:46
ab04422 to
42037c8
Compare
nanjiangwill
force-pushed
the
delta-pull-weights
branch
from
July 6, 2026 18:52
42037c8 to
5666a72
Compare
nanjiangwill
force-pushed
the
delta-pull-weights
branch
3 times, most recently
from
July 6, 2026 19:05
8217c60 to
9a05693
Compare
…_weights) Follow-up to THUDM#2089. That PR fanned the host-local delta apply out from slime via Ray (all_engine_actors, one actor per host of each multi-node engine) because only node 0 of a multi-node engine has an HTTP server. That leaks engine topology into slime and cannot work for external rollout engines, where slime only has an endpoint. A new /pull_weights endpoint (shipped as the standalone docker/patch/latest/sglang-pull_weights.patch) has each engine pull the published weights onto every host it spans, riding the existing control-request broadcast; a per-host flock collapses co-located ranks to one pull, and the reply is all-gathered across the TP group so success means every host holds a verified checkpoint. The pull is artifact-driven: a published version is either a full HF checkpoint (copied as-is, resetting the chain) or a delta against its predecessor (patched in place, per-tensor checksums), detected from the index metadata; a fresh host seeds from the newest full version at or below the target, or from the engine's own model path for a pure-delta stream. The shared-filesystem refresh hook follows sglang's custom-weight-loader convention (--custom-pull-weights-pre-read-hook), forwarded through the existing --sglang-* passthrough. slime now only talks to one endpoint per engine: all_engine_actors and SGLangEngine.sync_local_checkpoint are removed, the delta updater calls pull_weights(v) before the reload, and pull_weights(0) during baseline capture replaces the init-thread base materialization (still overlapped with the snapshot gather). Full-mode disk sync pulls to local disk too when --update-weight-local-checkpoint-dir is set. The post-write hook is renamed --custom-update-weight-post-write-path since it now serves full and delta alike, and two pre-existing full-disk bugs on non-POSIX shared filesystems are fixed: every writing rank creates the version dir and renames its own shards, and the post-write hook runs on every rank. Validated end to end on GLM-4.7-Flash non-colocated (2 trainer nodes + one 2-node tp16 rollout engine, object-store-backed shared filesystem): delta mode 4/4 pulls with 0 checksum mismatches (~23s steady-state sync); full mode 4/4 pulls, one pull per host per version, engines reloading from the pulled local checkpoint.
nanjiangwill
force-pushed
the
delta-pull-weights
branch
from
July 6, 2026 19:10
9a05693 to
4694fed
Compare
This was referenced Jul 6, 2026
This was referenced Jul 7, 2026
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLdXoApPFW7oYmN8yEPHhz
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLdXoApPFW7oYmN8yEPHhz
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLdXoApPFW7oYmN8yEPHhz
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KLdXoApPFW7oYmN8yEPHhz
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training.
nanjiangwill
added a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
…host-local checkpoint A trainer publishes each weight sync as a version directory (a full HF checkpoint, or zstd-compressed per-tensor deltas with checksums) under a shared source_dir. /pull_weights fans out to every rank on every node of the deployment; each host seeds a local checkpoint from the newest full version (or the server's own model path) and applies the delta chain in place, verified per-tensor. The engine then reloads the local checkpoint through the ordinary update_weights_from_disk path, so the weight-loading code never sees the delta format. --custom-pull-weights-pre-read-hook covers object-store-backed shared filesystems that need an explicit refresh before reads. Ported from slime's runtime patch (THUDM/slime#2181) for miles/slime-style disaggregated RL training.
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.
Series:
#2089 fanned the per-host delta apply out from slime via Ray (
all_engine_actors) because only node 0 of a multi-node engine has an HTTP server — leaking engine topology into slime and breaking for external engines.This PR moves the pull into the engine:
POST /pull_weights {local_checkpoint_dir, source_dir, target_version}syncs the host-local checkpoint on every host the engine spans (standalonedocker/patch/latest/sglang-pull_weights.patch;sglang.patchuntouched). slime talks to one endpoint per engine.weight_v{N:06d}/is self-describing: full HF checkpoint (copied, resets the chain) or delta (in-place, per-tensor checksums). Fresh hosts seed from the newest full version ≤ target, or the engine'smodel_path.--custom-update-weight-post-write-path(trainer, after write) /--custom-pull-weights-pre-read-hook(engine, before read).all_engine_actorsandsync_local_checkpointremoved; full-mode disk sync also pulls to local disk when--update-weight-local-checkpoint-diris set; two non-POSIX full-disk publisher bugs fixed (per-rank mkdir/rename, per-rank hook).Validation — GLM-4.7-Flash, 2 trainer nodes + one 2-node tp16 engine, object-store-backed shared filesystem, 3 rollouts per mode; plus an offline suite (mixed streams, resharded resets, pruned history, corruption, concurrency).
The logprob diff already measures 0.041 at rollout 0, before any sync (engine serving its init-loaded checkpoint) — that residual is sglang-vs-Megatron kernel numerics, and the syncs add nothing on top of it.