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, 22:35 UTC
[Deprecation] Remove deprecated args and methods (#21907)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Jul 31, 2025 at 14:46 UTC
9532a6d5631bbf906f992806379516ed569c447d
3 files changed
+5
-59
vllm/entrypoints/chat_utils.py
+4
-28
@@ -48,7 +48,7 @@ from vllm.transformers_utils.chat_templates import (
48
# yapf: enable
49
from vllm.transformers_utils.processor import cached_get_processor
50
from vllm.transformers_utils.tokenizer import AnyTokenizer, MistralTokenizer
51
-from vllm.utils import deprecate_kwargs, random_uuid
51
+from vllm.utils import random_uuid
52
53
logger = init_logger(__name__)
54
@@ -383,17 +383,12 @@ def resolve_mistral_chat_template(
383
return None
384
385
386
-@deprecate_kwargs(
387
- "trust_remote_code",
388
- additional_message="Please use `model_config.trust_remote_code` instead.",
389
-)
386
def resolve_hf_chat_template(
387
tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
388
chat_template: Optional[str],
389
tools: Optional[list[dict[str, Any]]],
390
*,
391
model_config: ModelConfig,
396
- trust_remote_code: Optional[bool] = None,
392
) -> Optional[str]:
393
# 1st priority: The given chat template
394
if chat_template is not None:
@@ -488,10 +483,6 @@ def _log_chat_template_content_format(
483
)
484
485
491
-@deprecate_kwargs(
492
- "trust_remote_code",
493
- additional_message="Please use `model_config.trust_remote_code` instead.",
494
-)
486
def resolve_chat_template_content_format(
487
chat_template: Optional[str],
488
tools: Optional[list[dict[str, Any]]],
@@ -499,7 +490,6 @@ def resolve_chat_template_content_format(
490
tokenizer: AnyTokenizer,
491
*,
492
model_config: ModelConfig,
502
- trust_remote_code: Optional[bool] = None,
493
) -> _ChatTemplateContentFormat:
494
if given_format != "auto":
495
return given_format
@@ -568,17 +558,9 @@ class BaseMultiModalItemTracker(ABC, Generic[_T]):
558
559
input_modality = modality.replace("_embeds", "")
560
571
- if mm_registry.has_processor(model_config):
572
- mm_processor = mm_registry.create_processor(model_config)
573
- allowed_counts = mm_processor.info.get_allowed_mm_limits()
574
- allowed_count = allowed_counts.get(input_modality, 0)
575
- else:
576
- mm_config = model_config.multimodal_config
577
- if mm_config is None:
578
- msg = "This model does not support multi-modal inputs"
579
- raise ValueError(msg)
580
-
581
- allowed_count = mm_config.get_limit_per_prompt(input_modality)
561
+ mm_processor = mm_registry.create_processor(model_config)
562
+ allowed_counts = mm_processor.info.get_allowed_mm_limits()
563
+ allowed_count = allowed_counts.get(input_modality, 0)
564
565
current_count = len(self._items_by_modality[modality]) + 1
566
if current_count > allowed_count:
@@ -1285,10 +1267,6 @@ def parse_chat_messages_futures(
1267
return conversation, mm_tracker.all_mm_data()
1268
1269
1288
-@deprecate_kwargs(
1289
- "trust_remote_code",
1290
- additional_message="Please use `model_config.trust_remote_code` instead.",
1291
-)
1270
def apply_hf_chat_template(
1271
tokenizer: Union[PreTrainedTokenizer, PreTrainedTokenizerFast],
1272
conversation: list[ConversationMessage],
@@ -1297,8 +1275,6 @@ def apply_hf_chat_template(
1275
*,
1276
model_config: ModelConfig,
1277
tokenize: bool = False, # Different from HF's default
1300
- # Deprecated, explicitly capture here so it doesn't slit into kwargs.
1301
- trust_remote_code: Optional[bool] = None,
1278
**kwargs: Any,
1279
) -> str:
1280
hf_chat_template = resolve_hf_chat_template(
vllm/multimodal/registry.py
-25
@@ -5,7 +5,6 @@ from dataclasses import dataclass
5
from typing import TYPE_CHECKING, Generic, Optional, Protocol, TypeVar
6
7
import torch.nn as nn
8
-from typing_extensions import deprecated
8
9
from vllm.envs import VLLM_MM_INPUT_CACHE_GIB
10
from vllm.inputs import InputProcessingContext
@@ -105,13 +104,6 @@ class MultiModalRegistry:
104
105
return True # Success
106
108
- @deprecated("Legacy input processor/mapper pipeline has been removed. "
109
- "Please update your model runner to use "
110
- "`seq_group_metadata.multi_modal_data` directly without "
111
- "further processing.")
112
- def create_input_mapper(self, model_config: "ModelConfig"):
113
- return lambda data, mm_processor_kwargs: data
114
-
107
def get_max_tokens_per_item_by_modality(
108
self,
109
model_config: "ModelConfig",
@@ -182,16 +174,6 @@ class MultiModalRegistry:
174
"""
175
return sum(self.get_max_tokens_by_modality(model_config).values())
176
185
- @deprecated("Legacy input processor/mapper pipeline has been removed. "
186
- "Please update your model runner to use "
187
- "`seq_group_metadata.multi_modal_data` directly without "
188
- "further processing.")
189
- def init_mm_limits_per_prompt(
190
- self,
191
- model_config: "ModelConfig",
192
- ) -> None:
193
- pass
194
-
177
def get_mm_limits_per_prompt(
178
self,
179
model_config: "ModelConfig",
@@ -246,13 +228,6 @@ class MultiModalRegistry:
228
model_cls, _ = get_model_architecture(model_config)
229
return model_cls
230
249
- @deprecated("Legacy input processor/mapper pipeline has been removed. "
250
- "Please update your model runner to use "
251
- "`seq_group_metadata.multi_modal_data` directly without "
252
- "further processing.")
253
- def has_processor(self, model_config: "ModelConfig") -> bool:
254
- return True
255
-
231
def create_processor(
232
self,
233
model_config: "ModelConfig",
vllm/worker/neuron_model_runner.py
+1
-6
@@ -15,8 +15,7 @@ from vllm.lora.request import LoRARequest
15
from vllm.model_executor import SamplingMetadata
16
from vllm.model_executor.layers.sampler import SamplerOutput
17
from vllm.model_executor.model_loader.neuron import get_neuron_model
18
-from vllm.multimodal import (MULTIMODAL_REGISTRY, BatchedTensorInputs,
19
- MultiModalKwargs)
18
+from vllm.multimodal import BatchedTensorInputs, MultiModalKwargs
19
from vllm.platforms import current_platform
20
from vllm.sampling_params import SamplingParams
21
from vllm.sequence import IntermediateTensors, SequenceGroupMetadata
@@ -88,10 +87,6 @@ class NeuronModelRunner(ModelRunnerBase[ModelInputForNeuron]):
87
self.device = self.device_config.device
88
self.pin_memory = is_pin_memory_available()
89
91
- # Multi-modal data support
92
- self.multi_modal_input_mapper = MULTIMODAL_REGISTRY \
93
- .create_input_mapper(self.model_config)
94
-
90
# Lazy initialization.
91
self.model: nn.Module # initialize after load_model.
92