Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdouglas committed Nov 4, 2024
1 parent 762daf4 commit 875414e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,13 @@ def forward(

# Extract the corresponding weights
if state.has_fp16_weights:
state.subB = B[:, state.idx].t() # .contiguous()
state.subB = B[:, state.idx].t()
else:
outliers = state.CB[:, state.idx] # .clone()
outliers = state.CB[:, state.idx]

# To dequantize our weights associated with the input outliers,
# we want to divide by 127. It's however more performant to multiply
# by the reciprocal.
state.subB = (7.874016e-3 * outliers * state.SCB.view(-1, 1)).t().to(A.dtype)
else:
subA = None
Expand Down

0 comments on commit 875414e

Please sign in to comment.