File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
src/llmcompressor/modifiers/awq Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -464,11 +464,12 @@ def _apply_smoothing(self, model: Module) -> None:
464464 # The weights are reshaped to be organised by quantization group
465465 if self ._group_size > 0 :
466466 weight = weight .view (- 1 , self ._group_size )
467- # Calculates the relative magnitude of the weights within
468- # each of the quantization groups, and rescales each group
469- # individually so that each group has weights on a 0-1 scale.
470- weight .abs_ ()
471- weight .div_ (weight .amax (dim = 1 , keepdim = True ) + 1e-6 )
467+ # Calculates the relative magnitude of the weights within
468+ # each of the quantization groups, and rescales each group
469+ # individually so that each group has weights on a 0-1 scale.
470+ weight .abs_ ()
471+ weight .div_ (weight .amax (dim = 1 , keepdim = True ) + 1e-6 )
472+ if self ._group_size > 0 :
472473 # Resizes the rescaled weight matrix back up to
473474 # its original dimensions
474475 weight = weight .view (org_shape )
You can’t perform that action at this time.
0 commit comments