Skip to content

Conversation

@22quinn
Copy link
Collaborator

@22quinn 22quinn commented Aug 29, 2025

Purpose

Token-in-token-out is a common use case for RL. Tokenizer is not needed.
Without this PR the API server would complain:

openai.BadRequestError: Error code: 400 - {'error': {'message': 'Unable to get tokenizer because skip_tokenizer_init is True', 'type': 'BadRequestError', 'param': None, 'code': 400}}

Test Plan

pytest tests/entrypoints/openai/test_token_in_token_out.py

Test Result

Passed


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: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
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 addresses a bug where using skip_tokenizer_init would cause a crash when making token-in-token-out requests. The changes correctly handle cases where the tokenizer is not initialized by making it optional in several functions. A new test is also added to cover this scenario. My review found a critical issue where a string prompt would still cause a crash if the tokenizer is not initialized. I've provided a code suggestion to add a check and raise a proper error in this case, improving the robustness of the implementation.

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
@22quinn 22quinn added ready ONLY add when PR is ready to merge/full CI is needed rl Related to RL workflows labels Aug 29, 2025
Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) August 29, 2025 06:50
Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
auto-merge was automatically disabled August 29, 2025 07:15

Head branch was pushed to by a user without write access

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
MODEL_NAME,
allow_patterns=["*"],
cache_dir="/tmp/qwen3_06b",
ignore_patterns=["tokenizer*", "vocab*"])
Copy link
Member

Choose a reason for hiding this comment

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

also ignore the safetensors to accelerate test time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ignoring safetensors will cause failure, unless we set load format to be dummy.

RuntimeError: Cannot find any model weights with /tmp/qwen3_06b/models--Qwen--Qwen3-0.6B/snapshots/c1899de289a04d12100db370d81485cdf75e47ca

from ...utils import RemoteOpenAIServer

MODEL_NAME = "Qwen/Qwen3-0.6B"
MODEL_PATH = "/tmp/qwen3_06b"
Copy link
Member

Choose a reason for hiding this comment

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

better use a tempdir without hardcoding a path.

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Copy link
Member

@youkaichao youkaichao 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 fix!

@youkaichao youkaichao enabled auto-merge (squash) August 29, 2025 07:59
@youkaichao
Copy link
Member

failures are unrelated, merging.

@youkaichao youkaichao disabled auto-merge August 29, 2025 17:09
@youkaichao youkaichao merged commit 4d7fe40 into vllm-project:main Aug 29, 2025
37 of 40 checks passed
eicherseiji pushed a commit to eicherseiji/vllm that referenced this pull request Sep 9, 2025
…-project#23904)

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
…-project#23904)

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
@22quinn 22quinn deleted the no-tokenizer branch November 16, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend ready ONLY add when PR is ready to merge/full CI is needed rl Related to RL workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants