Signal & Weight · Part 6 of 8
The KV cache: the memory that is not weights
Once Qwen3.8-Max is loaded, each of its 16 GPUs has about 120 GB left for conversations. How vLLM lays out the KV cache and the DeltaNet state in that space, why three bytes in four of the KV cache are copies, and how many conversations fit.
An NVIDIA B300 has 288 GB of memory. Under vLLM’s recipe for Qwen3.8-Max, about 156 GB of it holds the GPU’s share of the weights (Part 5). Most of the rest goes to the conversations the model is serving.
For each token of each conversation, the model keeps the keys and values its 23 full-attention layers computed, so later tokens can attend to it without recomputing it. That’s the KV cache: 94,208 bytes per token in BF16, as Part 1 counted, and 47,104 in FP8, which the recipe selects with --kv-cache-dtype fp8. The other 69 layers are Gated DeltaNet layers. Each keeps a fixed-size state per conversation instead, 587 MB in all, whatever the conversation’s length.
Those are the model’s figures. Spread over 16 GPUs by vLLM, the numbers change, and so does how many conversations fit. Everything below is per GPU, computed from the model’s published configuration and vLLM’s cache code.
One conversation on one GPU
The recipe uses tensor parallelism over 16 GPUs, so every GPU holds a slice of every conversation. On one GPU, a conversation costs 11,776 bytes of KV cache per token. Its DeltaNet state is 36.7 MB from the first token: a 128 × 128 matrix of 32-bit numbers for each of 8 heads in each of the 69 layers, plus a small buffer of recent inputs for the layer’s convolution.
Stored the way vLLM stores it, below, the state takes 38.4 MB and the cache catches up at 3,264 tokens. Below that, most of a conversation’s memory is DeltaNet state: 75% of it at 1,000 tokens. At the full 262,144-token context, the state is 1.2%.
Four copies of every head
Qwen3.8-Max has 64 query heads but only 4 key-value heads, which is what keeps its KV cache small. Tensor parallelism splits heads across GPUs, and 4 heads don’t divide 16 ways. vLLM gives each GPU one head and stores each head on four GPUs: GPUs 0 to 3 hold head 0, GPUs 4 to 7 head 1, and so on.
So each GPU stores 11,776 bytes per token, and the 16 together store 188,416, four times the 47,104 the model needs. Three bytes in four of the KV cache are copies. The 128 DeltaNet heads divide evenly, 8 per GPU, and aren’t copied.
Blocks of 1,088 tokens
vLLM allocates the cache in fixed-size blocks, so a conversation can grow without its memory being contiguous, and two conversations that start with the same prompt can share the blocks that hold it. The default block is 64 tokens.
A hybrid model complicates this. vLLM keeps the attention cache and the DeltaNet states in one pool of equal-sized pages, so it raises the attention block size until one attention page is at least as large as one DeltaNet layer’s state. On each GPU that state is 531,968 bytes, and one token of one attention layer is 512 bytes, so a block has to hold at least 1,039 tokens. vLLM rounds that up to a multiple of its 64-token default, which is also the step at which the DeltaNet kernels save their state during a prompt: 1,088 tokens, a 557,056-byte page. Each DeltaNet page is padded by 4.7% to match.
A conversation takes whole blocks: one per 1,088 tokens in each of the 23 attention layers, 12.81 MB per block across them, plus one page of state for each of the 69 DeltaNet layers. With prefix caching, which vLLM turns on by default, a running conversation can hold two state pages per layer instead of one, and a cache hit lands on a block boundary unless --prefix-match-unit sets a finer one. Shared prompts are reused in steps of 1,088 tokens.
How many conversations fit
What’s left for the cache depends on what else vLLM reserves: activations, CUDA graphs and communication buffers. vLLM measures this at start-up and gives the cache the rest. I assumed about 12 GB, which leaves about 120 GB per GPU (illustrative). Because every GPU holds a slice of every conversation, these are also the counts for the whole 16-GPU deployment. “Per GPU” is one conversation’s memory on one GPU:
| Tokens | Per GPU | Fit | Full attention |
|---|---|---|---|
| 1,000 | 51 MB | 2,341 | 2,487 |
| 4,000 | 90 MB | 1,338 | 631 |
| 9,240 | 154 MB | 780 | 274 |
| 32,768 | 436 MB | 275 | 77 |
| 131,072 | 1.59 GB | 75 | 19 |
| 262,144 | 3.13 GB | 38 | 9 |
On GPUs with at least 160 GB, vLLM runs at most 1,024 requests at a time by default, so short conversations reach that limit before they fill the memory. With two state pages per running conversation, the 9,240-token count drops from 780 to 624; at full length it barely moves, from 38 to 37.
The last column, “Full attention”, is the same model with all 92 layers full attention, the case the DeltaNet layers replace. At long contexts it fits about a quarter as many conversations. At 1,000 tokens it fits slightly more, because the DeltaNet state outweighs a short conversation’s cache.
vLLM’s recipe reports the same pattern from a measurement: “At 262144 the engine reserved KV for 25 concurrent requests; at 9240 (8k in + 1k out) the same 70 GiB of KV serves 506.” It doesn’t say which of its configurations that was; the run described just before it used the NVFP4 checkpoint on 8 GB300 GPUs, so the counts differ from the table above.
Changing the count
The recipe also lists an FP8 layout for throughput: tensor parallelism over 4 GPUs, four data-parallel groups of 4, and expert parallelism over all 16. Within a group, 4 KV heads divide evenly over 4 GPUs, so nothing is copied. Each group serves its own conversations, with its own limit of 1,024.
The cost is weights. The attention and DeltaNet weights are now split 4 ways instead of 16, which brings each GPU to about 175 GB (from Part 5’s byte counts) and leaves about 101 GB for the cache under the same assumption. Each GPU also holds 32 DeltaNet heads per conversation instead of 8, and blocks grow to 4,160 tokens. The net effect:
| Tokens | TP16 | TP4 × DP4, EP16 |
|---|---|---|
| 262,144 | 38 | 120 |
| 131,072 | 75 | 236 |
| 32,768 | 275 | 752 |
| 9,240 | 780 | 1,380 |
About three times as many long conversations fit. Each one also runs on 4 GPUs instead of 16 for its attention, so the two layouts trade per-request speed against capacity; the recipe calls the TP16 layout its latency configuration.
When the cache fills, vLLM preempts a request: it frees the request’s blocks, puts it back in the queue and recomputes its tokens when it resumes. With --kv-offloading-size, vLLM instead copies blocks, DeltaNet state included, to the server’s own memory, from which they can be loaded back. Whether loading beats recomputing depends on the link, which is the subject of the break-even bandwidth.
Where this goes next
This is Part 6 of Signal & Weight. Every token of every conversation also passes through the experts, and serving many conversations at once changes how many of the 512 experts each step reads. That’s Part 7.
Step through one conversation’s memory in the interactive, or go back to the cold start that comes before it.
Sources: the model’s config.json (layer types, 4 KV heads of 256 dimensions, 16 key and 128 value DeltaNet heads of 128 dimensions, convolution kernel 4, mamba_ssm_dtype float32). vLLM’s cache code at commit 5cfdcab (2026-11-23), files under vllm/: model.py (KV heads per GPU), linear.py (which GPUs hold which head), mamba_utils.py (DeltaNet state shapes and types), models/config.py (the state type read from the model’s config), interface.py (the hybrid block size and page padding), cache.py and gdn_attn.py (the 64-token default block and DeltaNet checkpoint step), single_type_kv_cache_manager.py (state pages per request), cache.py (prefix caching on by default, --prefix-match-unit, --kv-offloading-size, memory sizing), arg_utils.py (the 1,024-request default), scheduler.py (preemption). The vLLM recipe for Qwen3.8-2.4T-A95B, read on 2026-11-23 (the FP8 command with --kv-cache-dtype fp8, the TP4 · DP4 + EP16 layout, the 25 and 506 concurrent requests). B300 memory: NVIDIA’s DGX B300 page. The per-GPU sizes and counts are my arithmetic, in source/viz/kv-cache/measure/plan.py; the 12 GB reserved for activations and graphs, and so the 120 GB and 101 GB of cache, are illustrative.
Next in Signal & Weight: Mixture of Experts at scale: why batching touches every expert (coming soon)