From 056a68c7dbaff03252d2f8c058d3fb700565ad1f Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Thu, 24 Oct 2024 13:14:00 +0800 Subject: [PATCH] [XPU] avoid triton import for xpu (#9440) Co-authored-by: Cyrus Leung Co-authored-by: Cyrus Leung --- vllm/triton_utils/importing.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vllm/triton_utils/importing.py b/vllm/triton_utils/importing.py index ef7ca149..36315abc 100644 --- a/vllm/triton_utils/importing.py +++ b/vllm/triton_utils/importing.py @@ -5,10 +5,12 @@ from vllm.platforms import current_platform logger = init_logger(__name__) -# neuron has too old torch -HAS_TRITON = find_spec( - "triton") is not None and not current_platform.is_neuron() +HAS_TRITON = ( + find_spec("triton") is not None + and not current_platform.is_xpu() # Not compatible + and not current_platform.is_neuron() # neuron has too old torch +) if not HAS_TRITON: - logger.info("Triton not installed; certain GPU-related functions" - " will not be available.") + logger.info("Triton not installed or not compatible; certain GPU-related" + " functions will not be available.")