Repository navigation
Conversation
- Preserve the original release NVFP4 and MXFP8 expert weights and execute the looped text backbone on one Metal device. - Keep the bundled DSpark head and plain prompt-cache reuse in the native lane backend. - Refs ashhart#4274. Local M4 Pro evaluation, separate from the upstream full port.
- Keep the original vision tower, PNG/JPEG preparation, and the separate device and operator checks on the full integration branch. - The padded-image real-weight accuracy gate remains open. This commit is not part of the text-only review branch.
- Match pinned Transformers eager QK and scaling boundaries before FP32 softmax. - Keep the trained padded-image projector bound unchanged.
- Keep original NVFP4/MXFP8 checkpoint bytes and decode weights in registers, using BF16 activations and FP32 sums. - Match pinned Transformers conversion and SwiGLU/route precision, with packed-weight and zero-scale controls. - Refs ashhart#4274. Local original-weight M4 Pro qualification; not an upstream submission.
- Keep the shader and probe comments within the repository lean rules; no arithmetic changes.
- The rebase dropped the alias main uses for slide refusal, so the native server did not compile.
…-ups - Comments are one line each again (339 runs collapsed, 40 shortened) and no `/*` text remains, so lean_check.py adds nothing to the base's 168 problems. - TF_INKLING2_MINI_SMOKE reads through platform/environment.zig: a .metal/.path row, a docs row and a valid case in environment_test.zig. - The load check sums every model*.safetensors shard, as core/checkpoint.zig lists them, plus mtp.safetensors when drafted. - The state-bytes test covers Mini's looped shape: 24 physical layers as 48 visits, 8 global, visit 41 at physical 17. - A new contract control isolates the experts' down projections; --loops and --policy refusals have a test that names them. - The cacheBudget doc comment and the CHANGELOG state the DSpark prompt-cache limit: kept states need --no-drafts. - The Inkling 2 contract suites move to metal_inkling2_main.zig, holding their probes for the run, which keeps metal_main.zig under 600 lines. - The NVFP4 outer factor stays the unrounded quotient, pending the maintainer's F1 decision.
…ites - `zig fmt --check build.zig zig` (what the Zig format workflow runs) is clean; the new suites and loaders had drifted. - Layout and `@intFromEnum` -> `@backingInt` only: the contract, native, vision, forward and environment checks are rerun green on this tree.
…w projections - Score GEMMs are a full fp32 dot, off the tensor-unit operand cut, so an M5 matches the product measured on earlier chips. - One-row projections that share an input use one launch of the existing matvec lane chains. Same checkpoint token hash, about 2 ms off a 57 ms decode token.
- zig fmt on the forward layer, and the score-GEMM note is one line so lean check stays at the base count.
- Drop the blank lines zig fmt --check rejected on the projection fuse.
- f32_nt and f32_nn were filled from bf16 dyadics, so a 10-bit operand cut still matched the float64 product. - Wide inputs now set the low fraction bits. On this M4 Pro the gates pass at 0.337 and 0.354 of the bound.
- Gate-down walked all 64 ranks in one threadgroup. Eight ranks a group, each rank's sum order unchanged. - Decode on this M4 Pro is 23.2 tok/s, from 16.9, hash 57519a5a167f unchanged. - Prefill chunks are 512 rows. A 1056-token prompt prefilled at 81 tok/s.
…v_fuse, and fused decode kernels
…024, and warm verify window costs
This was referenced Nov 22, 2026
Open
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
Before: on #4337 (
8d54cafcd4),--prompt-cache-gib > 0was refused whenever DSpark drafting was enabled,max_rowswas capped at 512 (limiting average tokens/expert during grouped MoE prefill), andTarget.facts()leftwindow_costsempty (causinglanes/depthto bypassbestRows()and lock chat draft depth to 1). After: addsLaneSnapshotsave/restore inmetal_draft_core.zig/metal_draft.zigso--prompt-cache-gibworks bit-identically with DSpark enabled, widensmax_rowsto 1024, addsTarget.warm()(inkling2_warm.zig) to populate real Metal verify costs for widths1..window_rows, and includes thefixed_draft_blocklone-stream cost fix from #4457.8b29cbedfb, which stacks on Metal: experimental Inkling 2 Mini text, vision and bundled DSpark #43378d54cafcd4) and lanes/depth: price full fixed_draft_block head cost in lone roundCost #4457 (lanes/depth.zig); this PR adds 1 commit (bf46d5b75b, 6 files).atc overlap --json: Checked with--base 8d54cafcd4(2026-11-22T00:25Z); zero overlap onmetal_draft.zig,metal_draft_core.zig,inkling2.zig,inkling2_backend.zig,inkling2_warm.zigagainst any open PR (lanes/depth.zigis split into lanes/depth: price full fixed_draft_block head cost in lone roundCost #4457).Checks on this head
bf46d5b75b(stacked on inkling2 metal: grouped NAX MoE, NAX/multi-TG attention, vectorized mv_fuse, and fused decode kernels #44588b29cbedfb)python3 tools/zig/lean_check.py, on the base and on this head: 168 on base (8d54cafcd4), 168 on head (bf46d5b75b), 0 new findings.zig build native dev-tools -Doptimize=ReleaseFast -Dcpu=apple_m1— passed, 0 errors.zig fmt --check build.zig zigandgit diff --check— clean.tf-kernel-contract --only inkling2— 86/86 kernels PASS, 85/85 planted controls RED, 0 missed, 0 limit problems on Apple M5 Ultra, Apple M5 Pro, and Apple M3 Ultra.Receipt
8d54cafcd4onthinkingmachines/Inkling-2-Minied40e7da625f594fc9c4990f5f66be24873c22d7,T=0.0):--prompt-cache-gib 16, Apple M5 Ultra 512 GiB):cold_8k: TTFT3,773.6 ms(token_sha256=ef3c3025356dc777, len=163)warm_8k: TTFT1,140.4 ms(3.31x faster TTFT,token_sha256=ef3c3025356dc777, 100% bit-identical)warm_8k_new(shared 8K prefix + new question): TTFT1,165.1 ms(3.24x faster TTFT)max_rows = 1024,--prompt-cache-gib 0):2,575.4 tok/s(up from387 tok/sbaseline and1,880 tok/satmax_rows = 512)840.7 tok/s(up from101 tok/sbaseline and615.6 tok/satmax_rows = 512)1,257.5 tok/s(10.4K) /1,222.5 tok/s(20.5K)c=1decode withTarget.warm()window_costs:fibonacci-raw52.3 → 80.15 tok/s(tpc=2.84),gpu-chat46.4 → 54.93 tok/s(tpc=2.10), prefill-continuation93.1–108.7 tok/sfibonacci-raw24.1 → 40.30 tok/s,gpu-chat24.1 → 29.89 tok/sfibonacci-raw58.41 tok/s,gpu-chat41.73 tok/sinkling2native Metal backend, DSpark lane snapshot/restore,Target.warm(), andlanes/depth.zig.--prompt-cache-gibwith DSpark enabled).#4458(8b29cbedfb), headbf46d5b75b, Zig 0.17.0, Xcode Metal 4.0 toolchain, Apple M5 Ultra 512 GiB / M5 Pro 64 GiB (macOS 27.2.1) & M3 Ultra 512 GiB (macOS 26.6.2),thinkingmachines/Inkling-2-Minied40e7da625f594fc9c4990f5f66be24873c22d7with bundledmtp.safetensors.inkling2native serving (plain, DSpark, and DSpark + prompt cache) across M5 Ultra, M5 Pro, and M3 Ultra; M1/M2/M4 not run on hardware.T=0.0,token_sha256on Apple M5 Ultra 512 GiB):p15:plain=a5077f27220d93ba==dspark=a5077f27220d93ba==dspark_pc=a5077f27220d93bap33:plain=114eb7bb615a3609==dspark=114eb7bb615a3609==dspark_pc=114eb7bb615a3609p184:plain=da48844b05981221==dspark=da48844b05981221==dspark_pc=da48844b05981221==p184_warm=da48844b05981221cold_8k==warm_8k(--prompt-cache-gib 16, DSpark ON):ef3c3025356dc777==ef3c3025356dc777tools/bench_openai.py(--tokens 256 --reps 3 --temperatures 0).512/2048/8192/16384,--prompt-cache-gib 0) and cold vs warm 8K prompt-cache TTFT posted above.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.