Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def load_module_from_path(module_name, path):
"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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, Sorry that I missed ROCm before. I belive add the condition here torch.version.hip is None will fix the issue.

elif (sys.platform.startswith("linux") and torch.version.cuda is None
and torch.version.hip is None
and os.getenv("VLLM_TARGET_DEVICE") is None):
    # if cuda or hip is not available and VLLM_TARGET_DEVICE is not set,
    # fallback to cpu
    VLLM_TARGET_DEVICE = "cpu"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @wangxiyuan ! I've updated the PR with your fix

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"

Expand Down