Repository navigation
KV pool: host tier for the core pool (5/8) - #1501
Conversation
c73827f to
d625f19
Compare
|
Thanks @BlivionIaG. This is the tier we hoped for: generic, beside the pool rather than a second pager, with the pool still the only owner of page ids. The random loop, the lockstep digest and the mutants make a good test suite. It doesn't need slices 1 to 4. The last commit cherry-picks cleanly onto main by itself, and there Before it leaves draft:
No family uses the tier yet, so we'd land it together with its first user, off by default: slice 6, as #1419 lists it. Device cells can then check tokens against the device-only pool under eviction, and speed. |
24693fe to
9c628c6
Compare
|
Thanks @BlivionIaG. The latest push looks like it covers both points: a failed fill now One small thing: failedFillReads takes a fault but only runs with none. A mutant As before, we'd land this together with its first user, slice 6, off by default. Could |
79c245f to
cdd541b
Compare
|
Thanks @ashhart. Both points are in the latest push ( Understood on landing it together with slice 6 (#1522), off by default. |
cdd541b to
b1f4a72
Compare
9067782 to
11216f9
Compare
|
Thanks @BlivionIaG. Every earlier ask is answered in the one commit. The pool change is only an optional freed hook (null by default) at the three free-stack pushes, so no other model changes and no family opens a tier yet. It lands together with its first user, #1522, off by default as agreed. Two small asks first: (1) |
5d46d78 to
433e866
Compare
|
Thanks for the rebase @BlivionIaG; the body reads as this change alone now, so that ask is done. One small thing left from our last review: |
|
Update on the disk-backed Linux host run: it finished with a build summary of 21,073 passed, 137 skipped, 2 failed. Both failures are the same |
|
Update: the isolated |
|
I reproduced the train failure on macOS arm64, in a clean trial merge of One integration detail for the paired landing: Igor Lessio - AIFLOW LABS |
|
Pushed the sentinel guard as |
|
The published zig build test-kv-pool test-kv-safety-host -Dcpu=apple_m1 \
-Doptimize=ReleaseSafe -j2 --summary allThat confirms the revised parent on current main. The published #1522 child still needs to carry Igor Lessio - AIFLOW LABS |
|
Thanks @AIFlowML. The retired-marker guard ( Head |
|
Thanks @BlivionIaG. One question before a model family uses this tier: does a reader keep its pin until its device work has finished? If so, evicting a clean retired page after its last unpin is safe. If a reader can unpin earlier, eviction also needs to skip pages whose readers have not settled. A short comment stating the rule would settle it. Two small diagnostic fixes would also help.
|
|
Yes: a reader keeps its pin until its device work ends, and a pinned frame is never a victim (only unpinned, clean frames are: The digest now hashes the dirty flags ( The branch is also merged onto current main ( |
|
Thanks @BlivionIaG. That settles both:
The
|
A Tier beside the Pool for families whose pages are cached on the device from a host store. The pool stays the only owner of page ids and of what is promised; the tier adds a second currency (device frames a stream may pin at once), the page-to-frame mapping, an LRU order, pins for the frames a call reads, a dirty flag so a frame is dropped only once its rows reached the host store, and a generation per frame so a table written before a frame was recycled is told from a current one. A stream can also be lent frames for its life, mapped to no page, for a family that manages them itself. The pool tells the tier when a page loses its last holder. It moves no bytes and uses no device API: the family copies what a miss names, and a snapshot reads canonical rows from the host store. Tests: reservation conservation in both currencies, eviction order, pin rules, lent frames, generation safety, canonical rows, a randomised serving loop that audits the mapping and checks every row read against the last write, two ranks in lockstep (and a step or a lent count taken by one rank caught by the digest), and mutants (no generation, no pin rule, dirty frames unpinned) that the checks fail on. A failed batch unmaps the misses it mapped (their generation moves on), a page is marked dirty only under a pin of the marking lease, a stream cannot end while it holds the last pin of a dirty page, and a family can lend a run of consecutive frames (lendRun).
Avoid indexing tier state with the pool sentinel left by a retired page.
ArrayList.toOwnedSlice remaps in place when it can, so the pack reader's allocation count varied with allocator state and checkAllAllocationFailures reported NondeterministicMemoryUsage. Duplicate the slice so the count is fixed.
- a rank holding an unflushed page it cannot evict no longer matches one that flushed, so the open check sees it
04f1a1c to
85c4167
Compare
|
Thank you @BlivionIaG. 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. |
What this changes
Shared host K/V tier Core. Approved source is frozen at the unchanged commit below; no code, commit, dependency or draft-state change in this audit.
atc overlap --json: ATC0.9.6 was run against upstream with --base fb8fdf3; complete=false (myPullRequestsLimit, otherPullRequestsLimit, pullFilesLimit, pullFilesUnavailable, timeLimit). Supplemental complete snapshot:217foreign open heads,3038 exact local merge comparisons including latest Main ff742df; existing reviewed overlaps are retained, not claimed globally clean. The avoidable added environment-test collision with CUDA (GB10): a lending-daemon source for the display carveout, opt-in #2762 was removed by preserving Main's existing test name, without importing its unmerged feature.Checks on this head
f0a7ee7545976a798f8e848bd854893939cedb0e.Receipt
f0a7ee7545976a798f8e848bd854893939cedb0e; Zig0.17.0; Darwin27.2.0 arm64 CPU only. No GPU or checkpoint loaded for these checks; original checkpoint revisions remain source-bound in the recipes/receipts, not retagged.Remaining maintainer requests
Land together with #1522 off by default only after its device receipts and the maintainer release freeze. Core remains byte-for-byte/commit-for-commit unchanged.
Checklist
Title/description, head and stack agree; older results remain source-bound.
Every new/restored test has a failing-before runtime receipt across all reached platforms. Host evidence is above; missing device gates are not waived.
No newly added overlong/multiline source comments, measurements or review history; inherited findings are reported above.
Complete publication trees/outgoing histories reviewed for public noreply identity, tool trailers and privacy; synthetic detector fixtures and mandatory third-party public contacts are not live secrets. No package/binary upload proposed.
All inference-path/lane-round gates qualified on this head.
Drafted=plain, restored=fresh, concurrent=solo on required devices/settings.
Required precision/reference evidence on this exact head complete.
Decode/prompt no slower than Main at the required widths, greedy and sampled.
Historical source-bound notes — not current-head qualification
Earlier commands/measurements retain their original commit/binary scope. Any earlier readiness or provenance claim is superseded by the open gates above.
Current maintainer follow-up — Unreleased placement and credit
f0a7ee7545976a798f8e848bd854893939cedb0e, still on the agreed upstream qualification pin116a0d4ca41c50cd7c5c632a24bc8411d61a0220. Addresses the latest review: the(#1501)entry is under## Unreleased, not the released1.2.3section, and ends withThanks to @BlivionIaG.Host-tier issue: KV pool: host-RAM tier #1511.CHANGELOG.md. The approved tier implementation, tests and pool hook are byte-identical tob55d2620315fee31b705860e2b7a83703a7d80d0; no API or runtime arithmetic changed.18ecc42d6b3be5c18a26af9ff53acbd1e3922c62succeeded and placed the entry exactly once underUnreleased, with the requested credit. This is integration evidence, not a merge action or an advance of the agreed qualification pin.5c73011c52a1cbc72622b06aa4c2547e7ae0ff97. Landing remains paired with EXL3 Flash Next: host-resident K/V on the tier (6/8) #1522, off by default, after EXL3 Flash Next on CUDA: one rank, offloaded experts, sm_120 gate (1/8) #1441–EXL3 Flash Next: KV pages from the core pool (4/8) #1444; its device/client gate and already-existing runtime-entry integration conflicts are not claimed cleared by this documentation fix.Prior source-pinned checkpoints — preserved, not new-head qualification
Current maintainer follow-up — changelog reference only
b55d2620315fee31b705860e2b7a83703a7d80d0, still based on the agreed upstream pin116a0d4ca41c50cd7c5c632a24bc8411d61a0220. Addresses the latest #1501 review by adding(#1501)to the existing CHANGELOG entry; no implementation or API change.kv_tier.zigandkv_tier_test.zigare byte-identical to approved/rebased5a504efe419dcb3327f766f5c4aea1d6a3b6c298. The real non-test host consumer was run again against this exact head and passed its geometry refusals, dirty-row flush/eviction/refill, stale-ticket and final ownership checks with a clean allocator.5a504e; they are not re-labelled as new-head CI. All seven automatic CI checks have now also completed successfully for this exact documentation-only head; no manual rerun or dispatch was used.63bebd6b272c3413da7a745177b8ecee1630be4b; this standalone documentation change does not invalidate its outstanding device-receipt pin. Landing remains paired with EXL3 Flash Next: host-resident K/V on the tier (6/8) #1522, off by default, after EXL3 Flash Next on CUDA: one rank, offloaded experts, sm_120 gate (1/8) #1441–EXL3 Flash Next: KV pages from the core pool (4/8) #1444 as requested. No merge or qualification waiver is claimed.The following checkpoints and original PR text are preserved as historical, source-pinned evidence.
Current approved-core rebase checkpoint — pinned upstream
116a0d45a504efe419dcb3327f766f5c4aea1d6a3b6c298; base116a0d4ca41c50cd7c5c632a24bc8411d61a0220. This addresses the requestedfreedfield hunk rebase onto the agreed qualification pin; it does not claim coverage of later moving main.ledgernow sits beside it); the tier implementation/API and its tests have exactly the same Git blobs as approved head374d31275faf8cd9113b084b0fa1d560980c3b29.test-kv-pooltarget also passed 5/5 steps, 60/60 tests, including ledger and lane-host admission coverage. An initial direct invocation of a module-wired test lacked its imports; the correct existing build target above passed, and both receipts are retained.myPullRequestsLimit,pullFilesLimit); it is not global clearance.Historical approved body, preserved verbatim
Everything below retains its original source pins and dates; its earlier CI/test statements do not qualify the new head above. The performance-deferral note remains verbatim exactly once.
What this changes
Adds the independent optional host-resident core K/V tier with constructor geometry validation. The approved implementation and tests are preserved through this ancestry-only rebase.
Standalone core host/API gate passed; the full EXL3 integration gate remains pending on #1522. This is the authorized compliance-only rebase/fix pass, not the separate performance/elastic branch.
8094ec962ef03fb43bb879c2dde6e71869869e82; own range8094ec962ef03fb43bb879c2dde6e71869869e82..374d31275faf8cd9113b084b0fa1d560980c3b29.atc overlap --json: run after the final rebase against8094ec962ef03fb43bb879c2dde6e71869869e82; result archived 2026-11-05T00:21:06Z. ATC explicitly reports incomplete coverage (myPullRequestsLimit,pullFilesLimit). A separate fully paginated snapshot covers 188 open PRs / 9,053 file entries. Flagged current-source conflicts with Unlimited-OCR-2 on native Metal: the publisher's BF16 release, page images to structured text #2074/Unlimited-OCR-2 on CUDA: the family's steps on NVIDIA GPUs (sm_89 and up) #2077/glm cuda: TF_GLM_OVERLAP_PIECES defaults to 8 under solo on the wire #2116/fix(drama): report speech admission units without raising context #2143/feat(profile): register GLM's host KV switches and one name lookup for readers #2177 have no new conflict paths beyond pinned main or the previously published owned chain; preserved local proof worktrees are not competing implementations. Unknown ATC comparisons are not claimed clean.Checks on this head
374d31275faf8cd9113b084b0fa1d560980c3b29; base8094ec962ef03fb43bb879c2dde6e71869869e82. Parent scope above distinguishes inherited stack files from this slice.tools/zig/lean_check.pyon base/head and the actualtools/zig/lean_new.pycomparator: 425 inherited / 425 inherited, 0 new. Raw checker exits remain 1; delta comparator exits 0.zig fmt --check build.zig zigpasses on this exact prefix;git diff --checkpasses. All outgoing authors/committers use the approved public noreply identity; no co-author trailers or newly added private host/user paths were found.zig test zig/src/core/kv_tier.zig -lc—49 passed,0 failed,0 skipped.zig run zig/src/core/compliance_tier_runtime.zig -lc—real consumer PASS, dirty/refill/ticket/ownership behavior checked; temporary source removed after archiving. All7 current-head portability/style/release-path/client CI checks passed; exact published SHA read back.Receipt
This is the independent generic core host-tier layer, not a standalone model-serving backend. Its maintainer-approved gate is the pool/Tier host API; the enabled-tier CUDA/model integration gate remains on #1522 and is not waived.
8094ec962ef03fb43bb879c2dde6e71869869e82, head374d31275faf8cd9113b084b0fa1d560980c3b29, Zig0.17.0, macOS arm64 host. GPU/checkpoint/drafter: n/a for this standalone in-memory core layer; EXL3 Flash Next: host-resident K/V on the tier (6/8) #1522 must bind those in its device receipt.The inference checklist is not a claim that this core-only PR served a model; the full chain's integration requirements remain explicitly pending.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.The following deferral is retained verbatim as the project’s scope policy, not as a qualification claim for this pending head.
Performance work is deferred on purpose
This chain lands the architecture first: a working, bit-exact base on upstream main (TP=2 equals TP=1, drafted equals plain, prompt rows equal decode rows, NVFP4 bytes unchanged). The performance optimizations of the origin draft (#1113) are not all ported here. We ported only the ones that are exact and cheap; the rest follow in separate PRs once this base is merged, each with its own byte-equality receipt, so nothing in this chain has to be rewritten.
Known gaps against #1113 on the same hardware (numbers in the tables below): deep prefill is slower than #1113's non-exact version, drafted decode and the expert-line count at 2 streams are below it, and the two-stream prose case with drafts on is slower than plain. Candidates for the follow-ups: tile tuning, overlapping the partial all-reduce with attention, trimming the deep-prefill chunk buffers, a cheaper draft probe.
Historical receipt sections — original head 45623b9; not qualification of 374d312
These preserved sections predate this ref update. Any use of “current head” inside them refers to the original head named above, and any integrated-descendant receipt retains its separately stated source. None is relabelled onto the updated candidate.
Receipt
433e866f9b94b15097d1719a18c381ea4e1fba69, over pinned maind4b48fc497, passed 12/12 scoped steps and 53/53 tests, including the native CUDA cross-check; its fmt and lean checks passed, with 425 inherited lean findings and zero new. All seven expected GitHub checks succeeded on that earlier head, including Windows and macOS devtools (run); those are not current-head CI receipts.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false: n/a, nothing serves tokens through the tier in this PR; the unit tests check host pages, frame residency and generations against the pool.tools/bench_openai.py: n/a, the tier is off by default and nothing calls it in this PR.45623b99749103ecc181de35a20b5c29eb711adbpassedtest-kv-pool: 5/5 build steps and 55/55 tests. An independent non-test API executable also rejected all five invalid geometries with no allocation capacity, then exercised actual reserve, pin, eviction, stale-ticket rejection and refill. The native CUDA cross-check above belongs to the earlier head and was not repeated for this entry.Constructor review follow-up — 2026-11-04
Addressed the constructor request in
45623b99749103ecc181de35a20b5c29eb711adb:Tier.initrefuses zero page bytes, a host length not divisible by page bytes, zero frames and zero logical pages before allocator access.zig build test-kv-pool --summary all: 5/5 build steps; 55/55 tests passed.BadTierGeometrywith no allocation available; the smallest valid tier was leased, pinned, unpinned and fully released.zig fmt --checkpassed on both changed Zig files.These are core-library receipts, not a CUDA/model qualification claim. The host-tier backend remains paired with #1522 and off by default; older device receipts retain their original source identities.