Skip to content

Fix text only inputs for MRoPE models with the Transformers modelling backend#37055

Merged
DarkLight1337 merged 1 commit intovllm-project:mainfrom
hmellor:fix-mrope-text-only
Mar 16, 2026
Merged

Fix text only inputs for MRoPE models with the Transformers modelling backend#37055
DarkLight1337 merged 1 commit intovllm-project:mainfrom
hmellor:fix-mrope-text-only

Conversation

@hmellor
Copy link
Copy Markdown
Member

@hmellor hmellor commented Mar 14, 2026

In Transformers v5 text only prompts would fail because mm_token_type_ids is a required positional arg and vLLM was only passing it if there was image data present.

Now, in the Transformers modelling backend, if there is no image data we pass mm_token_type_ids to indicate that all the data is text.

… backend

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
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 correctly addresses a failure for text-only prompts in MRoPE models by ensuring mm_token_type_ids is always passed to the model's get_rope_index method. When no multimodal data is present, a zero tensor is now created. I have one suggestion to improve the implementation by using the correct dtype for this tensor to avoid potential mismatches.

Comment thread vllm/model_executor/models/transformers/multimodal.py
Comment thread vllm/model_executor/models/transformers/multimodal.py Outdated
@hmellor hmellor force-pushed the fix-mrope-text-only branch from 7cf9809 to fa77ffe Compare March 14, 2026 16:56
Comment thread vllm/model_executor/models/transformers/multimodal.py
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) March 16, 2026 08:19
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 16, 2026
@DarkLight1337 DarkLight1337 merged commit ad041c7 into vllm-project:main Mar 16, 2026
56 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Transformers backend Mar 16, 2026
@hmellor hmellor deleted the fix-mrope-text-only branch March 16, 2026 10:32
Lucaskabela pushed a commit to Lucaskabela/vllm that referenced this pull request Mar 17, 2026
… backend (vllm-project#37055)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
wendyliu235 pushed a commit to wendyliu235/vllm-public that referenced this pull request Mar 18, 2026
… backend (vllm-project#37055)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm that referenced this pull request Mar 27, 2026
… backend (vllm-project#37055)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
JiantaoXu pushed a commit to JiantaoXu/vllm that referenced this pull request Mar 28, 2026
… backend (vllm-project#37055)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
mtparet pushed a commit to blackfuel-ai/vllm that referenced this pull request Apr 9, 2026
… backend (vllm-project#37055)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants