Skip to content

Commit a09d05a

Browse files
authored
add int mm for xpu after torch 2.9 (#1736)
* add int mm for xpu after torch 2.9 Signed-off-by: jiqing-feng <[email protected]> * add packaging on pyproject Signed-off-by: jiqing-feng <[email protected]> --------- Signed-off-by: jiqing-feng <[email protected]>
1 parent c76e208 commit a09d05a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bitsandbytes/backends/xpu/ops.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
from collections.abc import Sequence
22
import warnings
33

4+
from packaging import version
45
import torch
56

67
from ..._ops import register_kernel
78
from ..utils import ipex_xpu, triton_available
89

9-
# _int_mm is available in torch starting from 2.7 version,
10-
# but currently it's don't have xpu implementation.
11-
if ipex_xpu and torch.__version__ >= (2, 7):
10+
# _int_mm is available in torch starting from 2.9 version, or ipex 2.7
11+
if version.parse(torch.__version__).release >= version.parse("2.9").release or (
12+
ipex_xpu and torch.__version__ >= (2, 7)
13+
):
1214

1315
@register_kernel("bitsandbytes::int8_linear_matmul", "xpu")
1416
def _(A: torch.Tensor, B: torch.Tensor):

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ classifiers = [
4343
]
4444
dependencies = [
4545
"torch>=2.2,<3",
46-
"numpy>=1.17"
46+
"numpy>=1.17",
47+
"packaging>=20.9"
4748
]
4849

4950
[project.urls]

0 commit comments

Comments
 (0)