_helion.py 364 B

1234567891011121314151617
  1. import functools
  2. from torch.utils._triton import has_triton
  3. @functools.cache
  4. def has_helion_package() -> bool:
  5. try:
  6. import helion # type: ignore[import-untyped, import-not-found] # noqa: F401
  7. except ImportError:
  8. return False
  9. return True
  10. @functools.cache
  11. def has_helion() -> bool:
  12. return has_helion_package() and has_triton()