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: NickLucche <[email protected]>
  • Loading branch information
3 people authored and NickLucche committed Oct 31, 2024
1 parent bb3fc89 commit a58086f
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 a58086f

Please sign in to comment.