Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7f064491
Unverified
Commit
7f064491
authored
Nov 17, 2025
by
Roger Wang
Committed by
GitHub
Nov 17, 2025
Browse files
[Bugfix][Perf] Revert applying HF processor on text-only inputs for multimodal models (#28858)
Signed-off-by:
Roger Wang
<
hey@rogerw.io
>
parent
64e39d66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
38 deletions
+11
-38
tests/test_inputs.py
tests/test_inputs.py
+7
-28
vllm/inputs/preprocess.py
vllm/inputs/preprocess.py
+4
-10
No files found.
tests/test_inputs.py
View file @
7f064491
...
...
@@ -86,34 +86,6 @@ def test_zip_enc_dec_prompts(mm_processor_kwargs, expected_mm_kwargs):
assert
zipped
[
"mm_processor_kwargs"
]
==
exp_kwargs
@
pytest
.
mark
.
parametrize
(
"model_id"
,
[
"facebook/opt-125m"
,
],
)
@
pytest
.
mark
.
parametrize
(
"prompt"
,
[
{
"prompt"
:
""
,
"multi_modal_data"
:
{
"dummy"
:
[]},
},
{
"prompt_token_ids"
:
[],
"multi_modal_data"
:
{
"dummy"
:
[]},
},
],
)
def
test_preprocessor_text_no_mm_inputs
(
model_id
,
prompt
):
model_config
=
ModelConfig
(
model
=
model_id
)
tokenizer
=
init_tokenizer_from_configs
(
model_config
)
input_preprocessor
=
InputPreprocessor
(
model_config
,
tokenizer
)
with
pytest
.
raises
(
ValueError
,
match
=
"does not support multimodal inputs"
):
input_preprocessor
.
preprocess
(
prompt
)
@
pytest
.
mark
.
parametrize
(
"model_id"
,
[
...
...
@@ -127,6 +99,13 @@ def test_preprocessor_text_no_mm_inputs(model_id, prompt):
{
"prompt_token_ids"
:
[]},
],
)
@
pytest
.
mark
.
skip
(
reason
=
(
"Applying huggingface processor on text inputs results in "
"significant performance regression for multimodal models. "
"See https://github.com/vllm-project/vllm/issues/26320"
)
)
def
test_preprocessor_always_mm_code_path
(
model_id
,
prompt
):
model_config
=
ModelConfig
(
model
=
model_id
)
tokenizer
=
init_tokenizer_from_configs
(
model_config
)
...
...
vllm/inputs/preprocess.py
View file @
7f064491
...
...
@@ -348,18 +348,15 @@ class InputPreprocessor:
)
inputs
:
TokenInputs
|
MultiModalInputs
if
self
.
model_config
.
is_
multimodal_
model
:
if
multi_modal_data
:
=
parsed_content
.
get
(
"
multi
_
modal_
data"
)
:
inputs
=
self
.
_process_multimodal
(
prompt_token_ids
,
parsed_content
.
get
(
"
multi_modal_data
"
)
or
{}
,
multi_modal_data
,
parsed_content
.
get
(
"mm_processor_kwargs"
)
or
{},
tokenization_kwargs
=
tokenization_kwargs
,
mm_uuids
=
mm_uuids
,
)
else
:
if
parsed_content
.
get
(
"multi_modal_data"
):
raise
ValueError
(
"This model does not support multimodal inputs"
)
inputs
=
token_inputs
(
prompt_token_ids
)
if
cache_salt
:
=
parsed_content
.
get
(
"cache_salt"
):
...
...
@@ -377,18 +374,15 @@ class InputPreprocessor:
prompt_text
=
parsed_content
[
"prompt"
]
inputs
:
TokenInputs
|
MultiModalInputs
if
self
.
model_config
.
is_
multimodal_
model
:
if
multi_modal_data
:
=
parsed_content
.
get
(
"
multi
_
modal_
data"
)
:
inputs
=
self
.
_process_multimodal
(
prompt_text
,
parsed_content
.
get
(
"
multi_modal_data
"
)
or
{}
,
multi_modal_data
,
parsed_content
.
get
(
"mm_processor_kwargs"
)
or
{},
tokenization_kwargs
=
tokenization_kwargs
,
mm_uuids
=
mm_uuids
,
)
else
:
if
parsed_content
.
get
(
"multi_modal_data"
):
raise
ValueError
(
"This model does not support multimodal inputs"
)
prompt_token_ids
=
self
.
_tokenize_prompt
(
prompt_text
,
tokenization_kwargs
=
tokenization_kwargs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment