Cache KV a 4 bit su GPU Hopper senza hardware FP4: un kernel batte l'FP8 fino a 1,48 volte4-bit KV cache on Hopper GPUs without FP4 hardware: a kernel beats FP8 by up to 1.48 times
Un kernel di Jian Zhang decodifica la cache KV a 4 bit su H200, che non ha FP4 nativo. È da 1,10 a 1,48 volte più veloce dei kernel FP8 ottimizzati, e porta 1,63 volte più token in cache. Ma a 120K token perde circa 15 punti.
A kernel by Jian Zhang decodes the 4-bit KV cache on H200, which has no native FP4. It is from 1.10 to 1.48 times faster than optimised FP8 kernels, and holds 1.63 times more tokens in cache. But at 120K tokens it loses about 15 points.

Le GPU Hopper (H100 e H200) non hanno unità FP4 native. Le implementazioni di cache chiave-valore a 4 bit con NVFP4 in vLLM sfruttano solo tra il 10 e il 19% della banda di memoria dell'H200. Il motivo è che estrarre i valori dai byte supera il budget di circa 7 istruzioni per byte. Jian Zhang (Northeastern University) propone un kernel che sovrappone decodifica e caricamento. Il kernel usa una disposizione della cache studiata per restare dentro quel budget.
Sui kernel il risultato è da 1,10 a 1,48 volte più veloce di XQA e FlashAttention-4 in FP8, su 11 forme. Con Llama-3.1-8B su H200 in vLLM, i passi di decodifica sono da 1,12 a 1,64 volte più rapidi dell'FP8 con batch da 8 in su. La capacità della cache sale di 1,63 volte, con perdite di accuratezza entro circa 3,5 punti rispetto a BF16. Ma a 120K token si perdono circa 15 punti, e il metodo è limitato a dimensione di testa 128.
Hopper GPUs (H100 and H200) have no native FP4 units. Implementations of the 4-bit key-value cache with NVFP4 in vLLM use only between 10% and 19% of the H200's memory bandwidth. The reason is that extracting values from bytes exceeds the budget of about 7 instructions per byte. Jian Zhang (Northeastern University) proposes a kernel that overlaps decoding and loading. The kernel uses a cache layout designed to stay within that budget.
On kernels the result is from 1.10 to 1.48 times faster than XQA and FlashAttention-4 in FP8, across 11 shapes. With Llama-3.1-8B on H200 in vLLM, decode steps are from 1.12 to 1.64 times faster than FP8 at batch sizes of 8 and above. Cache capacity rises 1.63 times, with accuracy losses within about 3.5 points against BF16. But at 120K tokens about 15 points are lost, and the method is limited to head dimension 128.
Il 23 novembre 2026 Jian Zhang, della Northeastern University, ha presentato su arXiv un lavoro (2611.30027, versione rivista il 29 novembre). Si intitola «Fast 4-bit KV-Cache Decoding on Hopper GPUs Without FP4 Hardware». È stato segnalato il 2 dicembre dai Daily Papers di Hugging Face. L'oggetto è la cache chiave-valore (KV), la memoria di lavoro in cui il modello conserva i calcoli sui token già letti. Durante la decodifica deve essere riletta a ogni token, e per i contesti lunghi diventa la voce di memoria e di banda più pesante.
Ridurre la cache da 8 a 4 bit dovrebbe dimezzare la memoria e la banda necessarie. Sulle GPU Hopper, però, non esiste un'unità di calcolo FP4 nativa. L'autore osserva che le implementazioni attuali di vLLM con NVFP4 raggiungono solo tra il 10 e il 19% della banda di memoria dell'H200. I valori a 4 bit devono essere estratti dai byte e convertiti prima del calcolo. Questa operazione supera il budget di istruzioni disponibile, circa 7 per byte, e trasforma il collo di bottiglia da memoria a calcolo.
La soluzione ha due elementi. Il primo è sovrapporre nel tempo decodifica e caricamento dei dati, in modo che la GPU converta un blocco mentre carica il successivo. Il secondo è una disposizione della cache progettata per rendere economica l'estrazione, insieme a operandi scambiati per piccoli gruppi di query. Così si resta entro il budget di istruzioni. I valori a 4 bit possono anche essere eseguiti sui tensor core FP8, con una velocità da 1,22 a 1,76 volte superiore.
I risultati del kernel sono misurati su 11 forme. Risulta da 1,10 a 1,48 volte più veloce dei kernel FP8 ottimizzati, XQA di TensorRT-LLM e FlashAttention-4. Integrato in vLLM, con Llama-3.1-8B su una H200, i passi di decodifica risultano da 1,12 a 1,64 volte più rapidi dell'FP8. Questo vale per batch da 8 in su. La capacità in token della cache aumenta di 1,63 volte. Un singolo H200 ha assorbito una frequenza di richieste da 1,23 a 2,20 volte quella dell'FP8 in raffiche di 600 secondi.
Sull'accuratezza l'autore riporta perdite entro circa 3,5 punti rispetto alla cache BF16 nella maggior parte dei modelli provati. I dati di calibrazione sono disponibili per dieci modelli. Alcuni modelli Qwen2 richiedono di tenere in BF16 il livello 0 per la stabilità.
I limiti sono dichiarati in modo esplicito. Il kernel funziona solo per dimensione di testa pari a 128, ed è legato a una specifica versione di vLLM. A 120.000 token di contesto la perdita rispetto a BF16 arriva a circa 15 punti. Quindi il metodo è adatto soprattutto a contesti brevi o medi. Inoltre i guadagni da 1,23 a 2,20 volte sul tasso di richieste sono misurati in raffiche di 600 secondi, partendo da una cache vuota. Non sono tassi sostenuti.
Il lavoro è utile perché riguarda hardware già molto diffuso. Con la cache a 4 bit si servono più richieste, o contesti più lunghi, sulle H100 e H200 esistenti, senza attendere le GPU con FP4 nativo. Il codice è disponibile con licenza Apache-2.0 e si installa come pacchetto Python (kv4-hopper). Servono però verifiche indipendenti, soprattutto sui contesti lunghi.
On 23 November 2026, Jian Zhang, of Northeastern University, posted a paper on arXiv (2611.30027, revised on 29 November). It is titled 'Fast 4-bit KV-Cache Decoding on Hopper GPUs Without FP4 Hardware'. It was featured on 2 December by Hugging Face's Daily Papers. The subject is the key-value (KV) cache, the working memory in which the model keeps its computations on tokens already read. During decoding it must be re-read for every token, and for long contexts it becomes the heaviest item of memory and bandwidth.
Reducing the cache from 8 to 4 bits should halve the memory and bandwidth needed. On Hopper GPUs, however, no native FP4 compute unit exists. The author observes that current vLLM implementations with NVFP4 reach only between 10% and 19% of the H200's memory bandwidth. The 4-bit values must be extracted from bytes and converted before computation. This operation exceeds the available instruction budget, about 7 per byte, and turns the bottleneck from memory to compute.
The solution has two elements. The first is to overlap data decoding and loading in time, so the GPU converts one block while loading the next. The second is a cache layout designed to make extraction cheap, together with swapped operands for small query groups. In this way the instruction budget is respected. The 4-bit values can also be run on FP8 tensor cores, with a speed from 1.22 to 1.76 times higher.
The kernel results are measured on 11 shapes: from 1.10 to 1.48 times faster than optimised FP8 kernels, TensorRT-LLM's XQA and FlashAttention-4. Integrated into vLLM, with Llama-3.1-8B on an H200, decode steps are from 1.12 to 1.64 times faster than FP8. This holds for batch sizes of 8 and above. The cache's token capacity grows 1.63 times. A single H200 absorbed a request rate from 1.23 to 2.20 times that of FP8 in 600-second bursts.
On accuracy the author reports losses within about 3.5 points against the BF16 cache in most models tried. Calibration data is available for ten models. Some Qwen2 models require layer 0 to be kept in BF16 for stability.
The limits are stated explicitly. The kernel works only for head dimension 128, and is tied to a specific vLLM version. At 120,000 tokens of context the loss against BF16 reaches about 15 points, so the method suits mainly short or medium contexts. Also, the gains from 1.23 to 2.20 times in request rate are measured in 600-second bursts starting from an empty cache. They are not sustained rates.
The work is useful because it concerns widely deployed hardware. With the 4-bit cache, more requests or longer contexts can be served on existing H100 and H200, without waiting for GPUs with native FP4. The code is available under the Apache-2.0 licence and installs as a Python package (kv4-hopper). Independent verification is needed, however, especially on long contexts.
Fonti
- Testata Hugging Face Papers - Fast 4-bit KV-Cache Decoding on Hopper GPUs huggingface.co
- Fonte originale arXiv - Fast 4-bit KV-Cache Decoding on Hopper GPUs Without FP4 Hardware arxiv.org
Articoli rivisti con l’intelligenza artificiale. A cura di Alessandro Patassini.Articles reviewed with artificial intelligence. Edited by Alessandro Patassini.














































