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 10, 22:45 UTC
[Chore][1/2] Drop `v0.14` deprecations (#31285)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Dec 25, 2025 at 01:54 UTC
09dc7c690c88ea17a886f6c5e6e8e92a74af4078
22 files changed
+28
-427
docs/api/README.md
-1
@@ -72,7 +72,6 @@ Internal data structures.
72
- [vllm.multimodal.inputs.MultiModalFieldConfig][]
73
- [vllm.multimodal.inputs.MultiModalKwargsItem][]
74
- [vllm.multimodal.inputs.MultiModalKwargsItems][]
75
-- [vllm.multimodal.inputs.MultiModalKwargs][]
75
- [vllm.multimodal.inputs.MultiModalInputs][]
76
77
### Data Parsing
tests/entrypoints/openai/test_chat_error.py
+1
-1
@@ -13,7 +13,7 @@ from vllm.entrypoints.openai.protocol import ChatCompletionRequest, ErrorRespons
13
from vllm.entrypoints.openai.serving_chat import OpenAIServingChat
14
from vllm.entrypoints.openai.serving_models import BaseModelPath, OpenAIServingModels
15
from vllm.outputs import CompletionOutput, RequestOutput
16
-from vllm.transformers_utils.tokenizer import get_tokenizer
16
+from vllm.tokenizers import get_tokenizer
17
from vllm.v1.engine.async_llm import AsyncLLM
18
19
MODEL_NAME = "openai-community/gpt2"
tests/entrypoints/openai/test_completion_error.py
+1
-1
@@ -13,7 +13,7 @@ from vllm.entrypoints.openai.protocol import CompletionRequest, ErrorResponse
13
from vllm.entrypoints.openai.serving_completion import OpenAIServingCompletion
14
from vllm.entrypoints.openai.serving_models import BaseModelPath, OpenAIServingModels
15
from vllm.outputs import CompletionOutput, RequestOutput
16
-from vllm.transformers_utils.tokenizer import get_tokenizer
16
+from vllm.tokenizers import get_tokenizer
17
from vllm.v1.engine.async_llm import AsyncLLM
18
19
MODEL_NAME = "openai-community/gpt2"
tests/entrypoints/openai/test_lora_resolvers.py
+2
-2
@@ -61,13 +61,13 @@ class MockLoRAResolver(LoRAResolver):
61
return LoRARequest(
62
lora_name="test-lora",
63
lora_int_id=1,
64
- lora_local_path="/fake/path/test-lora",
64
+ lora_path="/fake/path/test-lora",
65
)
66
elif lora_name == "invalid-lora":
67
return LoRARequest(
68
lora_name="invalid-lora",
69
lora_int_id=2,
70
- lora_local_path="/fake/path/invalid-lora",
70
+ lora_path="/fake/path/invalid-lora",
71
)
72
return None
73
vllm/entrypoints/context.py
+3
-4
@@ -41,9 +41,8 @@ from vllm.entrypoints.tool import Tool
41
from vllm.entrypoints.tool_server import ToolServer
42
from vllm.outputs import RequestOutput
43
from vllm.reasoning.abs_reasoning_parsers import ReasoningParser
44
-from vllm.tokenizers.protocol import TokenizerLike
44
+from vllm.tokenizers import TokenizerLike
45
from vllm.tool_parsers.abstract_tool_parser import ToolParser
46
-from vllm.transformers_utils.tokenizer import AnyTokenizer
46
from vllm.utils import random_uuid
47
48
if TYPE_CHECKING:
@@ -259,8 +258,8 @@ class ParsableContext(ConversationContext):
258
self,
259
*,
260
response_messages: list[ResponseInputOutputItem],
262
- tokenizer: AnyTokenizer,
263
- reasoning_parser_cls: Callable[[AnyTokenizer], ReasoningParser] | None,
261
+ tokenizer: TokenizerLike,
262
+ reasoning_parser_cls: Callable[[TokenizerLike], ReasoningParser] | None,
263
request: ResponsesRequest,
264
available_tools: list[str] | None,
265
tool_parser_cls: Callable[[TokenizerLike], ToolParser] | None,
vllm/entrypoints/openai/parser/responses_parser.py
+5
-6
@@ -19,9 +19,8 @@ from vllm.entrypoints.constants import MCP_PREFIX
19
from vllm.entrypoints.openai.protocol import ResponseInputOutputItem, ResponsesRequest
20
from vllm.outputs import CompletionOutput
21
from vllm.reasoning.abs_reasoning_parsers import ReasoningParser
22
-from vllm.tokenizers.protocol import TokenizerLike
22
+from vllm.tokenizers import TokenizerLike
23
from vllm.tool_parsers.abstract_tool_parser import ToolParser
24
-from vllm.transformers_utils.tokenizer import AnyTokenizer
24
from vllm.utils import random_uuid
25
26
logger = logging.getLogger(__name__)
@@ -33,8 +32,8 @@ class ResponsesParser:
32
def __init__(
33
self,
34
*,
36
- tokenizer: AnyTokenizer,
37
- reasoning_parser_cls: Callable[[AnyTokenizer], ReasoningParser],
35
+ tokenizer: TokenizerLike,
36
+ reasoning_parser_cls: Callable[[TokenizerLike], ReasoningParser],
37
response_messages: list[ResponseInputOutputItem],
38
request: ResponsesRequest,
39
tool_parser_cls: Callable[[TokenizerLike], ToolParser] | None,
@@ -150,8 +149,8 @@ class ResponsesParser:
149
150
def get_responses_parser_for_simple_context(
151
*,
153
- tokenizer: AnyTokenizer,
154
- reasoning_parser_cls: Callable[[AnyTokenizer], ReasoningParser],
152
+ tokenizer: TokenizerLike,
153
+ reasoning_parser_cls: Callable[[TokenizerLike], ReasoningParser],
154
response_messages: list[ResponseInputOutputItem],
155
request: ResponsesRequest,
156
tool_parser_cls,
vllm/entrypoints/openai/serving_models.py
+1
-1
@@ -119,7 +119,7 @@ class OpenAIServingModels:
119
lora_cards = [
120
ModelCard(
121
id=lora.lora_name,
122
- root=lora.local_path,
122
+ root=lora.path,
123
parent=lora.base_model_name
124
if lora.base_model_name
125
else self.base_model_paths[0].name,
vllm/entrypoints/openai/tool_parsers/__init__.py
deleted
-33
@@ -1,33 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-
4
-import warnings
5
-
6
-
7
-def __getattr__(name: str):
8
- if name == "ToolParser":
9
- from vllm.tool_parsers import ToolParser
10
-
11
- warnings.warn(
12
- "`vllm.entrypoints.openai.tool_parsers.ToolParser` has been moved to "
13
- "`vllm.tool_parsers.ToolParser`. "
14
- "The old name will be removed in v0.14.",
15
- DeprecationWarning,
16
- stacklevel=2,
17
- )
18
-
19
- return ToolParser
20
- if name == "ToolParserManager":
21
- from vllm.tool_parsers import ToolParserManager
22
-
23
- warnings.warn(
24
- "`vllm.entrypoints.openai.tool_parsers.ToolParserManager` "
25
- "has been moved to `vllm.tool_parsers.ToolParserManager`. "
26
- "The old name will be removed in v0.14.",
27
- DeprecationWarning,
28
- stacklevel=2,
29
- )
30
-
31
- return ToolParserManager
32
-
33
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/lora/request.py
-34
@@ -1,7 +1,6 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
-import warnings
4
5
import msgspec
6
@@ -21,7 +20,6 @@ class LoRARequest(
20
lora_name: str
21
lora_int_id: int
22
lora_path: str = ""
24
- lora_local_path: str | None = msgspec.field(default=None)
23
long_lora_max_len: int | None = None
24
base_model_name: str | None = msgspec.field(default=None)
25
tensorizer_config_dict: dict | None = None
@@ -29,16 +27,6 @@ class LoRARequest(
27
def __post_init__(self):
28
if self.lora_int_id < 1:
29
raise ValueError(f"id must be > 0, got {self.lora_int_id}")
32
- if self.lora_local_path:
33
- warnings.warn(
34
- "The 'lora_local_path' attribute is deprecated "
35
- "and will be removed in a future version. "
36
- "Please use 'lora_path' instead.",
37
- DeprecationWarning,
38
- stacklevel=2,
39
- )
40
- if not self.lora_path:
41
- self.lora_path = self.lora_local_path or ""
30
31
# Ensure lora_path is not empty
32
assert self.lora_path, "lora_path cannot be empty"
@@ -55,28 +43,6 @@ class LoRARequest(
43
def path(self):
44
return self.lora_path
45
58
- @property
59
- def local_path(self):
60
- warnings.warn(
61
- "The 'local_path' attribute is deprecated "
62
- "and will be removed in a future version. "
63
- "Please use 'path' instead.",
64
- DeprecationWarning,
65
- stacklevel=2,
66
- )
67
- return self.lora_path
68
-
69
- @local_path.setter
70
- def local_path(self, value):
71
- warnings.warn(
72
- "The 'local_path' attribute is deprecated "
73
- "and will be removed in a future version. "
74
- "Please use 'path' instead.",
75
- DeprecationWarning,
76
- stacklevel=2,
77
- )
78
- self.lora_path = value
79
-
46
def __eq__(self, value: object) -> bool:
47
"""
48
Overrides the equality method to compare LoRARequest
vllm/model_executor/models/interfaces.py
+2
-41
@@ -1,7 +1,7 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
-from collections.abc import Callable, Iterable, Mapping, MutableSequence, Set
4
+from collections.abc import Callable, Iterable, Mapping, MutableSequence
5
from typing import (
6
TYPE_CHECKING,
7
ClassVar,
@@ -100,17 +100,6 @@ class SupportsMultiModal(Protocol):
100
in their raw form and not input embeddings.
101
"""
102
103
- merge_by_field_config: ClassVar[bool | None] = None
104
- """
105
- [DEPRECATED] A flag that indicates which implementation of
106
- `vllm.multimodal.utils.group_mm_kwargs_by_modality` to use.
107
- """
108
-
109
- multimodal_cpu_fields: ClassVar[Set[str] | None] = None
110
- """
111
- [DEPRECATED] A set indicating CPU-only multimodal fields.
112
- """
113
-
103
_processor_factory: ClassVar[_ProcessorFactories]
104
"""
105
Set internally by `MultiModalRegistry.register_processor`.
@@ -277,35 +266,7 @@ def supports_multimodal(model: object) -> TypeIs[SupportsMultiModal]: ...
266
def supports_multimodal(
267
model: type[object] | object,
268
) -> TypeIs[type[SupportsMultiModal]] | TypeIs[SupportsMultiModal]:
280
- res = getattr(model, "supports_multimodal", False)
281
-
282
- if res:
283
- # We can remove this starting from v0.14
284
- merge_by_field_config = getattr(model, "merge_by_field_config", None)
285
- if merge_by_field_config is False:
286
- raise ValueError(
287
- "`merge_by_field_config=False` is no longer effective, "
288
- "please update your model to consider the new batching logic "
289
- "in `group_mm_kwargs_by_modality` (refer to "
290
- "https://github.com/vllm-project/vllm/issues/26149), "
291
- "and then remove the override from your model."
292
- )
293
- if merge_by_field_config is True:
294
- logger.warning_once(
295
- "`merge_by_field_config=True` is redundant, "
296
- "please remove the override from your model."
297
- )
298
-
299
- multimodal_cpu_fields = getattr(model, "multimodal_cpu_fields", None)
300
- if multimodal_cpu_fields is not None:
301
- raise ValueError(
302
- "`multimodal_cpu_fields` is no longer effective, "
303
- "please set `keep_on_cpu=True` in `MultiModalFieldConfig` "
304
- "(refer to https://github.com/vllm-project/vllm/pull/30181), "
305
- "and then remove the override from your model."
306
- )
307
-
308
- return res
269
+ return getattr(model, "supports_multimodal", False)
270
271
272
def supports_multimodal_raw_input_only(model: type[object] | object) -> bool:
vllm/multimodal/__init__.py
-2
@@ -6,7 +6,6 @@ from .inputs import (
6
ModalityData,
7
MultiModalDataBuiltins,
8
MultiModalDataDict,
9
- MultiModalKwargs,
9
MultiModalKwargsItems,
10
MultiModalPlaceholderDict,
11
MultiModalUUIDDict,
@@ -30,7 +29,6 @@ __all__ = [
29
"MultiModalDataBuiltins",
30
"MultiModalDataDict",
31
"MultiModalHasher",
33
- "MultiModalKwargs",
32
"MultiModalKwargsItems",
33
"MultiModalPlaceholderDict",
34
"MultiModalUUIDDict",
vllm/multimodal/inputs.py
+8
-64
@@ -20,7 +20,7 @@ from typing import (
20
)
21
22
import numpy as np
23
-from typing_extensions import NotRequired, TypeVar, deprecated
23
+from typing_extensions import NotRequired, TypeVar
24
25
from vllm.utils.collection_utils import full_groupby, is_list_of
26
from vllm.utils.import_utils import LazyLoader
@@ -356,8 +356,8 @@ class MultiModalFeatureSpec:
356
@dataclass
357
class MultiModalFieldElem:
358
"""
359
- Represents a keyword argument corresponding to a multi-modal item
360
- in [`MultiModalKwargs`][vllm.multimodal.inputs.MultiModalKwargs].
359
+ Represents a keyword argument inside a
360
+ [`MultiModalKwargsItem`][vllm.multimodal.inputs.MultiModalKwargsItem].
361
"""
362
363
modality: str
@@ -369,14 +369,14 @@ class MultiModalFieldElem:
369
key: str
370
"""
371
The key of this field in
372
- [`MultiModalKwargs`][vllm.multimodal.inputs.MultiModalKwargs],
372
+ [`MultiModalKwargsItem`][vllm.multimodal.inputs.MultiModalKwargsItem],
373
i.e. the name of the keyword argument to be passed to the model.
374
"""
375
376
data: NestedTensors
377
"""
378
The tensor data of this field in
379
- [`MultiModalKwargs`][vllm.multimodal.inputs.MultiModalKwargs],
379
+ [`MultiModalKwargsItem`][vllm.multimodal.inputs.MultiModalKwargsItem],
380
i.e. the value of the keyword argument to be passed to the model.
381
382
It may be set to `None` if it is determined that the item is cached
@@ -410,9 +410,9 @@ class MultiModalFieldElem:
410
@dataclass(frozen=True, kw_only=True)
411
class BaseMultiModalField(ABC):
412
"""
413
- Defines how to interpret tensor data belonging to a keyword argument in
414
- [`MultiModalKwargs`][vllm.multimodal.inputs.MultiModalKwargs] for multiple
415
- multi-modal items, and vice versa.
413
+ Defines how to interpret tensor data belonging to a keyword argument for
414
+ [`MultiModalKwargsItems`][vllm.multimodal.inputs.MultiModalKwargsItems],
415
+ and vice versa.
416
"""
417
418
keep_on_cpu: bool = False
@@ -985,62 +985,6 @@ MultiModalKwargsOptionalItems: TypeAlias = (
985
)
986
987
988
-@deprecated("`MultiModalKwargs` is deprecated and will be removed in v0.14.")
989
-class MultiModalKwargs(UserDict[str, NestedTensors]):
990
- """
991
- A dictionary that represents the keyword arguments to
992
- [`torch.nn.Module.forward`][].
993
- """
994
-
995
- @staticmethod
996
- @deprecated(
997
- "`MultiModalKwargs.from_hf_inputs` is deprecated and "
998
- "will be removed in v0.14. "
999
- "Please use `MultiModalKwargsItems.from_hf_inputs` and "
1000
- "access the tensor data using `.get_data()`."
1001
- )
1002
- def from_hf_inputs(
1003
- hf_inputs: "BatchFeature",
1004
- config_by_key: Mapping[str, MultiModalFieldConfig],
1005
- ):
1006
- return MultiModalKwargsItems.from_hf_inputs(hf_inputs, config_by_key).get_data()
1007
-
1008
- @staticmethod
1009
- @deprecated(
1010
- "`MultiModalKwargs.from_items` is deprecated and "
1011
- "will be removed in v0.14. "
1012
- "Please use `MultiModalKwargsItems.from_seq` and "
1013
- "access the tensor data using `.get_data()`."
1014
- )
1015
- def from_items(
1016
- items: Sequence[MultiModalKwargsItem],
1017
- *,
1018
- pin_memory: bool = False,
1019
- ):
1020
- return MultiModalKwargsItems.from_seq(items).get_data(pin_memory=pin_memory)
1021
-
1022
- def __getitem__(self, key: str):
1023
- if key not in self:
1024
- raise KeyError(
1025
- f"Keyword argument {key!r} not found. "
1026
- f"Available keys: {set(self.keys())}"
1027
- )
1028
-
1029
- return super().__getitem__(key)
1030
-
1031
- def __eq__(self, other: object) -> bool:
1032
- if not isinstance(other, self.__class__):
1033
- return False
1034
-
1035
- for k in self:
1036
- if k not in other:
1037
- return False
1038
- if not nested_tensors_equal(self[k], other[k]):
1039
- return False
1040
-
1041
- return True
1042
-
1043
-
988
MultiModalPlaceholderDict: TypeAlias = Mapping[str, Sequence[PlaceholderRange]]
989
"""
990
A dictionary containing placeholder ranges for each modality.
vllm/multimodal/utils.py
+1
-14
@@ -4,7 +4,7 @@
4
import asyncio
5
import atexit
6
import mimetypes
7
-from collections.abc import Generator, Set
7
+from collections.abc import Generator
8
from concurrent.futures import ThreadPoolExecutor
9
from itertools import groupby
10
from pathlib import Path
@@ -462,8 +462,6 @@ def group_mm_kwargs_by_modality(
462
*,
463
device: torch.types.Device = None,
464
pin_memory: bool = False,
465
- merge_by_field_config: bool | None = None,
466
- multimodal_cpu_fields: Set[str] | None = None,
465
) -> Generator[tuple[str, int, BatchedTensorInputs], None, None]:
466
"""Group consecutive `MultiModalKwargsItem`s from `mm_kwargs` with the same
467
modality together into the same `MultiModalKwargs` instance.
@@ -476,17 +474,6 @@ def group_mm_kwargs_by_modality(
474
Yields:
475
A tuple `(modality, num_items, grouped_kwargs)`.
476
"""
479
- if merge_by_field_config is not None:
480
- logger.warning_once(
481
- "The `merge_by_field_config` argument of `group_mm_kwargs_by_modality` "
482
- "is deprecated and will be removed in v0.14."
483
- )
484
- if multimodal_cpu_fields is not None:
485
- logger.warning_once(
486
- "The `multimodal_cpu_fields` argument of `group_mm_kwargs_by_modality` "
487
- "is deprecated and will be removed in v0.14."
488
- )
489
-
477
from vllm.multimodal.inputs import MultiModalKwargsItems
478
479
for modality, items in groupby(mm_kwargs, key=lambda item: item.modality):
vllm/tokenizers/__init__.py
-2
@@ -7,7 +7,6 @@ from .registry import (
7
cached_get_tokenizer,
8
cached_tokenizer_from_config,
9
get_tokenizer,
10
- init_tokenizer_from_config,
10
)
11
12
__all__ = [
@@ -16,5 +15,4 @@ __all__ = [
15
"cached_get_tokenizer",
16
"get_tokenizer",
17
"cached_tokenizer_from_config",
19
- "init_tokenizer_from_config",
18
]
vllm/tokenizers/registry.py
+1
-8
@@ -7,7 +7,7 @@ from pathlib import Path
7
from typing import TYPE_CHECKING
8
9
import huggingface_hub
10
-from typing_extensions import TypeVar, assert_never, deprecated
10
+from typing_extensions import TypeVar, assert_never
11
12
import vllm.envs as envs
13
from vllm.logger import init_logger
@@ -224,10 +224,3 @@ def cached_tokenizer_from_config(model_config: "ModelConfig", **kwargs):
224
trust_remote_code=model_config.trust_remote_code,
225
**kwargs,
226
)
227
-
228
-
229
-@deprecated(
230
- "Renamed to `cached_tokenizer_from_config`. The old name will be removed in v0.14."
231
-)
232
-def init_tokenizer_from_config(model_config: "ModelConfig"):
233
- return cached_tokenizer_from_config(model_config)
vllm/transformers_utils/tokenizer.py
+2
-110
@@ -1,127 +1,19 @@
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-
3
import warnings
5
-from typing import Any
6
-
7
-from typing_extensions import deprecated
8
-
9
-from vllm.logger import init_logger
10
-from vllm.tokenizers import TokenizerLike
11
-
12
-logger = init_logger(__name__)
4
5
6
def __getattr__(name: str):
16
- if name == "AnyTokenizer":
17
- warnings.warn(
18
- "`vllm.transformers_utils.tokenizer.AnyTokenizer` has been moved to "
19
- "`vllm.tokenizers.TokenizerLike`. "
20
- "The old name will be removed in v0.14.",
21
- DeprecationWarning,
22
- stacklevel=2,
23
- )
24
-
25
- return TokenizerLike
7
+ # Keep until lm-eval is updated
8
if name == "get_tokenizer":
9
from vllm.tokenizers import get_tokenizer
10
11
warnings.warn(
12
"`vllm.transformers_utils.tokenizer.get_tokenizer` "
13
"has been moved to `vllm.tokenizers.get_tokenizer`. "
32
- "The old name will be removed in v0.14.",
14
+ "The old name will be removed in a future version.",
15
DeprecationWarning,
16
stacklevel=2,
17
)
18
19
return get_tokenizer
38
- if name == "cached_get_tokenizer":
39
- from vllm.tokenizers import cached_get_tokenizer
40
-
41
- warnings.warn(
42
- "`vllm.transformers_utils.tokenizer.cached_get_tokenizer` "
43
- "has been moved to `vllm.tokenizers.cached_get_tokenizer`. "
44
- "The old name will be removed in v0.14.",
45
- DeprecationWarning,
46
- stacklevel=2,
47
- )
48
-
49
- return cached_get_tokenizer
50
- if name == "cached_tokenizer_from_config":
51
- from vllm.tokenizers import cached_tokenizer_from_config
52
-
53
- warnings.warn(
54
- "`vllm.transformers_utils.tokenizer.cached_tokenizer_from_config` "
55
- "has been moved to `vllm.tokenizers.cached_tokenizer_from_config`. "
56
- "The old name will be removed in v0.14.",
57
- DeprecationWarning,
58
- stacklevel=2,
59
- )
60
-
61
- return cached_tokenizer_from_config
62
- if name == "init_tokenizer_from_configs":
63
- from vllm.tokenizers import cached_tokenizer_from_config
64
-
65
- warnings.warn(
66
- "`vllm.transformers_utils.tokenizer.init_tokenizer_from_configs` "
67
- "has been moved to `vllm.tokenizers.cached_tokenizer_from_config`. "
68
- "The old name will be removed in v0.14.",
69
- DeprecationWarning,
70
- stacklevel=2,
71
- )
72
-
73
- return cached_tokenizer_from_config
74
-
75
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
76
-
77
-
78
-@deprecated("Will be removed in v0.14. Please use `tokenizer.decode()` instead.")
79
-def decode_tokens(
80
- tokenizer: TokenizerLike,
81
- token_ids: list[int],
82
- *,
83
- skip_special_tokens: bool | None = None,
84
-) -> str:
85
- """
86
- Backend-agnostic equivalent of HF's
87
- `tokenizer.decode(token_ids, ...)`.
88
-
89
- `skip_special_tokens=None` means to use the backend's default
90
- settings.
91
- """
92
- kw_args: dict[str, Any] = {}
93
-
94
- if skip_special_tokens is not None:
95
- kw_args["skip_special_tokens"] = skip_special_tokens
96
-
97
- return tokenizer.decode(token_ids, **kw_args)
98
-
99
-
100
-@deprecated("Will be removed in v0.14. Please use `tokenizer.encode()` instead.")
101
-def encode_tokens(
102
- tokenizer: TokenizerLike,
103
- text: str,
104
- *,
105
- truncation: bool | None = None,
106
- max_length: int | None = None,
107
- add_special_tokens: bool | None = None,
108
-) -> list[int]:
109
- """
110
- Backend-agnostic equivalent of HF's
111
- `tokenizer.encode(text, ...)`.
112
-
113
- `add_special_tokens=None` means to use the backend's default
114
- settings.
115
- """
116
-
117
- kw_args: dict[str, Any] = {}
118
- if max_length is not None:
119
- kw_args["max_length"] = max_length
120
-
121
- if truncation is not None:
122
- kw_args["truncation"] = truncation
123
-
124
- if add_special_tokens is not None:
125
- kw_args["add_special_tokens"] = add_special_tokens
126
-
127
- return tokenizer.encode(text, **kw_args)
vllm/transformers_utils/tokenizer_base.py
deleted
-33
@@ -1,33 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-
4
-import warnings
5
-
6
-
7
-def __getattr__(name: str):
8
- if name == "TokenizerBase":
9
- from vllm.tokenizers import TokenizerLike
10
-
11
- warnings.warn(
12
- "`vllm.transformers_utils.tokenizer_base.TokenizerBase` has been "
13
- "moved to `vllm.tokenizers.TokenizerLike`. "
14
- "The old name will be removed in v0.14.",
15
- DeprecationWarning,
16
- stacklevel=2,
17
- )
18
-
19
- return TokenizerLike
20
- if name == "TokenizerRegistry":
21
- from vllm.tokenizers import TokenizerRegistry
22
-
23
- warnings.warn(
24
- "`vllm.transformers_utils.tokenizer_base.TokenizerRegistry` has been "
25
- "moved to `vllm.tokenizers.TokenizerRegistry`. "
26
- "The old name will be removed in v0.14.",
27
- DeprecationWarning,
28
- stacklevel=2,
29
- )
30
-
31
- return TokenizerRegistry
32
-
33
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/utils/__init__.py
-30
@@ -2,39 +2,9 @@
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
import uuid
5
-import warnings
6
-from typing import Any
5
6
import torch
7
10
-_DEPRECATED_MAPPINGS = {
11
- "cprofile": "profiling",
12
- "cprofile_context": "profiling",
13
- # Used by lm-eval
14
- "get_open_port": "network_utils",
15
-}
16
-
17
-
18
-def __getattr__(name: str) -> Any: # noqa: D401 - short deprecation docstring
19
- """Module-level getattr to handle deprecated utilities."""
20
- if name in _DEPRECATED_MAPPINGS:
21
- submodule_name = _DEPRECATED_MAPPINGS[name]
22
- warnings.warn(
23
- f"vllm.utils.{name} is deprecated and will be removed in a future version. "
24
- f"Use vllm.utils.{submodule_name}.{name} instead.",
25
- DeprecationWarning,
26
- stacklevel=2,
27
- )
28
- module = __import__(f"vllm.utils.{submodule_name}", fromlist=[submodule_name])
29
- return getattr(module, name)
30
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
31
-
32
-
33
-def __dir__() -> list[str]:
34
- # expose deprecated names in dir() for better UX/tab-completion
35
- return sorted(list(globals().keys()) + list(_DEPRECATED_MAPPINGS.keys()))
36
-
37
-
8
MASK_64_BITS = (1 << 64) - 1
9
10
vllm/v1/engine/async_llm.py
-9
@@ -11,7 +11,6 @@ from typing import Any, cast
11
12
import numpy as np
13
import torch
14
-from typing_extensions import deprecated
14
15
import vllm.envs as envs
16
from vllm.config import VllmConfig
@@ -190,14 +189,6 @@ class AsyncLLM(EngineClient):
189
else:
190
self.profiler = None
191
193
- @property
194
- @deprecated(
195
- "`AsyncLLM.processor` has been renamed to `AsyncLLM.input_processor`. "
196
- "The old name will be removed in v0.14."
197
- )
198
- def processor(self):
199
- return self.input_processor
200
-
192
@classmethod
193
def from_vllm_config(
194
cls,
vllm/v1/engine/llm_engine.py
+1
-9
@@ -7,7 +7,7 @@ from copy import copy
7
from typing import Any, cast
8
9
import torch.nn as nn
10
-from typing_extensions import TypeVar, deprecated
10
+from typing_extensions import TypeVar
11
12
import vllm.envs as envs
13
from vllm.config import ParallelConfig, VllmConfig
@@ -136,14 +136,6 @@ class LLMEngine:
136
# Don't keep the dummy data in memory
137
self.reset_mm_cache()
138
139
- @property
140
- @deprecated(
141
- "`LLMEngine.processor` has been renamed to `LLMEngine.input_processor`. "
142
- "The old name will be removed in v0.14."
143
- )
144
- def processor(self):
145
- return self.input_processor
146
-
139
@classmethod
140
def from_vllm_config(
141
cls,
vllm/v1/engine/processor.py
deleted
-20
@@ -1,20 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-import warnings
4
-
5
-
6
-def __getattr__(name: str):
7
- if name == "Processor":
8
- from .input_processor import InputProcessor
9
-
10
- warnings.warn(
11
- "`vllm.v1.engine.processor.Processor` has been moved to "
12
- "`vllm.v1.engine.input_processor.InputProcessor`. "
13
- "The old name will be removed in v0.14.",
14
- DeprecationWarning,
15
- stacklevel=2,
16
- )
17
-
18
- return InputProcessor
19
-
20
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
vllm/v1/worker/gpu_model_runner.py
-2
@@ -1090,13 +1090,11 @@ class GPUModelRunner(
1090
mm_kwargs.append(feature.data)
1091
1092
# Input all modalities at once
1093
- model = cast(SupportsMultiModal, self.model)
1093
mm_kwargs_combined: BatchedTensorInputs = {}
1094
for _, _, mm_kwargs_group in group_mm_kwargs_by_modality(
1095
mm_kwargs,
1096
device=self.device,
1097
pin_memory=self.pin_memory,
1099
- merge_by_field_config=model.merge_by_field_config,
1098
):
1099
mm_kwargs_combined.update(mm_kwargs_group)
1100