diff --git a/bitsandbytes/nn/modules.py b/bitsandbytes/nn/modules.py index ad424a6f4..32854413f 100644 --- a/bitsandbytes/nn/modules.py +++ b/bitsandbytes/nn/modules.py @@ -471,6 +471,7 @@ def forward(self, x: torch.Tensor): and not hasattr(self.weight.quant_state, "op_context") and self.weight.quant_state.shape[1] % self.weight.quant_state.blocksize == 0 and self.weight.quant_state.quant_type == "nf4" + and x.requires_grad == False ): enable_ipex_fusion(self.weight, self.weight.quant_state)