Skip to content

Commit eeceada

Browse files
authored
[Misc] Add deprecation warning for beam search (#6402)
1 parent babf52d commit eeceada

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

vllm/envs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
NVCC_THREADS: Optional[str] = None
4242
VLLM_USE_PRECOMPILED: bool = False
4343
VLLM_INSTALL_PUNICA_KERNELS: bool = False
44+
VLLM_NO_DEPRECATION_WARNING: bool = False
4445
CMAKE_BUILD_TYPE: Optional[str] = None
4546
VERBOSE: bool = False
4647

@@ -251,6 +252,10 @@
251252
lambda: os.getenv("VLLM_XLA_CACHE_PATH", "~/.vllm/xla_cache/"),
252253
"VLLM_FUSED_MOE_CHUNK_SIZE":
253254
lambda: int(os.getenv("VLLM_FUSED_MOE_CHUNK_SIZE", "65536")),
255+
256+
# If set, vllm will skip the deprecation warnings.
257+
"VLLM_NO_DEPRECATION_WARNING":
258+
lambda: bool(int(os.getenv("VLLM_NO_DEPRECATION_WARNING", "0"))),
254259
}
255260

256261
# end-env-vars-definition

vllm/sampling_params.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
from pydantic import Field
99
from typing_extensions import Annotated
1010

11+
import vllm.envs as envs
12+
from vllm.logger import init_logger
13+
14+
logger = init_logger(__name__)
15+
1116
_SAMPLING_EPS = 1e-5
1217

1318

@@ -184,6 +189,13 @@ def __init__(
184189

185190
self._verify_args()
186191
if self.use_beam_search:
192+
if not envs.VLLM_NO_DEPRECATION_WARNING:
193+
logger.warning(
194+
"[IMPORTANT] We plan to discontinue the support for beam "
195+
"search in the next major release. Please refer to "
196+
"https://github.com/vllm-project/vllm/issues/6226 for "
197+
"more information. Set VLLM_NO_DEPRECATION_WARNING=1 to "
198+
"suppress this warning.")
187199
self._verify_beam_search()
188200
else:
189201
self._verify_non_beam_search()

0 commit comments

Comments
 (0)