@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 10138c92a5
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, 09:30 UTC

[V0 deprecation] Deprecate use_v1 parameter (#28112)

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

wangxiyuan committed Nov 12, 2025 at 22:03 UTC 10138c92a5c78678dd7e47cfb9df638d5a6b5719
8 files changed +31 -35
tests/plugins/vllm_add_dummy_platform/vllm_add_dummy_platform/dummy_platform.py
-1
@@ -27,7 +27,6 @@ class DummyPlatform(Platform):
27 dtype,
28 kv_cache_dtype,
29 block_size,
30 - use_v1,
30 use_mla,
31 has_sink,
32 use_sparse,
vllm/attention/selector.py
+30 -11
@@ -1,6 +1,7 @@
1 # SPDX-License-Identifier: Apache-2.0
2 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4 +import inspect
5 import os
6 from collections.abc import Generator
7 from contextlib import contextmanager
@@ -141,17 +142,35 @@ def _cached_get_attn_backend(
142 # get device-specific attn_backend
143 from vllm.platforms import current_platform
144
144 - attention_cls = current_platform.get_attn_backend_cls(
145 - selected_backend,
146 - head_size,
147 - dtype,
148 - kv_cache_dtype,
149 - block_size,
150 - True,
151 - use_mla,
152 - has_sink,
153 - use_sparse,
154 - )
145 + sig = inspect.signature(current_platform.get_attn_backend_cls)
146 + if "use_v1" in sig.parameters:
147 + logger.warning_once(
148 + "use_v1 parameter for get_attn_backend_cls is deprecated and will "
149 + "be removed in v0.13.0 or v1.0.0, whichever is soonest. Please "
150 + "remove it from your plugin code."
151 + )
152 + attention_cls = current_platform.get_attn_backend_cls(
153 + selected_backend,
154 + head_size,
155 + dtype,
156 + kv_cache_dtype,
157 + block_size,
158 + True, # use_v1
159 + use_mla,
160 + has_sink,
161 + use_sparse,
162 + )
163 + else:
164 + attention_cls = current_platform.get_attn_backend_cls(
165 + selected_backend,
166 + head_size,
167 + dtype,
168 + kv_cache_dtype,
169 + block_size,
170 + use_mla,
171 + has_sink,
172 + use_sparse,
173 + )
174 if not attention_cls:
175 raise ValueError(
176 f"Invalid attention backend for {current_platform.device_name}"
vllm/platforms/cpu.py
-3
@@ -131,7 +131,6 @@ class CpuPlatform(Platform):
131 dtype: torch.dtype,
132 kv_cache_dtype: str | None,
133 block_size: int,
134 - use_v1: bool,
134 use_mla: bool,
135 has_sink: bool,
136 use_sparse: bool,
@@ -144,8 +143,6 @@ class CpuPlatform(Platform):
143 raise NotImplementedError("MLA is not supported on CPU.")
144 if use_sparse:
145 raise NotImplementedError("Sparse Attention is not supported on CPU.")
147 - if not use_v1:
148 - raise ValueError("CPU backend only supports V1.")
146 return AttentionBackendEnum.CPU_ATTN.get_path()
147
148 @classmethod
vllm/platforms/cuda.py
-7
@@ -336,17 +336,10 @@ class CudaPlatformBase(Platform):
336 dtype: torch.dtype,
337 kv_cache_dtype: "CacheDType | None",
338 block_size: int | None,
339 - use_v1: bool,
339 use_mla: bool,
340 has_sink: bool,
341 use_sparse: bool,
342 ) -> str:
344 - if not use_v1:
345 - raise RuntimeError(
346 - "V0 attention backends have been removed. Set VLLM_USE_V1=1 "
347 - "to select a supported backend."
348 - )
349 -
343 device_capability = cls.get_device_capability()
344 assert device_capability is not None
345
vllm/platforms/interface.py
-1
@@ -215,7 +215,6 @@ class Platform:
215 dtype: torch.dtype,
216 kv_cache_dtype: "CacheDType | None",
217 block_size: int,
218 - use_v1: bool,
218 use_mla: bool,
219 has_sink: bool,
220 use_sparse: bool,
vllm/platforms/rocm.py
-7
@@ -213,7 +213,6 @@ class RocmPlatform(Platform):
213 dtype,
214 kv_cache_dtype,
215 block_size,
216 - use_v1,
216 use_mla,
217 has_sink,
218 use_sparse,
@@ -224,12 +223,6 @@ class RocmPlatform(Platform):
223 if use_sparse:
224 raise NotImplementedError("Sparse Attention is not supported on ROCm.")
225
227 - if not use_v1:
228 - raise RuntimeError(
229 - "V0 attention backends have been removed. Set VLLM_USE_V1=1 "
230 - "to select a supported backend."
231 - )
232 -
226 if use_mla:
227 if selected_backend is None:
228 selected_backend = (
vllm/platforms/tpu.py
-3
@@ -58,7 +58,6 @@ class TpuPlatform(Platform):
58 dtype: torch.dtype,
59 kv_cache_dtype: str | None,
60 block_size: int,
61 - use_v1: bool,
61 use_mla: bool,
62 has_sink,
63 use_sparse,
@@ -70,8 +69,6 @@ class TpuPlatform(Platform):
69 if selected_backend != AttentionBackendEnum.PALLAS:
70 logger.info("Cannot use %s backend on TPU.", selected_backend)
71
73 - if not use_v1:
74 - raise ValueError("TPU backend only supports V1.")
72 logger.info("Using Pallas V1 backend.")
73 return AttentionBackendEnum.PALLAS.get_path()
74
vllm/platforms/xpu.py
+1 -2
@@ -48,7 +48,6 @@ class XPUPlatform(Platform):
48 dtype: torch.dtype,
49 kv_cache_dtype: str | None,
50 block_size: int,
51 - use_v1: bool,
51 use_mla: bool,
52 has_sink: bool,
53 use_sparse,
@@ -76,7 +75,7 @@ class XPUPlatform(Platform):
75 elif selected_backend:
76 raise ValueError(
77 f"Invalid attention backend for {cls.device_name}, "
79 - f"with use_v1: {use_v1} use_mla: {use_mla}"
78 + f"with use_mla: {use_mla}"
79 )
80
81 logger.info("Using Flash Attention backend.")