Repository navigation
feat(weights): sparse XOR deltas for the filesystem weight broadcast #4085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
faresobeid
wants to merge
97
commits into
main
Choose a base branch
from
feat/sparse-filesystem-weight-broadcast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,909
−45
Open
Changes from 74 commits
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
830de9b
feat(weights): sparse XOR deltas for the filesystem weight broadcast
faresobeid 41836bb
feat(weights): engine workers prefetch only the sparse delta entries …
faresobeid 8766951
fix(weights): allow checkpoint tensors the engine casts on load (e.g.…
faresobeid 52c4d7f
feat(weights): fp8-domain sparse deltas for engines that quantize onl…
faresobeid ab7f572
feat(weights): write periodic sparse-broadcast anchors off the traine…
faresobeid 23123e9
perf(weights): keep the sparse snapshot in pinned host memory and reu…
faresobeid 0f7fad6
feat(weights): verify every sparse delta against trainer checksums; l…
faresobeid 66917af
perf(weights): drop sparse deltas and anchors from the engine host's …
faresobeid 5bcb2b0
perf(weights): pin the anchor host buffer on a thread ahead of each a…
faresobeid 1615bbe
perf(weights): checksum held params with one cumsum per param; filter…
faresobeid 8d4d5e3
fix(weights): engines off the delta chain replay from the latest comp…
faresobeid a5b9734
feat(weights): boot weights as the first sparse step, background delt…
faresobeid 2b49427
perf(weights): register exact-size pinned buffers; drop written spars…
faresobeid faab858
fix(weights): decode and apply sparse deltas in chunks of whole tenso…
faresobeid af4dbea
perf(weights): background sparse writes release the GIL; fewer compre…
faresobeid 7d08f09
chore(weights): log the sparse snapshot initialization time
faresobeid 7554b18
feat(weights): write sparse anchors from the trainer snapshot; page-l…
faresobeid 8a48879
fix(weights): page-lock the snapshot only after it is filled
faresobeid 939c14e
fix(weights): page-lock the snapshot with one registration
faresobeid e076262
fix(weights): load anchors layer by layer
faresobeid 3c6f97a
feat(weights): encode sparse deltas in the background, overlapped wit…
faresobeid 3ef6205
fix(weights): diff fp8-held tensors on the training thread; pin the s…
faresobeid 3289d97
perf(weights): skip the pre-broadcast drain and cache release for spa…
faresobeid b37392d
feat(weights): store sparse deltas as zigzag raw-bit differences, one…
faresobeid fa14059
docs: sparse weight broadcast snapshot placement and background encode
faresobeid 9afadaa
feat(weights): stream sparse deltas in parts; record the v0 snapshot …
faresobeid d3a9e95
perf(weights): copy sparse delta parts to the host through a pinned s…
faresobeid 253f1a5
perf(weights): diff fp8-held tensors on the encode thread with an ahe…
faresobeid fd11f15
fix(weights): engine fp8 layout only from checkpoint weights; positio…
faresobeid c87e75e
refactor(weights): simplify the sparse weight broadcast
faresobeid dbe267b
refactor(weights): sparse sender as a FileSystemWeightSender subclass…
faresobeid 1d731e3
fix(weights): finish the encode's weight reads before the final backw…
faresobeid 31ca464
fix(weights): wait for every anchor write before the host buffer is r…
faresobeid 54e241a
perf(weights): position-weighted checksums with one reduction per run…
faresobeid 44b0c83
fix(weights): engines recognize a sparse run's full checkpoint by its…
faresobeid f2bea83
fix(weights): revalidate NFS dirs for anchor markers and engine layou…
faresobeid 8501f91
refactor(weights): record the v0 snapshot inside the first broadcast …
faresobeid 2ecd0c9
perf(weights): no host snapshot buffer for a GPU snapshot: v1 is a fu…
faresobeid 427b749
docs(weights): snapshot placement at v1 and the host anchor buffer
faresobeid 4b9e0d9
refactor(weights): drop the engine reader's NUMA binding (no gain in …
faresobeid 1a42971
perf(weights): v1 is a delta against the boot checkpoint read back fr…
faresobeid 515cfc2
fix(weights): order the gathered fp8 tensors v0 read after the snapsh…
faresobeid 54ad1b4
feat(weights): fp8 block scales in the delta; slice-local full checkp…
faresobeid 255b0d0
docs(weights): fp8 scales in the delta, slice-local anchor reloads
faresobeid 0e90805
perf(weights): checksum same-shape writes into a param in one batch (…
faresobeid 48de997
fix(weights): fault the sparse host buffer in before training; skip a…
faresobeid 5cc0591
fix(weights): pin the engine's delta read buffer at twice the delta, …
faresobeid f39c69e
feat(weights): sparse deltas from the full-offload optimizer step, wi…
faresobeid df71b4e
perf(weights): write the optimizer step delta parts during the step
faresobeid 738b37e
fix(weights): map a non-empty sparse host buffer on ranks without shards
faresobeid cc5beb6
chore(weights): trim sparse broadcast comments, drop dead attributes …
faresobeid 8e87fe9
docs(weights): concise sparse broadcast docs and config descriptions
faresobeid 129b225
fix(weights): fail the trainer when the optimizer-step diff fails; ta…
faresobeid d445d80
feat(weights): sparse deltas from the optimizer step for every optimi…
faresobeid aa3c695
fix(weights): write the anchor slices of optimizer tensors the step d…
faresobeid d5ea649
feat(weights): anchor every 50 steps by default
faresobeid bc69bd5
fix(weights): verify every tensor of anchors and full checkpoints on …
faresobeid 0ad0147
fix(weights): diff packed qkv in the optimizer step instead of a copy…
faresobeid 3140787
perf(weights): diff bf16 updates in place with sync-free kernels, wit…
faresobeid 6ce9377
perf(weights): write full-offload anchors from the live weights after…
faresobeid 81064f4
fix(weights): release the diff slot and regions before writing the an…
faresobeid 4bc9e2d
fix(weights): reject Muon and LoRA with the sparse weight broadcast i…
faresobeid 36e0de7
fix(weights): fail engines reading a sparse delta whose trainer encod…
faresobeid 303d438
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid a980ff0
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid 2e99ce3
fix(weights): engine layouts from every world rank, so pipeline stage…
faresobeid 2299e35
fix(weights): engines report their layout at every full broadcast, an…
faresobeid 681231e
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid b5a4f3c
feat(weights): sparse weight broadcast with Muon
faresobeid b8ecec1
refactor(weights): SparseFileSystemWeightBroadcastConfig, 1:1 with Sp…
faresobeid 0cd553e
fix(weights): fail sparse commits on failed ranks, fail every rank on…
faresobeid 14bd1bd
test(optim): chunked optimizer steps match a plain step and advance p…
faresobeid 2ad7455
refactor(weights): sparse deltas as `[weight_broadcast.delta]` on the…
faresobeid 2616dfa
fix(weights): a tied weight's other names carry no sparse deltas; `de…
faresobeid bbfe2f1
perf(weights): read the sparse delta before the dispatcher stops for …
faresobeid 2fcb620
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid 97be305
fix(weights): anchors and full checkpoints keep every name of a tied …
faresobeid adbf95d
fix(weights): anchors and full checkpoints load tensors the engine ca…
faresobeid 10d931e
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid 5286d0a
chore: bump vLLM to 0.33.0 (torch 2.14.0)
faresobeid 3307dc2
refactor(inference): drop the LoRA load_inplace reset vLLM 0.33 does …
faresobeid 95e9768
chore: pin prime-kernels, deep-ep, deep-gemm, deep-select built for t…
faresobeid 27ce941
fix(inference): keep KV offload reuse with routed experts on vLLM 0.33
faresobeid 7eb55c6
Merge commit '27ce941cf' into feat/sparse-filesystem-weight-broadcast
faresobeid 0ea767d
fix(weights): one update plan per TP group; replica-aware, incrementa…
faresobeid ca9cfa6
perf(weights): apply sparse deltas with one fused Triton kernel
faresobeid f1652fe
feat(weights): offset tables for writes into permuted kernel layouts
faresobeid 7d35cf4
perf(weights): keep the static half of the TP checksum check across u…
faresobeid ef15448
perf(weights): one compiled sparse-apply variant per bits dtype
faresobeid 45f1541
feat(weights): log where a sparse delta's apply time goes
faresobeid 05d6f00
fix(trainer): per-token fp8 casts multiply by the reciprocal, like vL…
faresobeid 7763f04
Merge remote-tracking branch 'origin/main' into worktree-vllm-0.33
faresobeid 5312977
Merge remote-tracking branch 'origin/chore/vllm-0.33' into sparse-core
faresobeid 9280e96
fix(weights): revalidate before probing a delta; check loaded anchors…
faresobeid 1de91f1
fix(weights): match the index map to the engine's boot layout
faresobeid c70aa3c
fix(weights): skip tied names a checkpoint omits when reading rows
faresobeid 515e70f
Merge remote-tracking branch 'origin/main' into feat/sparse-filesyste…
faresobeid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not just make the update weight route non-blocking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into this and would keep the route blocking. Here is what
/update_weightswaits for on a sparse step. All of it runs inside the pause the orchestrator holds:/prefetch_weightsread it.update_weight_version, so tokens sampled after it carry the new version.Steps 2 and 3 take 0.12-0.83 s in the H200 table. The slow part that needs no pause is reading and decompressing the delta (0.1-5 s).
/prefetch_weightsalready takes that out and is the non-blocking half: its RPC only submits the read to a worker thread, and the route pollsprefetch_weights_done. The orchestrator calls it inWeightReceiver.prepare, before it stops dispatch.Returning from
/update_weightsbefore the apply finishes would gain almost nothing and would cost correctness:collective_rpcon the engine core, and the core schedules no batches while it runs. The engine generates nothing during the apply either way. A non-blocking route could only save the pause and resume RPCs (0.03-0.08 s together in the table).policy.versionwhen the call returns. If it returned early, both the version label andpolicy.versionwould move before the weights are verified. Rollouts from a failed or half-applied update would then be labeled v{n+1}. Avoiding that means polling for completion before resuming, which is the blocking call again.weight_step = -1), and the next update reloads an anchor and replays. A fire-and-forget route would have to report that failure some other way.on_version_pendingin between, which aborts stale rollouts before the pause.This does not interact with #4427's overlapped step. The trainer drains it (
wait_for_optimizer_step) beforeweight_sender.broadcast, so the manifest and part files thatpreparewaits for appear only after the step is complete, and the engine routes key off those files. The "return early, fence later" pattern pays off in #4427/#4428 because the trainer has the next forward to overlap before the fence. Here the fence would be the resume, and nothing useful runs between the update and the resume.So I'd keep the two routes:
/prefetch_weightsruns without blocking while the engine serves, and/update_weightsblocks for the apply and verify inside the pause. If the naming is the problem, I can rename them (e.g./stage_weights+/update_weights).