From 875414ea63bc572358e07699058e9dc18343773a Mon Sep 17 00:00:00 2001 From: Matthew Douglas <38992547+matthewdouglas@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:33:32 -0500 Subject: [PATCH] add comment --- bitsandbytes/autograd/_functions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bitsandbytes/autograd/_functions.py b/bitsandbytes/autograd/_functions.py index d40b3f706..7b1cccb23 100644 --- a/bitsandbytes/autograd/_functions.py +++ b/bitsandbytes/autograd/_functions.py @@ -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