mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
This kinda just worked out of the box, shocking. PT2 traced into helion and emitted it as a user defined triton kernel: P1836496774 In the long run, we do not actually want this, but rather to create a helion HOP so we can do fusions etc. Pull Request resolved: https://github.com/pytorch/pytorch/pull/155513 Approved by: https://github.com/zou3519, https://github.com/jansel
18 lines
384 B
Python
18 lines
384 B
Python
import functools
|
|
|
|
from torch.utils._triton import has_triton
|
|
|
|
|
|
@functools.lru_cache(None)
|
|
def has_helion_package() -> bool:
|
|
try:
|
|
import helion # type: ignore[import-untyped, import-not-found] # noqa: F401
|
|
except ImportError:
|
|
return False
|
|
return True
|
|
|
|
|
|
@functools.lru_cache(None)
|
|
def has_helion() -> bool:
|
|
return has_helion_package() and has_triton()
|