Why We Run turbo6 KV Cache on Inkling-2-Mini (32 GB Strix Halo)
turbo6 is a 6.125-bit KV cache format (the memory holding the conversation so far) that stays near-lossless to q8_0. At 262K tokens it shrinks Inkling-2-Mini's KV cache from 8.0 GiB (FP16) and ~4.25 GiB (q8_0) down to 3.24 GiB — the extra ~1.0 GiB saved over q8_0 lets a full 262K run fit inside a 32 GB laptop.
- Fits 262K in 32 GB unified RAM: A full 262,000-token run peaked at 21.02 GiB of the GPU's 24 GiB shared memory limit (0.6 GiB free, zero errors).
- Near-lossless to
q8_0with task parity: In upstream PR #381 (Qwen3.8-27B),turbo6stayed close toq8_0(KLD 0.00050–0.00056 vs 0.00025–0.00036; KLD measures output probability drift, where 0 = identical). On Inkling-2-Mini we measured 142/164 on HumanEval with both (effort=none), 3/3 on Rust multi-file ports, and 4K KLD 0.0077–0.0099 vs FP16 (95.3–96.5% top-1 agreement). - Speed trade-off: Short generation is 44.5 vs 45.6 tok/s (−2.4%) and 36K prompt prefill is within 1% (894 vs 903 tok/s), but 2K / 4K / 16K prefill is still 10% / 22% / 18% slower than FP16.
- Known caveat:
turbo6is not safe for every model — on small denseQwen2.5-0.5Bit hit KLD 0.572 withoutq8_0edge layers (Section 4), and 262K needle retrieval (NIAH) is not yet tested.
1. Why turbo6 instead of FP16 or q8_0
On a 32 GB unified-memory laptop (ASUS TUF A14 FA401EA, Ryzen AI Max+ 392 / Radeon 8060S, where the GPU can address up to 24.0 GiB of system RAM), running Inkling-2-Mini at its full 262,144-token context comes down to KV-cache size:
- FP16 KV (16.0 bits/value, 8.0 GiB at 262K): Across Inkling's 8 global attention visits (layers run multiple times per token), FP16 KV plus ~18 GiB weights and runtime projects to ~26 GiB — over the 24 GiB GPU pool.
q8_0KV (8.5 bits/value, ~4.25 GiB at 262K): Standard 8-bit KV needs about 1 GiB more thanturbo6(~22.3 GiB projected all-in), leaving almost nothing free for the OS at 262K; we did not benchmarkq8_0at 262K.turbo6KV (6.125 bits/value, 3.24 GiB at 262K): Uses Walsh-Hadamard rotation plus a 6-bit Lloyd-Max codebook (128 values in 98 bytes; ported from TheTom/llama-cpp-turboquant PR #381 by JakeATX / TurboQuant arXiv:2504.19874). It stays near-lossless toq8_0while cutting KV memory 2.47× below FP16 and ~24% belowq8_0.- Why not 5-bit (
turbo5): In earlier Qwen hybrid 20K tests, dropping fromturbo6toturbo5tripled KLD (0.0016 → 0.0053). We did not testturbo5on Inkling.
q8_0 projected, turbo6 measured at 262,000 tokens). Right: Measured quality and speed comparison.2. Measured Full 262,000-Token Fill on a 32 GB Laptop
Only 8 of Inkling-2-Mini's 48 layer visits grow linearly with context (head_dim = 128 = one turbo6 block per head, 12.25 KiB/token = 3.06 GiB at 262K); the other 40 visits keep a fixed 1,024-token sliding ring (0.18 GiB total). We ran a full 262,000-token fill on Inkling-2-Mini-abliterated-Mix-16G + turbo6 (2026-11-27):
- Full 262K prefill: 479.14 s (546.8 tok/s average across 262,000 tokens).
- Memory footprint: Peak GPU RAM 21.02 GiB (21,523 MiB), steady host RSS 0.79 GiB (~21.35 GiB all-in). It fits with 0.6 GiB to spare (609 MiB MemAvailable low): tight, with zero out-of-memory or kernel errors.
- Steady decode at 262K full fill: 61.0 ms/token (16.4 tok/s). This run verified memory and speed stability; 262K needle retrieval quality is not yet tested.
3. Quality, Memory & Speed (FP16 vs q8_0 vs turbo6)
| Measurement (model file noted per row) | FP16 KV | q8_0 KV | turbo6 KV | Notes |
|---|---|---|---|---|
| KV size at 262,144 ctx (Inkling-2-Mini) | 8.00 GiB | ~4.25 GiB | 3.24 GiB | 2.47× smaller than FP16; ~1.0 GiB smaller than q8_0 |
| All-in RAM at 262K (Mix-16G, 32 GB laptop) | ~26 GiB (OOM) | ~22.3 GiB | 21.02 GiB GPU | FP16 & q8_0 projected; turbo6 measured at 262K (0.6 GiB free) |
| Upstream KLD vs FP16 (PR #381, Qwen3.8-27B) | 0.000 | 0.00025–0.00036 | 0.00050–0.00056 | Near-lossless to q8_0 at 6.125 vs 8.5 bits/value |
HumanEval 164 (UD-IQ4_XS, greedy, effort=none) | 142 / 164 | — | 142 / 164 | 4 unique passes each side (noise; EVAL-N01's 154/164 used effort=0.2) |
Rust multi-file port (UD-IQ4_XS, 4 tests) | 3 / 3 | — | 3 / 3 | All 6 runs passed 4/4 tests in 5–9 turns |
Inkling KLD vs FP16 (Unsloth UD-Q4_K_XL, 3 × 4K) | 0.000 | — | 0.0077–0.0099 | Top-1 agreement 95.3–96.5% (task parity, not bitwise identical) |
Short-prompt decode (Unsloth UD-Q4_K_XL) | 45.6 tok/s | — | 44.5 tok/s | −2.4% speed cost for 2.47× KV compression |
Short/mid prefill (Mix-16G, 2K / 4K / 16K) | baseline | — | −10% / −22% / −18% | Known regression (open optimization track) |
Long prefill (Mix-16G, 36K 2-pass) | 903 tok/s | — | 894 tok/s | Within 1% of FP16 prefill at 36K |
4. Important Caveat: Do Not Apply Blindly to Small Dense Models
Dense-model warning: turbo6 works well on hybrid/sliding-window models with wide heads (Inkling-2-Mini 4K KLD 0.0077–0.0099; earlier Qwen3 hybrid GQA 6:1 head_dim=256 KLD 2.0e-4–3.3e-4). On a small dense model (Qwen2.5-0.5B), unguarded turbo6 hit KLD 0.572 (cut to 0.0375 by keeping the first 4 and last 4 layers at q8_0). Always run a KLD + task check before adopting on a new architecture.
5. Upstream Code, Paper & Model Attribution
We did not invent TurboQuant or the turbo6 codebook tables — our contribution is the AMD HIP port, GFX1151 prefill/decode kernels, bit-exact oracle tests, and Inkling-2-Mini integration (draft upstream PRs PR #25 & PR #26). Full upstream credits:
- TurboQuant algorithm: Zandieh et al. (Google Research), TurboQuant: Online Vector Quantization with Near-optimal Distortion Rate, arXiv:2504.19874 (random orthogonal rotation + Lloyd-Max scalar quantization; the
llama.cppfork uses fast Walsh-Hadamard rotation). turbo5/turbo6KV format & Lloyd-Max codebook tables: Ported directly from TheTom/llama-cpp-turboquant PR #381 authored by JakeATX (JakeATX/tq5-tq6-kv-cache, MIT license) in TheTom'sllama-cpp-turboquantfork.- Base Inkling-2-Mini engine: alesha-pro/maya-inkling-mini (CUDA original; ported to AMD HIP as
maya-ik2) and gufo-org/gufo (base engine extended by tubo). - Models tested: Thinking Machines Lab (thinkingmachines/Inkling-2-Mini), orcarouter (orcarouter/Inkling-2-Mini-abliterated), and Unsloth (unsloth/Inkling-2-Mini-GGUF).