Repository navigation
Persistence: the key gaps #2163 leaves, for every family (closes #2131) - #2287
Merged
Merged
Conversation
ashhart
force-pushed
the
lead/persistence-gaps
branch
3 times, most recently
from
November 9, 2026 07:02
ab312b5 to
e308a7d
Compare
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…ed for Review of #2287. GLM's key read GLM_EHPROJ_NAX itself and still said "tile" when the tile pipeline failed to build and eh_proj served on the scalar kernel. The setting is now a row of platform/environment.zig's table (0 or 1, refused otherwise at startup), read once where wide.zig builds the pipeline; 0 builds none. The prompt pass no longer reads the environment: bf16Nax serves on the scalar kernel whenever that pipeline is absent, and the key takes ehTile, true only with a prompt path, a bf16 head and the built pipeline. Flash Next's key drops `serial`: it only picks a serial encoder over barriers between the same launches, and the host flips it per call. gdn_pipe and gdn_kept stay: they choose the kernel that writes the DeltaNet state and conv rows a snapshot copies. Qwen Metal's key drops frame.capacity, which only sizes buffers and bounds a pass's rows, and keeps back.chunk; a different chunk height starts the Qwen and GLM stores cold, as the recipe now says. An indexed shard missing from the folder is refused as IndexedShardMissing (the loaders already refuse it). Nemotron Metal's identity no longer hashes config and index bytes twice. The rewrite tests move the rewritten shard's mtime a second on instead of sleeping 5 ms first.
4 of 8 tasks
ashhart
force-pushed
the
lead/persistence-gaps
branch
from
November 9, 2026 11:52
e308a7d to
30064ad
Compare
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…ed for Review of #2287. GLM's key read GLM_EHPROJ_NAX itself and still said "tile" when the tile pipeline failed to build and eh_proj served on the scalar kernel. The setting is now a row of platform/environment.zig's table (0 or 1, refused otherwise at startup), read once where wide.zig builds the pipeline; 0 builds none. The prompt pass no longer reads the environment: bf16Nax serves on the scalar kernel whenever that pipeline is absent, and the key takes ehTile, true only with a prompt path, a bf16 head and the built pipeline. Flash Next's key drops `serial`: it only picks a serial encoder over barriers between the same launches, and the host flips it per call. gdn_pipe and gdn_kept stay: they choose the kernel that writes the DeltaNet state and conv rows a snapshot copies. Qwen Metal's key drops frame.capacity, which only sizes buffers and bounds a pass's rows, and keeps back.chunk; a different chunk height starts the Qwen and GLM stores cold, as the recipe now says. An indexed shard missing from the folder is refused as IndexedShardMissing (the loaders already refuse it). Nemotron Metal's identity no longer hashes config and index bytes twice. The rewrite tests move the rewritten shard's mtime a second on instead of sleeping 5 ms first.
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…ses resolved Review of #2287 asked why these two owners add no policy words. Kept states come only from prompt passes, so the audit followed every load-time choice to the kernel or layout that writes one. Flash Next on CUDA now keys its solo and busy chunk heights, the DeltaNet, read-out, hyper-connection and in-pass mark forms, the NVFP4 prompt-tile threshold, the K32 and BF16 prompt tiles, the experts' decode warps and resident grids, and whether a captured set runs and which entries run on our glue beside it. The five per-call switches are read once in Kernels.load (Forms), and the pass and the key both read that. Nemotron on CUDA keys --precision checkpoint's math, the expert ranks of TF_NEMOTRON_WORLD, a ModelOpt checkpoint's NVFP4 decode warps and the experts' resident grids. Nemotron on Metal keys TF_COOP_SPLIT as the backend resolved it at load and, with the split on, the scratch rows a prompt chunk's partials must fit. Each goes through persistence_policy.extend under its own domain. Snapshot payloads and layouts are unchanged; only the namespace key moves.
Owner
Author
|
Restart check on an M3 Ultra, this head
The same check on a GB10 (Nemotron NVFP4, with |
ashhart
marked this pull request as ready for review
November 9, 2026 12:45
Owner
Author
|
The same restart check on a GB10, this head
Both platforms pass, so this is out of draft and in our landing queue. |
This was referenced Nov 9, 2026
Key resolved Metal policies and CUDA Qwen rotary inputs independently of startup probes. Include Flash Next's opened pack stamps and loaded metadata in its namespace. Keep snapshot payloads and layouts unchanged, and cover stale misses and matching disk reads with host regressions. Refs #2131. Stacked on #2163.
Stamp validated weight-map paths, including nested shards and files with other suffixes, while retaining auxiliary top-level safetensors. Use the same reader for Nemotron on Metal. Share the existing index validation bodies across modules without changing filename admission. Cover all eight native disk owners with same-probe stale misses and matching reads of planted conversation states. Refs #2131. Stacked on #2163.
Exercise nested safetensors paths admitted by every audited family. The shared reader also retains all other indexed names its loader admits. Refs #2131.
…ed for Review of #2287. GLM's key read GLM_EHPROJ_NAX itself and still said "tile" when the tile pipeline failed to build and eh_proj served on the scalar kernel. The setting is now a row of platform/environment.zig's table (0 or 1, refused otherwise at startup), read once where wide.zig builds the pipeline; 0 builds none. The prompt pass no longer reads the environment: bf16Nax serves on the scalar kernel whenever that pipeline is absent, and the key takes ehTile, true only with a prompt path, a bf16 head and the built pipeline. Flash Next's key drops `serial`: it only picks a serial encoder over barriers between the same launches, and the host flips it per call. gdn_pipe and gdn_kept stay: they choose the kernel that writes the DeltaNet state and conv rows a snapshot copies. Qwen Metal's key drops frame.capacity, which only sizes buffers and bounds a pass's rows, and keeps back.chunk; a different chunk height starts the Qwen and GLM stores cold, as the recipe now says. An indexed shard missing from the folder is refused as IndexedShardMissing (the loaders already refuse it). Nemotron Metal's identity no longer hashes config and index bytes twice. The rewrite tests move the rewritten shard's mtime a second on instead of sleeping 5 ms first.
…ond on instead of sleeping 5 ms
…ses resolved Review of #2287 asked why these two owners add no policy words. Kept states come only from prompt passes, so the audit followed every load-time choice to the kernel or layout that writes one. Flash Next on CUDA now keys its solo and busy chunk heights, the DeltaNet, read-out, hyper-connection and in-pass mark forms, the NVFP4 prompt-tile threshold, the K32 and BF16 prompt tiles, the experts' decode warps and resident grids, and whether a captured set runs and which entries run on our glue beside it. The five per-call switches are read once in Kernels.load (Forms), and the pass and the key both read that. Nemotron on CUDA keys --precision checkpoint's math, the expert ranks of TF_NEMOTRON_WORLD, a ModelOpt checkpoint's NVFP4 decode warps and the experts' resident grids. Nemotron on Metal keys TF_COOP_SPLIT as the backend resolved it at load and, with the split on, the scratch rows a prompt chunk's partials must fit. Each goes through persistence_policy.extend under its own domain. Snapshot payloads and layouts are unchanged; only the namespace key moves.
…isk states TF_QMMF_HALF_BELOW is resolved into qmmf's Lane at load. A pass of 16 rows or fewer with BF16 or MXFP8 weights then takes the 32-column tile instead of the 64-column one. Flash Next reaches it through the shared expert's nativeMatmul, and Nemotron through a ModelOpt checkpoint's lane, so a short prompt chunk saved under one threshold could resume under another. The startup probe's mark sits in a longer pass and never exercises this form. Both keys now carry the threshold as the lane loaded it. Flash Next also hashes the SM count its BF16 prompt tile is weighed against beside the experts' grids, which already moved with it.
With a captured set, --context decides which _chunk and _merge variant runs: the smallest whose NCH covers the context's chunks. The captured merge's reduction over NCH chunks cannot be shown to ignore those past a row, so a state saved under one context could resume under another variant. The key now carries NCH while a captured set runs. Our own merge reads only a row's chunks and uses NCH as a stride, so without a set the context stays out of the key.
The policy tests call withPolicy directly, so the call sites that build the keys went untested: the CUDA disk identity could return its legacy id, the Metal learned identity its bare hash, or the backend could keep a constant in place of TF_COOP_SPLIT as the forward pass resolves it, and every test stayed green. None of these runs on a host without a device. test-cuda-persistence-source-host now reads the three function bodies, without whitespace or line comments, and requires each call.
…which paging is keyed Flash Next's TF_FLASHNEXT_KV_PAGES and _KV_PAGES_ALL are keyed through the profile rows; only the page-placement test switch is not. The CUDA rows and paragraph also name the lane's half-tile threshold, the BF16 prompt tile's SM count and Nemotron's captured attention variant.
…om the keyed half-tile threshold
…tead of setting it Zig 0.17's std panics in dirSetTimestamps on Windows, so the rewrite there only checks that the write time moved, and skips the test when it didn't.
ashhart
force-pushed
the
lead/persistence-gaps
branch
from
November 9, 2026 19:49
383b731 to
acc89a3
Compare
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…ed for Review of #2287. GLM's key read GLM_EHPROJ_NAX itself and still said "tile" when the tile pipeline failed to build and eh_proj served on the scalar kernel. The setting is now a row of platform/environment.zig's table (0 or 1, refused otherwise at startup), read once where wide.zig builds the pipeline; 0 builds none. The prompt pass no longer reads the environment: bf16Nax serves on the scalar kernel whenever that pipeline is absent, and the key takes ehTile, true only with a prompt path, a bf16 head and the built pipeline. Flash Next's key drops `serial`: it only picks a serial encoder over barriers between the same launches, and the host flips it per call. gdn_pipe and gdn_kept stay: they choose the kernel that writes the DeltaNet state and conv rows a snapshot copies. Qwen Metal's key drops frame.capacity, which only sizes buffers and bounds a pass's rows, and keeps back.chunk; a different chunk height starts the Qwen and GLM stores cold, as the recipe now says. An indexed shard missing from the folder is refused as IndexedShardMissing (the loaders already refuse it). Nemotron Metal's identity no longer hashes config and index bytes twice. The rewrite tests move the rewritten shard's mtime a second on instead of sleeping 5 ms first.
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
…ses resolved Review of #2287 asked why these two owners add no policy words. Kept states come only from prompt passes, so the audit followed every load-time choice to the kernel or layout that writes one. Flash Next on CUDA now keys its solo and busy chunk heights, the DeltaNet, read-out, hyper-connection and in-pass mark forms, the NVFP4 prompt-tile threshold, the K32 and BF16 prompt tiles, the experts' decode warps and resident grids, and whether a captured set runs and which entries run on our glue beside it. The five per-call switches are read once in Kernels.load (Forms), and the pass and the key both read that. Nemotron on CUDA keys --precision checkpoint's math, the expert ranks of TF_NEMOTRON_WORLD, a ModelOpt checkpoint's NVFP4 decode warps and the experts' resident grids. Nemotron on Metal keys TF_COOP_SPLIT as the backend resolved it at load and, with the split on, the scratch rows a prompt chunk's partials must fit. Each goes through persistence_policy.extend under its own domain. Snapshot payloads and layouts are unchanged; only the namespace key moves.
ashhart
added a commit
to mrv777/TensorFold
that referenced
this pull request
Nov 9, 2026
ashhart
added a commit
that referenced
this pull request
Nov 9, 2026
ashhart
added a commit
that referenced
this pull request
Nov 10, 2026
Figures corrected to the PRs' measured ones (#2699 head runs, #2509, #2633, #2436, #2644, #2593, #2430, #2568), scope fixed (#2253, #2287, #2511, #2569, #2337, #2627, #2351, #2626), unsourced figures dropped (#2181, #2606, #2257's pricing clauses), the shipped #2176, #2565, #2548 and gfx12 silu entries and the first #2625 copy removed, and the #2568 and #2352 entries unwrapped to one line each.
ashhart
added a commit
that referenced
this pull request
Nov 10, 2026
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
ashhart
added a commit
that referenced
this pull request
Nov 10, 2026
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
ashhart
added a commit
that referenced
this pull request
Nov 10, 2026
qwen35_draft.cu gained the opt-in DSpine draft kernels (#2633), flashnext_hc.cu shares sum_rn and rms_scale with the same SASS (#2666, #2684), and flashnext/cuda_batch.zig keys disk states by the resolved prompt passes (#2287). test-qwen-serving-host and test-gradient-serving fail on main until the pins follow.
This was referenced Nov 10, 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.
This is the rest of #2131, after #2163 bound saved prompt states to the serving binary and checkpoint stamps. It audits every family that saves prompt states to disk and fixes what #2163 left.
What each owner's key covers is the table in
docs/recipes/persisted-serving-keys.md. It has eight family and backend combinations: Nemotron, dense Qwen, GLM and Flash Next on Metal, and Nemotron, dense Qwen, Qwen MoE and Flash Next on CUDA. Other families have no cross-process disk tier.The gaps this closes
eh_projran on the tile kernel as the load built it.IndexedShardMissing, as the loaders already refuse it.A stale state now misses safely when any of these change. A fresh save's bytes and snapshot layouts don't change. Host tests cover each owner with a gap: a state changed in just that input misses, and a matching one still hits.
What users will see
GLM_EHPROJ_NAXnow accepts only0or1. Other text, which main read as on, is refused at start by name. Blank or unset still means the tile kernel.Still open before this leaves draft
--precision checkpointmath, expert ranks, a ModelOpt lane's half-tile threshold and, with a captured set, the attention variant its--contextpicks. What stays unkeyed, and why, is in the recipe. Host tests miss on each changed value and hit on the same, and three source checks pin Nemotron's wiring.gdn_pipe/gdn_kept. These stay in Flash Next Metal's key until a device bits run shows the two DeltaNet kernels write the same state.