Skip to content

Commit ee71ef6

Browse files
DarkLight1337jimpang
authored and
jimpang
committed
[ROCm] Make amdsmi import optional for other platforms (vllm-project#13460)
1 parent 08f7b2f commit ee71ef6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

vllm/platforms/rocm.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from typing import TYPE_CHECKING, Dict, List, Optional
66

77
import torch
8-
from amdsmi import (amdsmi_get_gpu_asic_info, amdsmi_get_processor_handles,
9-
amdsmi_init, amdsmi_shut_down)
108

119
import vllm.envs as envs
1210
from vllm.logger import init_logger
@@ -20,6 +18,12 @@
2018

2119
logger = init_logger(__name__)
2220

21+
try:
22+
from amdsmi import (amdsmi_get_gpu_asic_info, amdsmi_get_processor_handles,
23+
amdsmi_init, amdsmi_shut_down)
24+
except ImportError as e:
25+
logger.warning("Failed to import from amdsmi with %r", e)
26+
2327
try:
2428
import vllm._C # noqa: F401
2529
except ImportError as e:

0 commit comments

Comments
 (0)