Skip to content

Commit 4a10272

Browse files
format
Co-authored-by: didongli182 <[email protected]> Signed-off-by: shen-shanshan <[email protected]>
1 parent 9385771 commit 4a10272

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

vllm_ascend/worker/model_runner_v1.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -612,31 +612,18 @@ def _profile_multimodal(self) -> None:
612612
)
613613
dummy_mm_data = dummy_request_data.multi_modal_data
614614

615+
if not isinstance(dummy_mm_data, MultiModalKwargs):
616+
# TODO: Delete this check once input mapper is fully removed.
617+
raise RuntimeError("Legacy input mapper is not supported in V1")
618+
615619
# Dummy data definition in V0 may contain multiple multimodal items
616620
# (e.g, multiple images) for a single request, therefore here we
617621
# always replicate first item by max_num_mm_items times since in V1
618622
# they are scheduled to be processed separately.
619623

620-
# Case when models have a merged processor, their dummy data is
621-
# already batched `MultiModalKwargs`, therefore we take the first
622-
# `MultiModalKwargsItem` from the desired modality to profile on.
623-
if isinstance(dummy_mm_data, MultiModalKwargs):
624-
dummy_mm_item = dummy_mm_data.get_item(
625-
modality=dummy_data_modality, item_index=0)
626-
dummy_mm_kwargs = MultiModalKwargs.from_items([dummy_mm_item])
627-
628-
# Case when models have dummy data explicitly defined as
629-
# `MultiModalDataDict`, so they need to be processed through input
630-
# mapper.
631-
# TODO (ywang96): deprecate this path once merged processor is
632-
# supported on all models.
633-
else:
634-
mm_kwargs_list = self.mm_input_mapper_profiling.process_inputs(
635-
mm_data=dummy_mm_data,
636-
mm_hashes=None,
637-
mm_processor_kwargs=None,
638-
precomputed_mm_inputs=None)
639-
dummy_mm_kwargs = mm_kwargs_list[0]
624+
dummy_mm_item = dummy_mm_data.get_item(modality=dummy_data_modality,
625+
item_index=0)
626+
dummy_mm_kwargs = MultiModalKwargs.from_items([dummy_mm_item])
640627

641628
batched_dummy_mm_inputs = MultiModalKwargs.batch([dummy_mm_kwargs] *
642629
max_num_mm_items)

0 commit comments

Comments
 (0)