Repository navigation
Conversation
3e0e9bc to
f790014
Compare
aefb063 to
c41911e
Compare
|
Sorry for the noise: this was closed automatically when #4387 landed on main and its base branch was removed. It is reopened and now targets
|
2e0f59e to
6ac6cb3
Compare
|
Thank you @gilby. Main already retains the head-major target snapshot fix. Two issues remain in this slice: its drafter loads chain kernels that the standalone tree does not provide, and snapshot saving drops the byte offset of a shared tail-tap row, so a later stream can save the first stream's row instead. Please keep the snapshot change independent or supply its complete dependency, and preserve the tail view's offset with a non-first-stream restore check.
|
6ac6cb3 to
c12c6ab
Compare
c12c6ab to
305f2e0
Compare
|
Both review items from your previous comment are now addressed on
|
|
Thanks @gilby. Both earlier issues are closed: this is now an independent snapshot change, and the shared tail view’s byte offset is preserved and checked. The new copy tests and reported non-first-stream concurrent restores cover the missing case. The M3 shader overlay is clearly identified as a limit on that receipt. This head merges cleanly and is ready to land through the normal final-tree checks. The target snapshot fix already on main remains separate from this drafter-state improvement.
|
|
I checked the landing interaction with the other Inkling changes. On zig build test-inkling2-metal-host test-inkling2-host test-inkling2-metal-capabilities -Dfixed-cpu -j2 --summary allThe combined tree passed 158 tests with ten skips on the M5 Max, with all 71 build steps successful. That includes the non-first-stream snapshot copy and Metal capability checks. The combined checkpoint-backed serving run remains unverified. Igor Lessio - AIFLOW LABS |
What this changes
Before: on Inkling 2 Mini on Metal with
--drafter, prompt-cache snapshots only saved target KV state, so warm prompt-cache hits dropped DSpark context (lane.fromreset to0) or risked reading another stream's shared tail-tap row at offset0. After: rebased standalone ontomain(head-major target KV snapshot fix is already onmain, with no external chain-kernel dependencies),dspark_state.Snap+dspark.resolveTailTap+backend.SavedSnapcompactly snapshot and restore each stream's DSpark K/V rings,newestfused row, and exact non-first-streamtail_offtap offset with stale-generation and bounds checks, plus rollback resets on restore failure.main(3795e6054c), 1 commit (305f2e02de, 4 changed files).atc overlap --json: Checked againstmain(0open-PR conflicts acrossbackend.zig,dspark.zig,dspark_state.zig,native/inkling2.zig).Checks on this head
305f2e02detools/pr_check.py --pr 4542:lean 165 vs 165, 0 new,4 changed files,0 error(s).305f2e02de, Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast):zig fmt --check build.zig zigandgit diff --check origin/main..HEAD— exit0.zig build test-inkling2-metal-host test-inkling2-host --summary all(Apple M5 Max):8/8 steps succeeded; 148/158 tests passed (10 skipped)(test-inkling2-host45 pass, 4 skip;test-inkling2-metal-host103 pass, 6 skip, includingresolveTailTap preserves non-first-stream tap offset and validates generation and boundsandDSpark snapshot preserves non-first-stream tail tap byte offset and rejects out-of-range offsets).tf-kernel-contract --only "metal inkling2":SUMMARY 61 kernels: 61 pass gates 1-4, 0 fail, 0 known findings; 65 controls: 65 red as planted, 0 missed; 0 limit problems(gates 9312 ms, limits 395 ms).threadqualifier overlay on pre-existingprompt_attention.metallines 11 and 15 for Metal 3):SUMMARY 61 kernels: 61 pass gates 1-4, 0 fail, 0 known findings; 66 controls: 66 red as planted, 0 missed; 0 limit problems(gates 11456 ms, limits 97 ms).305f2e02de.Receipt
main(a19197631f/3795e6054c) against branch (305f2e02de) onInkling-2-Mini(ed40e7da625f594fc9c4990f5f66be24873c22d7),--parallel 4 --context 8192 --prompt-cache-gib 16,T=0.0, verifying single-stream 3-turn + branching chat AND concurrent 2-stream (c=2) non-first-stream (slot >= 1) warm save & restore against cold--no-draftsbaseline:base_plain,new_plain,new_drafterallall_sha_match=True,all_warm_hits=True):t1prompt=1185->t2prompt=1200-> branchedt3prompt=1202):t1(cached=0):sha=e4a37eb322a0,ttft=12.886s,accepted=18/28,22.9 tok/st2(cached=1174):sha=c8a9d32679df(100% bit-identical to cold--no-drafts),ttft=0.328s(39.3xfaster TTFT),accepted=18/26,23.3 tok/st3(cached=1174):sha=bd9b86e1fc2d(100% bit-identical to cold--no-drafts),ttft=0.348s(37.2xfaster TTFT vs coldt3),accepted=17/27,21.7 tok/sslotA1395->1412,slotB1473->1489):slotA.t2(cached=1386):sha=ee4178bda92a(exact match),prefill=0.327s,accepted=21/64slotB.t2(cached=1461):sha=1a8e6495980e(exact match),ttft=0.349s,accepted=21/66/v1/chat/completions(--context 16384):t1(6632,cached=0,ttft=73.046s,accepted=19/39) ->t2(6646,cached=6619,ttft=0.375s,194.8xfaster TTFT,accepted=20/37,18.4 tok/s, exactsha=a4a25beb2197) ->t3(6646,cached=6619,ttft=0.375s,accepted=20/37,18.4 tok/s, exactsha=55c9d992a9bf).Metal 3, symmetric 2-linethreadqualifier overlay on pre-existingprompt_attention.metallines 11 and 15;base_plain,new_plain,new_drafterallall_sha_match=True,all_warm_hits=True):t1prompt=1185->t2prompt=1200->t3prompt=1202):t1(cached=0):sha=2ed647ae1997,ttft=29.349s,accepted=20/27,18.2 tok/st2(cached=1174):sha=c8a9d32679df(100% bit-identical to cold--no-drafts),ttft=0.661s(44.4xfaster TTFT),accepted=18/26,16.4 tok/st3(cached=1174):sha=aca91013de0b(100% bit-identical to cold--no-drafts),ttft=0.706s(39.1xfaster TTFT),accepted=16/25,14.9 tok/sslotA1395->1412,slotB1473->1489):slotA.t2(cached=1386):sha=7da1cb791ff2(exact match),prefill=0.661s,accepted=21/70slotB.t2(cached=1461):sha=a57ccadeca5a(exact match),ttft=0.707s,accepted=20/70inkling2Metalbackend.zig,dspark.zig,dspark_state.zig,native/inkling2.zig.305f2e02deonmain(3795e6054c), Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast, Apple M5 Max / Apple M5 Ultra 512 GiB / Apple M3 Ultra 512 GiB,Inkling-2-Minied40e7da625f594fc9c4990f5f66be24873c22d7.inkling2prompt cache save/restore (plain and--drafter) across single-stream and concurrent streams.100%token_sha256equality across cold--no-drafts,base_plain,new_plain, andnew_drafterfor single-stream, branched, and concurrentc=2non-first-stream save & restore on both M5 Ultra and M3 Ultra. (Note raw/v1/completionstools/bench_cache.pykeeps0states by design becauseinkling2uses.grid = st.prompt_rows,.tail = false,.repeat_min = 0.)21.7–23.3 tok/son M5 Ultra vs14.6 tok/splain;14.9–16.4 tok/son M3 Ultra vs10.8 tok/splain)./v1/chat/completionsTTFT12.886s -> 0.328s(~1.2K) /73.046s -> 0.375s(6.6K) on M5 Ultra, and29.349s -> 0.661s(~1.2K) on M3 Ultra.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.