Skip to content

Commit

Permalink
Int8 fix for PEFT OLoRA init
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdouglas committed Dec 3, 2024
1 parent 5b2348b commit bbb7063
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ def forward(

has_grad = False

if state.has_fp16_weights:
if state.has_fp16_weights or state.CB is None:
has_grad = getattr(B, "grad", None) is not None
is_transposed = not B.is_contiguous() and B.shape[0] == B.stride(1)
if is_transposed:
B = B.contiguous()

if (state.is_training and not has_grad) or state.SCB is None:
if (state.is_training and not has_grad) or state.CB is None or state.SCB is None:
state.reset_grads()

# 2. Quantize B
Expand Down

0 comments on commit bbb7063

Please sign in to comment.