Asymmetric KV-Cache Quantization in llama.cpp: Q8_0 Keys with Q4_0 Values on Apple Silicon
llama.cpp lets users set key and value cache quantization independently through --cache-type-k and --cache-type-v, rather than treating both the same. The article argues keys need higher precision because they drive attention routing via the softmax, while values, which are summed after softmax, tolerate tighter quantization. Using GGML block sizes, the author calculates that pairing Q8_0 keys with Q4_0 values yields a KV cache about 0.406 times the size of FP16, a reduction near 60%. The savings compound across concurrent sequences, which matters for multi-slot local serving on Apple Silicon machines with 24 to 48 GB of unified memory. The piece also presents a three-part unified memory breakdown covering weights, KV cache, and compute scratch.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in