Skip to content

Conversation

DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Sep 24, 2025

Purpose

I've noticed that when using fast tokenizer inside HF processor, there is a chance that "Already borrowed" error (huggingface/tokenizers#537) can occur under high concurrency. Instead of failing the request immediately, it makes more sense to retry the HF processor after a short delay.

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 24, 2025
Copy link
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

This pull request introduces a retry mechanism for Hugging Face processor calls when an "Already borrowed" error occurs, which can happen under high concurrency. The change is well-targeted to solve this specific issue. My review includes a critical fix to prevent a potential IndexError from unhandled exceptions and a suggestion to adjust the logging level for transient errors to reduce log noise in production environments.

@Isotr0py Isotr0py enabled auto-merge (squash) September 24, 2025 03:04
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@vllm-bot vllm-bot merged commit fed8a9b into vllm-project:main Sep 24, 2025
38 of 39 checks passed
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
@DarkLight1337 DarkLight1337 deleted the handle-already-borrowed branch September 27, 2025 06:16
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants