Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 36344b0

Browse files
Small update
1 parent ddf750f commit 36344b0

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
package_dir={"": "src"},
77
packages=find_packages(where="src"),
88
install_requires=["bitsandbytes"],
9-
entry_points={"bitsandbytes.backends": ["bitsandbytes_intel = bitsandbytes_intel:_autoload"]},
9+
entry_points={"torch.backends": ["bitsandbytes_intel = bitsandbytes_intel:_autoload"]},
1010
)

src/bitsandbytes_intel/cpu_xpu_common.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
create_dynamic_map,
1111
get_4bit_type,
1212
)
13-
from bitsandbytes.utils import reverse_4bit_compress_format
1413

1514
try:
1615
# to support Intel CPU/GPU (XPU) backend
@@ -69,6 +68,15 @@ def _maybe_torch_compile(func):
6968
return func
7069

7170

71+
def reverse_4bit_compress_format(weight):
72+
out_1 = torch.empty(weight.size(0), dtype=torch.int32, device=weight.device)
73+
out_2 = torch.empty(weight.size(0), dtype=torch.int32, device=weight.device)
74+
out_1 = (weight & 0xF0) >> 4
75+
out_2 = (weight & 0xF) << 4
76+
out = out_1 | out_2
77+
return out
78+
79+
7280
@_maybe_torch_compile
7381
def double_quant_impl(A, col_stats=None, row_stats=None, out_col=None, out_row=None, threshold=0.0):
7482
"""

0 commit comments

Comments
 (0)