Repository navigation
Learning notes: Inkling 2 Mini at 128K on an M1 Max 32 GB (llama.cpp Metal, ~20 tok/s) #3
Replies: 3 comments
Engine comparison: llama.cpp vs MLX-VLM + speculation vs MLX-VLM plain (same Mac)The same three-setup test as the Qwen3.8-27B comparison on #4, on this M1 Max 32 GB (32-core GPU). Only one server ran at a time. Same prompts, temperature 0, 512-token cap, unique prefix per request, 3 runs at short / ~8.5K / ~25.7K tokens and 1 run at ~66K. Numbers are medians. Setups
Notes on the MLX weights:
Every weight file matched its HF LFS sha256.
Findings
Recommendation: keep llama.cpp (#466) as the 128K recipe. If your prompts stay under ~40K tokens and you paste large files, the MLX NVFP4 build with |
LookAtMyQuant on M1 Max 32 GB (32-core GPU)Runtime: ShinMegamiBoson/lookatmyquant pinned at
All context-check answers at 8K / 25K / max were correct. Drafter mode does not run on M1. The DSpark verify step ( Notes
Related: Qwen3.8-27B #4 · LFM2.5-24B-A2B #5 |
Update: LookAtMyQuant PR #4 fixes the drafter on M1ShinMegamiBoson/lookatmyquant#4 by @deeflect (head
Test details: ShinMegamiBoson/lookatmyquant#4 (comment) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Learning notes from getting Thinking Machines' Inkling 2 Mini running on a 32 GB MacBook Pro (M1 Max), tuning it with the inference-optimisation skill, and publishing a lab-passed recipe to the Local AI registry: sybil-solutions/local-ai-registry#466.
TL;DR
-ub 256+ q8_0 KV fixes it.How the model works
Quant, engine, and why that build
UD-Q4_K_XL(17.63 GB), fromunsloth/Inkling-2-Mini-GGUF@ae9327c5. It is the quant Unsloth's guide recommends (mean KLD 0.0107 vs the 8-bit reference, 98.0% same top token), and the largest that still leaves room for a 128K KV cache.UD-Q8_K_XL(22.9 GB) leaves no room in the 25 GiB Metal budget.b12588-mix-c0c3de8(macOS arm64 prebuilt, sha256229def18…fc496ceb8).How to run it on an M1 Max 32 GB
# from a directory holding llama-b12588-mix-c0c3de8/ and the GGUF llama-b12588-mix-c0c3de8/llama-server \ -m Inkling-2-Mini-UD-Q4_K_XL.gguf \ -c 131072 -np 1 -ngl 99 -fa on --fit off \ -ub 256 -ctk q8_0 -ctv q8_0 --cache-ram 0 \ --temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 \ --jinja --alias inkling-2-mini --host 127.0.0.1 --port 8080Sampling is Thinking Machines' recommendation (temp 1.0, no truncation). No
sysctl iogpu.wired_limit_mbchange is needed.Why the defaults fail
macOS gives the GPU a 25.0 GiB working set on a 32 GB Mac. Measured Metal buffers:
-ub 512, f16 KV)-ub 256, f16 KV-ub 256, q8_0 KVThe compute buffer is unusually large (~3.3 GiB fixed + ~5.5 MiB per ubatch token) because the relative-bias attention spans the whole window. q8_0 KV is a small quality trade.
Performance (M1 Max, 32-core GPU, macOS 26.6.2, AC power)
Decode sits at 25% of the bandwidth ceiling: the limit is kernel efficiency over 48 looped MoE layer passes, not memory bandwidth.
What the optimisation skill tried
Every candidate ran between two controls, median of 6 samples (control noise was under 2%).
-ub 128to fit)-ub 128vs-ub 256-lm none,-lm mmap+mlock-fa offWhy DSpark loses here: with 1 draft, 58% acceptance gives 1.58 tokens per step, but a 2-token verify step costs 1.98× a 1-token step. On Metal,
mul_mat_idbelow 32 rows uses a per-token mat-vec kernel, and each verified token routes to its own 8 of 128 experts in all 48 looped passes, so nothing is shared. Speculation only pays when verifying k tokens costs much less than k steps.Lessons
buffer size =lines in the server log and add them up.Evidence, logs and the full hill-climb log:
data/sources/inkling2-mini-m1-max-32gb-llamacpp/in #466.Companion: the same Mac, engine and benchmark settings with Qwen3.8-27B, plus a side-by-side table: #4
Series: Inkling 2 Mini (#3) · Qwen3.8-27B (#4) · LFM2.5-24B-A2B (#5): same Mac, same benchmark settings.
All reactions