Extend effective memory by offloading KV cache to CPU memory when GPU HBM is insufficient.
KV cache offloading stores key-value cache data in CPU memory when GPU HBM is exhausted, enabling:
NVIDIA HGX B200 Context: With 179 GB HBM per GPU and 8.0 TB/s bandwidth, the NVIDIA HGX B200 rarely needs KV offloading for typical workloads. Consider it only for extreme context lengths (128K+) or very high concurrency with large models.
The --cpu-offload-gb flag allocates a CPU memory buffer for KV cache overflow. When GPU KV cache is full, least-recently-used blocks are moved to CPU memory.
KV cache offloading works differently depending on the attention architecture:
The NVIDIA HGX B200 node has ample system RAM (typically 1-2 TB), so large CPU buffers are feasible.
CPU memory bandwidth (~200 GB/s DDR5) is 40x slower than NVIDIA HGX B200 HBM (8.0 TB/s). Offloading adds latency proportional to the cache blocks transferred:
The performance impact depends on how often the active working set exceeds GPU cache. If most requests fit in GPU VRAM and only overflow requests hit CPU, the average impact is small.
Before enabling KV cache offloading, try these approaches first: they maintain full GPU-speed operation.
Halves model weight memory, freeing VRAM for KV cache:
Halves per-token KV cache size independently of model quantization:
Adds ~9 GB KV capacity per GPU. Use with caution under peak load.
Higher tensor parallelism distributes model weights across more GPUs, freeing VRAM per GPU for KV cache:
NVIDIA Dynamo extends KV cache offloading with a multi-tier hierarchy:
Dynamo's KV-aware router intelligently places requests on GPUs that already have relevant cache, minimizing transfers.
See Dynamo Overview for details. Dynamo 0.9.1 was successfully started on this node with vLLM 0.16.0, though tiered caching requires the full Dynamo stack (etcd, NATS) which was not deployed.
0 Comments
Be the first to comment and share your perspective with the community.