Skip to content

Commit 38054f6

Browse files
authored
register triton kernel for quantization (#15)
Signed-off-by: jiqing-feng <[email protected]>
1 parent c42a38f commit 38054f6

File tree

1 file changed

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

1 file changed

+7
-0
lines changed

bitsandbytes/backends/xpu/ops.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ def _gemv_4bit_impl(
139139
if not isinstance(lib, ErrorHandlerMockBNBNativeLibrary):
140140
logger.info("Register sycl bitsandbytes kernels for XPU")
141141

142+
# TODO: Remove the triton register when quantization sycl kernel is ready.
143+
if triton_available:
144+
from ..triton import ops as triton_ops
145+
146+
register_kernel("bitsandbytes::quantize_blockwise", "xpu")(triton_ops.quantize_blockwise)
147+
register_kernel("bitsandbytes::quantize_4bit", "xpu")(triton_ops.quantize_4bit)
148+
142149
@register_kernel("bitsandbytes::dequantize_4bit", "xpu")
143150
def _(
144151
A: torch.Tensor,

0 commit comments

Comments
 (0)