Skip to content

[Misc][Benchmark] Add support for different tokenizer_mode - #15040

Merged
russellb merged 3 commits into
vllm-project:mainfrom
aarnphm:chore/benchmark-specify-tokenizer-type
Mar 19, 2025
Merged

russellb merged 3 commits into
vllm-project:mainfrom
aarnphm:chore/benchmark-specify-tokenizer-type

Conversation

@aarnphm

@aarnphm aarnphm commented Mar 18, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds support to tokenizer_mode in sampling example requests for supporting running this benchmark with Mistral models.

tokenizer_mode=auto doesn't seem to detect mistral tokenizer correctly (which is possibly a bug. However, the Mistral team suggest to set tokenizer_mode explicitly regardless.)

It also refactor --no-structured-outputs to use argparser.OptionalBooleanOptions, which set --no-structured-outputs/--structured-outputs (behaviour unchanged)

Signed-off-by: Aaron Pham contact@aarnphm.xyz

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@aarnphm
aarnphm requested a review from russellb March 18, 2025 14:41

@russellb russellb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you revert the formatting changes so this just includes the functional parts?

@aarnphm
aarnphm requested a review from russellb March 18, 2025 15:16
@aarnphm aarnphm changed the title [Misc] reuse OpenAI parser for benchmark scripts [Misc] reuse OpenAI parser for benchmark structured outputs scripts Mar 18, 2025
@aarnphm aarnphm changed the title [Misc] reuse OpenAI parser for benchmark structured outputs scripts [Misc][Benchmark] reuse OpenAI parser for structured outputs scripts Mar 18, 2025
@aarnphm aarnphm changed the title [Misc][Benchmark] reuse OpenAI parser for structured outputs scripts [Misc][Benchmark] reuse OpenAI parser for structured outputs Mar 18, 2025

@russellb russellb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't work for me

❯ python benchmarks/benchmark_serving_structured_output.py --help
INFO 03-18 15:19:00 [__init__.py:256] Automatically detected platform cuda.
Traceback (most recent call last):
  File "/home/rbryant/vllm/benchmarks/benchmark_serving_structured_output.py", line 843, in <module>
    parser.add_argument("--host", type=str, default="127.0.0.1")
  File "/usr/lib/python3.10/argparse.py", line 1460, in add_argument
    return self._add_action(action)
  File "/usr/lib/python3.10/argparse.py", line 1826, in _add_action
    self._optionals._add_action(action)
  File "/usr/lib/python3.10/argparse.py", line 1662, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
  File "/usr/lib/python3.10/argparse.py", line 1474, in _add_action
    self._check_conflict(action)
  File "/usr/lib/python3.10/argparse.py", line 1611, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/usr/lib/python3.10/argparse.py", line 1620, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --host: conflicting option string: --host

@cjackal

cjackal commented Mar 18, 2025

Copy link
Copy Markdown
Contributor

Doesn't this approach (of importing vllm in benchmark script) contradict with #14923?

@aarnphm

aarnphm commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

This doesn't work for me

Oh my bad, should be fixed now.

@aarnphm
aarnphm requested a review from russellb March 18, 2025 15:33
@aarnphm

aarnphm commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

Doesn't this approach (of importing vllm in benchmark script) contradict with #14923?

the structured outputs script uses internal utils for some unsupported features atm, so we need to import vllm regardless

@russellb

Copy link
Copy Markdown
Member

to reduce some duplicates parameters

can you be a bit more explicit in the description about what exactly this does? What problem did you observe that led to the change? Was it just duplication? What were the options before this change? and how about after?

@aarnphm

aarnphm commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

I updated the description.

@aarnphm
aarnphm force-pushed the chore/benchmark-specify-tokenizer-type branch 2 times, most recently from 51fb8cb to ada28c8 Compare March 18, 2025 20:25
@russellb

Copy link
Copy Markdown
Member

However, this will include some additional noop parameters (for example all of the spec_decode args).

I think this is a deal breaker for me. We need to disable/hide stuff that isn't a real option. Maybe sharing this code isn't a good fit as it's written?

@aarnphm

aarnphm commented Mar 18, 2025

Copy link
Copy Markdown
Contributor Author

yeah, I think we can just add support for --tokenizer-mode here instead.

@aarnphm
aarnphm force-pushed the chore/benchmark-specify-tokenizer-type branch 2 times, most recently from 06ecdf1 to b18dc3e Compare March 18, 2025 20:54
@aarnphm aarnphm changed the title [Misc][Benchmark] reuse OpenAI parser for structured outputs [Misc][Benchmark] Add support for different tokenizer_mode Mar 18, 2025
aarnphm added 2 commits March 19, 2025 10:53
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
@aarnphm
aarnphm force-pushed the chore/benchmark-specify-tokenizer-type branch from 2a0049d to 021e71e Compare March 19, 2025 10:54
Signed-off-by: Russell Bryant <rbryant@redhat.com>

@russellb russellb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@russellb russellb added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 19, 2025
@russellb
russellb enabled auto-merge (squash) March 19, 2025 14:10
@russellb
russellb merged commit 6c5a319 into vllm-project:main Mar 19, 2025
@aarnphm
aarnphm deleted the chore/benchmark-specify-tokenizer-type branch March 19, 2025 15:05
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.com>
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
0826joyce pushed a commit to 0826joyce/vllm-serving-optimization that referenced this pull request May 19, 2026
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.com>
philippesic pushed a commit to philippesic/vllm-semantic-cache that referenced this pull request Jul 19, 2026
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.com>
plasticchris pushed a commit to plasticchris/vllm that referenced this pull request Jul 20, 2026
…oject#15040)

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Co-authored-by: Russell Bryant <rbryant@redhat.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 structured-output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants