What this thread does
Compare KV layouts on the same workload before changing precision or concurrency; llama.cpp v0.9.0 ships a unified-cache optimization, while one reporter still sees a performance gap (official release, wsj040303's follow-up).
Do first: compare --no-kv-unified with --kv-unified --kv-unified-per-slot 2048; these are wsj040303's comparison flags, also documented in the v0.9.0 server README.
Choose the comparison
- Layout: keep model and precision unchanged, with 65,536 total tokens and 2,048 per slot; restart between configurations and compare elapsed time/output lengths (wsj040303).
- Precision: contributor am17an recommends F16. The official flags are
--cache-type-k f16 --cache-type-v f16; changing precision is a separate comparison (November 5 advice, server README). - Checkpointing and concurrency: am17an suggests
-cram 0 -ctxcp 0and says optimization currently focuses on up to eight parallel sequences, with 16/32 on the roadmap. These are diagnostic suggestions, not universal defaults; the README defines-cramas RAM cache size and-ctxcpas checkpoints per slot (advice, README).
Findings and release status
wsj040303's November 5 report in ggml-org/llama.cpp #31711 says “finished requests leave holes”. Scope: Ubuntu 26.04 x86_64, RTX 5070 12 GB, CUDA 13.4, Qwen3-0.6B BF16 weights; initial measurements use 0.7.0-dev at October 24 commit 6b9ba4f2e8c1436511956f0b3c309e2c9e642071. The author attributes fragmented decode batches and poor CUDA Graph reuse to gaps in active slot IDs, reduced with unified KV.
The ggml-org/llama.cpp maintainers' November 4 v0.9.0 note includes #29510 and flash_attn_ext_rows: “more efficient unified KV for multi-seq”. That optimization is released. The non-unified fragmentation issue remains open (#31711); this is not evidence of a released repair to that path.
In a November 5 follow-up, wsj040303 reports v0.9.0 unified KV with BF16 KV taking 193.909 seconds with kv_rows disabled and 165.632 seconds enabled, over 256 requests in eight batches of 32. This is the same reporter, not independent replication.
am17an's reply suggests BF16 may fall back to CPU on CUDA, qualified with “AFAIK”; treat that mechanism as uncertain contributor advice, not an established explanation for this trace.
Limits
One reporter, one small model/GPU and one full run per initial configuration; no confidence bounds (report). Larger models, other backends and continuously refilled queues are outside this evidence; these timings do not rank engines generally. Precision changes alter numerical format.
Not for: Qwen reprocessing the full prompt each turn; see llama-cpp-qwen-agent-full-prompt-reprocessing-preserve-thinking.
Started from a post by @llama.cpp maintainers, packaged by the editor. Original post