Repository navigation
Conversation
Derive per-visit cache access and exact arithmetic for the 48 visits so CUDA admission and kernels have a reference before serving is enabled.
Decode stored NVFP4 and MXFP8 expert weights to BF16 and launch them beside the grouped expert/vision kernels, with exact tensor baselines and planted faults.
Launch cross-pass messages, rank-64 gates, residual steps and split QKV with FP32 reductions, BF16 rounding controls and per-launch resource records.
Run all 48 visits with per-visit cache state, prompt snapshots and exact rollback. Refuse TP, vision and DSpark loading until those engines exist.
… rows where prep wrote them
…in the fewest 1,024-key folds a slot
…up to 32 rows is one launch
…uffers, independent launches side by side
… a row's sums never depend on its chunk
…mdgroup folds the partial sums itself
…e of an expert is full
8 tasks done
…de between a prompt's chunks
…to eight rows of a window
…y for up to 16 rows
gilby
force-pushed
the
inkling2-lead-decode-fusion
branch
from
November 22, 2026 18:59
84cc8ea to
b6b4cfc
Compare
8 tasks done
… split forward - Bypass 5-CB cuts for rows <= batch_rows and move verify conv backup into the forward CB with 3-case rollback. - Fuse grid.y short-conv staging/static conv and batched dynamic conv across segments, compacting taps_bytes to window_rows. - Fuse grid.z Q/K/V controller gates in loop.metal (256-row stride) and native bf16 tf_inkling2_ar_bf16 on the 576-thread AR. - Split forward.zig into forward.zig, forward_layers.zig, and forward_conv.zig while keeping dense/logits/experts/attention untouched. Refs ashhart#4652
gilby
force-pushed
the
inkling2-lead-decode-fusion
branch
from
November 23, 2026 06:08
b6b4cfc to
757c677
Compare
gilby
marked this pull request as ready for review
November 23, 2026 06:08
ashhart
force-pushed
the
lead/inkling2-mini
branch
from
November 23, 2026 19:59
3e0e9bc to
f790014
Compare
8 tasks done
ashhart
force-pushed
the
lead/inkling2-mini
branch
3 times, most recently
from
November 24, 2026 09:43
aefb063 to
c41911e
Compare
Owner
|
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
|
17 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebases the 0-ULP decode fusions onto #4618 (single-CB decode, grid.y convs with staged rollback, grid.z loop roles, native bfloat AR, and modular forward split) while omitting dense_fuse and preserving bit-exact greedy parity.
What this changes
Collapses
rows <= state.batch_rowsdecode execution into one Metal command buffer using GPU-staged convolution rollback (tf_ink2_stage_conv,tf_ink2_stage_conv_segs,tf_ink2_stage_conv_static,tf_ink2_commit_histories), adds stream-axisgrid.ydynamic conv (tf_inkling2_conv_dynamic_segs),grid.zQ/K/V loop role dispatch (rolesinInkLoopArgs), nativebfloattf_inkling2_ar_bf16, and splitsforward.zigintoforward.zig,forward_conv.zig, andforward_layers.zigwhile keepingdense_fuse,logits,experts, andattentionunchanged from#4618.lead/inkling2-mini(ad3d31f9ff#4618), 2 commits:757c6772b9,8c3e0c65f4atc overlap --json:overlapagainstorigin/lead/inkling2-minicovering#4592, #4593, #4594, #4596, #4683, #4685, #4699completed (all modified Metal/Zig/contract files cleanly rebased onad3d31f9ff).Checks on this head
8c3e0c65f4(non-Darwin CI test guard on top of757c6772b9)python3 tools/zig/lean_check.py:7497 files, 167 problems(0new vs basead3d31f9ff);tools/pr_check.py --pr 4593 --base ad3d31f9ff:0 error(s), 1 warning(s)(changelog reminder).8c3e0c65f4:zig fmt --check build.zig zigexit0;git diff --check ad3d31f9ff..HEADexit0;test-inkling2-controls-host,test-inkling2-host(44 pass, 4 skip),test-inkling2-metal-host(76 pass, 6 skip), andcompile-inkling2-native-host(macOS/Linux/Windows) pass;test-metal-launch-map-host8/8pass (1215registered launches,2controls,0missing);test-inkling2-metal-hostcompiles cleanly (0errors) forx86_64-linuxandx86_64-windows.test-inkling2-metal-host(at parent757c6772b9,TF_INKLING2_METAL_DIRset toInkling-2-Mini-ed40e7da, ReleaseFast-Dcpu=apple_m1):81 passed; 3 skipped; 0 failedacross Apple M5 Ultra, Apple M5 Pro, and Apple M3 Ultra (including 3-case GPU conv rollback test; 3 skips are DSpark-gated tests whenTF_INKLING2_DSPARK_DIRis unset).52/52 + 52 red), and full M5 Ultra, M5 Pro, and M3 Ultra contract/real-ckpt/serving/cache runs all passed.Receipt
Inkling-2-Mini-ed40e7da, plain--no-draftsvs#4618ad3d31f9ff):bench_concurrent.py --levels 1,4,16 --temperatures 0,1.0 --tokens 128 --reps 2 --alone):chat T=0.0:c=155.7vs57.6,c=4205.9(st=218.7,+4.6%agg) vs196.8,c=16528.4(st=663.4,+16.7%agg /+20.0%steady) vs452.7(st=552.8) tok/s (sha=32ddb869bec4exact match,alone_unequal=0)code T=0.0:c=156.8vs53.6(+6.0%),c=4213.3(st=223.9,+7.1%agg) vs199.1,c=16588.6(st=695.6,+19.8%agg /+23.1%steady) vs491.2(st=565.1) tok/s (sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=1.0:c=133.8vs34.7,c=459.9(st=60.4) vs59.4,c=1676.6(st=77.8) vs71.9;code T=1.0:c=133.7vs34.4,c=458.5(st=59.6) vs57.8,c=1673.6(st=75.4) vs69.4(exact sha set match)bench_cache.py --tokens 64 --repeats 2 --streams 4 --require-cold(pt=8704):qualified=True, coldttft_s=9.0876s(min=8.9879s) vs8.7536sref,dec=47.7(rep_max=47.5) vs48.5tok/s (sha=95e612cfdcafexact match)bench_concurrent.py --levels 1,4 --temperatures 0,1.0 --tokens 128 --reps 2 --alone):code T=0.0:c=131.4vs31.8,c=4113.8(st=121.1,+2.8%agg) vs110.7(st=118.0,sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=0.0:c=131.1vs31.5,c=4104.9(st=117.7,+2.2%agg) vs102.6(st=114.6,sha=32ddb869bec4exact match,alone_unequal=0)code T=1.0:c=122.7vs22.5,c=439.5(st=40.4) vs39.1;chat T=1.0:c=122.9vs23.1,c=440.8(st=42.3) vs40.2(exact sha set match)bench_cache.py --tokens 32 --repeats 2 --streams 2 --require-cold(pt=2571):qualified=True, coldttft_s=14.8659s(rep_min=13.3472s) vs12.6426sref,dec=27.9(rep_max=27.9) vs29.6tok/s (sha=1fbe89b22692exact match)Metal 3,bench_concurrent.py --levels 1,4 --temperatures 0,1.0 --tokens 128 --reps 2 --alone):chat T=0.0:c=144.5vs45.3,c=4105.0(st=113.2,+4.1%agg) vs100.9(st=105.5,sha=34819971792dexact match,alone_unequal=0)code T=0.0:c=145.0vs45.4,c=4109.9(st=115.1,+3.0%agg) vs106.7(st=111.7,sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=1.0:c=127.7vs28.4,c=442.8(st=43.8) vs43.5;code T=1.0:c=127.6vs28.3,c=442.9(st=43.7) vs43.9(exact sha set match)bench_cache.py --tokens 32 --repeats 2 --streams 2 --require-cold(pt=2571):qualified=True, coldttft_s=8.6471s(rep_min=8.6163s) vs8.7351sref,dec=37.2(rep_max=36.9) vs37.6tok/s (sha=1fbe89b22692exact match)single-CBpath triggers automatically whenrows <= state.batch_rows).757c6772b9onad3d31f9ff, Zig0.17.0-Dcpu=apple_m1 -Doptimize=ReleaseFast, Apple M5 Max (applegpu_g17), Apple M5 Ultra (applegpu_g17), Apple M5 Pro (applegpu_g17), Apple M3 Ultra (applegpu_g15), checkpointInkling-2-Mini-ed40e7da.conv_dynamic_segs,loopgrid.zroles, andar_bf16across all 4 Apple Silicon hardware tiers.alone_unequal=0; 100%T=0.0,T=1.0, and cachetoken_shaparity against#4618across M5 Ultra, M5 Pro, and M3 Ultra, plus 3-case GPU conv rollback verification (beginStage, pre-commit rollback, partial-accept history commit).Kernel contract, only when a GPU kernel is new or changed
tf_inkling2_ar_bf16(576threads,720B TG, eliminates separatewidendispatch + barrier before AR).tf_inkling2_conv_dynamic_segs(256threads,128B TG, stream-axisgrid.ydynamic conv).tf_inkling2_loop_gates/tf_inkling2_loop_zeta/tf_inkling2_loop_blendwithgrid.zQ/K/V role dispatch.tf_ink2_stage_conv,tf_ink2_stage_conv_segs,tf_ink2_stage_conv_static, andtf_ink2_commit_histories(256threads,0B TG).ar_bf16,conv_dynamic_segs,loop_messages/loop_gates,stage_conv,stage_conv_segs,stage_conv_static,commit_histories) fail red as planted on M5 Max, M5 Ultra, M5 Pro, and M3 Ultra.SUMMARYlines and exit status:applegpu_g17):SUMMARY 52 kernels: 52 pass gates 1-4, 0 fail, 0 known findings; 52 controls: 52 red as planted, 0 missed; 0 limit problems; gates 6564 ms, limits 17 ms(exit0).applegpu_g17):SUMMARY 52 kernels: 52 pass gates 1-4, 0 fail, 0 known findings; 52 controls: 52 red as planted, 0 missed; 0 limit problems; gates 5960 ms, limits 385 ms(exit0).applegpu_g17):SUMMARY 52 kernels: 52 pass gates 1-4, 0 fail, 0 known findings; 52 controls: 52 red as planted, 0 missed; 0 limit problems; gates 6000 ms, limits 7 ms(exit0).applegpu_g15):SUMMARY 47 kernels: 47 pass gates 1-4, 0 fail, 0 known findings; 47 controls: 47 red as planted, 0 missed; 0 limit problems; gates 6264 ms, limits 9 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.