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 c9bce2b commit 45e0b25Copy full SHA for 45e0b25
bitsandbytes/backends/hpu/ops.py
@@ -3,11 +3,16 @@
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
+# convert btw standard 4-bit compression format and ipex compression format
+# needed for backward compatibility with older versions of gaudi sw
11
+def _reverse_4bit_compress_format(weight: torch.Tensor):
12
+ out_1 = (weight & 0xF0) >> 4
13
+ out_2 = (weight & 0xF) << 4
14
+ out = out_1 | out_2
15
+ return out
16
17
@register_kernel("bitsandbytes::dequantize_4bit", "hpu")
18
def _(
0 commit comments