Skip to content

Commit eada037

Browse files
authored
[vllm] fix: use VLLM_SLEEP_LEVEL=1 on ASCEND NPU (#3355)
1 parent 7430285 commit eada037

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

verl/third_party/vllm/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from packaging import version as vs
1818

19+
from verl.utils.device import is_npu_available
1920
from verl.utils.import_utils import is_sglang_available
2021

2122

@@ -37,6 +38,11 @@ def get_version(pkg):
3738
f"vllm version {package_version} not supported and SGLang also not Found. Currently supported "
3839
f"vllm versions are 0.7.0+"
3940
)
41+
elif is_npu_available:
42+
# sleep_mode=2 is not supported on vllm-ascend for now, will remove this restriction when this ability is ready.
43+
VLLM_SLEEP_LEVEL = 1
44+
from vllm import LLM
45+
from vllm.distributed import parallel_state
4046
elif vs.parse(package_version) >= vs.parse("0.7.0"):
4147
vllm_version = package_version
4248
if vs.parse(package_version) >= vs.parse("0.8.5"):

0 commit comments

Comments
 (0)