From da16825c20de6a00e2138cd5cebbcb32ee561a04 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Fri, 12 Jul 2024 18:52:14 -0700 Subject: [PATCH 1/4] [Misc] Add deprecation warning for beam search --- vllm/sampling_params.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vllm/sampling_params.py b/vllm/sampling_params.py index a2caae21a86e..99c33966e932 100644 --- a/vllm/sampling_params.py +++ b/vllm/sampling_params.py @@ -8,6 +8,8 @@ from pydantic import Field from typing_extensions import Annotated +from vllm.utils import print_warning_once + _SAMPLING_EPS = 1e-5 @@ -184,6 +186,11 @@ def __init__( self._verify_args() if self.use_beam_search: + print_warning_once( + "[IMPORTANT] We plan to discontinue support for beam search " + "in the next major release. Please refer to " + "https://github.com/vllm-project/vllm/issues/6226 for more " + "information.") self._verify_beam_search() else: self._verify_non_beam_search() From b1b8eaa9ff6b7103eb3a0429bb3dc18f80849e7e Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Fri, 12 Jul 2024 20:46:04 -0700 Subject: [PATCH 2/4] Print warning every time --- vllm/sampling_params.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vllm/sampling_params.py b/vllm/sampling_params.py index 99c33966e932..4d6635aa2866 100644 --- a/vllm/sampling_params.py +++ b/vllm/sampling_params.py @@ -8,7 +8,9 @@ from pydantic import Field from typing_extensions import Annotated -from vllm.utils import print_warning_once +from vllm.logger import init_logger + +logger = init_logger(__name__) _SAMPLING_EPS = 1e-5 @@ -186,7 +188,7 @@ def __init__( self._verify_args() if self.use_beam_search: - print_warning_once( + logger.warning( "[IMPORTANT] We plan to discontinue support for beam search " "in the next major release. Please refer to " "https://github.com/vllm-project/vllm/issues/6226 for more " From a863fc3009cd076a33817e791e537a7ac412fbd7 Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Fri, 12 Jul 2024 20:54:05 -0700 Subject: [PATCH 3/4] Add env variable --- vllm/envs.py | 5 +++++ vllm/sampling_params.py | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/vllm/envs.py b/vllm/envs.py index c624510c7ea1..5b4a2010d12e 100644 --- a/vllm/envs.py +++ b/vllm/envs.py @@ -41,6 +41,7 @@ NVCC_THREADS: Optional[str] = None VLLM_USE_PRECOMPILED: bool = False VLLM_INSTALL_PUNICA_KERNELS: bool = False + VLLM_NO_DEPRECATION_WARNING: bool = False CMAKE_BUILD_TYPE: Optional[str] = None VERBOSE: bool = False @@ -251,6 +252,10 @@ lambda: os.getenv("VLLM_XLA_CACHE_PATH", "~/.vllm/xla_cache/"), "VLLM_FUSED_MOE_CHUNK_SIZE": lambda: int(os.getenv("VLLM_FUSED_MOE_CHUNK_SIZE", "65536")), + + # If set, vllm will skip the deprecation warnings. + "VLLM_NO_DEPRECATION_WARNING": + lambda: bool(int(os.getenv("VLLM_NO_DEPRECATION_WARNING", "0"))), } # end-env-vars-definition diff --git a/vllm/sampling_params.py b/vllm/sampling_params.py index 4d6635aa2866..d155c30ad663 100644 --- a/vllm/sampling_params.py +++ b/vllm/sampling_params.py @@ -8,6 +8,7 @@ from pydantic import Field from typing_extensions import Annotated +import vllm.envs as envs from vllm.logger import init_logger logger = init_logger(__name__) @@ -188,11 +189,12 @@ def __init__( self._verify_args() if self.use_beam_search: - logger.warning( - "[IMPORTANT] We plan to discontinue support for beam search " - "in the next major release. Please refer to " - "https://github.com/vllm-project/vllm/issues/6226 for more " - "information.") + if not envs.VLLM_NO_DEPRECATION_WARNING: + logger.warning( + "[IMPORTANT] We plan to discontinue the support for beam " + "search in the next major release. Please refer to " + "https://github.com/vllm-project/vllm/issues/6226 for " + "more information.") self._verify_beam_search() else: self._verify_non_beam_search() From a22261d79adaff1edf6256a71804bc8686f8fd6b Mon Sep 17 00:00:00 2001 From: Woosuk Kwon Date: Fri, 12 Jul 2024 20:55:35 -0700 Subject: [PATCH 4/4] Add --- vllm/sampling_params.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/sampling_params.py b/vllm/sampling_params.py index d155c30ad663..90f0944a7f3d 100644 --- a/vllm/sampling_params.py +++ b/vllm/sampling_params.py @@ -194,7 +194,8 @@ def __init__( "[IMPORTANT] We plan to discontinue the support for beam " "search in the next major release. Please refer to " "https://github.com/vllm-project/vllm/issues/6226 for " - "more information.") + "more information. Set VLLM_NO_DEPRECATION_WARNING=1 to " + "suppress this warning.") self._verify_beam_search() else: self._verify_non_beam_search()