@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / eeceadaecc
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 16, 22:00 UTC

[Misc] Add deprecation warning for beam search (#6402)

Woosuk Kwon committed Jul 13, 2024 at 11:52 UTC eeceadaecc80cc51c4e9ddae0cb99a33d379452d
2 files changed +17
vllm/envs.py
+5
@@ -41,6 +41,7 @@ if TYPE_CHECKING:
41 NVCC_THREADS: Optional[str] = None
42 VLLM_USE_PRECOMPILED: bool = False
43 VLLM_INSTALL_PUNICA_KERNELS: bool = False
44 + VLLM_NO_DEPRECATION_WARNING: bool = False
45 CMAKE_BUILD_TYPE: Optional[str] = None
46 VERBOSE: bool = False
47
@@ -251,6 +252,10 @@ environment_variables: Dict[str, Callable[[], Any]] = {
252 lambda: os.getenv("VLLM_XLA_CACHE_PATH", "~/.vllm/xla_cache/"),
253 "VLLM_FUSED_MOE_CHUNK_SIZE":
254 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"))),
259 }
260
261 # end-env-vars-definition
vllm/sampling_params.py
+12
@@ -8,6 +8,11 @@ import torch
8 from pydantic import Field
9 from typing_extensions import Annotated
10
11 +import vllm.envs as envs
12 +from vllm.logger import init_logger
13 +
14 +logger = init_logger(__name__)
15 +
16 _SAMPLING_EPS = 1e-5
17
18
@@ -184,6 +189,13 @@ class SamplingParams:
189
190 self._verify_args()
191 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.")
199 self._verify_beam_search()
200 else:
201 self._verify_non_beam_search()