Skip to content

Commit 7f1a962

Browse files
yma11DarkLight1337
authored andcommitted
[XPU] avoid triton import for xpu (vllm-project#9440)
Co-authored-by: Cyrus Leung <[email protected]> Co-authored-by: Cyrus Leung <[email protected]> Signed-off-by: Alvant <[email protected]>
1 parent 1b6de73 commit 7f1a962

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vllm/triton_utils/importing.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
logger = init_logger(__name__)
77

8-
# neuron has too old torch
9-
HAS_TRITON = find_spec(
10-
"triton") is not None and not current_platform.is_neuron()
8+
HAS_TRITON = (
9+
find_spec("triton") is not None
10+
and not current_platform.is_xpu() # Not compatible
11+
and not current_platform.is_neuron() # neuron has too old torch
12+
)
1113

1214
if not HAS_TRITON:
13-
logger.info("Triton not installed; certain GPU-related functions"
14-
" will not be available.")
15+
logger.info("Triton not installed or not compatible; certain GPU-related"
16+
" functions will not be available.")

0 commit comments

Comments
 (0)