Repository navigation
lanes: rank GLM CUDA prefills by their resident prefix - #4696
MaverickKB wants to merge 2 commits into
Conversation
Downstream SSD resume receiptOn a downstream TensorFold 1.3.4 build with two GB10 ranks, 1,048,576 context and eight slots, I restarted the workers, verified the page store was empty in RAM, and continued the same long conversation through its desktop client while another real conversation decoded. The two builds restored the same 583,680-token checkpoint, about 7.4 GiB, from the same SSD namespace.
The downstream restore change reads and verifies files on a separate thread with 8 MiB of staging. The engine still owns page publication and orders transfers across both ranks. Host checks cover byte-exact restore, corruption, cancellation and GLM rank transport. The binary embeds the same 139 CUDA kernel modules as the baseline. The later turn had 3,079 more uncached tokens and live decode traffic differed between runs. Active restore work fell by 46%. Elapsed restore and Desktop response time were similar. The book confirmation arrived in the desktop session while the other request was still decoding. This receipt describes the deployed downstream stack. The isolated CUDA comparison on this PR's public head remains open. |
What this changes
An admitted GLM CUDA continuation can have a longer prompt than a competing cold request and far fewer rows left to compute. With
TF_KV_SHARE, the backend used to discover its resident checkpoint at the first fill. Until then the lane host ranked the entire continuation as uncached.The optional backend hook looks up the deepest usable in-memory checkpoint once at admission. The scheduler uses the estimate to rank fills and classify short suffixes. The first actual fill still locates and acquires the pages. An intervening eviction costs one speculative priority decision, and the next choice uses actual progress. The estimate never updates cache usage or the reported number of completed rows. Aging still lets a waiting cold request run.
mainat95ae4081, two commits. The second moves one field to avoid streams: return_progress sends a prompt pass's progress before the first token #3216 and records the changelog entry.atc overlap --jsonagainst95ae4081, 2026-11-23 01:16 UTC: six shared-file entries, no confirmed conflict. Coverage was partial (pull count, file and time limits). I checked all six reported patches: four change other optimization-ledger entries, metal nemotron: TF_KV_SHARE keeps prompt states as core pool pages (stacked on #1837) #1850 changes adapter initialization, and Nemotron 3.5 Transcribe: audio input, the 65,536-token window, an hour of audio, MTP drafts #1632 changes stream options. A paginated inventory of all 399 open PRs identified 40 sharing source files with this patch. None implements this resident-prefix scheduling hook. A supplemental three-way source merge found an insertion at the same position as streams: return_progress sends a prompt pass's progress before the first token #3216. The final field placement merges both changes cleanly. The selected ATC rerun for streams: return_progress sends a prompt pass's progress before the first token #3216 at 01:18 UTC could list the shared files but could not perform its conflict check. The direct source merge included both branches’ fields. Across all 40 source-overlapping PRs, the final patch introduced no additional conflicting source hunks over the base.Checks on this head
0468b87a54f30b368dd2cc51bf9199596a252886.python3 tools/pr_check.py --base origin/main --pr 4696reported zero errors and zero warnings.zig test -lc --dep lanes --dep sys --dep profile -Mroot=zig/src/core/engine_api.zig --dep sys --dep profile -Mlanes=zig/src/core/lanes/lanes.zig -Msys=zig/src/platform/sys.zig --dep sys -Mprofile=zig/src/core/profile.zigran the full engine test module. All 753 passed, zero skipped or failed.zig build -j2 test-glm-image-cache-host test-glm-scheduling-host --summary all: 68 passed, zero failed or skipped. The real shared-store host fixture compares estimated and restored depth and verifies that the lookup leaves page availability, store counters and restored state unchanged.zig test -lc --dep lanes -Mroot=zig/src/native/cuda_bound.zig --dep sys --dep profile -Mlanes=zig/src/core/lanes/lanes.zig -Msys=zig/src/platform/sys.zig --dep sys -Mprofile=zig/src/core/profile.zig: both CUDA host forwarding tests passed.Receipt
The projects used existing source files. In the first row the lane trace measured 0.672 s from submission to the beginning of the fill and 2.088 s in the fill. Server-reported prefill time was 2.103 s. The concurrent project and arrival order differed in the second run. These are observations on a downstream build with other changes. They cannot establish a speedup or isolate the effect of this patch. The failing-control host tests above isolate the ordering change.
TF_KV_SHAREresident store. CPU host tests cover the shared-store query, image content identity, forwarding and scheduling. Other backends leave the optional hook unset.95ae4081, head0468b87aand Zig 0.17.0. The field observations used GLM-5.3-Flash on two NVIDIA GB10 systems. No GPU kernel, tensor contents or checkpoint revision is involved in the new lookup.Checklist