You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rebases the 0-ULP FP8 E4M3 LUT/shiftless UE8M0 decode and parallel 8-simdgroup wide grouping (tf_ink2_group_wide) onto #4618 while keeping #4618's exact BM=16, BN=32 ink2_units kernel untouched.
What this changes
Replaces scalar/per-element FP8 E4M3 and UE8M0 weight decoding in MXFP8 expert and unit paths with a 256-entry ink2_e4m3_lut and shiftless ink2_e4m3_bits/ink2_mx_edge_bf/ink2_mx_bf helpers (verified exhaustively across all 65,536 (e4m3, ue8m0) pairs on both host and GPU), and adds the 256-thread / 8 KiB shared-memory parallel tf_ink2_group_wide kernel for rows * topk > 256 while preserving #4618's exact BM=16, BN=32ink2_units reduction order and tf_ink2_logits_units.
Real-checkpoint test-inkling2-metal-host (TF_INKLING2_METAL_DIR set to Inkling-2-Mini-ed40e7da, ReleaseFast -Dcpu=apple_m1): 80 passed; 3 skipped; 0 failed across Apple M5 Ultra, Apple M5 Pro, and Apple M3 Ultra (3 skips are DSpark-gated tests when TF_INKLING2_DSPARK_DIR is unset).
CI: Local host, M5 Max contract (48/48 + 48 red), and full M5 Ultra, M5 Pro, and M3 Ultra contract/real-ckpt/serving/cache runs all passed.
Not run, and why: Non-Apple backends; all 4 Apple Silicon hardware tiers (M5 Max, M5 Ultra, M5 Pro, M3 Ultra) ran on real hardware.
Receipt
Base against branch (Apple M5 Ultra / M5 Pro / M3 Ultra, Inkling-2-Mini-ed40e7da, plain --no-drafts vs #4618ad3d31f9ff):
chat T=0.0: c=157.6 vs 57.6, c=4199.2 (st=209.1) vs 196.8 (st=203.1), c=16460.1 (st=553.7) vs 452.7 (st=552.8) tok/s (sha=32ddb869bec4 exact match, alone_unequal=0)
code T=0.0: c=158.8 vs 53.6 (+9.7%), c=4207.2 (st=215.9, +4.1%) vs 199.1, c=16501.2 (st=575.4, +2.0%) vs 491.2 tok/s (sha=4490e6bbcfbd exact match, alone_unequal=0)
chat T=1.0: c=135.5 vs 34.7, c=460.1 (st=60.5) vs 59.4, c=1672.4 (st=73.3) vs 71.9; code T=1.0: c=135.1 vs 34.4, c=458.7 (st=59.8) vs 57.8, c=1669.8 (st=71.4) vs 69.4 (exact sha set match)
Boxes it reaches: Apple Silicon Metal (M5 Max, M5 Ultra, M5 Pro, and M3 Ultra all verified).
New switch? None (tf_ink2_group_wide selected automatically for rows * topk > 256).
Environment: Commit df4cf37616 on ad3d31f9ff, Zig 0.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), checkpoint Inkling-2-Mini-ed40e7da.
Paths and platforms the change reaches: Inkling 2 Mini MXFP8 weight decode (experts.metal, experts_units.metal) and expert grouping (tf_ink2_group, tf_ink2_group_wide) across all 4 Apple Silicon hardware tiers.
Exactness: alone_unequal=0; 100% T=0.0, T=1.0, and cache token_sha parity against #4618 across M5 Ultra, M5 Pro, and M3 Ultra, plus GPU 65,536-pair MXFP8 check and tf_ink2_group vs tf_ink2_group_wide bit-identity check.
Licence of any new weights or drafter: n/a.
Kernel contract, only when a GPU kernel is new or changed
Kernels registered with the contract, and replacements:
Updated tf_ink2_group (32 threads, 0 B TG) and added tf_ink2_group_wide (256 threads, 8192 B TG, parallel wide grouping).
Updated MXFP8 decode helpers across experts.metal and ink2_mx_quad in experts_units.metal (keeping ink2_unitsBM=16, BN=32 and tf_ink2_logits_units unchanged).
Planted controls and status: Existing expert and unit controls (.mx_gu_scale/.mx_down_scale adapted for shiftless ink2_mx_quad) plus new .group_pair_order and .group_wide_pair_order controls all fail red as planted on M5 Max, M5 Ultra, M5 Pro, and M3 Ultra.
Backend SUMMARY lines and exit status:
M5 Max (applegpu_g17): SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 7073 ms, limits 13 ms (exit 0).
M5 Ultra (applegpu_g17): SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 5731 ms, limits 388 ms (exit 0).
M5 Pro (applegpu_g17): SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 5680 ms, limits 7 ms (exit 0).
M3 Ultra (applegpu_g15): SUMMARY 43 kernels: 43 pass gates 1-4, 0 fail, 0 known findings; 43 controls: 43 red as planted, 0 missed; 0 limit problems; gates 6036 ms, limits 356 ms (exit 0).
Chips not yet run: None (all 4 Apple Silicon hardware tiers completed).
Checklist
The title and description match the head commit, including the receipt and the stack.
New tests fail before the change, pass after it, and skip cleanly without their dependency.
Comments and docstrings are one line. No measurements or history in the source.
No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.
Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
No precision traded for speed. If the bits change, the description says which sums change and why.
Decode and prompt processing are no slower than main at one stream and the widest admitted; with --drafter, no slower than without it, greedy and sampled.
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 main. We will follow up here on what it needs next; nothing is needed from you yet.
Thank you @gilby for the shared UE8M0 edge decoder and the exhaustive scalar and MMA operand checks.
The applied code routes all four packed MMA bytes through the exact helper, and the wide grouping
preserves pair order and cap behavior in the reviewed paths.
One mechanical regression remains: tf_ink2_group_wide adds an eighth record with the Inkling2 MMA
launch-name prefix, but test-metal-launch-map-host still expects seven in zig/tests/contract/metal_mapping_test.zig:92. The test counts all eight records and then compares
that count with seven, so it cannot pass on this head. Please update the expectation to eight.
After that correction, the remaining Metal checkpoint A/B should compare exact token outputs against
the base, including greedy and same-seed sampled requests, concurrency, and fresh-versus-resumed
prompts. The exhaustive scalar and MMA decode probes should also compare BF16 words exactly, with no
numerical tolerance.
Synthena
This branch has not been deployed
No deployments
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
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 FP8 E4M3 LUT/shiftless UE8M0 decode and parallel 8-simdgroup wide grouping (
tf_ink2_group_wide) onto #4618 while keeping #4618's exact BM=16, BN=32ink2_unitskernel untouched.What this changes
Replaces scalar/per-element FP8 E4M3 and UE8M0 weight decoding in MXFP8 expert and unit paths with a 256-entry
ink2_e4m3_lutand shiftlessink2_e4m3_bits/ink2_mx_edge_bf/ink2_mx_bfhelpers (verified exhaustively across all 65,536(e4m3, ue8m0)pairs on both host and GPU), and adds the 256-thread / 8 KiB shared-memory paralleltf_ink2_group_widekernel forrows * topk > 256while preserving#4618's exactBM=16, BN=32ink2_unitsreduction order andtf_ink2_logits_units.lead/inkling2-mini(ad3d31f9ff#4618), 1 commit:df4cf37616atc overlap --json:overlapagainstorigin/lead/inkling2-minicovering#4592, #4593, #4594, #4596, #4683, #4685, #4699completed (clean/ 0 conflicts against#4594; remaining expert/contract overlaps are cleanly isolated ontoad3d31f9ff).Checks on this head
df4cf37616b035a4b0c77216b74b31651e204095python3 tools/zig/lean_check.py:7495 files, 167 problems(0new vs basead3d31f9ff);tools/pr_check.py --pr 4683 --base ad3d31f9ff:0 error(s), 1 warning(s)(changelog reminder).-Dcpu=apple_m1):zig fmt --check build.zig zigexit0;git diff --check ad3d31f9ff..HEADexit0;test-inkling2-controls-host15/15pass;test-inkling2-host44 pass, 4 skip;test-inkling2-metal-host(CPU)76 pass, 5 skip(including exhaustive 256-entry LUT & 65,536(w, scale)host parity);test-metal-launch-map-host8/8pass (1211registered launches,2controls,0missing);test-inkling2-metal-capabilities1/1pass;inkling2_experts_metal_records.zig7/7pass.test-inkling2-metal-host(TF_INKLING2_METAL_DIRset toInkling-2-Mini-ed40e7da, ReleaseFast-Dcpu=apple_m1):80 passed; 3 skipped; 0 failedacross Apple M5 Ultra, Apple M5 Pro, and Apple M3 Ultra (3 skips are DSpark-gated tests whenTF_INKLING2_DSPARK_DIRis unset).48/48 + 48 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=157.6vs57.6,c=4199.2(st=209.1) vs196.8(st=203.1),c=16460.1(st=553.7) vs452.7(st=552.8) tok/s (sha=32ddb869bec4exact match,alone_unequal=0)code T=0.0:c=158.8vs53.6(+9.7%),c=4207.2(st=215.9,+4.1%) vs199.1,c=16501.2(st=575.4,+2.0%) vs491.2tok/s (sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=1.0:c=135.5vs34.7,c=460.1(st=60.5) vs59.4,c=1672.4(st=73.3) vs71.9;code T=1.0:c=135.1vs34.4,c=458.7(st=59.8) vs57.8,c=1669.8(st=71.4) vs69.4(exact sha set match)bench_cache.py --tokens 64 --repeats 2 --streams 4 --require-cold(pt=8704):qualified=True, coldttft_s=8.2865s(rep_min=8.2509s) vs8.7536sref (-5.3%),dec=47.4(rep_max=51.0) 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=133.1vs31.8(+4.1%),c=4117.4(st=124.4,+6.1%) vs110.7(sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=0.0:c=132.9vs31.5(+4.4%),c=4107.9(st=120.0,+5.2%) vs102.6(sha=32ddb869bec4exact match,alone_unequal=0)code T=1.0:c=124.0vs22.5,c=440.6(st=41.7) vs39.1;chat T=1.0:c=124.2vs23.1,c=442.0(st=43.5) vs40.2(exact sha set match)bench_cache.py --tokens 32 --repeats 2 --streams 2 --require-cold(pt=2571):qualified=True, coldttft_s=12.6444s(rep_min=12.5966s) vs12.6426sref,dec=29.9(rep_max=30.1) 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=145.7vs45.3,c=4107.3(st=115.5,+6.3%agg) vs100.9(sha=34819971792dexact match,alone_unequal=0)code T=0.0:c=146.1vs45.4,c=4112.2(st=118.0,+5.2%agg) vs106.7(sha=4490e6bbcfbdexact match,alone_unequal=0)chat T=1.0:c=128.3vs28.4,c=443.5(st=44.5) vs43.5;code T=1.0:c=127.9vs28.3,c=443.2(st=44.0) vs43.9(exact sha set match)bench_cache.py --tokens 32 --repeats 2 --streams 2 --require-cold(pt=2571):qualified=True, coldttft_s=8.2639s(rep_min=8.2460s) vs8.7351sref (-5.4%),dec=37.7(rep_max=37.7) vs37.6tok/s (sha=1fbe89b22692exact match)tf_ink2_group_wideselected automatically forrows * topk > 256).df4cf37616onad3d31f9ff, 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.experts.metal,experts_units.metal) and expert grouping (tf_ink2_group,tf_ink2_group_wide) across 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 GPU 65,536-pair MXFP8 check andtf_ink2_groupvstf_ink2_group_widebit-identity check.Kernel contract, only when a GPU kernel is new or changed
tf_ink2_group(32threads,0B TG) and addedtf_ink2_group_wide(256threads,8192B TG, parallel wide grouping).experts.metalandink2_mx_quadinexperts_units.metal(keepingink2_unitsBM=16, BN=32andtf_ink2_logits_unitsunchanged)..mx_gu_scale/.mx_down_scaleadapted for shiftlessink2_mx_quad) plus new.group_pair_orderand.group_wide_pair_ordercontrols all fail red as planted on M5 Max, M5 Ultra, M5 Pro, and M3 Ultra.SUMMARYlines and exit status:applegpu_g17):SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 7073 ms, limits 13 ms(exit0).applegpu_g17):SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 5731 ms, limits 388 ms(exit0).applegpu_g17):SUMMARY 48 kernels: 48 pass gates 1-4, 0 fail, 0 known findings; 48 controls: 48 red as planted, 0 missed; 0 limit problems; gates 5680 ms, limits 7 ms(exit0).applegpu_g15):SUMMARY 43 kernels: 43 pass gates 1-4, 0 fail, 0 known findings; 43 controls: 43 red as planted, 0 missed; 0 limit problems; gates 6036 ms, limits 356 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.