Skip to content

Commit bbb7063

Browse files
Int8 fix for PEFT OLoRA init
1 parent 5b2348b commit bbb7063

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bitsandbytes/autograd/_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ def forward(
328328

329329
has_grad = False
330330

331-
if state.has_fp16_weights:
331+
if state.has_fp16_weights or state.CB is None:
332332
has_grad = getattr(B, "grad", None) is not None
333333
is_transposed = not B.is_contiguous() and B.shape[0] == B.stride(1)
334334
if is_transposed:
335335
B = B.contiguous()
336336

337-
if (state.is_training and not has_grad) or state.SCB is None:
337+
if (state.is_training and not has_grad) or state.CB is None or state.SCB is None:
338338
state.reset_grads()
339339

340340
# 2. Quantize B

0 commit comments

Comments
 (0)