Repository navigation
Conversation
|
I independently trial-merged zig build test-inkling2-host test-inkling2-metal-host test-inkling2-launch-map-host \
compile-inkling2-native-host -Dfixed-cpu -j2 --summary allThe #5020 Q4 change also fits with this head once its new shader keeps the 256-thread reservation. I posted that independent current-main finding on #5020. I ran the host fixtures here. The optional checkpoint-backed cells and served throughput were outside this run. Igor Lessio - AIFLOW LABS |
2926de5 to
d6e6286
Compare
|
Thanks @gilby. The target forward, verification, sampling and cache operations stay unchanged in source, and copied tokens still pass through target verification. This looks ready for a controlled comparison, including positive copy activity, plain/drafted equality and warm-cache checks. Please correct the baseline description: Model already defaults copy_drafts to true, and DSpark already sets copy_first. This head explicitly wires the drafts switch and changes the plain and DSpark match thresholds. The separate DSpark thread-guard fix is needed for its current load path.
|
|
Updated the PR description to reflect the
|
|
@gilby, our A/Bs of
Our bar is no slower cell, so this can't land yet. Our guess is that the prompt-copy drafts cost more on M3's slower verify than they win back after a long prompt. Could you look at whether the copy thresholds should depend on the measured verify cost, or skip copy drafting where it doesn't pay, so M3 stays at main's speed? We'll rerun both Macs on the next head.
|
…and keep DSpark copy_match=12 Refs ashhart#4961
d6e6286 to
f95bc47
Compare
|
Updated Root Cause & Fix
Interleaved A-B-B-A Verification (
|
| Cell | origin/main (A1/A2) |
#5023 (B1/B2) |
Delta | Cross Mismatches |
|---|---|---|---|---|
2,070-tok prompt -> 128-tok decode (c=1, T=0) |
20.03 tok/s (20.04, 20.00, 19.85, 20.22) |
20.14 tok/s (20.08, 20.02, 20.19, 20.26) |
+0.55% |
0 |
code T=0 c=1 |
27.35 tok/s |
27.35 tok/s |
0.00% |
0 |
code T=0 c=4 |
41.65 tok/s |
41.75 tok/s |
+0.24% |
0 |
chat T=0 c=1 |
27.55 tok/s |
27.65 tok/s |
+0.36% |
0 |
chat T=0 c=4 |
43.50 tok/s |
43.35 tok/s |
-0.34% |
0 |
code T=1 c=1 |
28.20 tok/s |
28.40 tok/s |
+0.71% |
0 |
code T=1 c=4 |
42.15 tok/s |
42.05 tok/s |
-0.24% |
0 |
chat T=1 c=1 |
27.70 tok/s |
27.65 tok/s |
-0.18% |
0 |
chat T=1 c=4 |
43.65 tok/s |
43.60 tok/s |
-0.11% |
0 |
edit (c=1, T=0) |
26.90 tok/s |
26.95 tok/s |
+0.19% |
0 |
Apple M5 Ultra 512 GiB
| Cell | origin/main (A1/A2) |
#5023 (B1/B2) |
Delta | Cross Mismatches |
|---|---|---|---|---|
2,070-tok prompt -> 128-tok decode (c=1, T=0) |
26.75 tok/s |
26.81 tok/s |
+0.22% |
0 |
code T=0 c=1 |
35.80 tok/s |
36.20 tok/s |
+1.12% |
0 |
code T=0 c=4 |
55.45 tok/s |
55.70 tok/s |
+0.45% |
0 |
chat T=0 c=1 |
36.05 tok/s |
36.35 tok/s |
+0.83% |
0 |
chat T=0 c=4 |
57.55 tok/s |
57.55 tok/s |
0.00% |
0 |
code T=1 c=1 |
36.55 tok/s |
36.55 tok/s |
0.00% |
0 |
code T=1 c=4 |
55.45 tok/s |
55.60 tok/s |
+0.27% |
0 |
chat T=1 c=1 |
36.10 tok/s |
36.45 tok/s |
+0.97% |
0 |
chat T=1 c=4 |
57.55 tok/s |
57.45 tok/s |
-0.17% |
0 |
edit (c=1, T=0, plain) |
36.05 tok/s |
35.80 tok/s |
-0.69% |
0 |
edit (c=1, T=0, --drafter DSpark) |
43.85 tok/s |
44.25 tok/s |
+0.91% |
0 |
Host & Lint Checks
zig fmt --check build.zig zig&git diff --check: cleanpython3 tools/pr_check.py --base origin/main --pr 5023:0errors (7files,0new lean,0new import cycle edges)zig build test-inkling2-host test-shared-lane-regressions-host -Dcpu=apple_m1:568/573passed (47 pass, 4 skipinkling2 host;521 pass, 1 skipshared lane regressions).
|
Thanks @gilby. We re-checked the latest head and found no correctness problem in the production path, so it's clear for our Mac device runs. One gap in the test: the checkpoint parity test can pass without any copy drafting happening. Please make it assert a positive drafted/accepted copy count, so it can't go green with SuffixLookup idle. We'll include copy-heavy cells and a warm prompt-cache case in the device run.
|
|
Updated
|
|
Thank you for adding the positive copy-activity assertions and the separate zero-count controls. The latest head merges cleanly with current main. The earlier source asks are now covered: the baseline description is corrected, the measured verify-cost guards and shared-cost measurements are present, and checkpoint parity now requires both positive drafted and accepted counts. The new controls can fail when either count stays zero. We found no new production correctness problem in the static re-check. The remaining work is the device comparison on the latest head. We still need M3 and M5 results for the long-prompt and sampled four-stream regressions, copy-heavy cells, and a warm prompt-cache second turn. The real-checkpoint parity test also needs to execute rather than skip. Each copy-heavy run should show positive activity, exact plain/drafted output, and no slower cell. Thank you for closing the test gap cleanly.
|
|
Thank you @gilby. We ran this on an M3 Ultra with Inkling 2 Mini, main against this head, two runs each in the order base, new, new, base.
So on these prompts the change costs about 2.6% on a first prompt and gains nothing elsewhere. Default-on behaviour has to be at least as fast everywhere. Could you either keep the lookup's setup off the first prompt's critical path, or make the copy drafting opt-in, and show the prompts where it wins (for example long code with repeated spans) with tokens and timings against main? Either way the exactness result above holds.
|
What this changes
Before: on
main,lanes.Modelalready defaults.copy_drafts = true(with.copy_match = 8) anddspark.Drafter.factsFn()already sets.copy_first = true; however,backend.Metal.facts()did not wire the CLI--drafts/--no-draftsswitch throughbackend.Optionsor lower the plain threshold to.copy_match = 4, anddspark.Drafter.factsFn()kept the default match threshold rather than explicitly setting.copy_match = 12.After:
zig/src/families/inkling2/metal/backend.zig: Plumbsdrafts: bool = truethroughOptions, wiring.copy_drafts = self.options.draftsto thedraftsswitch and setting plain.copy_match = if (self.options.drafts) 4 else 8inMetal.facts().zig/src/families/inkling2/metal/dspark.zig: Sets.copy_match = 12alongside the existing.copy_first = trueindspark.Drafter.factsFn()so DSpark skips draft-modelhold()calls when a >= 12-token prompt suffix match is available and falls back cleanly to DSpark otherwise while still absorbing target rows.zig/src/native/inkling2.zig: Passes.drafts = o.draftstobackend.Metal.init(...)and adds a startup unit test checkingdraft_sources.copiesunder--drafts/--no-draftsacross 1 and 2 lanes and DSparkcopy_first/copy_match = 12reporting.zig/src/native/inkling2_copy_fixture.zig,zig/src/native/inkling2_copy_test.zig,zig/src/native/inkling2_serving_test.zig,zig/src/inkling2_metal_host_test.zig: Add deterministic multi-stream (N=2), threshold (3/4/6/12), warm prompt-cache reuse, cancellation rollback,SuffixLookup.proposeAftergraft parity, DSparkcopy_firsthold-skip/fallback, and real-checkpoint copy-draft parity host tests.Issue: Refs Inkling 2 Mini Metal V4: exact-serial scaling, GPU sampling, DFlash 2 acceleration, and kernel fusions #4961
Stacked on:
main(9961ca4920,git merge-tree --write-treeclean:7f89cff548935fafe4bbd9882ec1b54573f0e899)Checks on this head
d6e6286493python3 tools/pr_check.py --base origin/main --pr 5023(python3 tools/zig/lean_check.py):lean 164 vs 164, 0 new,0error(s) (7changed files, max touched file597lines);zig fmt --check build.zig zigandgit diff --check origin/main..HEADexit0.zig build compile-inkling2-native-host: exit0.zig build compile-inkling2-native-host -Dtarget=x86_64-windows: exit0.zig build test-inkling2-host -Dcpu=apple_m1 -Doptimize=ReleaseFast:45 pass, 4 skip (49 total)(0failed; skipped: 4 optional env-gated checkpoint/tokenizer tests).zig build test-inkling2-metal-host -Dcpu=apple_m1 -Doptimize=ReleaseFasttest binary (--seed=0xcc8ea13f):117 passed; 7 skipped; 0 failed(skipped: env-gated checkpoint/alloc tests and2JPEG tests pending matchinglibjpeg-turbo).zig build tf-kernel-contract -Doptimize=ReleaseFaston Apple M5 Max (applegpu_g17, no.metalkernel modified); all 8 non-DSparkmetal inkling2suites exit0:metal inkling2 attention:SUMMARY 5 kernels: 5 pass gates 1-4, 0 fail, 0 known findings; 5 controls: 5 red as planted, 0 missed; 0 limit problems; gates 2668 ms, limits 76 msmetal inkling2 prompt:SUMMARY 1 kernels: 1 pass gates 1-4, 0 fail, 0 known findings; 1 controls: 1 red as planted, 0 missed; 0 limit problems; gates 1363 ms, limits 62 msmetal inkling2 glue:SUMMARY 10 kernels: 10 pass gates 1-4, 0 fail, 0 known findings; 13 controls: 13 red as planted, 0 missed; 0 limit problems; gates 392 ms, limits 601 msmetal inkling2 experts:SUMMARY 12 kernels: 12 pass gates 1-4, 0 fail, 0 known findings; 17 controls: 17 red as planted, 0 missed; 0 limit problems; gates 4402 ms, limits 547 msmetal inkling2 mma:SUMMARY 0 kernels: 0 pass gates 1-4, 0 fail, 0 known findings; 0 controls: 0 red as planted, 0 missed; 0 limit problems; gates 0 ms, limits 63 msmetal inkling2 loop:SUMMARY 3 kernels: 3 pass gates 1-4, 0 fail, 0 known findings; 4 controls: 4 red as planted, 0 missed; 0 limit problems; gates 158 ms, limits 62 msmetal inkling2 runtime:SUMMARY 6 kernels: 6 pass gates 1-4, 0 fail, 0 known findings; 6 controls: 6 red as planted, 0 missed; 0 limit problems; gates 38 ms, limits 26 msmetal inkling2 vision:SUMMARY 13 kernels: 13 pass gates 1-4, 0 fail, 0 known findings; 10 controls: 10 red as planted, 0 missed; 0 limit problems; gates 972 ms, limits 541 msmetal inkling2 dspark: on base9961ca4920,--only "metal inkling2"hit the pre-existingdspark_kernels.zig:122-125error: DsparkThreadsbug (untouched here); that thread-guard fix (inkling2 metal dspark: match maxThreads guard to kappa (64) and attention (768) #5041) is now merged onmain.origin/main(9961ca4920); CI checks pending after force-push.Receipt
0cross-legtoken_sha256mismatches across every cell on both machines;.copy_match = 12for DSparkcopy_firstand.copy_match = 4for plain copy drafting):mainvs branch):distinct c=1:68.75 -> 75.05 tok/s(+9.16%, TTFT+0.15%)distinct c=4:9.10 -> 8.60 agg tok/s(-5.49%due to first-prompt TTFT variance39.7->45.3sover a42.5swindow), while steady decode throughput (decode_tps) improved4.517 -> 4.820 tok/s(+6.7%).--drafter {TARGET},copy_match = 12):distinct c=1:66.20 -> 68.15 tok/s(+2.95%)distinct c=4:8.55 -> 9.50 tok/s(+11.11%,decode_tps3.562 -> 4.782 tok/s,+34.2%)dspark_guard):code c=1:26.30 -> 26.10(-0.76%, TTFT0.315 -> 0.227s,-27.98%)code c=4:28.00 -> 28.05(+0.18%, TTFT-2.79%)chat c=1:21.20 -> 21.70(+2.36%, TTFT-2.12%)chat c=4:19.45 -> 19.45(0.00%, TTFT-1.62%)mainvs branch):distinct c=1:35.35 -> 37.45 tok/s(+5.94%, TTFT-11.20%)distinct c=4:3.70 -> 3.80 tok/s(+2.70%,decode_tps1.717 -> 1.741)--drafter {TARGET},copy_match = 12):distinct c=1:35.30 -> 36.00 tok/s(+1.98%, TTFT+2.90%)distinct c=4:3.75 -> 3.95 tok/s(+5.33%,decode_tps1.502 -> 1.869 tok/s,+24.4%)dspark_guard,copy_match = 12):code c=1:17.15 -> 17.15(0.00%)code c=4:14.90 -> 14.90(0.00%, TTFT-3.95%)chat c=1:15.25 -> 15.70(+2.95%)chat c=4:10.30 -> 10.30(0.00%)backend.zig,dspark.zig,native/inkling2.zig,native/inkling2_copy_fixture.zig,native/inkling2_copy_test.zig,native/inkling2_serving_test.zig,inkling2_metal_host_test.zig.--drafts/--no-draftsalready exists; this wiresdraftstobackend.MetalalongsideModel's existing.copy_drafts = truedefault andDSpark's existing.copy_first = true, updating plain.copy_match(4/8) and DSpark.copy_match = 12).d6e6286493onmain(9961ca4920), Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast, Apple M5 Max (applegpu_g17), Apple M5 Ultra 512 GiB, Apple M3 Ultra 512 GiB; checkpoint Inkling-2-Mini.lanes(SuffixLookupprompt copies and DSpark hybrid drafting); verified locally and served across Apple M5 Ultra and Apple M3 Ultra; Apple M1/M2/M4/M5 Pro served A/Bs not directly run on this slice.0cross-legtoken_sha256mismatches across all plain, DSpark edit, and DSpark non-copy guard cells on both Apple M5 Ultra and Apple M3 Ultra; host tests prove token/logprob parity vs--no-drafts.+9.16%plain /+11.11%DSpark on M5 Ultra,+5.94%plain /+5.33%DSpark on M3 Ultra; non-copy DSpark guard-0.76%..+2.36%M5 Ultra and0.00%..+2.95%M3 Ultra).-1.62%..-27.98%M5 Ultra,0.00%..-3.95%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.