File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/llmcompressor/modifiers/quantization/gptq Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1010 QuantizationStrategy ,
1111 fake_quantize ,
1212)
13+ from loguru import logger
1314
1415from llmcompressor .modifiers .utils import SPARSITY_THRESHOLD
1516from llmcompressor .observers .base import Observer
@@ -161,11 +162,12 @@ def quantize_weight(
161162 H = torch .linalg .cholesky (H , upper = True )
162163 Hinv = H
163164 except torch ._C ._LinAlgError :
164- raise torch . _C . _LinAlgError (
165+ logger . warning (
165166 "Failed to invert hessian due to numerical instability. Consider "
166167 "increasing GPTQModifier.dampening_frac, increasing the number "
167168 "of calibration samples, or shuffling the calibration dataset"
168169 )
170+ Hinv = H = torch .eye (num_columns , dtype = H .dtype , device = H .device )
169171
170172 # See section 3.4 of https://arxiv.org/abs/2203.07259
171173 for i1 in range (0 , num_columns , blocksize ):
You can’t perform that action at this time.
0 commit comments