Skip to content

[Bugfix] Catch and log invalid token ids in detokenizer #2#26445

Merged
vllm-bot merged 2 commits intovllm-project:mainfrom
njhill:negative-tok-id
Oct 9, 2025
Merged

[Bugfix] Catch and log invalid token ids in detokenizer #2#26445
vllm-bot merged 2 commits intovllm-project:mainfrom
njhill:negative-tok-id

Conversation

@njhill
Copy link
Copy Markdown
Member

@njhill njhill commented Oct 8, 2025

This is an update to the "workaround" added in #24351.

That PR insulates against occasional negative token ids that can be produced occasionally, though we still don't know the root cause (see #21951).

With the update to tokenizers 0.22.1, this error manifests as a TypeError rather than an OverflowError, so the patch needs to be updated to account for this.

Mitigates #26438, #26071, #25821.

This is an update to the "workaround" added in vllm-project#24351.

That PR insulates against occasional negative token ids that can be produced occasionally, though we still don't know the root cause.

With the update to tokenizers 0.22.1, this error manifests as a TypeError rather than an OverflowError, so the patch needs to be updated to account for this.

Signed-off-by: Nick Hill <nhill@redhat.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

I've reviewed your pull request. The change to catch TypeError is correct based on the updated behavior of the tokenizers library. I've found one high-severity issue related to this change that could cause problems in the exception handling logic. Please see my detailed comment below.

Signed-off-by: Nick Hill <nhill@redhat.com>
@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 8, 2025
Copy link
Copy Markdown
Member

@yewentao256 yewentao256 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!

@yewentao256 yewentao256 enabled auto-merge (squash) October 8, 2025 23:59
@vllm-bot vllm-bot merged commit bb6d8c2 into vllm-project:main Oct 9, 2025
46 of 48 checks passed
@njhill njhill deleted the negative-tok-id branch October 9, 2025 04:26
845473182 pushed a commit to dsxsteven/vllm_splitPR that referenced this pull request Oct 10, 2025
…to loader

* 'loader' of https://github.com/dsxsteven/vllm_splitPR: (778 commits)
  [torchao] Add support for ModuleFqnToConfig using regex (vllm-project#26001)
  Add: Support for multiple hidden layers in Eagle3 (vllm-project#26164)
  Enable `RMSNorm` substitution for Transformers backend (vllm-project#26353)
  [Model] Gemma3: Fix GGUF loading and quantization (vllm-project#26189)
  Bump Flashinfer to v0.4.0 (vllm-project#26326)
  Update Dockerfile and install runai-model-streamer[gcs] package (vllm-project#26464)
  [Core] Relax the LoRA  max rank (vllm-project#26461)
  [CI/Build] Fix model nightly tests (vllm-project#26466)
  [Hybrid]: Decouple Kernel Block Size from KV Page Size (vllm-project#24486)
  [Core][KVConnector] Propagate all tokens on resumed preemptions (vllm-project#24926)
  [MM][Doc] Add documentation for configurable mm profiling (vllm-project#26200)
  [Hardware][AMD] Enable FlexAttention backend on ROCm (vllm-project#26439)
  [Bugfix] Incorrect another MM data format in vllm bench throughput (vllm-project#26462)
  [Bugfix] Catch and log invalid token ids in detokenizer #2 (vllm-project#26445)
  [Minor] Change warning->warning_once in preprocess (vllm-project#26455)
  [Bugfix] Set the minimum python version for gpt-oss (vllm-project#26392)
  [Misc] Redact ray runtime env before logging (vllm-project#26302)
  Separate MLAAttention class from Attention (vllm-project#25103)
  [Attention] Register FLASHMLA_SPARSE (vllm-project#26441)
  [Kernels] Modular kernel refactor (vllm-project#24812)
  ...
Dhruvilbhatt pushed a commit to Dhruvilbhatt/vllm that referenced this pull request Oct 14, 2025
vllm-project#26445)

Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Dhruvil Bhatt <bhattdbh@amazon.com>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
vllm-project#26445)

Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
vllm-project#26445)

Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
ppetrovicTT pushed a commit to tenstorrent/vllm that referenced this pull request Oct 27, 2025
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
@wuxianyess
Copy link
Copy Markdown

This issue still exists. Was this modification not merged into version 0.11.0?

TypeError: argument 'id': StreamInput must be either an integer or a list of integers

@icecream0215
Copy link
Copy Markdown

这个问题仍然存在。这项修改是否已合并到 0.11.0 版本中?

TypeError:参数“id”:StreamInput 必须是整数或整数列表
I've encountered a similar error in my service. Could you share your request command so I can confirm whether we're facing the same issue?

devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants