MiniMax M3.1 Flash in vLLM: How HBM KV Pooling Helped Deliver 2.14× Throughput
At 400 sessions, the prefill GPUs still had to process 7.6% of the incoming prompt tokens. I wanted to run more sessions and keep more of their history between turns. Both the prefill and decode GPUs had memory to spare. I added some of it to Mooncake’s shared cache. In the final 950-session run, only 3.9% of the incoming prompt tokens needed prefill.
When a coding session resumes, the next prompt carries the conversation so far. A GPU might receive a long history it processed just a moment ago, followed by a few lines of new text.
vLLM can save the attention keys and values it has already computed for those earlier tokens. If the same tokens appear at the start of the next prompt, vLLM can reuse their keys and values from memory. That’s a prefix cache hit. The GPU only needs to run prefill on the rest of the prompt.
I was tuning MiniMax M3.1 Flash on NVIDIA GB300 GPUs for AgentX, SemiAnalysis’s benchmark for multi-turn coding sessions. We used one group of GPUs to process prompts (prefill) and another to generate replies (decode). With much of a prompt already cached, MiniMax M3.1 Flash could finish prefill quickly enough that those GPUs would run out of work. I started by increasing concurrency.
At 400 concurrent sessions, AgentX reported a 92.4% prefix cache hit rate. Adding another session meant keeping another conversation in memory until its next turn. I started looking at which copies of that history we were keeping.
vLLM stores the keys and values for a group of tokens in a block. A prefill GPU could keep a block in its own high-bandwidth memory (HBM) after writing a copy to Mooncake, the store shared by the workers. If the next turn landed on a different GPU, the local copy did little for that request.
Where the memory came from
MiniMax M3.1 Flash has 428 billion parameters, with 23 billion active per token. We stored the weights in NVFP4 and distributed the experts across 16 decode GPUs. Each decode GPU used 32.76 GiB for its share of the weights.
GB300 NVL72 has more peak FP4 compute per GPU than HGX B300, but I had less host memory to work with. Mooncake got about 189 GiB per GPU in the GB300 run, just over half the 349 GiB in the B300 configuration. GPU memory was where I had room to grow the cache.
When a shared KV block is worth more than a local copy
A local copy is useful when the same GPU gets the next turn. It saves a read from Mooncake. But the load balancer can send the request to any prefill GPU, and that GPU can fetch a shared block while it works on another request. Losing the last accessible copy means the worker has to run prefill over those tokens again.
In the figure, the circle occupies two slots. If I give Mooncake the HBM slot, the circle is still available in host memory and there’s room for the diamond. Any prefill worker can now fetch either block.
Mooncake already knew how to move a KV block over RDMA. I used mount_external_segment to register HBM on the prefill and decode GPUs with the same store. A prefill worker could ask for a block by key even when the bytes lived on a remote decode GPU.
How I split local and shared memory
Prefill. I let vLLM size the shared segment at startup. In the 950-session configuration, GPU memory utilization was 0.95 and the Mooncake segment size was auto. vLLM profiled the KV budget and kept enough local blocks for one maximum-length request, a null block and one spare. The draft model kept its own pool. The remaining eligible blocks came to 140 GiB per prefill GPU in the worker logs.
Decode. A decode GPU needs local KV for the sessions it’s actively generating tokens for, so I set its budget explicitly. Each GPU had about 238 GiB free after loading the weights. I reserved 117.1 GiB for local KV (125738287104 bytes in the recipe) and gave Mooncake 111 GiB. That left about 10 GiB for the runtime.
Across 16 prefill and 16 decode GPUs, that added up to 3.92 TiB, with 2.19 TiB from prefill and 1.73 TiB from decode. With the existing 5.90 TiB of host DRAM, Mooncake could hold 9.82 TiB, or 1.66× as much KV on those same 32 GPUs.
Prefix cache hit rate rose from 92.4% to 96.1% even at 1.48× as many concurrent sessions per GPU
The earlier run used six 2-GPU prefill groups and one 8-GPU decode group, with 400 sessions across 20 GPUs, or 20 sessions per GPU. The new run used four 4-GPU prefill groups and one 16-GPU decode group, with 950 across 32, or 29.7 per GPU. Even at that higher density, the overall prefix cache hit rate reached 96.1%. The share of prompt tokens needing prefill fell from 7.6% to 3.9%, a 49% relative reduction.
Pooling gave us the extra 3.92 TiB. The hit-rate comparison includes the layout and serving changes as well. Measuring pooling’s contribution on its own would take another run at 950 sessions with just the HBM pool switched off.
Tokens per dollar at matched per-user speed
With HBM pooling and the other tuning, the new GB300 submission served 2.14× as many tokens per dollar as the previous one at a P90 generation speed of 262 tokens/s/user. Near 400 tokens/s/user, that ratio was 6.38×.
Acknowledgments
Special thanks to Kyle Liang at NVIDIA for helping me tune the GB300 submission, and to everyone else at Inferact and NVIDIA who helped along the way.
