Enabling FP8 KV cache without checking accuracy on long context
Dynamic range loss can affect needle-in-a-haystack or math reasoning if KV scales are omitted or mismatched.
Operator task guide
Switching the KV cache from BF16/FP16 to FP8 (--kv-cache-dtype fp8) cuts per-token KV memory in half on supported Hopper, Ada, and Blackwell GPUs, allowing roughly twice the concurrent context or batch capacity before hitting cache-block OOM or preemption.
Before rolling FP8 KV cache or CPU offloading into production, confirm your attention backend supports the chosen dtype, check whether explicit KV scaling factors are required, and benchmark accuracy plus p99 latency on representative long prompts.
Reviewed . Reference guidance is not a diagnosis of your workload.
Inspect startup logs for the exact GiB allocated to KV cache blocks and maximum concurrency at your target context length before altering dtype or offloading flags.
grep -iE 'available kv cache|maximum concurrency|gpu blocks' vllm.log
nvidia-smi --query-gpu=name,compute_cap,memory.total,memory.free --format=csvOn NVIDIA Ada (sm_89), Hopper (sm_90), or Blackwell (sm_100/sm_120) GPUs, test --kv-cache-dtype fp8 (or fp8_e4m3 depending on vLLM release). Check startup logs to confirm FlashAttention or FlashInfer accepts the selected cache dtype.
vllm serve YOUR_MODEL \
--kv-cache-dtype fp8 \
--calculate-kv-scales \
--max-model-len 32768 \
--gpu-memory-utilization 0.90If weights plus minimum active KV blocks still exhaust HBM, test CPU offloading or prefix caching carefully. PCIe host-to-device transfers add tail latency compared with scaling tensor parallelism across an extra GPU.
# Test CPU swap space or KV offloading limits on a single control replica
vllm serve YOUR_MODEL --swap-space 16 --max-num-seqs 64Run an evaluation set with long-context reasoning or tool-calling prompts to verify FP8 KV quantization did not introduce quality drift, and compare preemption counts against the BF16 baseline.
vllm bench serve --backend vllm --base-url http://127.0.0.1:8000 \
--model YOUR_MODEL --dataset-name random --random-input-len 8192 --random-output-len 512 --num-prompts 100| Signal | What it means | Next action |
|---|---|---|
| H100/H200/B200/L40S hitting KV cache preemptions at long context | FP16 KV cache occupies excess HBM. | Test --kv-cache-dtype fp8 with --calculate-kv-scales and validate accuracy. |
| Startup error: FP8 KV cache not supported on backend/compute_cap | Older GPU architecture or incompatible attention kernel. | Check compute capability (sm_80 Ampere lacks native FP8 KV in some backends) or update vLLM. |
| Startup error: No available memory for the cache blocks even with FP8 KV | Model weights alone consume nearly all HBM. | Quantize model weights (FP8/AWQ/GPTQ) or increase --tensor-parallel-size. |
| Latency spikes after raising --swap-space | Requests are swapping KV blocks over PCIe to host RAM. | Lower --max-num-seqs or add GPU capacity for interactive SLOs. |
Dynamic range loss can affect needle-in-a-haystack or math reasoning if KV scales are omitted or mismatched.
Swap space only stages preempted blocks in host RAM; active batches still must fit inside GPU HBM.
Models advertising 128k+ context force vLLM to reserve oversized worst-case slots unless capped.
Compare FP16 vs FP8 KV cache footprints across context lengths.
Balance max-model-len, gpu-memory-utilization, and batching.
Troubleshoot unsupported dtype or backend errors offline.
Track cache saturation and preemptions continuously.
Moving the KV cache from 16-bit (BF16/FP16) to 8-bit FP8 cuts KV cache memory per token by 50%, roughly doubling token capacity or concurrent batch size on the same GPU.
Ada Lovelace (L4, L40S, RTX 4090), Hopper (H100, H200), and Blackwell (B200, RTX 5090) provide native hardware FP8 support. Older Ampere (A100) GPUs have narrower kernel support depending on the selected attention backend.
Weight quantization (FP8/INT4/AWQ) shrinks static model parameters in HBM. KV cache quantization shrinks dynamic per-token attention keys and values that grow with context length and concurrency.
Use CPU offloading or prefix caching when batch throughput or offline processing can tolerate PCIe transfer latency, and scale tensor/data parallelism when strict interactive TTFT and ITL SLOs apply.
Get the likely cause, supporting evidence, and next safe steps with the same cloud reasoning used by paid plans. A crash the engine recognizes is answered in seconds, then checked by an independent AI review that updates this page when it finishes. A crash it does not recognize waits for the AI's own answer, which can take a few minutes. No account, card, or installation. Logs are masked at Denpex API ingress and are not saved to account history.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
No credit card. No automatic subscription. See whether Denpex helps with an incident you already understand.
Up to 50 diagnoses a day for 30 days. Verify your work email to activate an eligible company evaluation, then replay a resolved incident and compare the evidence and next steps with your team's confirmed cause.
Use the three free diagnoses to review your error and relevant evidence. Keep reference guidance separate from the cause and recovery status of your own workload.
Diagnose your incident