A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Model] Deprecate `merge_by_field_config=False` (#27551)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Oct 27, 2025 at 16:43 UTC
b368382964913312d41c670b4166f4c83eed49aa
1 file changed
+14
-4
vllm/multimodal/utils.py
+14
-4
@@ -18,6 +18,7 @@ from PIL import Image, UnidentifiedImageError
18
19
import vllm.envs as envs
20
from vllm.connections import HTTPConnection, global_http_connection
21
+from vllm.logger import init_logger
22
from vllm.utils.jsontree import json_map_leaves
23
24
from .audio import AudioMediaIO
@@ -25,8 +26,6 @@ from .base import MediaIO
26
from .image import ImageEmbeddingMediaIO, ImageMediaIO
27
from .video import VideoMediaIO
28
28
-_M = TypeVar("_M")
29
-
29
if TYPE_CHECKING:
30
from .inputs import (
31
BatchedTensorInputs,
@@ -38,11 +37,15 @@ else:
37
MultiModalKwargsItem = Any
38
MultiModalPlaceholderDict = Any
39
40
+logger = init_logger(__name__)
41
+
42
global_thread_pool = ThreadPoolExecutor(
43
max_workers=envs.VLLM_MEDIA_LOADING_THREAD_COUNT
44
)
45
atexit.register(global_thread_pool.shutdown)
46
47
+_M = TypeVar("_M")
48
+
49
50
class MediaConnector:
51
def __init__(
@@ -413,14 +416,21 @@ def group_mm_kwargs_by_modality(
416
"`merge_by_field_config` arg, please update your model runner "
417
"according to https://github.com/vllm-project/vllm/pull/25676."
418
)
419
+ if merge_by_field_config is False:
420
+ logger.warning_once(
421
+ "The legacy code for batching multi-modal kwargs is deprecated and "
422
+ "will be removed in v0.12. Please update your model with "
423
+ "`merge_by_field_config=True` to use the new code defined by "
424
+ "`MultiModalFieldConfig`. You can refer to "
425
+ "https://github.com/vllm-project/vllm/issues/26149 "
426
+ "for some examples on how to do this."
427
+ )
428
429
from vllm.multimodal.inputs import MultiModalKwargs, MultiModalKwargsItems
430
431
for modality, items in groupby(mm_kwargs, key=lambda item: item.modality):
432
items_lst = list(items)
433
422
- # TODO: Deprecate `merge_by_field_config` once
423
- # we have migrated all in-tree models
434
if merge_by_field_config:
435
mm_kwargs_group: BatchedTensorInputs = dict(
436
MultiModalKwargsItems.from_seq(items_lst).get_data(