Repository navigation
glm cuda: full GLM-5.3 keeps conversation states on disk (--prompt-cache-disk) - #5432
Conversation
|
Thanks, @bjornmonnens, for the full GLM-5.3 disk-state implementation and the detailed restart evidence. Three small cleanups remain:
|
|
@ashhart, thanks.
The same learn test still matches: turn 2 sha |
…che-disk) GLM's disk store (ashhart#1411) wrote GLM-5.3-Flash's images only: its Shape took the latent row as kv_lora, pools of 4 (sparse.pool) and index rings and pooled keys on every cache. A kept state's image now reads them from the state: the latent row (latentRow: 576 wide on full GLM-5.3), the pool (Config.kpool: 1), and which caches keep index keys (a shared indexer layer's cache holds latent rows alone, so its rings and pooled keys take no bytes and no rows by position). GLM-5.3-Flash's values are the ones the image took before, so its images are unchanged. The store serves both GLM entries (cuda_glm_disk.serves), and --prompt-cache-disk (and its older alias --learn-conversations) reaches full GLM-5.3 at TP=3; at TP=1 its held shares still keep no states. A host test checks full GLM-5.3's image against the snapshot plan at four positions and every head length, and that its rows by position are the 78 caches' latent rows and the 21 indexed layers' pooled keys.
Checkpoint digests, the launch, and the learn-test rows. The binary was built from 6ec94e2a7. The code commit on this branch is the rebase of that change; its five files are unchanged.
The server bound every interface. The dotted unspecified address is what pr_check warns on, so the launch line states the fact without it.
The spill and share refusals name Flash or full GLM-5.3, the refusal test covers both, and the CUDA conversation-state notes do too. The disk-image assertion stays, with its comment on its own line.
5a298bb to
ee265a0
Compare
|
Thank you @bjornmonnens. 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. |
GLM's disk store (#1411) wrote GLM-5.3-Flash's images only: its
Shapetook the latent row askv_lora, pools of 4 (sparse.pool) and index rings and pooled keys on every cache. A keptstate's image now reads them from the state: the latent row (576 wide on full GLM-5.3), the pool
(
Config.kpool: 1), and which caches keep index keys — a shared indexer layer's cache holdslatent rows alone, so its rings and pooled keys take no bytes and no rows by position.
GLM-5.3-Flash's values are the ones the image took before, so its images are unchanged.
The store serves both GLM entries (
cuda_glm_disk.serves), and--prompt-cache-disk(and itsolder alias
--learn-conversations) reaches full GLM-5.3 at TP=3; at TP=1 its held shares stillkeep no states.
mainatc464c9128b; the code commit, then the receipt.atc overlap --json: not run (atcis not installed). The same check by hand on git 2.56.1, 2026-11-27, basec464c9128b, headfadbf96464: every open pull request's head (396) test-merged against this branch and againstmainwithgit merge-tree. 56 touch a file this changes. 54 of those already conflict withmain. This branch adds conflict filesmaindoes not already have on three of them: GLM on CUDA: owner-only latent rows and owner-computed attention (TF_GLM_KV_SPLIT, #1431 part 2; stacked on #2415) #2935 and GLM on CUDA: the prompt history fetch under the latent split (TF_GLM_KV_SPLIT, #1431 part 3; stacked on #2935) #2937 (cuda_disk_image_test.zig,cuda.zig) and GLM on CUDA: kept states, carries and prompt twins under the latent split (TF_GLM_KV_SPLIT, #1431 part 4; stacked on #2937) #2938 (cuda.zig,cuda_refusal.zig). Two share a file and merge clean: qwen3_5 cuda: SenseNova-Loop-9B (sensenova_loop) in BF16, text only #3723 and cuda: opt-in complete-round attribution for speculative decoding #5263. Whichever lands second rebases. The localglm53-d-mainworktree conflicts with this branch oncuda_disk_image.zigand its test, and does not conflict withmain; that is our own next slice, still stacked on the pre-rebase commit.Tests.
length, and that its rows by position are the 78 caches' latent rows and the 21 indexed
layers' pooled keys.
6ec94e2a7and again on the previous rebase9fd37df44(those five files matched the tested commit). Not repeated on91e4975cf3. The only extra line in the five files is main's env-reader migration incuda.zig(2b76e782fb), which is not on the disk path.zig build test-glm-keep-seqs-host test-glm-snapshots-host test-glm-tp3-host test-glm-exl3-host test-glm-exl3-prompt-host test-glm-prompt-settings-host test-glm-formats-host -Dfixed-cpu -j4 --summary all→Build Summary: 25/25 steps succeeded; 100/100 tests passed(one test prints a harmlessfailed command:line to stderr; the Build Summary line is authoritative).Cross-build:
zig build check-native-cuda-host compile-cuda-tests -Dtarget=aarch64-linux-gnu -Dfixed-cpu -j4 --summary all→Build Summary: 21/21 steps succeededon the tested commit.8f87e985c(same slice-c files as9fd37df44), not repeated after the rebase ontoc464c9128b:zig build -Dfixed-cpu test-host --test-timeout 20m --summary all→Build Summary: 2726/2726 steps succeeded; 2647/2697 tests passed (50 skipped), exit 0.An earlier run on the same tree reported five C compile failures (
tfvideo_stub.c,mem_seek_test.c,window_fallback_shim.c,drama_cfg_mix_shim.c): clang 22, under-Werror,rejected this machine's GCC 12 install because it had no libstdc++ headers. Installing
g++-12and
libstdc++-12-dev(12.3.0) cleared it. Those steps now succeed, and none of those files arein this change. The lower inner-test total versus that earlier run is cached test binaries; the
step total is the full graph.
zig fmt --checkandgit diff --checkpassed.Device (the disk tier across a restart, three GB10s at TP=3, BF16 cache).
host-a/b/c,LAUNCHERandCKPTas in #4900's receipt; the learn test waits for no.partfiles before the restart. Tested implementation is
6ec94e2a7(binary sha2569f91d3cb4c05…), built-Dgpu=spark -Doptimize=fast. The code commit on this branch is91e4975cf3.git diff 6ec94e2a7 91e4975cf3is empty on the other four files.cuda.zigalsocontains main's env-reader migration (
2b76e782fb), not on the disk path. BF16 cache, no--kv-cache.Receipt:
docs/receipts/glm53-disk-6ec94e2a7/.shares) in 13.738 s.
cached 22528; its token sha equals the cache-off reference (PASS). Theshas are the same as the cache-off turns in this run (
37287f2c420f…,af785ef933c5…).No precision or token trades. The store's image is the state's bytes; resumed equals fresh.