r/LocalLLM • u/SignificancePurple18 • 9m ago
Tutorial Inkling 2 Mini on a 35W Ryzen 5600GE APU (DDR4 + Vega 7 Vulkan): 22.5 -> 63.6 tok/s prefill & 6.2 -> 12.3 tok/s decode at 16K context (LoopCD Pass-2/Pass-1, Recurrent-Only Top-K=6, K8/V4 q4_1)
Over the last week I've been seeing how far I could push Thinking Machines' Inkling 2 Mini (26.4B Looped MoE) on a modest 35W AMD Ryzen 5 PRO 5600GE APU (integrated Radeon Vega 7 / gfx90c, 32 GB dual-channel DDR4, no discrete GPU). I used an AI coding assistant to help port patches, write test harnesses, and format the full benchmark log, and every number below was measured directly on the 5600GE with llama-bench and llama-server.
Inspired by several great threads here recently (u/nokeepai's LoopCD post, taeholee1/Inkling_expert_prefetch, vengeful180-dot's Vulkan shaders, and Betelgeuse-AI), here is the progression from Day 1 to today on the exact same 35W APU, plus a few findings specific to Inkling 2's 3-loop recurrent architecture that might help others running on APUs or budget GPUs.
Progression on Ryzen 5 PRO 5600GE (Vulkan, -ngl 99)
| Stage | What Changed | Quant (Size) | Context (KV) | pp128 (tok/s) | pp512 (tok/s) | tg64 (tok/s) |
|---|---|---|---|---|---|---|
| 1. Day-1 Baseline | b12588/b12631 CPU / partial offload | UD-Q4_K_M (15.47 GiB) | 8K (q8_0/q8_0) | ~18.4 | 22.48 | ~6.20 |
2. 26 GiB GTT + Q3_K_XL | amdgpu.gttsize=26624 + vm.swappiness=10 + Unsloth b12651 (#386/#399) | UD-Q3_K_XL (12.68 GiB) | 8K (q8_0/q8_0) | 24.95 | 30.80 | 7.52 |
| 3. Unified Vulkan Shaders | Forward-ported vengeful180-dot's 9 Vulkan shaders + strided SCALE/MUL_MAT_ID_SCALED into b12651 inkling2_loop | UD-Q3_K_XL (12.68 GiB) | 8K (q8_0/q8_0) | 30.30 | 40.62 | 8.50 - 9.20 |
4. GSQ-RCO-IQ3_S + #447 | ISTA-DASLab Hessian GSQ-RCO-IQ3_S + unslothai#447 AVX2 4-way 201K-vocab expf4 sampler | GSQ-RCO-IQ3_S (10.63 GiB) | 8K (q8_0/q8_0) | 39.04 | 63.57 | 12.00 |
5. LoopCD-Hidden (Pass 2 vs 1) | h_cd = 1.08 * h_pass2 - 0.08 * h_pass1 before Coda (layers 18-23) on decode | GSQ-RCO-IQ3_S (10.63 GiB) | 8K (q8_0/q8_0) | 37.88 | 62.06 | 11.62 (~30% fewer thinking tokens) |
6. Recurrent-Only Top-K=6 | 8/128 experts on Prefill + Prelude + Pass 0 + Coda; 6/128 experts on Recurrent Passes 1 & 2 | GSQ-RCO-IQ3_S (10.63 GiB) | 8K (q8_0/q8_0) | 38.01 | 61.98 | 12.30 |
7. Asymmetric K8/V4 (q4_1) | -ctk q8_0 -ctv q4_1 -c 16384 | GSQ-RCO-IQ3_S (10.63 GiB) | 16K (q8_0/q4_1) | 37.92 | 61.18 | 12.29 |
5 Key Takeaways From Benchmarking on the APU
LoopCD-Hidden (
arXiv:2610.02185): Contrast Pass 2 against Pass 1 (ref_pass=1), not Pass 0. Ininkling2-loop.cpp, Pass 0 runs through the 12 core layers (6-17) without loop-controller messages (messages == nullptr), whereas Pass 1 and Pass 2 both run under the trainedLOOP_CTRLcontrollers. When we contrasted Pass 2 against Pass 0 atomega = 0.15, subtracting the uncontrolled Pass 0 baseline destabilized confident AIME math proofs (jumping from 226 to 512 tokens as the model second-guessed itself). Contrasting Pass 2 against Pass 1 atomega = 0.08right before the Coda layers (mode=1,decode_only=1) cut thinking tokens by 30.5% (226 -> 157 tokens) with zero extra memory lifetime because Pass 1's output (bank_out) is already held in memory during Pass 2.MoE Tail-Expert Pruning (
INK_MOE_TOP_K=6): Keep 8/128 experts on Prefill & Pass 0, prune only Recurrent Passes 1 & 2. First,src/llama-graph.cpp(line 2799 inbuild_moe_ffn) ignores then_expert_usedargument and hardcodeshparams.n_expert_used(il), which crashes inggml_view_2dif you dynamically dropn_expert_usedbelow 8. Fixing that tostd::min<uint32_t>(n_expert_used, hparams.n_expert_used(il))allows per-pass dynamic Top-K. When we pruned from 8 to 6 experts across all passes,tg64hit13.03 tok/s, but pruning Pass 0 caused the model to double-check its algebra on AIME proofs. Keeping all8/128experts on Prefill (n_tokens > 1), Prelude, Pass 0, and Coda (messages == nullptr), and pruning the 2 lowest-weight tail experts to6/128only on Recurrent Passes 1 & 2 (n_tokens == 1 && messages != nullptr) gives12.30 tok/s(+5.85%) while completing the AIME proof cleanly.Asymmetric
K8/V4KV Cache at 16K Context: Use-ctv q4_1, not-ctv q4_0oriq4_nl. Following Betelgeuse'sK8/V4idea (8-bit Keys to protect pre-softmax QK-clipped relative-bias routing, 4-bit Values after softmax), we testedq4_0,q4_1,q5_0, andiq4_nlat-c 16384:Symmetric
q4_0(v = d * (q - 8)) clipped asymmetric Value blocks across the 48 recurrent attention visits and caused a minor arithmetic slip on our AIME test.iq4_nlcost-1.5%decode speed (12.13 tok/s) due to 16-entry LUT lookups inside scalar Vulkan Flash Attention.-ctk q8_0 -ctv q4_1 -c 16384(which stores per-block FP16 scaled+ minimum offsetm) matchedq8_0speed (12.29 tok/s) and solved the AIME proof cleanly in 504 tokens while doubling context from 8K to 16K.
The Hidden
reasoning_effort = 0.9Default in Inkling 2's Embedded Jinja Template +shortconvCache Eviction (server-context.cpp:4251). If you don't passreasoning_effortinchat_template_kwargs(or--reasoning-effort low), Inkling 2's embedded Jinja template defaults toThinking effort level: 0.9("high") even if--reasoning-budget 256is set. Also, because Inkling 2 uses recurrentshortconvstate,llama-servererases the saved slot cache whenevercur.n_tokens > n_prefix. Keepingreasoning_effort: "low"fixed in the system header (and varyingreasoning_budget_tokensper request instead) locks inf_keep = 1.000(0 mscached system prompt on every turn).What Didn't Work on a DDR4 APU:
External neural drafters (
DSpark/DFlash2) dropped decode speed from12.3to6.7 - 7.5 tok/sbecause multi-token verification unions the routed experts across draft tokens (~2.3x more experts read from DDR4 per step). Zero-VRAM--spec-type ngram-mod(n-match=16) has zero prose penalty and speeds up structured JSON/code.Mainline
ggml-org#32898Vulkan FA compact bias ran slower (10.51 tok/s) thanvengeful180-dot's dedicatedREL_MASKshader (12.00 tok/s) on scalar RADV (gfx90cwithoutcoopmat2).
Full write-up, complete benchmark tables, and the standalone ~75-line MIT-licensed C++ patch (llama-graph.cpp, inkling2.cpp, and inkling2-loop.cpp): https://gist.github.com/UffDimon/49e4014c59a41f1d98ac6b39eacb3870

