Repository navigation
Conversation
|
Rebased onto upstream main Upstream's The receipt's tested commit |
|
Thanks @volfco. Off by default the plan is main's, and the nine-turn TP=2 receipt is the evidence we'd want: the same |
|
Done: the fingerprint layout is 20 now (5914a28), with the comment on the field naming 18 and 19 as #2162's and #1423's shapes. I will carry #2162's |
|
Rebased onto main 8abb30f (the conflict was the ranks test file: main's TF_GLM_OVERLAP_PIECES test and this branch's TF_GLM_KV_LIVE_HALF test were added at the same place; both are kept, main's first). Layout stays 20; the commits are 0119e48 (the change), 23e9981 (the receipt) and 50e8cb2 (the layout number and the receipt's rebase note). Host tests and |
|
Thanks @volfco. The rebase onto layout 20 is right, and the restore building its plan from the kept state's own |
|
Added to the body under Receipt: the whole-head arm ( |
|
Rebased onto main 8abb30f → 29d6e8b, as queued behind #2162 (still open, so the The only conflict was the recipe hunk, as expected: main's new KV-pages paragraph ( New commits: |
|
Thanks @volfco, the rebase is right: the recipe bullet now sits after main's KV-pages paragraph, and the Zig is |
|
Rebased onto main
The Zig differs from the tested tree only in that merge. The rebased tree builds natively on GB10 (sm_121). Ready for merge. |
|
Thanks @volfco, the rebase is right.
We'll set the CHANGELOG ending at landing. |
|
Thanks @ashhart, all three are done, at
The recipe bullet cites both receipts, and names the earlier one's checkpoint as modified. |
|
Thanks, @volfco. All three are in: the four-arm run on this head with replies, draft statistics and
The CHANGELOG ending is ours at landing, as said. |
… in a kept prompt state A kept state carries both halves of the double-buffered KDA recurrent state. The dead half is the state before the last prompt chunk or decode window: every chunk and every window reads recAt(cur), writes recAt(1 - cur) and flips the layer's bit, and a keep waits for an empty window, so nothing reads it after a restore. With the flag on, the plan carries the arena head in two parts around the dead half (71 MB a rank on GLM-5.3-Flash at TP=2), a restore builds its plan from the kept state's own parity and leaves the slot's dead half as it was, and the ranks' fingerprint carries the flag (layout 16). Off by default. Host tests: the plan's hole and lengths on a real state of virtual addresses, the given parity against the slot's, halfOf's fallbacks, and the setting's parse and agreement.
… on; the recipe names the flag Receipt docs/receipts/glm-kv-live-half-d3e06e76: the binary built from d3e06e7 served the whole head and the live half, drafts off and on, nine greedy turns each. Replies identical in every turn across the four runs; draft counts identical in every turn with fewer tokens accepted than drafted, so the partial-accept commit path ran; every live keep 68 MiB (71,303,168 bytes) smaller in the prompt cache's own accounting, 22 % fewer MiB over the nine states; time to first token within one run's noise. Scripts as run, scrubbed of local names and addresses.
…nd 19 are ashhart#2162's and ashhart#1423's shapes)
…he change), drafts on, against main and a fresh run
Part of #2180.
What changes
cuda_snapshot_layout.zig: with the flag on, the plan carries the arena head in two parts around the dead half ofthe double-buffered KDA recurrent state (
halfOf: the layers' parity when every layer agrees, both halvesotherwise).
Plan.initForbuilds a restore's plan from the kept state's own parity;Plan.withHalfis the explicitform for tests.
cuda_snapshots.zig: a restore uses the kept state's parity (s.cur); the slot's dead half is left as it was.cuda_ranks.zig: the setting (0or1, a typo refused by name) and its fingerprint field (layout 20 as assigned in the review (16 iskda_padon main, 18 and 19 are glm cuda: TF_GLM_L2PF reads a decode window's next weights into L2 on a side stream, on by default on a GB10 #2162's and glm cuda: a prompt step takes two chunks while no other stream decodes, each one's exchanges under the other's sites #1423's shapes),kv_live_halfafterkda_pad; 23 words beforecapacity, so four bytes of padding, which nothing reads since the fields compare by name).cuda_snapshot_layout_test.zig(the hole's position and lengths for both parities on a real state of virtualaddresses, every later part unchanged; the given parity against the slot's;
halfOf's fallbacks) andcuda_ranks_test.zig(the setting's parse and agreement; the field in the coverage list).docs/receipts/glm-kv-live-half-d3e06e76/.Off by default. No kernel, arithmetic or wire change. 71,303,168 bytes a rank less in every kept state on
GLM-5.3-Flash at TP=2 (34 KDA layers, 32 heads a rank, fp32 128x128 a head).
Why it is safe
The dead half is the state before the last prompt chunk or decode window: the forward reads
recAt(cur)and writesrecAt(1 - cur), every chunk and every committed window flips the bit, a keep is refused while a window is pending,and commit's partial-accept replay reads
curand the window's saved rows into1 - cur. Nothing reads the deadhalf after a restore, so leaving it out of the plan changes no restored computation.
Receipt
Two GB10 (NVIDIA GB10, sm_121, 128 GB shared memory) at TP=2 over a direct RoCE link, Ubuntu 24.04.4, kernel
6.17.0-1018-nvidia, driver 580.159.03, Zig 0.17.0, nvcc 13.0, checkpoint Mia-AiLab/GLM-5.3-Flash-EXL3-4bpw-TensorFold-Ablit
revision
57edefd2, context 65,536, one stream, prompt cache in pinned host memory (16 GiB). Binary built fromd3e06e76c, sha256 inbinaries.txt, identical on both ranks.Four nine-turn greedy conversations on the same binary (3k to 21k tokens; six main turns, a raw keep, a raw restore
and a later restore): whole head and live half, drafts off and drafts on.
The receipt's whole-head arm (
TF_GLM_KV_LIVE_HALF=0) is the default path, unchanged by this PR, so it stands in formain.compare.json).41/26/21, 41/24/23, 42/29/18, 43/24/24, 38/33/14, 35/20/28, 44/29/18); fewer accepted than drafted in every turn,
so the partial-accept commit path ran on the live half.
prompt cache:lines (MiB a state, rank 0):Every keep 68 MiB (71,303,168 bytes) smaller; 22.5 % fewer MiB over the nine states with drafts off, 21.6 % with
drafts on.
consistent sign). No speed claim is made.
Checks
zig fmt --checkclean on the changed files;python3 tools/zig/lean_check.pyunchanged against the branch's base(424 problems before and after, none in the changed files).
zig build test-cuda-hostpasses at the base and on the branch; a failure planted in the new layout test isreported by name (one of 2,289 tests) and the restored tree passes.
TF_KV_PAGES), thepage-sharing store (
TF_GLM_KV_SHARE),--kv-cache fp8. The head's split is the same code for them.atc overlap --json(ATC 0.7.0) run before opening from a worktree atf869cd189against upstream main8094ec962: 64 open pull requests share files with this change (28 changed files, at most four shared with any onepull request); every
conflictcame backunknownandcomplete: false(pullFilesUnavailable,timeLimit), asthe clone has no upstream remote to fetch
refs/pull/<n>/headfrom, so no test merge ran.atc check 2180 --json:not claimed, no other pull requests. Not claimed with
atc claim; this pull request'sPart of #2180is the claimper
docs/atc/SKILL.md. Happy to claim or start a session if you want it on the radar.🤖 Generated with Claude Code