From 91e876750eace8e899ab25cd5d93fc365906c07b Mon Sep 17 00:00:00 2001 From: "Kevin H. Luu" Date: Mon, 10 Feb 2025 18:06:16 -0800 Subject: [PATCH] [misc] Fix setup.py condition to avoid AMD from being mistaken with CPU (#13022) Signed-off-by: kevin --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3e2adadf6704f..27e5aab760f9a 100755 --- a/setup.py +++ b/setup.py @@ -48,8 +48,9 @@ elif not (sys.platform.startswith("linux") "so vLLM may not be able to run correctly", sys.platform) VLLM_TARGET_DEVICE = "empty" elif (sys.platform.startswith("linux") and torch.version.cuda is None - and os.getenv("VLLM_TARGET_DEVICE") is None): - # if cuda is not available and VLLM_TARGET_DEVICE is not set, + and os.getenv("VLLM_TARGET_DEVICE") is None + and torch.version.hip is None): + # if cuda or hip is not available and VLLM_TARGET_DEVICE is not set, # fallback to cpu VLLM_TARGET_DEVICE = "cpu"