[Bugfix] Correct prompt lengths for timed_traces benchmark - #45423
Merged
Conversation
Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com>
tdoublep
reviewed
Aug 13, 2026
Co-authored-by: Thomas Parnell <tpa@zurich.ibm.com> Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com>
Member
|
/ci run |
|
✅ @s3woz, CI is now available for this PR.
|
|
✅ Triggered Buildkite CI #83725 for commit |
Member
|
/ci run |
tdoublep
enabled auto-merge (squash)
August 13, 2026 19:46
|
✅ Triggered Buildkite CI #83790 for commit |
Alessandra005
pushed a commit
to Alessandra005/vllm
that referenced
this pull request
Aug 17, 2026
…ect#45423) Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com> Co-authored-by: Thomas Parnell <tpa@zurich.ibm.com> Signed-off-by: Alessandra005 <aurib032@fiu.edu>
zyp2014
pushed a commit
to zyp2014/vllm
that referenced
this pull request
Aug 21, 2026
…ect#45423) Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com> Co-authored-by: Thomas Parnell <tpa@zurich.ibm.com>
wyettzeng
pushed a commit
to wyettzeng/vllm
that referenced
this pull request
Aug 21, 2026
…ect#45423) Signed-off-by: Stanislaw Wozniak <stw@zurich.ibm.com> Co-authored-by: Thomas Parnell <tpa@zurich.ibm.com> Signed-off-by: Wyett <wyettzeng@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
#39795 introduced
timed_tracessupport forvllm bench serve. The traces look as follows:Current implementation creates prompts with these input_lengths, and then runs:
vLLM engine on the server side runs:
Unfortunately, tokenizer logic is not idempotent, so whereas the client generates requests of length 6758, 7322, 7236, 2290, etc., the server receives requests of different length 7253, 7844, 7679, 2445, etc.
Solution: Avoid calling
.decodeand.encodeThe OpenAI API and vLLM engine support direct tokens id passing, see:
vllm/entrypoints/openai/completion/protocol.pyThis PR avoids the
.encode()to directly pass token ids, maintaining correct prompt lengths on the server side.Test Plan
Just run any of the traces sequentially (--max-concurrency 1) :
and observe
request.num_tokensinvllm/v1/core/sched/scheduler.py::Scheduler.scheduleTest Result
Json file input_lengths: 6758, 7322, 7236, 2290, ...
Main:
For consecutive scheduling rounds,
request.num_tokens=7253, 7844, 7679, 2445,...This PR:
For consecutive scheduling rounds,
request.num_tokens=6758, 7322, 7236, 2290, ...-- as expected
@animeshtrivedi @tdoublep