You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
turboquant: support head_dim = any positive multiple of 128
Relaxes the head_dim == 128 hard guard in llama-kv-cache.cpp to a
multiple-of-128 check. Qwen 3.5, Gemma, and other head_dim=256
families now load with -ctk turbo3 / -ctv turbo3 cleanly.
The cpy.cu kernels need no change: ggml stores a 256-dim row as two
back-to-back block_turbo3 entries (blck_size = 128 × type_size = 50
per block × 2 blocks/head). cpy_turbo3_f16_cuda dispatches one CUDA
block per 128-element block, so a 256-dim head just gets two
thread blocks per row instead of one.
Validated on RTX 5080:
- Qwen3.5-9B Q4_K_M (n_embd_head_k=256), -c 32768 -fa 1
FP16 KV: 7968 MiB
TURBO3 KV: 7140 MiB (~830 MiB saved)
- Qwen2.5-Coder-14B Q4_K_M (head_dim=128 baseline) still
reproduces 15.3 GB FP16 vs 10.9 GB TURBO3, ~4.4 GB saved.
Spec: doc/specs/2026-05-30-turboquant-kv-cache.md
0 commit comments