Papers
arxiv:2611.30027

Fast 4-bit KV-Cache Decoding on Hopper GPUs Without FP4 Hardware

Published on Nov 29
Authors:

Abstract

A 4-bit KV cache decode kernel for Hopper GPUs can outperform FP8 serving kernels by overlapping decoding and loading, increasing speed and cache capacity while maintaining acceptable accuracy.

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.

Community

Author here. If you run vLLM on H100 / H200, three things from the paper you can check today (vLLM 0.33, H200, Llama-3.1-8B unless noted):

  1. --kv-cache-dtype nvfp4 decodes slower than FP8 on Hopper: 1.4–2.3× slower per step at batch 8 and above. Hopper has no FP4 hardware, and software unpacking exceeds the H200's budget of about 7 instructions per byte read. UltraQuant (ultraquant_4bit) falls back to Triton on NVIDIA and is 1.8–4.4× slower than FP8.
  2. Your FP8 baseline may not be the fast kernel. vLLM uses TensorRT-LLM's XQA decode only if a download from NVIDIA's artifact server succeeds; behind a proxy it silently falls back. Look for decode_backend=xqa in the log.
  3. Qwen2-family reasoning models can collapse under FP8 KV. Keeping layer 0 in BF16 (--kv-cache-dtype-skip-layers 0) restored them in our runs; test your model with and without it.

What the paper adds: a Hopper decode kernel for 4-bit KV (NVFP4 / MXFP4 / INT4) that stays within that budget. As a bare kernel it is 1.10–1.48× faster than the faster of XQA and FlashAttention-4's native FP8 at the 11 shapes we measured. In vLLM, with K mean removal, K rotation, 4 BF16 sink tokens and layer 0 in BF16, a decode step is 1.12–1.64× faster than FP8 at batch 8 and above (on par at batch 1), and the cache holds 1.63× as many tokens.

Limits: at 120K tokens on Llama-3.1-8B the cache loses 15 points against BF16 KV; head dim 128 only; the plugin is tied to vLLM 0.33.

Sign up or log in to comment

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2611.30027 in a model README.md to link it from this page.

Datasets citing this paper 2

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.30027 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.