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
66da99aa
Unverified
Commit
66da99aa
authored
Feb 06, 2025
by
Matthew Douglas
Committed by
GitHub
Feb 06, 2025
Browse files
Improve guard for triton compatibility (#1497)
parent
f3e8cbb2
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 @
66da99aa
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