Repository navigation
Conversation
|
I trial-merged 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'With #4981 first, the shader conflict is in Igor Lessio - AIFLOW LABS |
|
I also tested this head 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'On M5 Max that pair passed 149 host tests with 10 skips and 67 Metal kernels, with all 71 planted controls caught and zero problems across 77 launch records. This was the two-PR pair. The #4981 guard and actual checkpoint serving still need coverage on the final combined tree. Igor Lessio - AIFLOW LABS |
|
Thanks, @gilby. The paired K/V bodies retain the existing sum order and BF16 rounding, and the posted device checks are useful. One setup cleanup fix is needed: in Suite.add, the control probe is built before the fallible baseline pipeline load, but its deinit error handler is installed afterward. A failed baseline load therefore leaks the candidate pipelines. Please protect the acquired probe before that call and cover the failure path. The combined load-guard changes remain a separate integration step.
|
|
While testing the setup cleanup Ash flagged, I found a second rollback case at I trial-merged into The fixture injects the kernel-list allocation failure. It does not inject a baseline Metal pipeline failure. Igor Lessio - AIFLOW LABS |
|
Thanks, @gilby. The paired arithmetic and reported combined tree checks remain useful. This head still has the setup cleanup gap: Please protect the acquired probe before that call and cover the failure path. The
|
|
I reproduced the baseline-load failure on M5 Max at With the cleanup guard in its original position, the allocator reports one leak. Installing zig build test-inkling-setup-cleanup -Dfixed-cpu -j2 --summary allThat's the local fixture target, which passes 3/3. The focused device contract on the exact PR head plus the cleanup change also passed both paired K/V kernels, caught both planted controls and reported zero launch-limit problems. The current-main glue changes are described in the #5011 integration note. Igor Lessio - AIFLOW LABS |
23870c9 to
ca7cb94
Compare
|
I checked 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 rebase carries the pipeline thread limits forward. In the test harness, Igor Lessio - AIFLOW LABS |
|
I checked the landing order with #4919 zig build test-inkling2-metal-host tf-kernel-contract -Dfixed-cpu -j2 --summary all
./zig-out/bin/tf-kernel-contract --only 'metal inkling2'On M5 Max, the resolved tree passed 104 Metal tests with six skipped. All 63 kernels passed, all 69 controls were caught, and there were zero launch-limit problems. This covers the two-PR integration and leaves the earlier test setup cleanup and checkpoint timing checks open. Igor Lessio - AIFLOW LABS |
ca7cb94 to
00ab195
Compare
|
The revised zig build test-inkling2-host test-inkling2-metal-host tf-kernel-contract -Dfixed-cpu -j2 --summary all
./zig-out/bin/tf-kernel-contract --only kv_convThe earlier allocation rollback finding still applies to Igor Lessio - AIFLOW LABS |
|
Thanks @gilby. The paired loader now carries the required thread limits, and the earlier arithmetic checks remain useful. Two setup paths still need repair. The candidate probe's cleanup guard comes after the fallible baseline load, so that failure leaks its pipelines. Also, a failed kernel-list append leaves a freed probe in the owner list, including the split helper. Please protect the acquired probe before the baseline call and make registration transactional, with focused failure coverage.
|
|
@gilby, about the probe-registration cleanup our review asked for: the same two-append pattern was on main in 85 places, and #5058 (now merged) fixes it there with one helper, errdefer p.deinit(); // with errdefer s.a.destroy(p) after create, as the suite's teardown frees it
try ct.register(s.a, &s.probes, &s.kernels, p, p.kernel());Using it for this PR's new suites closes that item.
|
00ab195 to
b01bf9e
Compare
|
Rebased onto
Verified on
|
What this changes
Before: on
main, each gated-attention layer runs short depthwise-separable convolutions for K (conv_k) and V (conv_v) in two sequential dispatches (either twotf_inkling2_conv_staticor twotf_inkling2_conv_dynamiclaunches) with a compute barrier between them before attention projection reads both results.After: pairs K and V short convolutions into a single dispatch using
tf_inkling2_kv_conv_static(grid.z = 2) andtf_inkling2_kv_conv_dynamic(grid.y = 2) inzig/kernels/metal/inkling2/glue.metal, wired throughglue.zig,glue_plan.zig, andforward.zig. Adds paired static/dynamic contract parity proofs and planted controls inmetal_inkling2_glue.zig,metal_inkling2_glue_kv_conv.zig, andmetal_inkling2_glue_controls.zig, with transactional probe acquisition and registration (addAcquired,registerProbe) acrossSuite.add,Suite.addNanControl, andSuite.addSplitplus host failure-path tests.main(a992d0da99,git merge-tree --write-treeclean:e07ca6b7ff)atc overlap --json:changedFiles: 9Checks on this head
b01bf9e676python3 tools/pr_check.py --base origin/main --pr 5004(python3 tools/zig/lean_check.py):lean 164 vs 164, 0 new,0error(s),1advisory warning (noCHANGELOG.mdedit) (9changed files, all<= 600lines, max538lines);zig fmt --check build.zig zigandgit diff --check origin/main..HEADpass with exit0.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 -Dfixed-cpu compile-native-cuda-windows: exit0.zig build test-inkling2-host -Dcpu=apple_m1 -Doptimize=ReleaseFast --summary all:46/50 tests passed (4 skipped)(skipped: 4 optional checkpoint/tokenizer env tests).zig build test-inkling2-controls-host --summary all:26/26 tests passed(includes baseline-load failure andFailingAllocatorkernel-list OOM rollback tests).zig build test-kernel-contract --summary all:255/255 tests passed(gate logic, launch limits, Metal launch map1314 registered launches, 2 controls, 0 missing, Inkling 2 controls, and host contract suites).zig build test-inkling2-metal-host -Dcpu=apple_m1 -Doptimize=ReleaseFast --summary all:111 pass, 6 skip (117 total)(skipped: env-gated checkpoint/alloc tests and 2 JPEG tests pending newerlibjpeg-turbo).zig build tf-kernel-contract -Doptimize=ReleaseFast: exit0.main(a992d0da99); CI checks pending on this head (b01bf9e676).c=1,4andT=0.0,1.0.Receipt
tools/bench_concurrent.py --tokens 128 --reps 2,--context 8192 --parallel 4,0cross-legtoken_sha256mismatches across all 32 cells on both machines, run prior to the test-harness-only setup cleanup and rebase ontoa992d0da99with identical production shader/dispatch/kernel code):mainvs branch, Metal 3 overlay):--no-drafts --parallel 4):c=1:code T=0.0:12.40 -> 12.45 tok/s(+0.40%);chat T=0.0:12.50 -> 12.60 tok/s(+0.80%);code T=1.0:12.40 -> 12.50 tok/s(+0.81%, TTFT-1.20%);chat T=1.0:12.45 -> 12.55 tok/s(+0.80%).c=4:code T=0.0:23.60 -> 23.95 tok/s(+1.48%, TTFT-1.70%);chat T=0.0:24.90 -> 25.15 tok/s(+1.00%, TTFT-1.80%);code T=1.0:23.75 -> 24.00 tok/s(+1.05%);chat T=1.0:24.90 -> 25.25 tok/s(+1.41%).--drafter {TARGET} --parallel 4):c=1:code T=0.0:17.15 -> 17.20(+0.29%, TTFT-6.70%);chat T=0.0:15.20 -> 15.30(+0.66%);code T=1.0:14.40 -> 14.40(0.00%, TTFT-6.93%);chat T=1.0:15.10 -> 15.10(0.00%).c=4:code T=0.0:14.90 -> 15.00(+0.67%);chat T=0.0:10.30 -> 10.30(0.00%);code T=1.0:12.70 -> 12.80(+0.79%);chat T=1.0:10.10 -> 10.20(+0.99%).mainvs branch):--no-drafts --parallel 4):c=1:code T=0.0:16.80 -> 16.90 tok/s(+0.60%, TTFT-0.96%);chat T=0.0:16.90 -> 17.00 tok/s(+0.59%);code T=1.0:16.90 -> 17.00 tok/s(+0.59%, TTFT-6.12%);chat T=1.0:16.85 -> 17.00 tok/s(+0.89%).c=4:code T=0.0:37.30 -> 37.80 tok/s(+1.34%);chat T=0.0:38.40 -> 39.05 tok/s(+1.69%);code T=1.0:36.95 -> 37.50 tok/s(+1.49%, TTFT-3.51%);chat T=1.0:38.25 -> 38.80 tok/s(+1.44%).--drafter {TARGET} --parallel 4):c=1:code T=0.0:26.05 -> 26.25(+0.77%);chat T=0.0:21.20 -> 21.25(+0.24%);code T=1.0:19.50 -> 19.55(+0.26%, TTFT-6.28%);chat T=1.0:20.50 -> 20.55(+0.24%, TTFT-1.18%).c=4:code T=0.0:28.10 -> 28.15(+0.18%);chat T=0.0:19.50 -> 19.50(0.00%, TTFT-1.49%);code T=1.0:22.95 -> 23.10(+0.65%);chat T=1.0:19.80 -> 19.90(+0.51%).glue.metal,inkling2_glue_metal_records.zig,forward.zig,glue.zig,glue_plan.zig,glue_test.zig,metal_inkling2_glue.zig,metal_inkling2_glue_controls.zig,metal_inkling2_glue_kv_conv.zig.b01bf9e676rebased ontoa992d0da99(prior M3 Ultra / M5 Ultra A-B-B-A and M5 Ultra contract receipts from00ab195259/d01f8f39f9), Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast, Apple M5 Max (applegpu_g17), Apple M3 Ultra 512 GiB, Apple M5 Ultra 512 GiB; checkpoint Inkling-2-Mini.0cross-legtoken_sha256mismatches across all 32 cells (plain--skip-serialanddspark--serial) on Apple M3 Ultra and Apple M5 Ultra;0-ULP parity against sequentialtf_inkling2_conv_staticandtf_inkling2_conv_dynamicverified bymetal_inkling2_glue.zigandmetal_inkling2_glue_kv_conv.zig.+1.48%plain /+0.99%self-drafted on Apple M3 Ultra; up to+1.69%plain /+0.77%self-drafted on Apple M5 Ultra;0regressive cells out of32).c=1TTFT improved up to-6.93%(M3 Ultra) and-6.28%(M5 Ultra).Kernel contract, only when a GPU kernel is new or changed
metal inkling2 glue kv_conv_static tf_inkling2_kv_conv_static(32threads) andmetal inkling2 glue kv_conv_dynamic tf_inkling2_kv_conv_dynamic(256threads,128bytes TG memory), pairing two sequentialtf_inkling2_conv_staticortf_inkling2_conv_dynamicdispatches for K and V inforward.zig.69/69controls across allmetal inkling2suites on Apple M5 Max (b01bf9e676) and57/57controls on Apple M5 Ultra (d01f8f39f9) fail red as planted (0missed), includingkv_conv_staticandkv_conv_dynamicplanted controls inmetal_inkling2_glue_controls.zig.SUMMARYline and exit status:b01bf9e676, rebased ona992d0da99which includes#5041):./zig-out/bin/tf-kernel-contract --only "metal inkling2"(all Inkling 2 suites includingmetal inkling2 glueandmetal inkling2 dspark):SUMMARY 63 kernels: 63 pass gates 1-4, 0 fail, 0 known findings; 69 controls: 69 red as planted, 0 missed; 0 limit problems; gates 10955 ms, limits 657 ms(exit0)../zig-out/bin/tf-kernel-contract --only "metal inkling2 glue":SUMMARY 12 kernels: 12 pass gates 1-4, 0 fail, 0 known findings; 15 controls: 15 red as planted, 0 missed; 0 limit problems; gates 586 ms, limits 58 ms(exit0).d01f8f39f9):SUMMARY 50 kernels: 50 pass gates 1-4, 0 fail, 0 known findings; 57 controls: 57 red as planted, 0 missed; 0 limit problems; gates 8782 ms, limits 391 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.