Repository navigation
Conversation
|
Independent M5 Max integration check on
zig build test-inkling2-host test-inkling2-metal-host tf-kernel-contract -Dfixed-cpu -j2 --summary all
./zig-out/bin/tf-kernel-contract --only 'metal inkling2'All three device runs reported zero launch-limit problems. I did not rerun checkpoint serving or the throughput comparisons. Igor Lessio - AIFLOW LABS |
|
Thanks, @gilby. The cached norms and fused updates retain the written reduction order and BF16 rounding point. The standalone host and M5 contract results support bounded A/B, with M3 coverage and remaining state-restoration cells still open. For combined work, keep the load guard aligned with all fifteen pipelines and preserve the relative-table removal in the scratch layout. The standalone PR merges cleanly; no source-order defect found.
|
2a1fb99 to
aef19d3
Compare
|
I reran zig build test-inkling2-host test-inkling2-metal-host tf-kernel-contract -Dfixed-cpu -j2 --summary all
./zig-out/bin/tf-kernel-contract --only 'metal inkling2'The trial merge is also clean at Igor Lessio - AIFLOW LABS |
|
Thanks @gilby. All fifteen pipeline guards now match their shader bounds. The cached/fused arithmetic and BF16 boundary remain as previously reviewed, while the row-aware AR interface and current projection paths are retained. One integration change is needed before landing: the clean merge with current main makes zig/tests/contract/metal_inkling2_glue.zig 658 lines, beyond the 600-line limit. Please split its probe/helpers while preserving all registrations, replacement-byte comparisons and controls. The posted M5 results remain useful. M3 coverage and the remaining checkpoint restore/cancel/cache cells are still open; the older 64-row qualification does not cover every new 256-row/current-tree cell. No new reduction-order defect was found.
|
32ad007 to
793caf4
Compare
|
Thank you, @gilby. The split closes the file-length ask. All registrations, replacement byte comparisons and planted controls remain, and the cached/fused arithmetic and 15 launch guards are unchanged. The current head merges cleanly. Ready for controlled comparisons. The earlier M3, larger prompt-row, restore and cancellation cells remain before landing; the supplied passing M5 checks are retained.
|
What this changes
Before: on
main, each layer'stf_inkling2_arrecomputes normalized RMS norms (sumsq->rsqrt) across all previously finalized depth blocks (0..sources-2) twice per layer (before attention and before MLP), and attention/MLP partial-update residual adds (tf_inkling2_partial_add/tf_inkling2_mlp_add) run as separate full-buffer dispatches before the next AR reduction reads those same tensors back from device memory.After: caches each finalized depth block's scalar
inv_rmsonce viatf_inkling2_block_inv_rmsand reads cached scalars intf_inkling2_cached_ar, then fuses the post-projection partial residual update directly into the subsequent AR pass (tf_inkling2_attn_partial_arandtf_inkling2_mlp_partial_ar, plus cached query support whenlayers == 0/ final norm consumes block outputs). Both optimizations preserve0-ULP bitwise BF16/FP32 equality againstmain's reduction order.Rebased onto
origin/main(f3c0fa8c65, including#5000and#5058):Preserves
#5000'srel_tabremoval alongsideblock_inv_rmsinstate.zig, with all 15 glue pipelines and thread bounds aligned inglue.zig.Switches all probe/kernel registrations in
metal_inkling2_glue.zigtocontract.registerwith matchingerrdefers (#5058) and consolidates the four cached/fused AR contract probes inmetal_inkling2_glue_fused.zigso every touched file remains<= 600lines.Issue: Refs Inkling 2 Mini Metal V4: exact-serial scaling, GPU sampling, DFlash 2 acceleration, and kernel fusions #4961
Stacked on:
main(f3c0fa8c65,git merge-tree --write-treeclean1780e2ae71)Checks on this head
793caf4450(2-commit stack:66e14b8f65+793caf4450)python3 tools/pr_check.py --base origin/main --pr 5001:lean 164 vs 164, 0 new,0 error(s)(11changed files, max touched file546lines<= 600);zig fmt --check build.zig zigandgit diff --check origin/main..HEADexit0.-Dcpu=apple_m1 -Doptimize=ReleaseFast):zig build -Dcpu=apple_m1 -Doptimize=ReleaseFast: exit0.zig build compile-inkling2-native-host: exit0.zig build compile-inkling2-native-host -Dtarget=x86_64-windows: exit0.zig build compile-native-cuda-windows: exit0.zig build test-inkling2-host -Dcpu=apple_m1 -Doptimize=ReleaseFast:46 pass, 4 skip (50 total)(optional checkpoint/tokenizer env tests skipped).zig build test-inkling2-controls-host:24 pass (24 total).zig build test-kernel-contract:45/45steps succeeded (259/259non-cached tests passed,0failed).zig build tf-kernel-contract -Doptimize=ReleaseFast: exit0.zig build test-inkling2-metal-host -Dcpu=apple_m1 -Doptimize=ReleaseFast(--seed=0xf1163109):114 pass, 6 skip (120 total)(0failed;2JPEG tests skipped pending newerlibjpeg-turbo)../zig-out/bin/tf-kernel-contract):793caf4450,--only "metal inkling2"):SUMMARY 66 kernels: 66 pass gates 1-4, 0 fail, 0 known findings; 72 controls: 72 red as planted, 0 missed; 0 limit problems; gates 13500 ms, limits 153 ms(exit0).793caf4450,--only "metal inkling2 glue"):SUMMARY 14 kernels: 14 pass gates 1-4, 0 fail, 0 known findings; 17 controls: 17 red as planted, 0 missed; 0 limit problems; gates 488 ms, limits 56 ms(exit0).3f1f52a858; kernel math unchanged):SUMMARY 52 kernels: 52 pass gates 1-4, 0 fail, 0 known findings; 59 controls: 59 red as planted, 0 missed; 0 limit problems; gates 8527 ms, limits 386 ms(exit0).793caf4450.c=1,4.Receipt
tools/bench_concurrent.py --tokens 128 --reps 2,--context 8192 --parallel 4,0cross-legtoken_sha256mismatches across all cells on both machines):mainvs branch,T=0.0):--no-drafts --parallel 4):c=1:code:13.45 -> 13.60 tok/s(+1.12%, TTFT0.520 -> 0.507s,-2.41%);chat:13.60 -> 13.70 tok/s(+0.74%, TTFT1.272 -> 1.244s,-2.20%).c=4:code:21.50 -> 22.10 tok/s(+2.79%, TTFT1.256 -> 1.215s,-3.27%);chat:22.90 -> 23.65 tok/s(+3.28%, TTFT4.982 -> 4.724s,-5.16%).--drafter {TARGET} --parallel 4):c=1:code:13.85 -> 14.15 tok/s(+2.17%, TTFT0.556 -> 0.534s,-3.96%);chat:11.60 -> 11.85 tok/s(+2.16%, TTFT1.357 -> 1.288s,-5.09%).c=4:code:10.30 -> 10.70 tok/s(+3.88%, TTFT1.342 -> 1.308s,-2.53%);chat:7.20 -> 7.50 tok/s(+4.17%, TTFT5.107 -> 4.928s,-3.50%).mainvs branch,T=0.0,1.0):--no-drafts --parallel 4):c=1:code T=0.0:16.80 -> 17.10 tok/s(+1.79%, TTFT-8.23%);chat T=0.0:16.85 -> 17.15 tok/s(+1.78%, TTFT-14.99%);code T=1.0:16.85 -> 17.25 tok/s(+2.37%, TTFT-10.26%);chat T=1.0:16.90 -> 17.30 tok/s(+2.37%, TTFT-14.95%).c=4:code T=0.0:37.30 -> 40.90 tok/s(+9.65%, TTFT0.496 -> 0.428s,-13.70%);chat T=0.0:38.35 -> 41.80 tok/s(+9.00%, TTFT1.728 -> 1.376s,-20.35%);code T=1.0:36.90 -> 40.50 tok/s(+9.76%, TTFT0.493 -> 0.418s,-15.20%);chat T=1.0:38.25 -> 41.65 tok/s(+8.89%, TTFT1.728 -> 1.374s,-20.43%).--drafter {TARGET} --parallel 4):c=1:code T=0.0:26.05 -> 27.85 tok/s(+6.91%, TTFT-6.71%);chat T=0.0:21.30 -> 22.40 tok/s(+5.16%, TTFT-22.63%);code T=1.0:19.50 -> 20.50 tok/s(+5.13%, TTFT-16.55%);chat T=1.0:20.50 -> 21.70 tok/s(+5.85%, TTFT-20.57%).c=4:code T=0.0:28.05 -> 33.80 tok/s(+20.50%, TTFT0.524 -> 0.453s,-13.63%);chat T=0.0:19.50 -> 23.35 tok/s(+19.74%, TTFT1.826 -> 1.466s,-19.69%);code T=1.0:23.00 -> 27.50 tok/s(+19.57%, TTFT0.535 -> 0.448s,-16.26%);chat T=1.0:19.80 -> 24.00 tok/s(+21.21%, TTFT1.804 -> 1.449s,-19.66%).glue.metal,inkling2_glue_metal_records.zig,forward.zig,glue.zig,glue_plan.zig,glue_test.zig,runtime_test.zig,state.zig,metal_inkling2_glue.zig,metal_inkling2_glue_controls.zig,metal_inkling2_glue_fused.zig.793caf4450rebased ontof3c0fa8c65, Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast, Apple M5 Max (applegpu_g17), Apple M5 Pro 64 GiB, Apple M5 Ultra 512 GiB; checkpoint Inkling-2-Mini.0cross-legtoken_sha256mismatches across allplain(--skip-serial) anddspark(--serial) legs on both Apple M5 Pro and Apple M5 Ultra; bitwise0-ULP equality against uncached AR and unfused partial adds proved acrossmetal_inkling2_glue.zigandmetal_inkling2_glue_fused.zig.+0.74%..+3.28%plain /+2.16%..+4.17%self-drafted on Apple M5 Pro;+1.78%..+9.76%plain /+5.13%..+21.21%self-drafted on Apple M5 Ultra).-5.16%(M5 Pro) and-22.63%(M5 Ultra).Kernel contract, only when a GPU kernel is new or changed
metal inkling2 glue cached_ar tf_inkling2_cached_ar,metal inkling2 glue block_inv_rms tf_inkling2_block_inv_rms,metal inkling2 glue attn_partial_ar tf_inkling2_attn_partial_ar, andmetal inkling2 glue mlp_partial_ar tf_inkling2_mlp_partial_ar(256threads each) toglue.metalandinkling2_glue_metal_records.zig, replacing separate recomputedtf_inkling2_arand partial-add passes whenblock_inv_rms/ partial inputs are active.72/72controls on Apple M5 Max (793caf4450) and59/59controls on Apple M5 Ultra (pre-rebase3f1f52a858) fail red as planted (0missed), including planted failures inmetal_inkling2_glue_controls.zigandmetal_inkling2_glue_fused.zig.SUMMARYline and exit status:793caf4450,--only "metal inkling2"):SUMMARY 66 kernels: 66 pass gates 1-4, 0 fail, 0 known findings; 72 controls: 72 red as planted, 0 missed; 0 limit problems; gates 13500 ms, limits 153 ms(exit0).793caf4450,--only "metal inkling2 glue"):SUMMARY 14 kernels: 14 pass gates 1-4, 0 fail, 0 known findings; 17 controls: 17 red as planted, 0 missed; 0 limit problems; gates 488 ms, limits 56 ms(exit0).3f1f52a858):SUMMARY 52 kernels: 52 pass gates 1-4, 0 fail, 0 known findings; 59 controls: 59 red as planted, 0 missed; 0 limit problems; gates 8527 ms, limits 386 ms(exit0).Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.