Skip to content

Conversation

@DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Oct 25, 2025

Purpose

  • get_max_tokens_per_item_by_nonzero_modality is redundant because get_max_tokens_per_item_by_modality already considers the limits by only passing in modalities with limit > 0.
  • Don't create processor twice in get_max_tokens_per_item_by_modality.

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 Oct 25, 2025
@DarkLight1337 DarkLight1337 added the multi-modality Related to multi-modality (#4194) label Oct 25, 2025
@mergify mergify bot added the v1 label Oct 25, 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 correctly simplifies the logic for determining the maximum tokens for multimodal models by removing the redundant get_max_tokens_per_item_by_nonzero_modality function and avoiding the double creation of the multimodal processor within get_max_tokens_per_item_by_modality. The changes are clean and improve efficiency. However, I've identified a similar inefficiency in MultiModalBudget.__init__ where the processor is still created twice. Addressing this would further align with the goals of this PR.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 changed the title [Misc] Simplfy max tokens in multimodal registry [Misc] Simplify max tokens in multimodal registry Oct 25, 2025
@Isotr0py Isotr0py enabled auto-merge (squash) October 25, 2025 03:36
@ywang96
Copy link
Member

ywang96 commented Oct 25, 2025

Looks like the one of the tests didn't pass cc @DarkLight1337

ValueError: At most 0 image(s) may be provided in one prompt.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337
Copy link
Member Author

Fixed in 10532e5

@vllm-bot vllm-bot merged commit 4c5f632 into vllm-project:main Oct 25, 2025
45 of 47 checks passed
@DarkLight1337 DarkLight1337 deleted the simplify-max-tokens branch October 25, 2025 06:56
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multi-modality Related to multi-modality (#4194) 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.

4 participants