Scenario

FP8 KV scales silently at 1.0

L3SeniorIncident20 minDebuggingML depth

RolesInference EngineeringAI Evaluation and Reliability

Engine
vLLM 0.31.0
Model
Qwen/Qwen3-8B
Hardware
one L4 with 24 GB of memory

Situation

A team serves Qwen/Qwen3-8B on one L4. Requests queue because the KV pool is full, so they add --kv-cache-dtype fp8 to store each cached value in one byte instead of two. The first start fails with a compiler error from a kernel library. A colleague adds a backend flag, the server starts, and a quick benchmark shows the time per token a little lower than before.

Before the rollout, the team runs GSM8K on its first 500 questions in BF16 and in FP8 and sees the same accuracy within the error bars. They ship. In the review, a staff engineer asks one question: "Which scale did the cache use?" Nobody knows. The production model is not this one, it is a newer family whose checkpoint ships calibrated scales.

Questions

  1. The server picked a different attention backend when the KV data type changed. Why does the data type decide the backend, and why did that backend fail on this host?
  2. Two things changed between the BF16 and FP8 runs in the speed table. What can you claim from it, at which user count, and what can you not claim?
  3. What is a KV scale, what does a scale of 1.0 do to an FP8 value, and for which checkpoints is 1.0 the only option?
  4. Every interval in the accuracy table overlaps. What does that prove, and what can 500 questions not rule out?
  5. The production checkpoint carries calibrated scales. Give the three checks, in order, that prove the running server uses them.

Commit to a cause after each listing. Write it down before you read the next one.

Evidence

1/5

the first start with an FP8 KV cache on the L4

Read the backend that the second line picks, then the error in the fourth line.

evidence/first-start-fails.txt
(APIServer pid=813100) INFO 10-22 09:10:51 [api_utils.py:286] non-default args: {'model_tag': 'Qwen/Qwen3-8B', 'host': '127.0.0.1', 'port': 30000, 'model': 'Qwen/Qwen3-8B', 'max_model_len': 8192, 'gpu_memory_utilization': 0.9, 'kv_cache_dtype': 'fp8', 'num_gpu_blocks_override': 1506}
(EngineCore pid=814129) INFO 10-22 09:11:03 [cuda.py:526] Using FLASHINFER attention backend out of potential backends: ['FLASHINFER', 'TRITON_ATTN'].
(EngineCore pid=814129) ERROR 10-22 09:11:53 [core.py:1433] subprocess.CalledProcessError: Command '['ninja', '-v', '-C', '/root/.cache/flashinfer/0.7.0.post1/89/cached_ops/batch_prefill_with_kv_cache_dtype_q_bf16_dtype_kv_e4m3_dtype_o_bf16_dtype_idx_i32_head_dim_qk_128_head_dim_vo_128_posenc_0_use_swa_False_use_logits_cap_False_f16qk_False_kv_stride_equal', '-f', '/root/.cache/flashinfer/0.7.0.post1/89/cached_ops/ba
(EngineCore pid=814129) ERROR 10-22 09:11:53 [core.py:1433] /data/vllm/.venv/lib/python3.12/site-packages/flashinfer/data/cccl/libcudacxx/include/cuda/std/__cccl/cuda_toolkit.h:41:8: error: #error "CUDA compiler and CUDA toolkit headers are incompatible, please check your include paths"
RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

Source: manuals/vllm-101/capture/gpu/incidents/l4-vllm-kv-fp8-flashinfer-attention-jit.txt, lines 1-5

2/5

the FP8 KV cache with the Triton backend against the BF16 default, pool held fixed

Compare the clock and the seed count of each row before you read the time per token.

evidence/speed-at-a-fixed-pool.txt
| Users, L4 throttled session | Median TPOT, BF16 / FP8 | Output tok/s, BF16 / FP8 | Median SM clock, BF16 / FP8 | Seeds, BF16 / FP8 |
|---|---|---|---|---|
| 1 | 104.1 / 101.8 ms | 10.59 / 10.75 | 210 / 210 MHz | 3 / 2 |
| 32 | 142.7 / 138.0 ms | 186.68 / 192.00 | 450 / 480 MHz | 3 / 2 |

Source: manuals/vllm-101/sections/2-4-fit-more-users-with-an-fp8-kv-cache.md, lines 69-72

3/5

GSM8K accuracy of the four configs on both engines

Read the sentence about the scales before the table, then the width of each interval.

evidence/accuracy-check.txt
Eval: the first 500 GSM8K test questions, 8-shot, greedy, one run per config. The prefix cache was flushed before each run.
Neither checkpoint carries KV scales, so the FP8 KV runs used a scale of 1.0.
vLLM FP8 KV runs used --attention-backend TRITON_ATTN, because the FlashInfer FP8 prefill kernel does not build on this host.

engine   config                     correct   accuracy   Wilson 95% interval
SGLang   BF16                       458/500   91.6%      88.8 to 93.7
SGLang   FP8 weights                456/500   91.2%      88.4 to 93.4
SGLang   FP8 KV cache               458/500   91.6%      88.8 to 93.7
SGLang   FP8 weights + FP8 KV       460/500   92.0%      89.3 to 94.1
vLLM     BF16                       459/500   91.8%      89.1 to 93.9
vLLM     FP8 weights                453/500   90.6%      87.7 to 92.9
vLLM     FP8 KV cache               454/500   90.8%      87.9 to 93.0
vLLM     FP8 weights + FP8 KV       453/500   90.6%      87.7 to 92.9

Every interval overlaps every other interval, so this run did not show a difference between the configs. With 500 questions, it cannot rule out a loss of a few points.

Source: manuals/vllm-101/capture/gpu/out-l4/gsm8k-fp8-accuracy.txt, lines 5-19

4/5

three rows of the incident index at 0.31.0

The first and the third row name a loader that drops scales, and both issues are open.

evidence/known-loader-bugs.txt
| 54623 | the Qwen3.5 family never loads checkpoint KV scales, so an FP8 KV cache runs at scale 1.0 | open | [FP8 KV cache](#s-fit-more-users-with-an-fp8-kv-cache) |
| 57853 | a weight update sent while the engine sleeps segfaults the engine core | open | [RL rollouts](#s-use-vllm-as-an-rl-rollout-engine) |
| 60333 | one MTP draft loader drops FP8 KV scales, and the draft layers use scale 1.0 | open | [FP8 KV cache](#s-fit-more-users-with-an-fp8-kv-cache) |

Source: manuals/vllm-101/sections/r-3-incident-index.md, lines 16-18

5/5

the manual's check for scales in the checkpoint and in the startup log

The last line names the warning to search for in the log.

evidence/the-check.txt
No output means that the checkpoint has no scales.

A checkpoint with one weight file has no index. For it, list the tensor names with the `safetensors` Python package.

Then read the startup log. The warning `Using KV cache scaling factor 1.0` means that vLLM uses a scale of 1.0. If the checkpoint has scales and the log still shows the warning, the loader dropped them.

Source: manuals/vllm-101/sections/2-4-fit-more-users-with-an-fp8-kv-cache.md, lines 110-114

The answer

Show the walkthrough

Start with the failed start. The second line shows the backend choice: FLASHINFER out of the two candidates FLASHINFER and TRITON_ATTN. FlashAttention is missing from that list. On an L4, vLLM tries FlashAttention first, but at 0.31.0 FlashAttention reads an FP8 KV cache only on Hopper and Blackwell data center GPUs, and the L4 is an Ada GPU with SM 8.9. So vLLM moved to the next backend in its list. FlashInfer builds its kernels on the first start, and the fourth line shows that build failing because the CUDA compiler and the CUDA headers came from different releases. The fix is --attention-backend TRITON_ATTN, which reads an FP8 KV cache without that build, plus VLLM_USE_FLASHINFER_SAMPLER=0 because the sampler fails to build in the same way.

The speed table holds the pool at 24,096 tokens in both runs, so it does not show the larger pool at all. It shows the change in speed. At one user, FP8 was 2.3 percent faster per token, 101.8 against 104.1 ms, at the same clock of 210 MHz, and the seed ranges did not overlap. At 32 users the seed ranges overlapped and the FP8 run had the higher clock, 480 against 450 MHz, so no claim holds there. Two things changed together, the KV data type and the backend, so even the gain at one user cannot be attributed to the data type alone.

The accuracy table starts with the sentence that answers the staff engineer. Neither checkpoint carries KV scales, so the FP8 KV runs used a scale of 1.0. An FP8 value has few bits, and a scale maps the range of the real keys and values onto that range. With no calibrated scale the server stores the values as they are. For this model the result was 454 of 500 correct against 459 in BF16, 90.8 percent against 91.8, with intervals of 87.9 to 93.0 and 89.1 to 93.9. Every interval overlaps every other one. That means the run did not show a difference. It does not mean there is none. With 500 questions the test cannot rule out a loss of a few points, and it covers one model and one benchmark.

The incident index adds the part that makes the question dangerous. Issue 54623 reports that the Qwen3.5 model family never loads its checkpoint KV scales, so an FP8 KV cache runs at scale 1.0 even when the checkpoint has calibrated scales. Issue 60333 reports the same for one MTP draft loader. Both are open at 0.31.0. So a checkpoint with scales does not prove that the server uses them.

The last listing gives the check. Search the weight index for tensor names that end in k_scale or v_scale. No output means the checkpoint has no scales. Then read the startup log for the warning Using KV cache scaling factor 1.0. If the checkpoint has scales and the warning is still there, the loader dropped them. Last, run your own prompts with and without FP8 and compare the answers.

Show the resolution

The incident is a missing question, not a crash. For Qwen/Qwen3-8B a scale of 1.0 was the only option, and the accuracy check on 500 questions could not tell the two configs apart. For the production model the team had to prove three things before the rollout: that the checkpoint holds k_scale and v_scale tensors, that the startup log does not print the scale 1.0 warning, and that a sample of their own prompts gives the same answers with and without FP8.

They also had to read the backend line after every change to the KV data type. On this L4 the change moved the server from FlashAttention to Triton, and the speed table measured that move as much as the data type. Write the backend, the scale and the accuracy interval next to the result, and keep the accuracy test on your own task, because a model with a different attention layout can lose more.

Show the wrong turns
  • “The accuracy matched, so FP8 is safe for every model.”

    The check covered one model with no scales, one benchmark and 500 questions. It could not rule out a loss of a few points, and a different model can lose more.

  • “The checkpoint has scales, so the server uses them.”

    At 0.31.0 two open issues report loaders that drop the scales and run at 1.0. Only the startup log proves what the server used.

  • “FP8 made each token 2.3 percent faster, so the data type paid off.”

    The backend changed in the same run, and the gain held only at one user. The table cannot say which change gave it.

  • “Fix the compiler error so FlashInfer builds.”

    That is a host repair, not a serving decision. The Triton backend reads the FP8 cache without the build, and the backend line in the log says which one runs.

Show the general rule

A quantized store needs a scale, and a default scale of 1.0 is a silent choice that the server makes for you. Whenever you change a data type, read the three lines that follow from it: which kernel now runs, which scale it uses and what the quality check can and cannot detect at its sample size. A test that shows no difference bounds the loss, it does not remove it.

Taught in

The vLLM manual turns on the FP8 KV cache and checks the scales in the FP8 KV cache page, explains the backend choice in the attention backend page and lists the open loader issues in the incident index, and the SGLang manual runs the same accuracy check in its quantization page.