Repository navigation
keep seqs check: keep the prompt state once, on rank 0 - #5122
Merged
Merged
Conversation
Owner
|
Thank you @BadAd84. The one-shot rank-0 callback now matches the fence's The supplied full-checkpoint TP=3 results cover both
|
ashhart
force-pushed
the
keep-seqs-resume-fix
branch
from
November 25, 2026 23:15
99c6ed5 to
cb82299
Compare
The case keeps a state from inside the mark callback, and every rank reaches that mark. Each keep took the same id on every rank, so the followers were refused with StateKept while rank 0 waited in the rank fence for partners that had already exited: a TP=3 run of the check spins. The callback now spends itself once and keeps on rank 0 only; the fence carries the id to the other ranks, which is how a keep happens in the serve. Verified: zig fmt --check clean, zig build test-glm-keep-seqs-host exit 0 on upstream main 8d3f8f9 with this change.
Keeping on rank 0 alone left the followers asserting an id their callback never set, so they failed TestFailed and exited while rank 0 waited in the fence. The followers now read the id from their own snapshot map, which is where the fence put it.
ashhart
force-pushed
the
keep-seqs-resume-fix
branch
from
November 26, 2026 00:15
cb82299 to
90112d2
Compare
Owner
|
Thank you @BadAd84. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
ashhart
added a commit
that referenced
this pull request
Nov 26, 2026
ashhart
added a commit
that referenced
this pull request
Nov 26, 2026
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.
What this does
The prompt-cache resume case keeps a prompt state from inside the mark callback that
prefillfires. Every rank reachesthat mark, so each rank took the same id, and the followers were refused with
StateKeptwhile rank 0 waited in the rankfence for partners that had already exited. A TP=3 run of
glm-keep-seqs-checkspins and never reaches itsPASSline.Two changes, both inside the callback:
gatehas every otherrank keep it.
Why
snapshots.keeptakes the next id and setse.announce;snapshots.gatethen tells the other ranks tokeepAsthat id.A keep called on every rank therefore takes one id everywhere and collides with the fence's own
keepAs, and a rank thatexits on that error leaves the others waiting in the fence.
Verification
zig fmt --check zig/tests/cuda/glm_keep_seqs_tests.zigexits 0.zig build test-glm-keep-seqs-hostexits 0 on upstreammainat8d3f8f923with this change.The check itself,
glm-keep-seqs-checkat TP=3 on three DGX Sparks, image built from this head (glm53-zig:prkeep5),TF_GLM_KEEP_SEQS=1, full 61-layer checkpoint,kv8=falseandkv8=true: rc 0 on all three ranks, and rank 0 printedThe planted control fires first on both formats, so the pass cannot be vacuous.
Changed against upstream
mainat8d3f8f923.