Repository navigation
inkling2 metal: zero-split-K 64-pair NVFP4 prefill units (0 B TG, 0 barriers) - #4784
Open
cwschroeder wants to merge 22 commits into
Open
cwschroeder wants to merge 22 commits into
cwschroeder wants to merge 22 commits into
Conversation
ashhart
force-pushed
the
lead/inkling2-mini
branch
from
November 23, 2026 19:59
3e0e9bc to
f790014
Compare
Owner
|
Thanks @cwschroeder for the Inkling 2 Metal work. I found one small cleanup to make here.
|
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
|
cwschroeder
force-pushed
the
pr/inkling2-m5max-nvfp4-prefill-zsk
branch
2 times, most recently
from
November 24, 2026 10:16
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
cwschroeder
force-pushed
the
pr/inkling2-m5max-nvfp4-prefill-zsk
branch
from
November 24, 2026 11:06
78ea28c to
3b486c5
Compare
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.
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)