vllm - 💡(How to fix) Fix [Bug]: `prompt_token_ids` dropped in `EmbedsInput` pipeline

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…

Fix Action

Fix / Workaround

This causes CachedRequestState.prompt_token_ids to be None, which triggers:

  • get_token_id() raises ValueError (or returns 0 if patched), corrupting backup_next_token_ids
  • token_ids_cpu prompt region is uninitialized
  • DFlash verification produces garbled output with system token leakage

Code Example

Your output of `python collect_env.py` here
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
Your output of `python collect_env.py` here
</details>

🐛 Describe the bug

When using enable_prompt_embeds=True with DFlash, users pass prompt_embeds (precomputed embeddings including vision tokens) instead of prompt_token_ids. However, DFlash's speculative decoding bookkeeping (backup_next_token_ids, token_ids_cpu, penalty computation) requires prompt_token_ids to function correctly.

Currently, EmbedsInput has no prompt_token_ids field, so even if the user provides both prompt_embeds and prompt_token_ids in the prompt dict, the token IDs are silently dropped at multiple points:

  1. EmbedsInput (in vllm/inputs/engine.py) has no prompt_token_ids field
  2. EmbedsPrompt (in vllm/inputs/llm.py) has no prompt_token_ids field
  3. _process_embeds() (in vllm/renderers/base.py) does not forward prompt_token_ids
  4. input_processor.py hardcodes prompt_token_ids = None when type == "embeds"

This causes CachedRequestState.prompt_token_ids to be None, which triggers:

  • get_token_id() raises ValueError (or returns 0 if patched), corrupting backup_next_token_ids
  • token_ids_cpu prompt region is uninitialized
  • DFlash verification produces garbled output with system token leakage

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.

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]: `prompt_token_ids` dropped in `EmbedsInput` pipeline