We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e82c4da commit be47d49Copy full SHA for be47d49
bitsandbytes/__init__.py
@@ -4,6 +4,7 @@
4
# LICENSE file in the root directory of this source tree.
5
6
7
+import importlib
8
import sys
9
10
import torch
@@ -37,8 +38,13 @@
37
38
if hasattr(torch, "xpu") and torch.xpu.is_available():
39
from .backends.xpu import ops as xpu_ops
40
-if hasattr(torch, "hpu") and torch.hpu.is_available():
41
- from .backends.hpu import ops as hpu_ops
+
42
+if importlib.util.find_spec("habana_frameworks.torch"):
43
+ # In case not automatically imported
44
+ import habana_frameworks.torch # type: ignore # noqa: I001
45
46
+ if hasattr(torch, "hpu") and torch.hpu.is_available():
47
+ from .backends.hpu import ops as hpu_ops
48
49
50
def _import_backends():
0 commit comments