We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6de46d9 commit 507a4afCopy full SHA for 507a4af
bitsandbytes/triton/triton_utils.py
@@ -1,5 +1,14 @@
1
-import importlib
+import functools
2
3
4
+@functools.lru_cache(None)
5
def is_triton_available():
- return importlib.util.find_spec("triton") is not None
6
+ try:
7
+ # torch>=2.2.0
8
+ from torch.utils._triton import has_triton, has_triton_package
9
+
10
+ return has_triton_package() and has_triton()
11
+ except ImportError:
12
+ from torch._inductor.utils import has_triton
13
14
+ return has_triton()
0 commit comments