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 b2a8a15 commit 2adcb7aCopy full SHA for 2adcb7a
bitsandbytes/backends/hpu/ops.py
@@ -3,12 +3,19 @@
3
4
import torch
5
6
-from bitsandbytes.utils import _reverse_4bit_compress_format
7
-
8
from ..._ops import register_kernel
9
from ..utils import GAUDI_SW_VER
10
11
+# convert btw standard 4-bit compression format and ipex compression format
+# needed for backward compatibility with older versions of gaudi sw
12
+def _reverse_4bit_compress_format(weight: torch.Tensor):
13
+ out_1 = (weight & 0xF0) >> 4
14
+ out_2 = (weight & 0xF) << 4
15
+ out = out_1 | out_2
16
+ return out
17
+
18
19
@register_kernel("bitsandbytes::dequantize_4bit", "hpu")
20
def _(
21
A: torch.Tensor,
0 commit comments