File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/llmcompressor/modifiers/obcq Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import torch
5
5
import transformers
6
+ from loguru import logger
6
7
7
8
SGPT_PRECISION = torch .float32
8
9
@@ -108,11 +109,12 @@ def sparsify_weight(
108
109
H = torch .linalg .cholesky (H , upper = True )
109
110
Hinv = H
110
111
except torch ._C ._LinAlgError :
111
- raise torch . _C . _LinAlgError (
112
+ logger . warning (
112
113
"Failed to invert hessian due to numerical instability. Consider "
113
114
"increasing SparseGPTModifier.dampening_frac, increasing the number "
114
115
"of calibration samples, or shuffling the calibration dataset"
115
116
)
117
+ Hinv = H = torch .eye (num_columns , dtype = H .dtype , device = H .device )
116
118
117
119
# sparsity mask
118
120
# TODO: consider computing sparsity mask in the same way and place as gptq
You can’t perform that action at this time.
0 commit comments