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
|
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.