Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
507a4afc
Commit
507a4afc
authored
Feb 06, 2025
by
Matthew Douglas
Browse files
Improve guard for triton compatibility (#1497)
parent
6de46d99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
bitsandbytes/triton/triton_utils.py
bitsandbytes/triton/triton_utils.py
+11
-2
No files found.
bitsandbytes/triton/triton_utils.py
View file @
507a4afc
import
importlib
import
functools
@
functools
.
lru_cache
(
None
)
def
is_triton_available
():
def
is_triton_available
():
return
importlib
.
util
.
find_spec
(
"triton"
)
is
not
None
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment