@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 91294d56e1
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, 19:30 UTC

[Bugfix] Handle PackageNotFoundError when checking for xpu version (#7398)

sasha0552 committed Aug 12, 2024 at 23:07 UTC 91294d56e1b9e3e7e5cd8fa2ec4d45b126941598
1 file changed +5 -2
vllm/utils.py
+5 -2
@@ -344,8 +344,11 @@ def is_tpu() -> bool:
344
345 @lru_cache(maxsize=None)
346 def is_xpu() -> bool:
347 - from importlib.metadata import version
348 - is_xpu_flag = "xpu" in version("vllm")
347 + from importlib.metadata import PackageNotFoundError, version
348 + try:
349 + is_xpu_flag = "xpu" in version("vllm")
350 + except PackageNotFoundError:
351 + return False
352 # vllm is not build with xpu
353 if not is_xpu_flag:
354 return False