Repository navigation
docs: a plan for Inkling 2 Mini on CUDA and Metal in claimable slices - #4274
Conversation
|
Thanks for laying out the slices. I can test native Metal on an M4 Pro (48 GiB), and would like to coordinate here rather than start a competing proposal.
I have a local Metal experiment, but no native receipt or ATC claim yet. Once the gate and shared host ownership are agreed, I can contribute the M4 Pro validation and coordinate a Metal slice with you. Which slice would be most useful for me to take? |
|
One correction to the proposed gate: the pinned tiny Mini checkpoint explicitly drops MTP and has a one-block loop core. It can cover plain/resume/concurrency, but not drafted/plain or selection between two previous-pass message sources. Could we make H4 a dependency of C5/M6, cover the two-source message case in H3, and run draft parity on the original bundled pair with actual proposal/acceptance counts? SGLang's capture code also makes the tap contract explicit: 5/23/41 are inputs to zero-based decoder visits; 48 is the post-final-norm output, not a cache slot. |
|
@akol1, thank you for this plan: it is clear, and it is the plan we are now working from. Answers to the seven questions:
If you or @AbrahamCete want a slice, say which here before you start, so nothing is built twice. Device runs on our machines (a GB10, M5 and M3 Ultras, and a gfx1151) come from us.
|
|
Thanks, and coordinating here is what the plan is for. Nothing is claimed yet and the gate is not agreed, so this is a suggestion, not an assignment. I can run a GB10 and an M4 Max, so my likely share is the CUDA slices on sm_121. Your M4 Pro is the earlier-chip coverage Metal needs: the pre-M5 prompt path of M1 would be the most useful, or M2 if you would rather start on the glue kernels. Neither waits on decision 2. Neither of us has an M5, so the tensor-unit path needs a third tester. Your 19.70 GB figure is a useful fit baseline for M5's admission by memory class. I've added SGLang's pull request to the plan as a second candidate for decision 2, with your note that H3, C3 and M3 must name the path and its rounding points. I have not checked its rounding myself. |
|
Thanks both. Following @ashhart’s decision, I’ll keep the integrated experiment local and leave the shared host code and full Metal bring-up to your team. I’d like to take M1’s pre-M5 attention prompt path, with M4 Pro validation, if you haven’t started that part. I can work against your attention arithmetic and share the device receipt, without taking the M5 tensor-unit path. If pre-M5 is already underway, I’m happy to validate your branch on the M4 Pro instead. I’ll wait for the ownership confirmation before opening a slice PR. |
|
Thanks @ashhart, and @akol1 for the plan. For HIP I'd like to take the attention slice, the HIP counterpart of M1: sliding and global attention with the sink, the relative bias, log scaling and the L2 clips on gfx1151, following #4125's arithmetic, with the decode and prompt paths under the kernel contract (records and planted controls). It depends only on decision 1, so it can start now, and I can bring gfx1151 receipts from my Strix Halo alongside yours. If your team has already started HIP attention, I can take the HIP routed experts as stored instead (NVFP4 and MXFP8 decoded to BF16 in registers, with the checkpoint's activation quantization per decision 2, the counterpart of C3 and M3), or validate your branch on gfx1151. I'll wait for your confirmation before opening anything. |
|
Native M4 Pro update for the validation offer: the original Mini checkpoint ( |
|
A correction to answer 2, after reading the checkpoint and the reference more closely.
So the contract for the routed experts is the reference's arithmetic: the stored NVFP4 and MXFP8 weights decoded in registers, bf16 activations, FP32 sums. That keeps every stored weight bit and makes the tiny checkpoint's token-equal fixture usable as the fidelity check. The declared activation quantization can come later as an opt-in with its own quality gate, if anyone wants it.
|
|
The BF16 correction measurably helps on M4 Pro. On |
|
Thanks @ashhart, that settles all seven. I'll bring the plan document up to date with the decisions, including the corrected answer 2, and with @BlivionIaG's two corrections once I have checked them against the tiny checkpoint and the tap code. A slice, as you asked, before starting anything: I'd like to take H3, the loop's arithmetic written down for the gates and the cross-pass message, with a float64 model and single-change probes on the host. It needs no GPU and every backend's loop kernels depend on it. If your team has already started it, my fallback is C3, the routed experts as stored on sm_121 with bf16 activations and FP32 sums, which I can run on a GB10. I'll start neither before you confirm. Meanwhile, and not a slice: I'm measuring standard-server baselines for the speed bar on the two machines I have, a GB10 and an M4 Max with 128 GiB, since I found none published for either. I'll post them here with the pinned revisions and raw results. |
|
Standard-server baselines for the speed bar, on the two machines I have. Clients: GB10 (sm_121)
M4 Max, 128 GiB, macOS 27.2.1
Decode is the raw-completion prompt's median of three; the 4-stream figure is the code prompt. Pinned:
Limits:
I can attach the raw JSON if useful. |
|
We can take the XPU column of this plan on an Intel Arc Pro B70 (32 GB, Xe2), following the Metal slices: X1 attention (sliding and global, sink, relative bias, log scaling, L2 clips) on #4125's arithmetic, X2 glue kernels, X3 routed experts as stored (NVFP4/MXFP8 decoded in registers, bf16 activations, FP32 sums per decision 2), then X4 loop kernels once H3 lands and X5 the engine at one card. The baseline would be measured on the same card. We would start nothing before your confirmation, and can also run C-slice checks on a GB10 if useful. |
|
@ashhart, @akol1: we'd like to help where it doesn't duplicate work already asked for. Nothing below is started; I'll wait for your confirmation. Slice: H4 + C5, the DSpark drafter. H4 is the host side: Review and test, for any slice:
We can begin with reviews of #4127 and #4128 now, since C1, C5 and C6 build on them. |
|
Thanks for the plan. We can fill the M5 gap named under Hardware. We run two Mac Studios with M5 Ultra, 512 GB each, and can run each Metal slice's kernel contract (SUMMARY with planted controls) and the served receipt on the exact head, including M1's M5 tensor-unit prompt path, then post the raw output. For the speed bar on M5 Ultra we already measured a standard-server baseline with the original checkpoint ( We are not claiming a build slice. If you'd like an M5 owner for M1 later, we're happy to take it once you confirm. |
|
Shared-core review of this plan at Wrong dependency
Should
Small points
The full list, with both sides' file:line, is ready to paste if useful. Per-PR notes follow on #4127, #4128 and #4124. |
|
Opened #4337 with the M4 Pro Metal path. Head It adds native serving of the original On this 48 GiB M4 Pro the expert contract passed 86/86 with the planted controls red, the tiny checkpoint matched 35/35 top tokens against Transformers |
- 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 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.
|
The expert scales, read from the original checkpoint's bytes ( NVFP4, layers 0-19
MXFP8, layers 20-23
Scripts and residual tables are available on request. |
- 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 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.
|
The routed-expert correction is now recorded correctly. Two details from the shared review still need fixing. M6 says Kimi K3 has a Metal DSpark drafter to adapt, but its Metal adapter explicitly refuses external draft heads. Please name MiniMax M3 as the existing implementation, or make M6 a shared Metal DSpark slice with a second caller. Also add
|
|
gfx1151 figures for the speed bar, since it is the one machine in the plan without them. They use @akol1's method from #4274 (comment), on the same pins: Strix Halo, Ryzen AI MAX+ 395 (gfx1151), 128 GB, Ubuntu, llama.cpp Vulkan
Decode is the raw-completion prompt's median of three. The 4-stream figure is the code prompt. Pinned:
Limits:
@ashhart, one question about HIP: has your team already started HIP attention? If not, I'll start the slice I offered above (#4274 (comment)) on #4125's arithmetic, and bring gfx1151 receipts measured against these figures. If it has, I'd rather validate your branch on this machine. |
…at the tiny checkpoint covers
…te, and record ashhart#4126 as landed
869180d to
7557cc1
Compare
|
Thank you @akol1. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
|
Congrats on landing the plan. Picking up my note from the 21st: could the XPU column join it? We'd take it on an Intel Arc Pro B70, built on #4387's host slices and #4124's reply split once they land, and claimed slice by slice as the plan asks. Where it stands locally, on one B70 (card 0), none of it pushed:
If that works for you, I'll post the slice list here first and wait for your go before opening anything. |
|
@ashhart #4337 (Inkling 2 Mini on Metal: text, vision and the bundled DSpark head, M4 Pro) is out of draft. The description now goes through the agreed gate item by item. Short version, with what is not met stated there too:
The decisions that are yours are listed in the description: F1 (NVFP4 outer-factor rounding), |
|
Thank you for landing #4633. With the HIP attention on main, here is a HIP column in the plan's form, for your go before I open anything. It runs the same weights as CUDA and Metal (the original checkpoint) on gfx1151, under the gate agreed on #4265: the kernel contract with planted controls, same-engine exactness, teacher-forced fidelity against huggingface/transformers#51050, and decode no slower than llama.cpp's Vulkan server on the same machine (21.9 tok/s at one stream and 62.6 at four for IQ4_NL, posted above).
I would start with HIP2 and HIP3, which need nothing else, then HIP4 once #4387's loop model is on main. If your team has already started any of these on HIP, tell me which, and I will take the others or validate yours on gfx1151. |
|
@ashhart updating my slice claim of 2026-11-21 now that #4387 is on From what I measured on My slices:
Not taking: M2, M3, M4, M6 or the M5 tensor-unit paths, which sethforprivacy, gilby and cwschroeder have open. #4744 (the sampler heap) is separate and ready. If any of these collides with a slice you or sethforprivacy already have in flight, say so here and I will drop mine. |
|
@AbrahamCete, thank you for the HIP column and for #4633. Yes, go ahead with it as you laid it out, one slice per pull request, under the same gate as #4265: the kernel contract with planted controls, same-engine exactness (drafted equals plain, resumed equals fresh, concurrent equals solo), teacher-forced fidelity against the reference, and decode no slower than the Vulkan figures you posted. A few notes as you start:
|
|
Thank you. I'll start with HIP3, the routed experts, against One question on HIP2 before I fix its arithmetic.
Which should HIP match bit for bit? My preference is Metal's order, since it follows the reference's ascending-id convention. If you agree, I'd add serial references for the router, the convs and the softcap to |
|
Slices opened for the claim above, all ready, all against |
What this changes
Adds
docs/design/inkling-2-mini.md: a plan for serving Inkling 2 Mini (inkling2_loop) on CUDA and Metal, cut into slices that separate contributors can claim. Before: Mini has a proposal for HIP only (#4265) and no plan for the other two backends. After: one document records the maintainer's decisions, the host slices shared with HIP, the CUDA and Metal slices with what each waits on, DSpark on both backends, and the agreed gate.The maintainer agreed the plan and its gate in this discussion on 2026-11-21. The document now records the seven decisions, the agreed gate with its speed bar, and what the tiny checkpoint can and cannot cover. It claims nothing; I have asked here for H3, with C3 as the fallback, and start neither before confirmation.
523d58cbe; five commits.atc overlap --json(ATC 0.9.6, 2026-11-21, base523d58cbe): incomplete (otherPullRequestsLimit,pullFilesUnavailable,pullRequestsLimit,timeLimit). The one changed file is new, so no open pull request shares it; the overlaps the run lists belong to my other open pull requests.Checks on this head
a4b18d130python3 tools/zig/lean_check.py, on the base and on this head: 168 and 168, 0 new (frompython3 tools/pr_check.py --base origin/main: 0 errors, 0 warnings).git diff --checkclean. No test reaches a design document.zig build test test-goldenandzig fmt --check; the change is one Markdown file and touches no source, build file or fixture.Receipt
n/a: documentation only; nothing here can reach inference.
thinkingmachines/Inkling-2-Miniand itsmtp.safetensors, both Apache-2.0.What I have not established
config.jsonand model card, not from running the checkpoint. The memory figures are estimates from the config.Checklist