Repository navigation
Conversation
875c056 to
34f66f3
Compare
|
Rebased onto main ( |
|
Thanks @jschmied for the clean rebase. We read the two commits. |
|
Thanks @ashhart. Here are the M3 Pro checks rerun on Where this run differs from the body
Gates
ABBA speed, share against main: medians of 4 servers per arm, 3 repeats each.
Since this Mac runs under daily load, a run on your M3 or M5 Ultra would give cleaner speed numbers and the copy-store comparison. We'd gladly take your offer. |
|
Thanks @jschmied, that's a thorough rerun: every reply byte-equal, every gate green, and the three numbers that moved explained by the box's state, not the code. We'll take the Mac run you suggested: on our M3 or M5 Ultra, on this head, flag off against main, |
|
Thanks @jschmied. Here's the Mac run on an M5 Ultra with Nemotron 3.5 Lightning 30B-A3B MLX 4-bit, balanced order, against main:
All three read level. On both One correction to what we said we'd run: these arms used 1 and 8, not the 4 you suggested, and this table doesn't report the cached-token counts or the cap-8 round robin separately. It answers the question that matters for landing, that the flag off and on costs nothing here. This is queued to land, and our prep will carry the one-line rebase around |
34f66f3 to
c2854c9
Compare
|
Thanks @jschmied. Main has moved under this one. Nemotron's prompt loop now cuts its chunks in |
c2854c9 to
96cec73
Compare
|
Thanks @ashhart. All done on
Lean checker 210 and 210, new findings 0. Nemotron Metal host tests on the rebased head (Apple M3 Pro, Zig 0.17.0). The counts are from the first run on the rebased tree; since then only the new test's name changed, and the rerun on |
|
Thanks @jschmied. The cut now sits in |
96cec73 to
2e5cd2c
Compare
|
Thanks @ashhart. All three are on
|
|
Thanks @jschmied. Here are the two missing cells on the rebased head 96cec73, against its main parent c3f64ca, on an M5 Ultra with Nemotron 3.5 Lightning 30B-A3B MLX 4-bit.
Every tested reply's token IDs and text equal its fresh run and the other store's reply. Per-request cached tokens are in cached-tokens.tsv. The functional cells used greedy sampling and draft:false. The server reported 8192-row chunks, so these prompts were longer than that grid. Cap 8: 12 conversations, 12 hits, 20 evictions; the state count reached 8 and never exceeded it. All 40 replies equal fresh. 112 idle census lines satisfy free + kept == total. The counters do not distinguish page-pressure reclaim from state-cap eviction; we did not force pressure. With TF_KV_SHARE unset, warm/base/new/new/base, first process excluded:
All 192 cross-arm prompt/reply keys match. The full report includes both process medians per arm and all speed findings. TF_NEMOTRON_METAL_KV_PAGES=1 was enabled throughout. Share-enabled concurrency/drafting and forced-pressure cases remain unchecked on this head. No source changes or public post were made. These ran on |
|
@jschmied, this was in tonight's landing train, but on today's main it takes |
2e5cd2c to
3dca2b1
Compare
|
Thanks @ashhart. Done on
|
|
Thank you @jschmied. The port onto today's main kept your four commits under your name and wired the KV-share pass into stepped Nemotron prefill, with the new stepped-pass test. The build shims still export safetensors and now add kv_pool and kv_prompts, so the SAM3 work can keep torch_checkpoint beside them. The earlier GB10 and M5 Ultra runs were green with identical tokens, and the default path is unchanged with the option unset. Nothing is left for you to change, only the
|
5a9d4a3 to
3b0fdc3
Compare
# Conflicts: # CHANGELOG.md -- 2.54.0 (Apple Git-157) -- 2.43.0
) Port of ashhart#1850 onto main's prefill_metal.zig and prefill_steps.zig: Ops.open begins the store's pass before the cache opens (its held pages less the lane's promise) and resumes on the adopted pages before the host cache's restore; the pass lives per stream across prefill_step calls, its marks cut the chunks, and it ends ok on finish and not ok on error, cancel and Steps.forget. kv_prompts takes a Query now: .of(s.prompt()). Rebase notes on jschmied's 7e98a79: its hunks in backend.zig's old prefillFn are carried here instead (main moved that loop out in ashhart#3021), its traceLessons move to slide.zig is dropped (main has it in prefill_metal.zig), and metal.zig takes modelContext from cuda_window.zig with metal_shared.zig's copy removed, as the branch's merge of ashhart#2425 did.
|
On The same command passed 103/103 on that resolved tree, including the paged Metal fixtures. This uses synthetic KV/device fixtures and host residency tests. I did not rerun the release-checkpoint timing or token parity tests. Igor Lessio - AIFLOW LABS |
) Port of ashhart#1850 onto main's prefill_metal.zig and prefill_steps.zig: Ops.open begins the store's pass before the cache opens (its held pages less the lane's promise) and resumes on the adopted pages before the host cache's restore; the pass lives per stream across prefill_step calls, its marks cut the chunks, and it ends ok on finish and not ok on error, cancel and Steps.forget. kv_prompts takes a Query now: .of(s.prompt()). Rebase notes on jschmied's 7e98a79: its hunks in backend.zig's old prefillFn are carried here instead (main moved that loop out in ashhart#3021), its traceLessons move to slide.zig is dropped (main has it in prefill_metal.zig), and metal.zig takes modelContext from cuda_window.zig with metal_shared.zig's copy removed, as the branch's merge of ashhart#2425 did.
3b0fdc3 to
3e09d94
Compare
|
The latest On M5 Max with Zig 0.17.0, the KV page and residency targets passed all 104 tests. The stepped prefill and cut-width targets passed all 15 tests, and the native Metal server built. That includes the stepped-pass fixture that stops at each store mark and returns adopted pages on cancellation. zig build test-metal-kv-pages test-metal-residency-host -Dcpu=apple_m1 -j2 --summary all
zig build test-nemotron-metal-steps-host test-nemotron-prefill-widths-host native \
-Dcpu=apple_m1 -Doptimize=ReleaseSafe -j2 --summary allThe release-checkpoint token parity and timing results remain tied to the earlier device receipts. Igor Lessio - AIFLOW LABS |
… names kv_pool and kv_prompts
…ashhart#1293) The core prompt_radix store over the Nemotron pool, opened through the CUDA adapter. A kept state is its Mamba states (Snap.pages); its rows stay in pages a later stream adopts. Marks lie on the prompt chunk grid, so a resume's chunk seams are a cold pass's. Unset or 0: the host prompt cache as before. The store's marks end chunks in prompt_flight.rows, where the prompt loop cuts them. metal.zig reads the model's window with cuda_window's modelContext instead of its own copy.
…s, as the --learn-conversations refusal does
…e core adapter, so metal.zig stays under 600 lines
) Port of ashhart#1850 onto main's prefill_metal.zig and prefill_steps.zig: Ops.open begins the store's pass before the cache opens (its held pages less the lane's promise) and resumes on the adopted pages before the host cache's restore; the pass lives per stream across prefill_step calls, its marks cut the chunks, and it ends ok on finish and not ok on error, cancel and Steps.forget. kv_prompts takes a Query now: .of(s.prompt()). Rebase notes on jschmied's 7e98a79: its hunks in backend.zig's old prefillFn are carried here instead (main moved that loop out in ashhart#3021), its traceLessons move to slide.zig is dropped (main has it in prefill_metal.zig), and metal.zig takes modelContext from cuda_window.zig with metal_shared.zig's copy removed, as the branch's merge of ashhart#2425 did.
… so metal.zig stays within 600 lines With this PR's prompt-page store on today's main, zig/src/native/metal.zig reached 609 lines. ownsQwen27, qwen27Context, Qwen27Budget, qwen27_margin and qwen27Budget move unchanged into metal_qwen27.zig, as main splits metal_admit.zig and metal_spill.zig; metal.zig keeps the same names as aliases, so callers and info's @hasDecl check are unchanged. No behaviour change.
… main git's auto-merge of 'TF_KV_SHARE's prompt pass on main's stepped pass' kept the PR's ops.end(s, false) in retain but main's retain(b, s, at) signature, leaving ops undeclared; both callers pass it again.
3e09d94 to
a2a725b
Compare
|
Thanks @jschmied. The shared-page design looks carefully integrated. I found two issues to address before merge. The slide Metal host target still generates its core shim without the KV pool and prompt-hook exports now required by the shared-page adapter, so that host test target will fail to compile. Please mirror the exports already added to the other Metal shim. The new shared prompt pass also resumes untaught streams from ordinary taught snapshots. With learned neurons active, that gives an untaught request state it could not produce from a fresh pass. Please bypass shared resume and keep for untaught streams, and add a regression covering taught-prefix-then-untaught reuse.
|
…slide Metal host shim exports the pool An untaught stream reads the model as shipped, so a taught prompt's kept state is not one it could reach: its pass neither resumes from the store nor keeps at its marks. test-nemotron-metal-share-host covers a taught prefix then an untaught reuse of it, with a taught control that does resume. test-slide-metal-host's core shim gets kv_pool and kv_prompts, as the drama3 and residency shims have.
|
Thanks. Both are fixed on
|
|
Thanks @jschmied. Both requested fixes are present by source: the slide Metal host shim now exports Three shared-store integration issues still need changes:
Main has also moved since your last push, and the change that passes After these repairs, please rerun the focused slide, shared-page and stepped-prefill host steps and add coverage for the three integration paths above.
|
…--learn with it is refused A lane host's Disk now names the shared radix store (host.disk.shared) where the family keeps prompts as pool pages: a Sliding Weights step that moves weights clears it as it clears the host cache, a flush drops its states and pages instead of answering 501, and where/load asks read its RAM resume. prompt_radix.Store.clear drops every state and page. The Metal and CUDA hosts set it beside their adapter. TF_KV_SHARE with --learn or --learn-conversations on Nemotron Metal is now refused by name before any load (core kv_prompts.learnRefusal, shared with the CUDA host).
|
Thanks @ashhart. All three are fixed on
Planted controls, each red before green: without the clear in Verified on Linux: |
|
Thanks @jschmied. The shim and untaught-stream fixes remain present. Changed weights now clear the shared store, flushes and queries reach it, and the unsupported persistent-learning combinations are refused before load. The new controls cover those requests. We will carry the atomic closing and tied-head changes through integration. Current integrated shared-cache/default reply and timing qualification remains separate from the earlier device receipts.
|
Part of #1293 (step 4). On main (#1837 has landed); this PR's change is its two commits,
ab9c1ea88and34f66f309. Headf22a537e9canswers the second review: the shared store is cleared when weights move, flushes and imprint asks reach it, andTF_KV_SHAREwith--learnis refused.161e74387eanswered the first review: untaught streams bypass the store, and the slide Metal host shim exports the pool. The M3 Pro checks of the first version are in the rerun, where three numbers differ from the ones below under memory pressure.With
TF_KV_SHARE=n, Nemotron on Metal keeps prompt states in the coreprompt_radixstore over the Nemotron KV pool, as CUDA does since #1756. Unset or 0: the host prompt cache as before.What changes
efc4cdc07: a Metal lane can adopt a kept prompt's pages. The engines'corere-exportstensorfold.kv_pool, so Metal and CUDA use the samePooltype, and main'scuda_prompt_pagesadapter is used as is.875c05684: a kept state holds only Nemotron's Mamba states (Snap.pages). Its attention rows stay in the pool pages a later stream adopts, so a shared prefix is held once.Checks (M3 Pro)
zig build test test-metal-kv-pages test-native: 590/590 steps, 1,312/1,336 tests (24 skipped); contract nemotron: 63 pass gates 1-4 with 1 known finding (main's experts relu2), 29/29 controls red as planted, limits 0 problems.Untaught streams (
22f9a28d6)prompt_pages.zigPass.begin).test-nemotron-metal-share-host(zig/src/nemotron_prompt_pages_test.zig): a taught pass keeps 256 rows, the same prompt untaught adopts no pages, gets no state and no marks, and a taught control does resume at 256. Planted control: with the bypass line removed it fails at line 89 (!u.on); with it, green.test-slide-metal-host: its core shim getskv_poolandkv_prompts, as the drama3 and residency shims. Checked by an aarch64-macos cross analysis of that test (no link): ata2a725b8dit fails oncuda_prompt_pages.zig:8(nokv_prompts), at22f9a28d6it passes.test-slide-metal-host,test-nemotron-metal-share-hostandtest-nemotron-metal-steps-hostpass on22f9a28d6(16/16 steps, 27/27 tests). On the parenta2a725b8d,test-slide-metal-hostfails to compile:cuda_prompt_pages.zig:8:19: root source file struct 'slide-drama-core' has no member named 'kv_prompts'.22f9a28d60(the same code; the head161e74387eonly folds a two-line comment into one): 2449/2449 steps, 24674/24831 tests (157 skipped),check-native-cuda-host compile-cuda-tests17/17,zig fmt --checkclean. Its one finding was that comment (lean 166 vs 165); on161e74387e, lean is 165 vs 165 andpr_checkreports 0 errorsShared store integration (
f22a537e9c)disk.sharednames theprompt_radixstore a family keeps on pool pages.lane_host_learn.stepclears it when a Sliding Weights step reports changed weights, as it clearsh.cache.lane_host_rowstakes a flush when either store exists (no 501), and answers flush and the other imprint asks from the shared store when there is no host cache.prompt_radix.Store.cleardrops every state and releases the tree's pages. Metal and CUDA setdisk.sharednext to their adapter (metal.zig,cuda_startup_phase.zig).TF_KV_SHAREwith--learnor--learn-conversationson Nemotron Metal is refused by name before any load, so no store, imprint or learned folder is opened. The text is corekv_prompts.learnRefusal, which the CUDA host's--learn-conversationsrefusal now uses too.zig/src/core/lane_host_shared_test.zig(intest-lane-api-host): a retained state survives an unchanged learn step (control) and is gone after a changed step, with its pages back in the pool; a flush without a host cache drops 1 state and 3 bytes, and with no store it is still 501 (control). Planted controls: without the clear inlane_host_learn.zig, the changed-step test fails; with the oldh.cache == nullflush check, the flush test fails.metal_slide_test.zig(intest-slide-metal-host): the refusal by name for both learn options, no learned folder, and a control withoutTF_KV_SHAREthat reaches the load and fails there.test-nemotron-metal-share-host test-nemotron-metal-steps-host test-lane-api-host test-kv-pool test-cache-replay-host test-gemma4-shared-host21/21 steps, 811/811 tests; aarch64-macos cross analysis oftest-slide-metal-hostclean;zig fmt --checkclean.pr_check0 errors, lean 0 new. Full CI set on x86 atf22a537e9c: green, 2449/2449 steps, 25258/25418 tests (160 skipped), lean 165 vs 165 (0 new). Mac (M3 Pro): planted5d5a16181fred on exactly the --learn refusal test;f22a537e9c19/19 steps, 781/781 tests ontest-slide-metal-host test-nemotron-metal-share-host test-nemotron-metal-steps-host test-lane-api-host.Proposed CHANGELOG line: Metal Nemotron:
TF_KV_SHARE=nkeeps prompt states as core pool pages; untaught requests bypass it, moved weights and flushes clear it, and--learnwith it is refused.