Repository navigation
inkling2 metal: zero-split-K 64-pair NVFP4 prefill units (0 B TG, 0 barriers) - #4784
cwschroeder wants to merge 23 commits into
Conversation
3e0e9bc to
f790014
Compare
|
Thanks @cwschroeder for the Inkling 2 Metal work. I found one small cleanup to make here.
|
aefb063 to
c41911e
Compare
|
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
|
f09ccef to
78ea28c
Compare
…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
…t attention, and use mv_mma for prompt dense projections
Replace the scalar stride-2304 tf_inkling2_logits kernel with a 256-thread (8-simdgroup) batched implementation where each simdgroup computes one vocab row across up to 8 token rows, sharing coalesced bfloat4 unembed loads and preserving width-invariant FP32 reduction and BF16 softcap rounding. Update glue dispatch, contract limits record, host check, and 8x8 tile/interval contract tests.
… and batch conv staging and commits
…size prompt part_o by capacity, and widen glue/loop scratch to 512
…eams and raise batch_rows to 64
…, 8 KiB active-expert NAX, and blocked stage_conv
…nd 8 KiB bfloat4 dense_units
…end/rel_table and vectorized bfloat4 stores
…/gates, and bfloat4 attention prep
78ea28c to
3b486c5
Compare
|
Thanks for catching that, Synthena. Fixed in 658717f: Noted as well that this branch still sits atop the earlier base stack; happy to rebase the zero-split-K prefill changes once the clean serial-order base is ready. |
|
One way to land the cleanup while the Inkling stack waits: current main Igor Lessio - AIFLOW LABS |
|
Split out the |
|
Thanks @cwschroeder. The pipeline cleanup is fixed: the f32 pipeline is protected before BF16 creation, and the same file is already on main. Thank you for splitting it into #5015. That closes the cleanup ask. The full Inkling stack remains held for the serial-order base; the isolated ownership fix does not clear that hold. No further cleanup change or run is needed here.
|
What this changes
Stacked on #4777 (
88c45204f, overlead/inkling2-mini3e0e9bcb8). Note: modifiesexperts_units.metal, which is also touched by #4689.tf_ink2_nvfp4_gu_units,tf_ink2_nvfp4_down_unitsinexperts_units.metal,experts.zig,inkling2_units_metal_records.zig):256threads,8 KiBTG scratch, 2 barriers per 8 pairs, 32-pair bands) on NVFP4 prefill with 4 simdgroups along N (128weight rows per TG,128threads,0 BTG memory,0barriers) accumulating 64-pair bands (lo0..3,hi0..3) with direct register-to-globalbfloat2/bfloat4stores.X4x across the 4 simdgroups, and removes all split-K barrier and epilogue stalls.tf_ink2_mxfp8_gu_units,tf_ink2_mxfp8_down_units):256threads /8 KiBTG preserves full MXFP8 speed (-1.2%/-2.6%)._1and_activekernels are unchanged, preserving 100% bit-exact width invariance (--no-draftsvs drafted verify).Checks on this head
zig fmt --check build.zig zig: PASS (Zig0.17.0)tools/pr_check.py --base origin/lead/inkling2-mini: 0 errors (lean 167 vs 167, 0 new, all modified files<= 600lines)zig build native -Doptimize=Debug: PASSzig build test-inkling2-controls-host test-inkling2-metal-host test-metal-launch-map-host: PASS (1235 registered launches, 2 controls, 0 missing)applegpu_g17,tensor units true):tf-kernel-contract --only "inkling2 units": 4/4 kernels pass Gates 1-4, 4/4 controls red as planted, 0 limit problems (128threads /0 BTG for NVFP4;256threads /8192 BTG for MXFP8)Receipt
0.17.0,thinkingmachines/Inkling-2-Mini@ed40e7da625f594fc9c4990f5f66be24873c22d7(unmodified BF16+NVFP4+MXFP8), AC power,powermode 0.sha=22ca50f2d47b) and bit-exact width invariance (plain == draftgreedy4ee138579f02andtemp=1.0cf570e19b8bb).ctl -> cand -> ctlA/B (beats_both=Trueon prefill and decode, no regression):tf_ink2_attn_prompt_sliding):tf_ink2_nvfp4_gu_units: -21.1% (~-26.4 ms/chunkat cold clock)tf_ink2_nvfp4_down_units: -11.1% (~-6.0 ms/chunkat cold clock)tf_ink2_mxfp8_gu_units: -1.2% /tf_ink2_mxfp8_down_units: -2.6% (0 regression)