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 11, 16:15 UTC
[Deprecation] Remove deprecated task, seed and MM settings (#30397)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
Cyrus Leung committed
Dec 11, 2025 at 11:59 UTC
7e24e5d4d65abbe5ffc7e653fdfd670c7e300944
16 files changed
+25
-276
benchmarks/benchmark_ngram_proposer.py
+1
-1
@@ -37,7 +37,7 @@ def benchmark_propose(args):
37
tokenizer="facebook/opt-125m",
38
tokenizer_mode="auto",
39
dtype="auto",
40
- seed=None,
40
+ seed=0,
41
trust_remote_code=False,
42
)
43
proposer = NgramProposer(
examples/offline_inference/audio_language.py
+1
-1
@@ -422,7 +422,7 @@ def parse_args():
422
parser.add_argument(
423
"--seed",
424
type=int,
425
- default=None,
425
+ default=0,
426
help="Set the seed when initializing `vllm.LLM`.",
427
)
428
parser.add_argument(
examples/offline_inference/encoder_decoder_multimodal.py
+1
-1
@@ -77,7 +77,7 @@ def parse_args():
77
parser.add_argument(
78
"--seed",
79
type=int,
80
- default=None,
80
+ default=0,
81
help="Set the seed when initializing `vllm.LLM`.",
82
)
83
return parser.parse_args()
examples/offline_inference/qwen2_5_omni/only_thinker.py
+1
-1
@@ -158,7 +158,7 @@ def parse_args():
158
parser.add_argument(
159
"--seed",
160
type=int,
161
- default=None,
161
+ default=0,
162
help="Set the seed when initializing `vllm.LLM`.",
163
)
164
examples/offline_inference/qwen3_omni/only_thinker.py
+1
-1
@@ -158,7 +158,7 @@ def parse_args():
158
parser.add_argument(
159
"--seed",
160
type=int,
161
- default=None,
161
+ default=0,
162
help="Set the seed when initializing `vllm.LLM`.",
163
)
164
examples/offline_inference/vision_language.py
+1
-1
@@ -2031,7 +2031,7 @@ def parse_args():
2031
parser.add_argument(
2032
"--seed",
2033
type=int,
2034
- default=None,
2034
+ default=0,
2035
help="Set the seed when initializing `vllm.LLM`.",
2036
)
2037
examples/offline_inference/vision_language_multi_image.py
+3
-3
@@ -1382,7 +1382,7 @@ def run_generate(
1382
model,
1383
question: str,
1384
image_urls: list[str],
1385
- seed: int | None,
1385
+ seed: int,
1386
tensor_parallel_size: int | None,
1387
):
1388
req_data = model_example_map[model](question, image_urls)
@@ -1416,7 +1416,7 @@ def run_chat(
1416
model: str,
1417
question: str,
1418
image_urls: list[str],
1419
- seed: int | None,
1419
+ seed: int,
1420
tensor_parallel_size: int | None,
1421
):
1422
req_data = model_example_map[model](question, image_urls)
@@ -1494,7 +1494,7 @@ def parse_args():
1494
parser.add_argument(
1495
"--seed",
1496
type=int,
1497
- default=None,
1497
+ default=0,
1498
help="Set the seed when initializing `vllm.LLM`.",
1499
)
1500
parser.add_argument(
examples/pooling/plugin/prithvi_geospatial_mae_client.py
+1
-1
@@ -16,7 +16,7 @@ import requests
16
# - start vllm in serving mode with the below args
17
# --model='christian-pinto/Prithvi-EO-2.0-300M-TL-VLLM'
18
# --model-impl terratorch
19
-# --task embed --trust-remote-code
19
+# --trust-remote-code
20
# --skip-tokenizer-init --enforce-eager
21
# --io-processor-plugin terratorch_segmentation
22
# --enable-mm-embeds
examples/pooling/pooling/vision_language_pooling.py
+3
-3
@@ -305,7 +305,7 @@ def get_query(modality: QueryModality):
305
raise ValueError(msg)
306
307
308
-def run_encode(model: str, modality: QueryModality, seed: int | None):
308
+def run_encode(model: str, modality: QueryModality, seed: int):
309
query = get_query(modality)
310
req_data = model_example_map[model](query)
311
@@ -335,7 +335,7 @@ def run_encode(model: str, modality: QueryModality, seed: int | None):
335
print("-" * 50)
336
337
338
-def run_score(model: str, modality: QueryModality, seed: int | None):
338
+def run_score(model: str, modality: QueryModality, seed: int):
339
query = get_query(modality)
340
req_data = model_example_map[model](query)
341
@@ -390,7 +390,7 @@ def parse_args():
390
parser.add_argument(
391
"--seed",
392
type=int,
393
- default=None,
393
+ default=0,
394
help="Set the seed when initializing `vllm.LLM`.",
395
)
396
return parser.parse_args()
tests/conftest.py
+1
-1
@@ -741,7 +741,7 @@ class VllmRunner:
741
tokenizer_name: str | None = None,
742
tokenizer_mode: str = "auto",
743
trust_remote_code: bool = True,
744
- seed: int | None = 0,
744
+ seed: int = 0,
745
max_model_len: int | None = 1024,
746
dtype: str = "auto",
747
disable_log_stats: bool = True,
tests/test_config.py
-58
@@ -89,64 +89,6 @@ def test_update_config():
89
new_config3 = update_config(config3, {"a": "new_value"})
90
91
92
-# Can remove once --task option is fully deprecated
93
-@pytest.mark.parametrize(
94
- ("model_id", "expected_runner_type", "expected_convert_type", "expected_task"),
95
- [
96
- ("distilbert/distilgpt2", "generate", "none", "generate"),
97
- ("intfloat/multilingual-e5-small", "pooling", "none", "embed"),
98
- ("jason9693/Qwen2.5-1.5B-apeach", "pooling", "classify", "classify"),
99
- ("cross-encoder/ms-marco-MiniLM-L-6-v2", "pooling", "none", "classify"),
100
- ("Qwen/Qwen2.5-Math-RM-72B", "pooling", "none", "embed"),
101
- ("openai/whisper-small", "generate", "none", "transcription"),
102
- ],
103
-)
104
-def test_auto_task(
105
- model_id, expected_runner_type, expected_convert_type, expected_task
106
-):
107
- config = ModelConfig(model_id, task="auto")
108
-
109
- assert config.runner_type == expected_runner_type
110
- assert config.convert_type == expected_convert_type
111
-
112
-
113
-# Can remove once --task option is fully deprecated
114
-@pytest.mark.parametrize(
115
- ("model_id", "expected_runner_type", "expected_convert_type", "expected_task"),
116
- [
117
- ("distilbert/distilgpt2", "pooling", "embed", "embed"),
118
- ("intfloat/multilingual-e5-small", "pooling", "embed", "embed"),
119
- ("jason9693/Qwen2.5-1.5B-apeach", "pooling", "classify", "classify"),
120
- ("cross-encoder/ms-marco-MiniLM-L-6-v2", "pooling", "classify", "classify"),
121
- ("Qwen/Qwen2.5-Math-RM-72B", "pooling", "embed", "embed"),
122
- ("openai/whisper-small", "pooling", "embed", "embed"),
123
- ],
124
-)
125
-def test_score_task(
126
- model_id, expected_runner_type, expected_convert_type, expected_task
127
-):
128
- config = ModelConfig(model_id, task="score")
129
-
130
- assert config.runner_type == expected_runner_type
131
- assert config.convert_type == expected_convert_type
132
-
133
-
134
-# Can remove once --task option is fully deprecated
135
-@pytest.mark.parametrize(
136
- ("model_id", "expected_runner_type", "expected_convert_type", "expected_task"),
137
- [
138
- ("openai/whisper-small", "generate", "none", "transcription"),
139
- ],
140
-)
141
-def test_transcription_task(
142
- model_id, expected_runner_type, expected_convert_type, expected_task
143
-):
144
- config = ModelConfig(model_id, task="transcription")
145
-
146
- assert config.runner_type == expected_runner_type
147
- assert config.convert_type == expected_convert_type
148
-
149
-
92
@pytest.mark.parametrize(
93
("model_id", "expected_runner_type", "expected_convert_type"),
94
[
tests/utils.py
+2
-2
@@ -119,7 +119,7 @@ class RemoteOpenAIServer:
119
vllm_serve_args: list[str],
120
*,
121
env_dict: dict[str, str] | None = None,
122
- seed: int | None = 0,
122
+ seed: int = 0,
123
auto_port: bool = True,
124
max_wait_seconds: float | None = None,
125
override_hf_configs: dict[str, Any] | None = None,
@@ -283,7 +283,7 @@ class RemoteOpenAIServerCustom(RemoteOpenAIServer):
283
child_process_fxn: Callable[[dict[str, str] | None, str, list[str]], None],
284
*,
285
env_dict: dict[str, str] | None = None,
286
- seed: int | None = 0,
286
+ seed: int = 0,
287
auto_port: bool = True,
288
max_wait_seconds: float | None = None,
289
) -> None:
vllm/config/model.py
-131
@@ -73,17 +73,6 @@ logger = init_logger(__name__)
73
RunnerOption = Literal["auto", RunnerType]
74
ConvertType = Literal["none", "embed", "classify", "reward"]
75
ConvertOption = Literal["auto", ConvertType]
76
-TaskOption = Literal[
77
- "auto",
78
- "generate",
79
- "embedding",
80
- "embed",
81
- "classify",
82
- "score",
83
- "reward",
84
- "transcription",
85
- "draft",
86
-]
76
TokenizerMode = Literal["auto", "hf", "slow", "mistral", "deepseek_v32"]
77
ModelDType = Literal["auto", "half", "float16", "bfloat16", "float", "float32"]
78
LogprobsMode = Literal[
@@ -93,12 +82,6 @@ HfOverrides = dict[str, Any] | Callable[[PretrainedConfig], PretrainedConfig]
82
ModelImpl = Literal["auto", "vllm", "transformers", "terratorch"]
83
LayerBlockType = Literal["attention", "linear_attention", "mamba"]
84
96
-_RUNNER_TASKS: dict[RunnerType, list[TaskOption]] = {
97
- "generate": ["generate", "transcription"],
98
- "pooling": ["embedding", "embed", "classify", "score", "reward"],
99
- "draft": ["draft"],
100
-}
101
-
85
_RUNNER_CONVERTS: dict[RunnerType, list[ConvertType]] = {
86
"generate": [],
87
"pooling": ["embed", "classify", "reward"],
@@ -126,12 +109,6 @@ class ModelConfig:
109
"""Convert the model using adapters defined in
110
[vllm.model_executor.models.adapters][]. The most common use case is to
111
adapt a text generation model to be used for pooling tasks."""
129
- task: TaskOption | None = None
130
- """[DEPRECATED] The task to use the model for. If the model supports more
131
- than one model runner, this is used to select which model runner to run.
132
-
133
- Note that the model may support other tasks using the same model runner.
134
- """
112
tokenizer: SkipValidation[str] = None # type: ignore
113
"""Name or path of the Hugging Face tokenizer to use. If unspecified, model
114
name or path will be used."""
@@ -335,7 +312,6 @@ class ModelConfig:
312
ignored_factors = {
313
"runner",
314
"convert",
338
- "task",
315
"tokenizer",
316
"tokenizer_mode",
317
"seed",
@@ -510,97 +486,6 @@ class ModelConfig:
486
is_generative_model = registry.is_text_generation_model(architectures, self)
487
is_pooling_model = registry.is_pooling_model(architectures, self)
488
513
- def _task_to_convert(task: TaskOption) -> ConvertType:
514
- if task == "embedding" or task == "embed":
515
- return "embed"
516
- if task == "classify":
517
- return "classify"
518
- if task == "reward":
519
- logger.warning(
520
- "Pooling models now default support all pooling; "
521
- "you can use it without any settings."
522
- )
523
- return "embed"
524
- if task == "score":
525
- new_task = self._get_default_pooling_task(architectures)
526
- return "classify" if new_task == "classify" else "embed"
527
-
528
- return "none"
529
-
530
- if self.task is not None:
531
- runner: RunnerOption = "auto"
532
- convert: ConvertOption = "auto"
533
- msg_prefix = (
534
- "The 'task' option has been deprecated and will be "
535
- "removed in v0.13.0 or v1.0, whichever comes first."
536
- )
537
- msg_hint = "Please remove this option."
538
-
539
- is_generative_task = self.task in _RUNNER_TASKS["generate"]
540
- is_pooling_task = self.task in _RUNNER_TASKS["pooling"]
541
-
542
- if is_generative_model and is_pooling_model:
543
- if is_generative_task:
544
- runner = "generate"
545
- convert = "auto"
546
- msg_hint = (
547
- "Please replace this option with `--runner "
548
- "generate` to continue using this model "
549
- "as a generative model."
550
- )
551
- elif is_pooling_task:
552
- runner = "pooling"
553
- convert = "auto"
554
- msg_hint = (
555
- "Please replace this option with `--runner "
556
- "pooling` to continue using this model "
557
- "as a pooling model."
558
- )
559
- else: # task == "auto"
560
- pass
561
- elif is_generative_model or is_pooling_model:
562
- if is_generative_task:
563
- runner = "generate"
564
- convert = "auto"
565
- msg_hint = "Please remove this option"
566
- elif is_pooling_task:
567
- runner = "pooling"
568
- convert = _task_to_convert(self.task)
569
- msg_hint = (
570
- "Please replace this option with `--convert "
571
- f"{convert}` to continue using this model "
572
- "as a pooling model."
573
- )
574
- else: # task == "auto"
575
- pass
576
- else:
577
- # Neither generative nor pooling model - try to convert if possible
578
- if is_pooling_task:
579
- runner = "pooling"
580
- convert = _task_to_convert(self.task)
581
- msg_hint = (
582
- "Please replace this option with `--runner pooling "
583
- f"--convert {convert}` to continue using this model "
584
- "as a pooling model."
585
- )
586
- else:
587
- debug_info = {
588
- "architectures": architectures,
589
- "is_generative_model": is_generative_model,
590
- "is_pooling_model": is_pooling_model,
591
- }
592
- raise AssertionError(
593
- "The model should be a generative or "
594
- "pooling model when task is set to "
595
- f"{self.task!r}. Found: {debug_info}"
596
- )
597
-
598
- self.runner = runner
599
- self.convert = convert
600
-
601
- msg = f"{msg_prefix} {msg_hint}"
602
- warnings.warn(msg, DeprecationWarning, stacklevel=2)
603
-
489
self.runner_type = self._get_runner_type(architectures, self.runner)
490
self.convert_type = self._get_convert_type(
491
architectures, self.runner_type, self.convert
@@ -918,22 +803,6 @@ class ModelConfig:
803
804
return convert_type
805
921
- def _get_default_pooling_task(
922
- self,
923
- architectures: list[str],
924
- ) -> Literal["embed", "classify", "reward"]:
925
- if self.registry.is_cross_encoder_model(architectures, self):
926
- return "classify"
927
-
928
- for arch in architectures:
929
- match = try_match_architecture_defaults(arch, runner_type="pooling")
930
- if match:
931
- _, (_, convert_type) = match
932
- assert convert_type != "none"
933
- return convert_type
934
-
935
- return "embed"
936
-
806
def _parse_quant_hf_config(self, hf_config: PretrainedConfig):
807
quant_cfg = getattr(hf_config, "quantization_config", None)
808
if quant_cfg is None:
vllm/engine/arg_utils.py
+8
-65
@@ -71,7 +71,6 @@ from vllm.config.model import (
71
LogprobsMode,
72
ModelDType,
73
RunnerOption,
74
- TaskOption,
74
TokenizerMode,
75
)
76
from vllm.config.multimodal import MMCacheType, MMEncoderTPMode
@@ -360,7 +359,6 @@ class EngineArgs:
359
hf_config_path: str | None = ModelConfig.hf_config_path
360
runner: RunnerOption = ModelConfig.runner
361
convert: ConvertOption = ModelConfig.convert
363
- task: TaskOption | None = ModelConfig.task
362
skip_tokenizer_init: bool = ModelConfig.skip_tokenizer_init
363
enable_prompt_embeds: bool = ModelConfig.enable_prompt_embeds
364
tokenizer_mode: TokenizerMode | str = ModelConfig.tokenizer_mode
@@ -373,7 +371,7 @@ class EngineArgs:
371
config_format: str = ModelConfig.config_format
372
dtype: ModelDType = ModelConfig.dtype
373
kv_cache_dtype: CacheDType = CacheConfig.cache_dtype
376
- seed: int | None = 0
374
+ seed: int = ModelConfig.seed
375
max_model_len: int | None = ModelConfig.max_model_len
376
cudagraph_capture_sizes: list[int] | None = (
377
CompilationConfig.cudagraph_capture_sizes
@@ -462,7 +460,6 @@ class EngineArgs:
460
MultiModalConfig, "media_io_kwargs"
461
)
462
mm_processor_kwargs: dict[str, Any] | None = MultiModalConfig.mm_processor_kwargs
465
- disable_mm_preprocessor_cache: bool = False # DEPRECATED
463
mm_processor_cache_gb: float = MultiModalConfig.mm_processor_cache_gb
464
mm_processor_cache_type: MMCacheType | None = (
465
MultiModalConfig.mm_processor_cache_type
@@ -558,9 +555,6 @@ class EngineArgs:
555
use_tqdm_on_load: bool = LoadConfig.use_tqdm_on_load
556
pt_load_map_location: str = LoadConfig.pt_load_map_location
557
561
- # DEPRECATED
562
- enable_multimodal_encoder_data_parallel: bool = False
563
-
558
logits_processors: list[str | type[LogitsProcessor]] | None = (
559
ModelConfig.logits_processors
560
)
@@ -628,7 +622,6 @@ class EngineArgs:
622
model_group.add_argument("--model", **model_kwargs["model"])
623
model_group.add_argument("--runner", **model_kwargs["runner"])
624
model_group.add_argument("--convert", **model_kwargs["convert"])
631
- model_group.add_argument("--task", **model_kwargs["task"], deprecated=True)
625
model_group.add_argument("--tokenizer", **model_kwargs["tokenizer"])
626
model_group.add_argument("--tokenizer-mode", **model_kwargs["tokenizer_mode"])
627
model_group.add_argument(
@@ -882,11 +875,6 @@ class EngineArgs:
875
parallel_group.add_argument(
876
"--worker-extension-cls", **parallel_kwargs["worker_extension_cls"]
877
)
885
- parallel_group.add_argument(
886
- "--enable-multimodal-encoder-data-parallel",
887
- action="store_true",
888
- deprecated=True,
889
- )
878
879
# KV cache arguments
880
cache_kwargs = get_kwargs(CacheConfig)
@@ -960,9 +948,6 @@ class EngineArgs:
948
multimodal_group.add_argument(
949
"--mm-processor-cache-gb", **multimodal_kwargs["mm_processor_cache_gb"]
950
)
963
- multimodal_group.add_argument(
964
- "--disable-mm-preprocessor-cache", action="store_true", deprecated=True
965
- )
951
multimodal_group.add_argument(
952
"--mm-processor-cache-type", **multimodal_kwargs["mm_processor_cache_type"]
953
)
@@ -1192,62 +1177,20 @@ class EngineArgs:
1177
if is_gguf(self.model):
1178
self.quantization = self.load_format = "gguf"
1179
1195
- # NOTE(woosuk): In V1, we use separate processes for workers (unless
1196
- # VLLM_ENABLE_V1_MULTIPROCESSING=0), so setting a seed here
1197
- # doesn't affect the user process.
1198
- if self.seed is None:
1199
- logger.warning_once(
1200
- "`seed=None` is equivalent to `seed=0` in V1 Engine. "
1201
- "You will no longer be allowed to pass `None` in v0.13.",
1202
- scope="local",
1203
- )
1204
-
1205
- self.seed = 0
1206
- if not envs.VLLM_ENABLE_V1_MULTIPROCESSING:
1207
- logger.warning(
1208
- "The global random seed is set to %d. Since "
1209
- "VLLM_ENABLE_V1_MULTIPROCESSING is set to False, this may "
1210
- "affect the random state of the Python process that "
1211
- "launched vLLM.",
1212
- self.seed,
1213
- )
1214
-
1215
- if self.disable_mm_preprocessor_cache:
1216
- logger.warning_once(
1217
- "`--disable-mm-preprocessor-cache` is deprecated "
1218
- "and will be removed in v0.13. "
1219
- "Please use `--mm-processor-cache-gb 0` instead.",
1220
- scope="local",
1221
- )
1222
-
1223
- self.mm_processor_cache_gb = 0
1224
- elif envs.VLLM_MM_INPUT_CACHE_GIB != 4:
1225
- logger.warning_once(
1226
- "VLLM_MM_INPUT_CACHE_GIB` is deprecated "
1227
- "and will be removed in v0.13. "
1228
- "Please use `--mm-processor-cache-gb %d` instead.",
1229
- envs.VLLM_MM_INPUT_CACHE_GIB,
1230
- scope="local",
1180
+ if not envs.VLLM_ENABLE_V1_MULTIPROCESSING:
1181
+ logger.warning(
1182
+ "The global random seed is set to %d. Since "
1183
+ "VLLM_ENABLE_V1_MULTIPROCESSING is set to False, this may "
1184
+ "affect the random state of the Python process that "
1185
+ "launched vLLM.",
1186
+ self.seed,
1187
)
1188
1233
- self.mm_processor_cache_gb = envs.VLLM_MM_INPUT_CACHE_GIB
1234
-
1235
- if self.enable_multimodal_encoder_data_parallel:
1236
- logger.warning_once(
1237
- "--enable-multimodal-encoder-data-parallel` is deprecated "
1238
- "and will be removed in v0.13. "
1239
- "Please use `--mm-encoder-tp-mode data` instead.",
1240
- scope="local",
1241
- )
1242
-
1243
- self.mm_encoder_tp_mode = "data"
1244
-
1189
return ModelConfig(
1190
model=self.model,
1191
hf_config_path=self.hf_config_path,
1192
runner=self.runner,
1193
convert=self.convert,
1250
- task=self.task,
1194
tokenizer=self.tokenizer,
1195
tokenizer_mode=self.tokenizer_mode,
1196
trust_remote_code=self.trust_remote_code,
vllm/entrypoints/llm.py
+1
-1
@@ -198,7 +198,7 @@ class LLM:
198
quantization: QuantizationMethods | None = None,
199
revision: str | None = None,
200
tokenizer_revision: str | None = None,
201
- seed: int | None = None,
201
+ seed: int = 0,
202
gpu_memory_utilization: float = 0.9,
203
swap_space: float = 4,
204
cpu_offload_gb: float = 0,
vllm/envs.py
-5
@@ -72,7 +72,6 @@ if TYPE_CHECKING:
72
VLLM_MAX_AUDIO_CLIP_FILESIZE_MB: int = 25
73
VLLM_VIDEO_LOADER_BACKEND: str = "opencv"
74
VLLM_MEDIA_CONNECTOR: str = "http"
75
- VLLM_MM_INPUT_CACHE_GIB: int = 4
75
VLLM_TARGET_DEVICE: str = "cuda"
76
VLLM_MAIN_CUDA_VERSION: str = "12.9"
77
VLLM_FLOAT32_MATMUL_PRECISION: Literal["highest", "high", "medium"] = "highest"
@@ -786,9 +785,6 @@ environment_variables: dict[str, Callable[[], Any]] = {
785
# imported at runtime.
786
# If a non-existing backend is used, an AssertionError will be thrown.
787
"VLLM_MEDIA_CONNECTOR": lambda: os.getenv("VLLM_MEDIA_CONNECTOR", "http"),
789
- # [DEPRECATED] Cache size (in GiB per process) for multimodal input cache
790
- # Default is 4 GiB per API process + 4 GiB per engine core process
791
- "VLLM_MM_INPUT_CACHE_GIB": lambda: int(os.getenv("VLLM_MM_INPUT_CACHE_GIB", "4")),
788
# Path to the XLA persistent cache directory.
789
# Only used for XLA devices such as TPUs.
790
"VLLM_XLA_CACHE_PATH": lambda: os.path.expanduser(
@@ -1681,7 +1677,6 @@ def compile_factors() -> dict[str, object]:
1677
"VLLM_MEDIA_CONNECTOR",
1678
"VLLM_ASSETS_CACHE",
1679
"VLLM_ASSETS_CACHE_MODEL_CLEAN",
1684
- "VLLM_MM_INPUT_CACHE_GIB",
1680
"VLLM_WORKER_MULTIPROC_METHOD",
1681
"VLLM_ENABLE_V1_MULTIPROCESSING",
1682
"VLLM_V1_OUTPUT_PROC_CHUNK_SIZE",