@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 428bc7bf1c
Fork 0

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 13, 19:30 UTC

[V0 deprecation] Remove VLLM_USE_V1 usage in most modules (#27955)

Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>

wangxiyuan committed Nov 5, 2025 at 12:51 UTC 428bc7bf1c54674956dd24f00db43dbcf3655c4d
19 files changed +110 -241
docs/usage/v1_guide.md
-2
@@ -6,8 +6,6 @@
6
7 V1 is now enabled by default for all supported use cases, and we will gradually enable it for every use case we plan to support. Please share any feedback on [GitHub](https://github.com/vllm-project/vllm) or in the [vLLM Slack](https://inviter.co/vllm-slack).
8
9 -To disable V1, please set the environment variable as: `VLLM_USE_V1=0`, and send us a GitHub issue sharing the reason!
10 -
9 ## Why vLLM V1?
10
11 vLLM V0 successfully supported a wide range of models and hardware, but as new features were developed independently, the system grew increasingly complex. This complexity made it harder to integrate new capabilities and introduced technical debt, revealing the need for a more streamlined and unified design.
tests/conftest.py
-20
@@ -154,26 +154,6 @@ AUDIO_ASSETS = AudioTestAssets()
154 """Singleton instance of {class}`AudioTestAssets`."""
155
156
157 -@pytest.fixture(scope="function", autouse=True)
158 -def cleanup_VLLM_USE_V1(monkeypatch):
159 - """
160 - The V1 oracle sets "VLLM_USE_V1" during loading. This means
161 - that each invocation of a test change the env variable.
162 -
163 - If we touch "VLLM_USE_V1" with monkeypatch, then any changes
164 - made during the test run by vLLM will be cleaned up.
165 -
166 - This fixture is used by every test.
167 - """
168 -
169 - # If VLLM_USE_V1 is not set, set then delete. This will
170 - # cause monkeypatch to clean up VLLM_USE_V1 upon exit
171 - # if VLLM modifies the value of envs.VLLM_USE_V1.
172 - if "VLLM_USE_V1" not in os.environ:
173 - monkeypatch.setenv("VLLM_USE_V1", "")
174 - monkeypatch.delenv("VLLM_USE_V1")
175 -
176 -
157 @pytest.fixture(autouse=True)
158 def init_test_http_connection():
159 # pytest_asyncio may use a different event loop per test
tests/v1/engine/test_async_llm.py
+2 -5
@@ -424,15 +424,12 @@ async def test_customize_loggers(monkeypatch):
424
425
426 @pytest.mark.asyncio
427 -async def test_customize_aggregated_loggers(monkeypatch):
427 +async def test_customize_aggregated_loggers():
428 """Test that we can customize the aggregated loggers.
429 If a customized logger is provided at the init, it should
430 be added to the default loggers.
431 """
432 -
433 - with monkeypatch.context() as m, ExitStack() as after:
434 - m.setenv("VLLM_USE_V1", "1")
435 -
432 + with ExitStack() as after:
433 with set_default_torch_num_threads(1):
434 engine = AsyncLLM.from_engine_args(
435 TEXT_ENGINE_ARGS,
tests/v1/entrypoints/llm/test_struct_output_generate.py
-3
@@ -868,11 +868,8 @@ def test_structured_output_batched_with_non_structured_outputs_requests(
868
869 @pytest.mark.parametrize("guided_decoding_backend", ["xgrammar"])
870 def test_structured_output_with_structural_tag(
871 - monkeypatch: pytest.MonkeyPatch,
871 guided_decoding_backend: str,
872 ):
874 - monkeypatch.setenv("VLLM_USE_V1", "1")
875 -
873 llm = LLM(
874 model="Qwen/Qwen2.5-1.5B-Instruct",
875 guided_decoding_backend=guided_decoding_backend,
tests/v1/sample/test_logprobs.py
+59 -62
@@ -530,7 +530,6 @@ def test_logprobs_mode(logprobs_mode: LogprobsMode):
530 def test_spec_decode_logprobs(
531 logprobs_mode: LogprobsMode,
532 model_setup: tuple[str, str, str],
533 - monkeypatch: pytest.MonkeyPatch,
533 ):
534 """Spec decode logprobs should match those of the base model.
535
@@ -541,64 +540,62 @@ def test_spec_decode_logprobs(
540 """
541 from vllm import LLM
542
544 - with monkeypatch.context() as m:
545 - m.setenv("VLLM_USE_V1", "1")
546 - prompt = "Hello world"
547 - sampling_params = SamplingParams(
548 - temperature=0, logprobs=3, max_tokens=10, ignore_eos=False
549 - )
550 - method, model_name, spec_model_name = model_setup
551 - max_model_len = 256
552 -
553 - # Run base LLM.
554 - ref_llm = LLM(
555 - model=model_name,
556 - max_logprobs=5,
557 - max_model_len=max_model_len,
558 - seed=42,
559 - logprobs_mode=logprobs_mode,
560 - gpu_memory_utilization=0.4,
561 - )
562 - ref_results = ref_llm.generate([prompt], sampling_params)
563 - # Collect logprobs outputs from reference LLM.
564 - ref_logprobs = []
565 - for output in ref_results[0].outputs:
566 - for logprobs in output.logprobs:
567 - for token_id in logprobs:
568 - ref_logprobs.append(logprobs[token_id])
569 - del ref_llm
570 - torch.cuda.empty_cache()
571 - cleanup_dist_env_and_memory()
572 -
573 - # Run spec decode LLM.
574 - spec_llm = LLM(
575 - model_name,
576 - speculative_config={
577 - "method": method,
578 - "model": spec_model_name,
579 - "num_speculative_tokens": 3,
580 - "max_model_len": max_model_len,
581 - },
582 - max_logprobs=5,
583 - max_model_len=max_model_len,
584 - seed=42,
585 - logprobs_mode=logprobs_mode,
586 - gpu_memory_utilization=0.4,
587 - )
588 - spec_results = spec_llm.generate([prompt], sampling_params)
589 - # Collect logprobs outputs from spec decode LLM.
590 - spec_logprobs = []
591 - for output in spec_results[0].outputs:
592 - for logprobs in output.logprobs:
593 - for token_id in logprobs:
594 - spec_logprobs.append(logprobs[token_id])
595 - del spec_llm
596 - torch.cuda.empty_cache()
597 - cleanup_dist_env_and_memory()
598 -
599 - # Per-token logprobs are expected to be the same.
600 - assert len(ref_logprobs) == len(spec_logprobs)
601 - for ref_logprob, spec_logprob in zip(ref_logprobs, spec_logprobs):
602 - assert math.isclose(ref_logprob.logprob, spec_logprob.logprob, abs_tol=1e-3)
603 - assert ref_logprob.rank == spec_logprob.rank
604 - assert ref_logprob.decoded_token == spec_logprob.decoded_token
543 + prompt = "Hello world"
544 + sampling_params = SamplingParams(
545 + temperature=0, logprobs=3, max_tokens=10, ignore_eos=False
546 + )
547 + method, model_name, spec_model_name = model_setup
548 + max_model_len = 256
549 +
550 + # Run base LLM.
551 + ref_llm = LLM(
552 + model=model_name,
553 + max_logprobs=5,
554 + max_model_len=max_model_len,
555 + seed=42,
556 + logprobs_mode=logprobs_mode,
557 + gpu_memory_utilization=0.4,
558 + )
559 + ref_results = ref_llm.generate([prompt], sampling_params)
560 + # Collect logprobs outputs from reference LLM.
561 + ref_logprobs = []
562 + for output in ref_results[0].outputs:
563 + for logprobs in output.logprobs:
564 + for token_id in logprobs:
565 + ref_logprobs.append(logprobs[token_id])
566 + del ref_llm
567 + torch.cuda.empty_cache()
568 + cleanup_dist_env_and_memory()
569 +
570 + # Run spec decode LLM.
571 + spec_llm = LLM(
572 + model_name,
573 + speculative_config={
574 + "method": method,
575 + "model": spec_model_name,
576 + "num_speculative_tokens": 3,
577 + "max_model_len": max_model_len,
578 + },
579 + max_logprobs=5,
580 + max_model_len=max_model_len,
581 + seed=42,
582 + logprobs_mode=logprobs_mode,
583 + gpu_memory_utilization=0.4,
584 + )
585 + spec_results = spec_llm.generate([prompt], sampling_params)
586 + # Collect logprobs outputs from spec decode LLM.
587 + spec_logprobs = []
588 + for output in spec_results[0].outputs:
589 + for logprobs in output.logprobs:
590 + for token_id in logprobs:
591 + spec_logprobs.append(logprobs[token_id])
592 + del spec_llm
593 + torch.cuda.empty_cache()
594 + cleanup_dist_env_and_memory()
595 +
596 + # Per-token logprobs are expected to be the same.
597 + assert len(ref_logprobs) == len(spec_logprobs)
598 + for ref_logprob, spec_logprob in zip(ref_logprobs, spec_logprobs):
599 + assert math.isclose(ref_logprob.logprob, spec_logprob.logprob, abs_tol=1e-3)
600 + assert ref_logprob.rank == spec_logprob.rank
601 + assert ref_logprob.decoded_token == spec_logprob.decoded_token
vllm/attention/layers/chunked_local_attention.py
+6 -12
@@ -5,7 +5,6 @@ from typing import ClassVar
5
6 import torch
7
8 -from vllm import envs
8 from vllm.attention.backends.abstract import AttentionBackend, AttentionMetadata
9 from vllm.attention.selector import get_attn_backend
10 from vllm.config import CacheConfig
@@ -78,17 +77,12 @@ class ChunkedLocalAttention(Attention):
77 kv_cache_dtype = "auto"
78 block_size = 16
79
81 - if envs.VLLM_USE_V1:
82 - underlying_attn_backend = get_attn_backend(
83 - head_size, dtype, kv_cache_dtype, block_size
84 - )
85 -
86 - attn_backend = create_chunked_local_attention_backend(
87 - underlying_attn_backend, attention_chunk_size, block_size
88 - )
89 - else:
90 - # in v0 the local attention is handled inside the backends
91 - attn_backend = None
80 + underlying_attn_backend = get_attn_backend(
81 + head_size, dtype, kv_cache_dtype, block_size
82 + )
83 + attn_backend = create_chunked_local_attention_backend(
84 + underlying_attn_backend, attention_chunk_size, block_size
85 + )
86
87 super().__init__(
88 num_heads=num_heads,
vllm/attention/layers/cross_attention.py
+4 -10
@@ -6,7 +6,6 @@ from copy import copy
6 import numpy as np
7 import torch
8
9 -from vllm import envs
9 from vllm.attention.backends.abstract import (
10 AttentionBackend,
11 AttentionMetadata,
@@ -150,15 +149,10 @@ class CrossAttention(Attention):
149 kv_cache_dtype = "auto"
150 block_size = 16
151
153 - if envs.VLLM_USE_V1:
154 - underlying_attn_backend = get_attn_backend(
155 - head_size, dtype, kv_cache_dtype, block_size
156 - )
157 -
158 - attn_backend = create_cross_attention_backend(underlying_attn_backend)
159 - else:
160 - # in v0 cross attention is handled inside the backends
161 - attn_backend = None
152 + underlying_attn_backend = get_attn_backend(
153 + head_size, dtype, kv_cache_dtype, block_size
154 + )
155 + attn_backend = create_cross_attention_backend(underlying_attn_backend)
156
157 if attn_type is not None:
158 assert attn_type == AttentionType.ENCODER_DECODER, (
vllm/attention/layers/encoder_only_attention.py
+4 -11
@@ -5,7 +5,6 @@ from copy import copy
5
6 import torch
7
8 -from vllm import envs
8 from vllm.attention.backends.abstract import (
9 AttentionBackend,
10 AttentionMetadata,
@@ -74,17 +73,11 @@ class EncoderOnlyAttention(Attention):
73 kv_cache_dtype = "auto"
74 block_size = 16
75
77 - if envs.VLLM_USE_V1:
78 - underlying_attn_backend = get_attn_backend(
79 - head_size, dtype, kv_cache_dtype, block_size
80 - )
76 + underlying_attn_backend = get_attn_backend(
77 + head_size, dtype, kv_cache_dtype, block_size
78 + )
79
82 - attn_backend = create_encoder_only_attention_backend(
83 - underlying_attn_backend
84 - )
85 - else:
86 - # in v0 encoder only attention is handled inside the backends
87 - attn_backend = None
80 + attn_backend = create_encoder_only_attention_backend(underlying_attn_backend)
81
82 if attn_type is not None:
83 assert attn_type == AttentionType.ENCODER_ONLY, (
vllm/attention/selector.py
+1 -7
@@ -134,16 +134,11 @@ def get_attn_backend(
134 use_sparse: bool = False,
135 ) -> type[AttentionBackend]:
136 """Selects which attention backend to use and lazily imports it."""
137 - # Accessing envs.* behind an @lru_cache decorator can cause the wrong
138 - # value to be returned from the cache if the value changes between calls.
139 - # To avoid this, we read envs.VLLM_USE_V1 here and pass it explicitly to the
140 - # private function.
137 return _cached_get_attn_backend(
138 head_size=head_size,
139 dtype=dtype,
140 kv_cache_dtype=kv_cache_dtype,
141 block_size=block_size,
146 - use_v1=envs.VLLM_USE_V1,
142 use_mla=use_mla,
143 has_sink=has_sink,
144 use_sparse=use_sparse,
@@ -156,7 +151,6 @@ def _cached_get_attn_backend(
151 dtype: torch.dtype,
152 kv_cache_dtype: str | None,
153 block_size: int,
159 - use_v1: bool = False,
154 use_mla: bool = False,
155 has_sink: bool = False,
156 use_sparse: bool = False,
@@ -199,7 +193,7 @@ def _cached_get_attn_backend(
193 dtype,
194 kv_cache_dtype,
195 block_size,
202 - use_v1,
196 + True,
197 use_mla,
198 has_sink,
199 use_sparse,
vllm/distributed/kv_transfer/kv_connector/factory.py
-7
@@ -5,7 +5,6 @@ import importlib
5 from collections.abc import Callable
6 from typing import TYPE_CHECKING, Optional, cast
7
8 -import vllm.envs as envs
8 from vllm.distributed.kv_transfer.kv_connector.base import (
9 KVConnectorBase,
10 KVConnectorBaseType,
@@ -47,12 +46,6 @@ class KVConnectorFactory:
46 role: KVConnectorRole,
47 kv_cache_config: Optional["KVCacheConfig"] = None,
48 ) -> KVConnectorBase:
50 - if not envs.VLLM_USE_V1:
51 - raise ValueError(
52 - "Attempting to initialize a V1 Connector, "
53 - f"but found {envs.VLLM_USE_V1=}"
54 - )
55 -
49 kv_transfer_config = config.kv_transfer_config
50 if kv_transfer_config is None:
51 raise ValueError("kv_transfer_config must be set to create a connector")
vllm/distributed/kv_transfer/kv_transfer_state.py
+5 -9
@@ -2,7 +2,6 @@
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 from typing import TYPE_CHECKING, Optional
4
5 -from vllm import envs
5 from vllm.distributed.kv_transfer.kv_connector.base import KVConnectorBaseType
6 from vllm.distributed.kv_transfer.kv_connector.factory import KVConnectorFactory
7 from vllm.distributed.kv_transfer.kv_connector.v1 import (
@@ -65,14 +64,11 @@ def ensure_kv_transfer_initialized(
64 vllm_config.kv_transfer_config.is_kv_transfer_instance
65 and _KV_CONNECTOR_AGENT is None
66 ):
68 - if envs.VLLM_USE_V1:
69 - _KV_CONNECTOR_AGENT = KVConnectorFactory.create_connector(
70 - config=vllm_config,
71 - role=KVConnectorRole.WORKER,
72 - kv_cache_config=kv_cache_config,
73 - )
74 - else:
75 - raise ValueError("V0 is no longer supported")
67 + _KV_CONNECTOR_AGENT = KVConnectorFactory.create_connector(
68 + config=vllm_config,
69 + role=KVConnectorRole.WORKER,
70 + kv_cache_config=kv_cache_config,
71 + )
72
73
74 def ensure_kv_transfer_shutdown() -> None:
vllm/entrypoints/cli/serve.py
+4 -12
@@ -88,9 +88,6 @@ def run_headless(args: argparse.Namespace):
88 usage_context=usage_context, headless=True
89 )
90
91 - if not envs.VLLM_USE_V1:
92 - raise ValueError("Headless mode is only supported for V1")
93 -
91 if engine_args.data_parallel_hybrid_lb:
92 raise ValueError("data_parallel_hybrid_lb is not applicable in headless mode")
93
@@ -156,15 +153,10 @@ def run_multi_api_server(args: argparse.Namespace):
153 usage_context = UsageContext.OPENAI_API_SERVER
154 vllm_config = engine_args.create_engine_config(usage_context=usage_context)
155
159 - if num_api_servers > 1:
160 - if not envs.VLLM_USE_V1:
161 - raise ValueError("api_server_count > 1 is only supported for V1")
162 -
163 - if envs.VLLM_ALLOW_RUNTIME_LORA_UPDATING:
164 - raise ValueError(
165 - "VLLM_ALLOW_RUNTIME_LORA_UPDATING cannot be used "
166 - "with api_server_count > 1"
167 - )
156 + if num_api_servers > 1 and envs.VLLM_ALLOW_RUNTIME_LORA_UPDATING:
157 + raise ValueError(
158 + "VLLM_ALLOW_RUNTIME_LORA_UPDATING cannot be used with api_server_count > 1"
159 + )
160
161 executor_class = Executor.get_class(vllm_config)
162 log_stats = not engine_args.disable_log_stats
vllm/entrypoints/openai/api_server.py
+1 -7
@@ -220,14 +220,8 @@ async def build_async_engine_client_from_engine_args(
220 # Create the EngineConfig (determines if we can use V1).
221 vllm_config = engine_args.create_engine_config(usage_context=usage_context)
222
223 - # V1 AsyncLLM.
224 - assert envs.VLLM_USE_V1
225 -
223 if disable_frontend_multiprocessing:
227 - logger.warning(
228 - "V1 is enabled, but got --disable-frontend-multiprocessing. "
229 - "To disable frontend multiprocessing, set VLLM_USE_V1=0."
230 - )
224 + logger.warning("V1 is enabled, but got --disable-frontend-multiprocessing.")
225
226 from vllm.v1.engine.async_llm import AsyncLLM
227
vllm/entrypoints/openai/protocol.py
+18 -39
@@ -79,7 +79,6 @@ from pydantic import (
79 model_validator,
80 )
81
82 -from vllm import envs
82 from vllm.entrypoints.chat_utils import ChatCompletionMessageParam, make_tool_call_id
83 from vllm.entrypoints.score_utils import ScoreContentPartParam, ScoreMultiModalParam
84 from vllm.logger import init_logger
@@ -475,16 +474,12 @@ class ResponsesRequest(OpenAIBaseModel):
474
475 @model_validator(mode="before")
476 def check_cache_salt_support(cls, data):
478 - if data.get("cache_salt") is not None:
479 - if not envs.VLLM_USE_V1:
480 - raise ValueError(
481 - "Parameter 'cache_salt' is not supported with "
482 - "this instance of vLLM, which uses engine V0."
483 - )
484 - if not isinstance(data["cache_salt"], str) or not data["cache_salt"]:
485 - raise ValueError(
486 - "Parameter 'cache_salt' must be a non-empty string if provided."
487 - )
477 + if data.get("cache_salt") is not None and (
478 + not isinstance(data["cache_salt"], str) or not data["cache_salt"]
479 + ):
480 + raise ValueError(
481 + "Parameter 'cache_salt' must be a non-empty string if provided."
482 + )
483 return data
484
485 @model_validator(mode="before")
@@ -946,10 +941,6 @@ class ChatCompletionRequest(OpenAIBaseModel):
941
942 if prompt_logprobs < 0 and prompt_logprobs != -1:
943 raise ValueError("`prompt_logprobs` must be a positive value or -1.")
949 - if prompt_logprobs == -1 and not envs.VLLM_USE_V1:
950 - raise ValueError(
951 - "`prompt_logprobs=-1` is only supported with vLLM engine V1."
952 - )
944 if (top_logprobs := data.get("top_logprobs")) is not None:
945 if top_logprobs < 0 and top_logprobs != -1:
946 raise ValueError("`top_logprobs` must be a positive value or -1.")
@@ -1083,16 +1074,12 @@ class ChatCompletionRequest(OpenAIBaseModel):
1074 @model_validator(mode="before")
1075 @classmethod
1076 def check_cache_salt_support(cls, data):
1086 - if data.get("cache_salt") is not None:
1087 - if not envs.VLLM_USE_V1:
1088 - raise ValueError(
1089 - "Parameter 'cache_salt' is not supported with "
1090 - "this instance of vLLM, which uses engine V0."
1091 - )
1092 - if not isinstance(data["cache_salt"], str) or not data["cache_salt"]:
1093 - raise ValueError(
1094 - "Parameter 'cache_salt' must be a non-empty string if provided."
1095 - )
1077 + if data.get("cache_salt") is not None and (
1078 + not isinstance(data["cache_salt"], str) or not data["cache_salt"]
1079 + ):
1080 + raise ValueError(
1081 + "Parameter 'cache_salt' must be a non-empty string if provided."
1082 + )
1083 return data
1084
1085
@@ -1449,10 +1436,6 @@ class CompletionRequest(OpenAIBaseModel):
1436
1437 if prompt_logprobs < 0 and prompt_logprobs != -1:
1438 raise ValueError("`prompt_logprobs` must be a positive value or -1.")
1452 - if prompt_logprobs == -1 and not envs.VLLM_USE_V1:
1453 - raise ValueError(
1454 - "`prompt_logprobs=-1` is only supported with vLLM engine V1."
1455 - )
1439 if (logprobs := data.get("logprobs")) is not None and logprobs < 0:
1440 raise ValueError("`logprobs` must be a positive value.")
1441
@@ -1487,16 +1470,12 @@ class CompletionRequest(OpenAIBaseModel):
1470 @model_validator(mode="before")
1471 @classmethod
1472 def check_cache_salt_support(cls, data):
1490 - if data.get("cache_salt") is not None:
1491 - if not envs.VLLM_USE_V1:
1492 - raise ValueError(
1493 - "Parameter 'cache_salt' is not supported with "
1494 - "this instance of vLLM, which uses engine V0."
1495 - )
1496 - if not isinstance(data["cache_salt"], str) or not data["cache_salt"]:
1497 - raise ValueError(
1498 - "Parameter 'cache_salt' must be a non-empty string if provided."
1499 - )
1473 + if data.get("cache_salt") is not None and (
1474 + not isinstance(data["cache_salt"], str) or not data["cache_salt"]
1475 + ):
1476 + raise ValueError(
1477 + "Parameter 'cache_salt' must be a non-empty string if provided."
1478 + )
1479 return data
1480
1481
vllm/model_executor/model_loader/tensorizer.py
-2
@@ -726,8 +726,6 @@ def tensorize_vllm_model(
726 ) as stream:
727 stream.write(encryption_params.key)
728
729 - assert envs.VLLM_USE_V1
730 -
729 from vllm.v1.engine.llm_engine import LLMEngine
730
731 engine = LLMEngine.from_vllm_config(engine_config)
vllm/model_executor/models/config.py
-8
@@ -285,10 +285,6 @@ class MambaModelConfig(VerifyAndUpdateConfig):
285 Args:
286 vllm_config: vLLM Config
287 """
288 -
289 - if not envs.VLLM_USE_V1:
290 - return
291 -
288 model_config = vllm_config.model_config
289 cache_config = vllm_config.cache_config
290
@@ -329,10 +325,6 @@ class HybridAttentionMambaModelConfig(VerifyAndUpdateConfig):
325 Args:
326 vllm_config: vLLM Config
327 """
332 -
333 - if not envs.VLLM_USE_V1:
334 - return
335 -
328 # Save the user input before it gets modified by MambaModelConfig
329 mamba_block_size = vllm_config.cache_config.mamba_block_size
330 # Enable FULL_AND_PIECEWISE by default
vllm/model_executor/models/gemma3_mm.py
+4 -6
@@ -9,7 +9,6 @@ from torch import nn
9 from transformers import BatchFeature, Gemma3Config, Gemma3Processor
10 from transformers.models.gemma3.processing_gemma3 import Gemma3ProcessorKwargs
11
12 -import vllm.envs as envs
12 from vllm.config import VllmConfig
13 from vllm.config.multimodal import BaseDummyOptions
14 from vllm.logger import init_logger
@@ -137,11 +136,10 @@ class Gemma3ProcessingInfo(BaseProcessingInfo):
136 if not do_pan_and_scan:
137 return 0
138
140 - if envs.VLLM_USE_V1:
141 - logger.warning_once(
142 - "`do_pan_and_scan=True` has suboptimal results on V1 "
143 - "because of the simplified attention pattern being used."
144 - )
139 + logger.warning_once(
140 + "`do_pan_and_scan=True` has suboptimal results on V1 "
141 + "because of the simplified attention pattern being used."
142 + )
143
144 # Based on Gemma3ImageProcessor.pan_and_scan
145 if image_width >= image_height:
vllm/model_executor/models/utils.py
+2 -6
@@ -12,7 +12,6 @@ from torch.func import functional_call
12 from transformers import PretrainedConfig
13 from typing_extensions import deprecated
14
15 -import vllm.envs as envs
15 from vllm.config import VllmConfig
16 from vllm.distributed import (
17 get_tensor_model_parallel_rank,
@@ -576,11 +575,8 @@ def maybe_offload_to_cpu(module: torch.nn.Module) -> torch.nn.Module:
575 pin_memory = is_pin_memory_available()
576 uva_available = is_uva_available()
577
579 - if envs.VLLM_USE_V1:
580 - assert uva_available, "V1 CPU offloading requires uva (pin memory) support"
581 - uva_offloading = True
582 - else:
583 - uva_offloading = False
578 + assert uva_available, "V1 CPU offloading requires uva (pin memory) support"
579 + uva_offloading = True
580
581 # offload parameters to CPU
582 # use pin_memory if possible, which helps cudagraph capture speed
vllm/multimodal/profiling.py
-13
@@ -9,7 +9,6 @@ import numpy as np
9 import numpy.typing as npt
10 from PIL import Image
11
12 -import vllm.envs as envs
12 from vllm.config.multimodal import (
13 AudioDummyOptions,
14 BaseDummyOptions,
@@ -306,18 +305,6 @@ class MultiModalProfiler(Generic[_I]):
305 if processor.pad_dummy_encoder_prompt:
306 num_tokens_to_pad = max(total_len, seq_len) - total_len
307 encoder_prompt_token_ids.extend([0] * num_tokens_to_pad)
309 - # NOTE: Whisper allows total_len > seq_len.
310 - elif total_len > seq_len and not envs.VLLM_USE_V1:
311 - # `max_num_batched_tokens` is defined by `SchedulerConfig`
312 - logger.warning_once(
313 - "The encoder sequence length used for profiling (max_num_batched_tokens / max_num_seqs = %d) " # noqa: E501
314 - "is too short to hold the multi-modal embeddings in the worst case (%d tokens in total, out of which %s are reserved for multi-modal embeddings). " # noqa: E501
315 - "This may cause certain multi-modal inputs to fail during inference, even when the input text is short. " # noqa: E501
316 - "To avoid this, you should increase `max_model_len`, reduce `max_num_seqs`, and/or reduce `mm_counts`.", # noqa: E501
317 - seq_len,
318 - total_len,
319 - str(self._get_mm_num_tokens(mm_inputs)),
320 - )
308
309 return DummyEncoderData(encoder_prompt_token_ids)
310