Skip to content

Commit 61c0375

Browse files
authored
fix contiguous (#1911)
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
1 parent 5b36a76 commit 61c0375

File tree

1 file changed

+4
-0
lines changed
  • bitsandbytes/backends/xpu

1 file changed

+4
-0
lines changed

bitsandbytes/backends/xpu/ops.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ def _dequantize_4bit_impl(
3232
dtype: torch.dtype,
3333
out: torch.Tensor,
3434
) -> None:
35+
# XPU SYCL kernels only support contiguous tensors.
36+
A = A.contiguous()
3537
args = (
3638
None,
3739
get_ptr(A),
@@ -61,6 +63,8 @@ def _dequantize_4bit_impl(
6163
def _dequantize_blockwise_impl(
6264
A: torch.Tensor, absmax: torch.Tensor, code: torch.Tensor, blocksize: int, dtype: torch.dtype, out: torch.Tensor
6365
) -> None:
66+
# XPU SYCL kernels only support contiguous tensors.
67+
A = A.contiguous()
6468
args = (
6569
get_ptr(code),
6670
get_ptr(A),

0 commit comments

Comments
 (0)