Skip to content

Conversation

oneraghavan
Copy link
Contributor

@oneraghavan oneraghavan commented Aug 28, 2025

Fix async mode to make use of truncate_prompt_tokens param .

Fixes #23511

@oneraghavan
Copy link
Contributor Author

cc : @DarkLight1337

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 adds support for truncate_prompt_tokens in AsyncLLM. The implementation in the generate method can be simplified for better readability. More importantly, the implementation in the encode method contains a critical bug where truncate_prompt_tokens is ignored if tokenization_kwargs is also provided. I have included review comments with code suggestions to address these issues.

@oneraghavan oneraghavan requested a review from aarnphm as a code owner August 28, 2025 08:40
@mergify mergify bot added the frontend label Aug 28, 2025
@oneraghavan
Copy link
Contributor Author

@DarkLight1337 Do you think anything else needs do done on this issue ?

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.

No, this should be good to go!

@DarkLight1337
Copy link
Member

But please fix pre-commit

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) August 28, 2025 15:23
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 28, 2025
auto-merge was automatically disabled August 28, 2025 16:07

Head branch was pushed to by a user without write access

@vllm-bot vllm-bot merged commit 05d839c into vllm-project:main Aug 29, 2025
34 of 36 checks passed
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 v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: SamplingParams's truncate_prompt_tokens not working in AsyncLLM Engine
3 participants