Skip to content

Commit 875414e

Browse files
add comment
1 parent 762daf4 commit 875414e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bitsandbytes/autograd/_functions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,13 @@ def forward(
353353

354354
# Extract the corresponding weights
355355
if state.has_fp16_weights:
356-
state.subB = B[:, state.idx].t() # .contiguous()
356+
state.subB = B[:, state.idx].t()
357357
else:
358-
outliers = state.CB[:, state.idx] # .clone()
358+
outliers = state.CB[:, state.idx]
359+
360+
# To dequantize our weights associated with the input outliers,
361+
# we want to divide by 127. It's however more performant to multiply
362+
# by the reciprocal.
359363
state.subB = (7.874016e-3 * outliers * state.SCB.view(-1, 1)).t().to(A.dtype)
360364
else:
361365
subA = None

0 commit comments

Comments
 (0)