Fast 4-bit KV-Cache Decoding on Hopper GPUs Without FP4 Hardware
On Hopper GPUs, which have no FP4 hardware, a 4-bit KV cache is slower than FP8 in today's serving stacks: on H200 the FlashInfer kernel behind vLLM's NVFP4 KV cache reaches only 10-19% of memory bandwidth. We show that this is a property of current implementations, not of the format. NVBit instruction counts against Hopper's issue budget, about 7 thread instructions per byte on H200, give two causes: the kernels behind vLLM's 4-bit paths execute 2-6x that budget, and the kernels we counted serialize loading, decoding and matrix multiplies. A decode kernel that stays within the budget and overlaps decoding with loading (a TMA producer warp, a cache layout that feeds decoded values to the tensor cores from registers, swapped operands for small query groups) is, as a bare kernel, 1.10-1.48x faster than the faster of TensorRT-LLM's XQA and FlashAttention-4's native FP8 kernels at all 11 shapes we measured, and 1.22-1.76x when the 4-bit K and V run on FP8 tensor cores. In vLLM, with K mean removal, K rotation, four BF16 sinks and layer 0 in BF16, a decode step on Llama-3.1-8B is 1.12-1.64x faster than with FlashInfer FP8 at batch 8 and above (on par at batch 1; 1.04-1.18x on 32B and 72B models), the cache holds 1.63x as many tokens, and on five models the 95% intervals exclude accuracy losses larger than about 3.5 points against BF16 KV. At 120K tokens on Llama-3.1-8B our cache loses 15 points against BF16 KV, about as much as vLLM's default FP8 path, while offline FP8 storage alone loses 3 and our cache 10. One H200 absorbed 1.23-2.20x FP8's request rate in 600-s bursts from an empty cache (mostly one seed); a higher sustained rate we examined but did not establish. In Qwen2-family models that collapse under FP8 KV, keeping layer 0 (whose key mean comes from the key-projection bias) in BF16 restores them, one only partly.
