Repository navigation
native cuda: TF_KV_SHARE=n keeps a paged family's prompts as its core pool's pages in one prompt_radix store (Kolibri-1 first) - #1755
Conversation
|
Thanks @jschmied. The share receipts are strong: 76 kept states against 24 at 4 GiB, and 81,920 cached tokens against 3,479 at 1 GiB, with every turn equal. Since #1756 put the adapter on main, this PR is now Kolibri's wiring on top of #1620. When you restack: 1. Drop the adapter commit. Main has it ( Then we'll run both on our GB10s and take them together. |
ad7d549 to
d8b9d83
Compare
|
Thanks @ashhart. Both are restacked on main 1. Restack. The adapter commit is dropped (main's 2. #1620 against main, decode sweep (GB10, Kolibri-1, 4 ABBA rounds, 8 fresh servers per arm, % delta of the medians, PR vs main). 64 streams don't fit on this box in either arm: at
At 4 streams that is −0.20/−0.13/−0.40/−0.18, against about −0.4 % in your 31 Oct table (on #1619) and 0.6–2.1 % when it was parked. 3. #1657's gates with
One thing I haven't explained yet: at share 256 and 4 GiB the store holds 324 pages (6,280 MiB), more than the 4 GiB copy budget. The pool is 673 pages with share on, against 264 without, and its idle census stays even. So the share store seems to be bounded by the pool and the state cap, not by the copy budget. Do you want the share store held to the same byte budget? The receipts and tools are local; I can attach any of them. |
|
@jschmied, an apology and a plan. While your #1620 and #1755 were waiting on us, one of our helpers built the same Kolibri-1 store wiring as our own PR #1891. Before that, the same happened for Gemma 4 with #1883, which landed tonight beside your #1619. That's our coordination slip, not yours: your PRs came first. What we found comparing them: #1755's Kolibri commit and #1891 are two implementations of the same wiring (the same So we're closing #1891 in favour of yours. #1620 now add/add-conflicts with #1883 on |
|
Thanks, and no harm done. Please go ahead and rebase #1619, #1620 and #1755 onto current main yourselves. Post the branches, and I'll check each against its PR's head: the same changes, nothing from #1883 or #1891 lost or doubled up on |
|
@jschmied, the three rebases are up, on main
Build means #1620 and #1755 replayed cleanly. Patches are identical except one context line in #1619 is where the judgment was. #1883 already contains most of its Gemma paging, built from the same lines, so #1619 shrinks to what main lacks:
Please check these in particular:
If they match your PRs, push them to your branches (or say so, and we'll update the PRs ourselves). We'll run each on our GB10 against main before landing. |
d8b9d83 to
f5f3f93
Compare
|
Thanks for doing the rebases. I've checked them and pushed them to the three PRs: #1619 at Against our heads: On our GB10 (
On your point 3: the tip is fine. I didn't bisect the two intermediate commits. One gap in the test, not a regression. Gates on each tip: lean 0 new, |
|
@jschmied, our GB10 runs for the Kolibri-1 part of your stack are in, both on
Since the store is opt-in, that doesn't hold the stack back. Could you say whether the 2K decode cost is expected, for example from the pool lookup on each step, or something to shave? And add a line to the docs so users who turn it on know. Gemma 4's run is next. |
|
Thanks @ashhart. I measured it on a GB10 with Kolibri-1, at this head. It's a prompt-side cost, not a per-step one: decode doesn't change with the store on.
So it's expected given the page size. It could be shaved by letting the store keep a short tail below a page, so a shared start of a few dozen tokens still hits. That would be a follow-up. For now I've added the line to |
2274a43 to
6b5bb30
Compare
|
Restacked on #1620's rebased head
Checks on 6b5bb30 (GB10): lean 424 on the base, 424 on the head, 0 new; |
6b5bb30 to
004ee4f
Compare
…state's rings in store-held pages With the shared store a prompt pass begins at the store's resume point: the matched pages adopted into the stream's lease, its sliding rings restored there from the kept state. Chunks cut at the store's marks (page edges, 512 tokens); at each the store takes the pages it lacks, the stream's copies swapped for the tree's, and the state's rings go into pool pages the store holds (snap_bytes counts those). Unset: as before. tf-cuda-test kolibri-pages with TF_KV_SHARE=4 resumes a kept prompt plain and drafted, equal to linear.
…its sub-page shared start
004ee4f to
ea9bb38
Compare
|
Thank you @jschmied. 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. |
|
Thanks @jschmied! This is in TensorFold 1.2.3, out now: https://github.com/ashhart/TensorFold/releases/tag/v1.2.3 |
Part of #1657: the native-CUDA adapter over
prompt_radix, off by default, with Kolibri-1 as its first user. Stacked on #1659 (merged) and on #1620.Stacking. Based on #1620 at
9d8079414(rebased onto main 14c907b). The first four commits are #1620's; the last two are this PR:native cuda: TF_KV_SHARE=n ...is the adapter, the same commit as in spark25 cuda: TF_KV_SHARE keeps prompts as the pool's pages in the prompt_radix store (on #1653) #1756 (Spark2.5, now directly on main since spark25 CUDA: the full layers' caches in pages of the core pool, every stream leasing; sliding layers keep their rings #1653 landed). Whichever PR lands first carries the adapter.kolibri1 cuda: ...is the family wiring.What it does
TF_KV_SHARE=nturns it on for a family on the core pool that declaresshare_poolandshare_attach. That family gets oneprompt_radix.Storeover its pool (native/cuda_prompt_pages.zig).snap_*decls supply the state past a page edge, andncaps those states.prompt_cachestore, and the cache budget becomes pool pages.core/kv_prompts.zig:begin: the resume point, adopted pages and the planned grid's marks;keepat each mark;report.Pool.hold).holdasks the store to reclaim first, aspromisedoes.Gates (GB10, Kolibri-1)
tf-cuda-test kolibri-pages, final binaryTF_KV_SHARE=4: PASS twice (and once more on the head before the rebase onto today's main), resume at 1024 plain and drafted, reply and logits same as linear. Unset: PASSv.sh(lean 0 new,zig build test, CI set, diff-check)Share misses are the first turns: the system prompt is shorter than one 512-token page.
Default path (
TF_KV_SHAREunset,--prompt-cache-gib 0). Base (the stack without these two commits) vs this head, fresh server per arm, ABBA over 2 rounds (4 at 4 streams), aggregate tok/s, greedy token_sha equal in every cell:The default path runs no new code in the step: the store is absent and the branches are on
prompts == null.Left. Gemma 4 wiring, after #1619.