File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
tests/llmcompressor/pytorch/modifiers/pruning/sparsegpt Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 5
5
from parameterized import parameterized
6
6
7
7
from llmcompressor .modifiers .obcq import SparseGPTModifier
8
- from llmcompressor .modifiers .quantization .calibration import calibrate_input_hook
9
8
from llmcompressor .modifiers .quantization .gptq import GPTQModifier
10
9
from tests .llmcompressor .modifiers .conf import (
11
10
LifecyleTestingHarness ,
@@ -61,7 +60,7 @@ def test_successful_layerwise_recipe(self):
61
60
62
61
63
62
@pytest .mark .unit
64
- class TestCreateDefaultQuantModifier (unittest .TestCase ):
63
+ class TestApplyQuantization (unittest .TestCase ):
65
64
def setUp (self ):
66
65
setup_modifier_factory ()
67
66
@@ -77,8 +76,10 @@ def test_create_default_quant_modifier(self):
77
76
assert hasattr (module , "quantization_scheme" )
78
77
assert hasattr (module , "input_observer" )
79
78
assert hasattr (module , "weight_observer" )
80
- assert module ._forward_pre_hooks [0 ] is calibrate_input_hook
81
- assert module ._forward_hooks [0 ] is modifier .calibrate_module
79
+ pre_hooks = list (module ._forward_pre_hooks .values ())
80
+ post_hooks = list (module ._forward_hooks .values ())
81
+ assert pre_hooks [0 ].__name__ == "calibrate_input_hook"
82
+ assert post_hooks [0 ].__name__ == "calibrate_module"
82
83
83
84
84
85
class TestSetQuantInGPTQ (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments