[XPU] avoid triton import for xpu (#9440)

Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
This commit is contained in:
Yan Ma 2024-10-24 13:14:00 +08:00 committed by GitHub
parent 33bab41060
commit 056a68c7db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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