mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/155613 Approved by: https://github.com/ezyang ghstack dependencies: #155612
18 lines
364 B
Python
18 lines
364 B
Python
import functools
|
|
|
|
from torch.utils._triton import has_triton
|
|
|
|
|
|
@functools.cache
|
|
def has_helion_package() -> bool:
|
|
try:
|
|
import helion # type: ignore[import-untyped, import-not-found] # noqa: F401
|
|
except ImportError:
|
|
return False
|
|
return True
|
|
|
|
|
|
@functools.cache
|
|
def has_helion() -> bool:
|
|
return has_helion_package() and has_triton()
|