vllm - 💡(How to fix) Fix [Bug]: V1 engine prefix caching was causing non-deterministic outputs during greedy decoding T=0 [1 comments, 2 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#39389Fetched 2026-04-10 03:40:54
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
commented ×1labeled ×1
RAW_BUFFERClick to expand / collapse

Your current environment

<details> llm = LLM(model="google/gemma-3-4b-it", enable_prefix_caching=False) vs. llm = LLM(model="google/gemma-3-4b-it", enable_prefix_caching=True)

Then do llm.generate(), the results can be very much different.

</details>

🐛 Describe the bug

NA

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 difference in behavior between enable_prefix_caching=False and enable_prefix_caching=True when using the LLM model suggests that caching may be influencing the generation results.

Guidance

  • Investigate the impact of enable_prefix_caching on the model's generation behavior by comparing results with caching enabled and disabled.
  • Review the documentation for LLM and enable_prefix_caching to understand the intended effects of this parameter.
  • Test the generation with different inputs to see if the difference in results is consistent or dependent on specific prompts.
  • Consider the version of the LLM model and library being used, as behavior may change between versions.

Example

No specific code example is provided due to the nature of the issue, but comparing the results of llm.generate() with enable_prefix_caching=True and enable_prefix_caching=False is crucial.

Notes

The exact cause of the difference in generation results is not specified, and without more details about the expected behavior, it's challenging to provide a definitive solution. The influence of enable_prefix_caching on the model's performance and output needs further investigation.

Recommendation

  • Apply workaround: Temporarily disable enable_prefix_caching to observe if it stabilizes or changes the generation results in a predictable manner, as this might help in understanding the caching mechanism's impact on the model's behavior.

FAIL-SAFE

Given the information, focusing on the enable_prefix_caching parameter and its effects seems the safest approach without making assumptions about the model or its intended use.

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