File size: 350 Bytes
037353a
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import functools


@functools.lru_cache(None)
def is_triton_available():
    try:
        # torch>=2.2.0
        from torch.utils._triton import has_triton, has_triton_package

        return has_triton_package() and has_triton()
    except ImportError:
        from torch._inductor.utils import has_triton

        return has_triton()