We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b2348b commit bbb7063Copy full SHA for bbb7063
bitsandbytes/autograd/_functions.py
@@ -328,13 +328,13 @@ def forward(
328
329
has_grad = False
330
331
- if state.has_fp16_weights:
+ if state.has_fp16_weights or state.CB is None:
332
has_grad = getattr(B, "grad", None) is not None
333
is_transposed = not B.is_contiguous() and B.shape[0] == B.stride(1)
334
if is_transposed:
335
B = B.contiguous()
336
337
- 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:
338
state.reset_grads()
339
340
# 2. Quantize B
0 commit comments