Skip to content

[Multimodal] Simplify MM input definitions#33331

Merged
Isotr0py merged 5 commits intovllm-project:mainfrom
DarkLight1337:cleanup-inputs
Jan 29, 2026
Merged

[Multimodal] Simplify MM input definitions#33331
Isotr0py merged 5 commits intovllm-project:mainfrom
DarkLight1337:cleanup-inputs

Conversation

@DarkLight1337
Copy link
Copy Markdown
Member

@DarkLight1337 DarkLight1337 commented Jan 29, 2026

Purpose

Remove unnecessary fields in MultiModalFieldElem; instead, always pass dictionaries to construct MultiModalKwargsItem and MultiModalKwargsItems to make their roles clearer. As group_mm_kwargs_by_modality still requires modality information, it has been updated to receive a list of (modality, MultiModalKwargsItem) instead of just a list of MultiModalKwargsItem.

Also, improve related docstrings.

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 Jan 29, 2026
@mergify mergify Bot added multi-modality Related to multi-modality (#4194) v1 labels Jan 29, 2026
Copy link
Copy Markdown
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 the multimodal input definitions to simplify them by removing redundant fields from MultiModalFieldElem. The changes are consistently applied across the codebase, including tests and serialization logic. The new design is cleaner and more maintainable. I found one critical bug in a test file where a tuple was constructed in the wrong order, which would lead to a runtime error. Otherwise, the changes look good.

Comment thread tests/models/multimodal/processing/test_tensor_schema.py Outdated
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 29, 2026

Hi @DarkLight1337, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
@Isotr0py Isotr0py enabled auto-merge (squash) January 29, 2026 12:46
@Isotr0py Isotr0py merged commit c6e7404 into vllm-project:main Jan 29, 2026
49 checks passed
@DarkLight1337 DarkLight1337 deleted the cleanup-inputs branch January 29, 2026 14:32
apd10 pushed a commit to apd10/vllm that referenced this pull request Jan 31, 2026
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
PiratePai pushed a commit to PiratePai/epd_shm that referenced this pull request Feb 3, 2026
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Signed-off-by: PiratePai <416932041@qq.com>
Signed-off-by: Pai <416932041@qq.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.

2 participants