From 5df056dd17fe106f7002e0d030133383c5afb21f Mon Sep 17 00:00:00 2001 From: handsomezhuzhu <2658601135@qq.com> Date: Tue, 10 Feb 2026 23:14:54 +0800 Subject: [PATCH] fix: Improve vllm version parsing and assume compatibility for dev versions --- vllm_npu/utils.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/vllm_npu/utils.py b/vllm_npu/utils.py index 8ffc139..37b8e4a 100644 --- a/vllm_npu/utils.py +++ b/vllm_npu/utils.py @@ -313,11 +313,15 @@ def vllm_version_is(target_vllm_version: str): try: return Version(vllm_version) == Version(target_vllm_version) except InvalidVersion: - raise ValueError( - f"Invalid vllm version {vllm_version} found. A dev version of vllm " - "is installed probably. Set the environment variable VLLM_VERSION " - "to control it by hand. And please make sure the value follows the " - "format of x.y.z.") + # Dev versions like "0.1.dev9973+g..." are not PEP 440 compliant. + # For the plugin, default to True for "0.11.0" since the user's + # branch is based on vllm 0.11.0. + import logging + logging.getLogger(__name__).warning( + f"Cannot parse vllm version '{vllm_version}'. " + f"Assuming compatibility with {target_vllm_version}. " + "Set VLLM_VERSION env var to override (format: x.y.z).") + return True def get_max_hidden_layers(hf_config) -> int: