Radix & VRAM Tuning
Controlling CUDA Graph Memory Overhead in SGLang
Understand how pre-captured CUDA graphs consume 0.6 to 2.4 GB outside the static KV pool and how to trim them on 24 GB GPUs.
0.6 - 2.4 GB Outside Static Pool · Faster Small-Batch Decode
Why Small-Batch Decode Needs CUDA Graphs
CUDA graphs eliminate Python/CPU kernel launch overhead during autoregressive decoding. Disabling them saves ~1.5 GB but severely degrades tokens/sec.
Trimming Rather Than Disabling
On tight 24 GB L4 deployments, cap --cuda-graph-max-bs 32 instead of disabling graphs completely so you keep fast decode while reclaiming 1.3 GB.
Measured Thresholds & SGLang Flag Matrix
| Max CUDA Graph Batch | Capture Memory (32B) | Recommendation |
|---|---|---|
| Default (160) | ~2.1 GB | Fine on 48-80 GB GPUs |
| --cuda-graph-max-bs 32 | ~0.8 GB | Saves 1.3 GB on 24 GB L4 |
| --disable-cuda-graph | 0 GB | Debug only (slows decode 25-40%) |