Skip to content

Commit feb8ad2

Browse files
committed
fix compile
Signed-off-by: jiqing-feng <[email protected]>
1 parent 0c88d43 commit feb8ad2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bitsandbytes/nn/modules.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ def __init__(
488488
self.compute_type_is_set = compute_dtype is not None
489489
self.quant_state = None
490490
self.quant_storage = quant_storage
491+
self.support_avx512bf16_for_cpu = has_avx512bf16()
491492

492493
def set_compute_type(self, x):
493494
if x.dtype in [torch.float32, torch.bfloat16]:
@@ -530,7 +531,7 @@ def forward(self, x: torch.Tensor):
530531
if (
531532
not getattr(quant_state, "packing_format_for_cpu", False)
532533
and x.device.type == "cpu"
533-
and has_avx512bf16()
534+
and self.support_avx512bf16_for_cpu
534535
and not self.training
535536
and x.requires_grad == False
536537
):

0 commit comments

Comments
 (0)