Skip to content

Commit

Permalink
[XPU] avoid triton import for xpu (vllm-project#9440)
Browse files Browse the repository at this point in the history
Co-authored-by: Cyrus Leung <[email protected]>
Co-authored-by: Cyrus Leung <[email protected]>
Signed-off-by: qishuai <[email protected]>
  • Loading branch information
3 people authored and FerdinandZhong committed Oct 29, 2024
1 parent 9f4429c commit 0b9bac0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions vllm/triton_utils/importing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

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.")

0 comments on commit 0b9bac0

Please sign in to comment.