Skip to content

Commit

Permalink
check grad before using ipex (#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiqing-feng authored Sep 19, 2024
1 parent 45b7d14 commit a23984f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bitsandbytes/nn/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit a23984f

Please sign in to comment.