vllm - 💡(How to fix) Fix [Bug]: MLA + FP8 KV cache + CUDA Graph causes random NaN in decode phase [5 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#38634Fetched 2026-04-08 01:58:51
View on GitHub
Comments
5
Participants
4
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×5mentioned ×2subscribed ×2closed ×1
RAW_BUFFERClick to expand / collapse

Your current environment

vLLM:0.12.0 Model: MLA Model like deepseek GPU:H200

✅ enforce_eager=True + FP8 kv cache → Right ✅ enforce_eager=False + BF16 → Right ❌ enforce_eager=False + FP8 → q 、kv_c_normed、k_pe has Nan (in MLAAttention forward)

🐛 Describe the bug

✅ enforce_eager=True + FP8 kv cache → Right ✅ enforce_eager=False + BF16 → Right ❌ enforce_eager=False + FP8 → q 、kv_c_normed、k_pe has Nan (in MLAAttention forward)

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

The issue can likely be resolved by using enforce_eager=True or switching to BF16 when using the MLA Model with FP8 kv cache.

Guidance

  • When enforce_eager=False and using FP8, the MLAAttention forward pass results in NaN values for q, kv_c_normed, and k_pe, indicating a potential numerical instability issue.
  • Using enforce_eager=True with FP8 kv cache or switching to BF16 resolves the issue, suggesting that the problem is related to the interaction between the enforce_eager flag and the FP8 data type.
  • To mitigate the issue, try setting enforce_eager=True when using FP8 kv cache or experiment with different data types, such as BF16, to find a stable configuration.
  • Verify that the issue is resolved by checking the values of q, kv_c_normed, and k_pe in the MLAAttention forward pass for NaN values.

Notes

The exact cause of the numerical instability is unclear, and further investigation may be necessary to determine the root cause of the issue.

Recommendation

Apply workaround: Use enforce_eager=True or switch to BF16 when using the MLA Model with FP8 kv cache, as these configurations have been shown to resolve the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - 💡(How to fix) Fix [Bug]: MLA + FP8 KV cache + CUDA Graph causes random NaN in decode phase [5 comments, 4 participants]