Skip to content

Conversation

@DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Aug 17, 2025

Purpose

More refactoring to enable #23018

  • Separate MultiModalKwargsItems (a modality-keyed dictionary of MultiModalKwargsItem) and MultiModalKwargs (a model argument-keyed dictionary of tensor data), in order to avoid confusion. As a result of this change, these classes can now be greatly simplified to be little more than a thin wrapper over a regular dictionary.
  • MultiModalKwargsItems.get_data() is used to construct MultiModalKwargs
  • Updated various models to use get_data explicitly in _get_prompt_updates

Fix NestedTensors not defined from #23070

Test Plan

Unblocked all MM tests to verify that the models still work correctly.

Test Result

(Optional) Documentation Update


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.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 requested a review from Isotr0py August 17, 2025 08:48
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 17, 2025
@github-actions
Copy link

👋 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.

🚀

@mergify mergify bot added documentation Improvements or additions to documentation deepseek Related to DeepSeek models llama Related to Llama models multi-modality Related to multi-modality (#4194) qwen Related to Qwen models v1 tpu Related to Google TPUs labels Aug 17, 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 refactors MultiModalKwargs into two distinct classes, MultiModalKwargsItems and MultiModalKwargs, to better separate structured, per-item data from batched tensor data. The changes are consistently applied throughout the codebase, improving clarity and maintainability. I've found one critical issue in a test case where a copy-paste error makes a check ineffective.

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

/gemini

@gemini-code-assist
Copy link
Contributor

Hi @DarkLight1337! It looks like you've invoked me without a specific command. If you'd like me to perform a code review, please use /gemini review. For a summary of the pull request, use /gemini summary. You can also type /gemini help to see a list of all available commands.

@DarkLight1337
Copy link
Member Author

/gemini review

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 refactors MultiModalKwargs into two distinct classes, MultiModalKwargsItems and MultiModalKwargs, to improve clarity and simplify the data structures for handling multi-modal inputs. MultiModalKwargsItems now represents a modality-keyed dictionary of items, while MultiModalKwargs holds the final batched tensor data for the model. The changes are propagated throughout the codebase, including numerous model implementations and testing utilities, to adopt the new get_data() method for converting between these types. The refactoring is well-executed and significantly enhances the maintainability of the multi-modal components. My review includes one high-severity suggestion to restore a removed assertion, ensuring robustness against potential runtime errors.

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 merged commit 27e8d1e into vllm-project:main Aug 18, 2025
44 checks passed
@DarkLight1337 DarkLight1337 deleted the separate-mm-kwargs branch August 18, 2025 09:52
princepride pushed a commit to princepride/vllm that referenced this pull request Aug 20, 2025
divakar-amd pushed a commit to divakar-amd/vllm_upstream that referenced this pull request Aug 20, 2025
cyang49 pushed a commit to cyang49/vllm that referenced this pull request Aug 20, 2025
djmmoss pushed a commit to djmmoss/vllm that referenced this pull request Aug 21, 2025
vllm-project#23053)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Duncan Moss <djm.moss@gmail.com>
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
xiao-llm pushed a commit to xiao-llm/vllm that referenced this pull request Aug 28, 2025
vllm-project#23053)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: Xiao Yu <xiao.yu@amd.com>
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
mengxingkongzhouhan pushed a commit to mengxingkongzhouhan/vllm that referenced this pull request Aug 30, 2025
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models documentation Improvements or additions to documentation llama Related to Llama models multi-modality Related to multi-modality (#4194) qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed tpu Related to Google TPUs v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants