Skip to content

Conversation

DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Apr 8, 2025

This PR fixes a mismatch in merging multi-modal embeddings when the model itself generates embedding placeholder tokens such as <image>. Although this error mainly occurs in V1, it can possibly occur in V0 as well. This PR focuses on the V1 case.

For V0 users, you can work around this by setting top_p so that the model has no chance of generating such tokens.

FIX #15677
FIX #15764
FIX #23891
FIX #23954
FIX #24456

Breaking change for model developers

This PR has updated SupportsMultiModal.get_input_embeddings to support passing is_multimodal mask and added a default implementation so that there is no need to override it in most cases. OOT/WIP models should either remove their override to use the default implementation, or update their override to accept is_multimodal and do_language_embed_multimodal arguments.

Text-only model developers should ensure that their models have implemented get_input_embeddings to continue using them in vLLM.

Breaking change for model runner plugins

In order to continue supporting multimodal models, you should update _gather_mm_embeddings method to build up and return the is_mm_embed mask, then pass it to the model.

Copy link

github-actions bot commented Apr 8, 2025

👋 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 v1 tpu Related to Google TPUs labels Apr 8, 2025
@DarkLight1337 DarkLight1337 changed the title [Bugfix] Merge multimodal embeddings by mask instead of token ID [Bugfix][V1] Merge multimodal embeddings by mask instead of token ID Apr 8, 2025
Signed-off-by: DarkLight1337 <[email protected]>
@DarkLight1337 DarkLight1337 changed the title [Bugfix][V1] Merge multimodal embeddings by mask instead of token ID [Bugfix][V1] Merge multimodal embeddings by index instead of token ID Apr 8, 2025
@DarkLight1337 DarkLight1337 changed the title [Bugfix][V1] Merge multimodal embeddings by index instead of token ID [Bugfix][V1] Merge multimodal embeddings by index instead of matching token ID Apr 8, 2025
@DarkLight1337 DarkLight1337 changed the title [Bugfix][V1] Merge multimodal embeddings by index instead of matching token ID [Bugfix][V1] Merge multimodal embeddings by index instead of matching tokens Apr 8, 2025
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Copy link
Collaborator

@NickLucche NickLucche left a comment

Choose a reason for hiding this comment

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

Fixed the tpu issues, thanks @DarkLight1337 !

Copy link

mergify bot commented Sep 22, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @DarkLight1337.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Sep 22, 2025
@mergify mergify bot removed the needs-rebase label Sep 24, 2025
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Copy link

mergify bot commented Sep 27, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @DarkLight1337.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Sep 27, 2025
@mergify mergify bot removed the needs-rebase label Sep 27, 2025
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) September 27, 2025 06:56
@DarkLight1337
Copy link
Member Author

DarkLight1337 commented Sep 27, 2025

We will not include this in the v0.11 release because of the breaking change. But it should be fine to merge this into main branch since the release branch has been cut already.

@DarkLight1337 DarkLight1337 merged commit 27d7638 into vllm-project:main Sep 27, 2025
52 checks passed
@DarkLight1337 DarkLight1337 deleted the rm-merge-mm-embeddings branch September 27, 2025 08:15
DarkLight1337 added a commit to wangxiongts/vllm-dev that referenced this pull request Sep 27, 2025
Signed-off-by: DarkLight1337 <[email protected]>
xuechendi added a commit to vllm-project/vllm-gaudi that referenced this pull request Oct 1, 2025
upstream PR: vllm-project/vllm#16229
Fix is still in progress, don't merge yet

---------

Signed-off-by: Agata Dobrzyniewicz <[email protected]>
Signed-off-by: Chendi Xue <[email protected]>
Co-authored-by: Chendi Xue <[email protected]>
iboiko-habana pushed a commit to iboiko-habana/vllm-gaudi that referenced this pull request Oct 2, 2025
upstream PR: vllm-project/vllm#16229
Fix is still in progress, don't merge yet

---------

Signed-off-by: Agata Dobrzyniewicz <[email protected]>
Signed-off-by: Chendi Xue <[email protected]>
Co-authored-by: Chendi Xue <[email protected]>
Signed-off-by: Iryna Boiko <[email protected]>
pdasigi pushed a commit to pdasigi/vllm that referenced this pull request Oct 2, 2025
…ect#16229)

Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: NickLucche <[email protected]>
Signed-off-by: Roger Wang <[email protected]>
Co-authored-by: NickLucche <[email protected]>
Co-authored-by: Roger Wang <[email protected]>
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: NickLucche <[email protected]>
Signed-off-by: Roger Wang <[email protected]>
Co-authored-by: NickLucche <[email protected]>
Co-authored-by: Roger Wang <[email protected]>
Signed-off-by: yewentao256 <[email protected]>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
…ect#16229)

Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: NickLucche <[email protected]>
Signed-off-by: Roger Wang <[email protected]>
Co-authored-by: NickLucche <[email protected]>
Co-authored-by: Roger Wang <[email protected]>
Signed-off-by: xuebwang-amd <[email protected]>
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 qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed speculative-decoding tpu Related to Google TPUs v1

Projects

None yet

3 participants