@@ -119,10 +119,8 @@ def compress(
119
119
compressed_dict [prefix + key ] = value .to (save_device )
120
120
121
121
else :
122
- # omit saving zero points for symmetric quantization
123
- if name .endswith ("zero_point" ) and not self ._should_save_zp (
124
- name , names_to_scheme
125
- ):
122
+ # omit saving zero points for symmetric or packed quantization
123
+ if name .endswith ("zero_point" ) and self ._skip_zp (name , names_to_scheme ):
126
124
continue
127
125
128
126
# omit saving for g_idx if uninitialized
@@ -134,7 +132,7 @@ def compress(
134
132
135
133
return compressed_dict
136
134
137
- def _should_save_zp (
135
+ def _skip_zp (
138
136
self , name : str , names_to_scheme : Dict [str , QuantizationScheme ]
139
137
) -> bool :
140
138
from compressed_tensors .compressors import PackedQuantizationCompressor
@@ -150,16 +148,16 @@ def _should_save_zp(
150
148
args = scheme .output_activations
151
149
152
150
symmetric = args .symmetric
153
- packable_strats = [
151
+ packable_strategies = [
154
152
QuantizationStrategy .GROUP .value ,
155
153
QuantizationStrategy .CHANNEL .value ,
156
154
]
157
155
packed = (
158
156
isinstance (self , PackedQuantizationCompressor )
159
- and args .strategy in packable_strats
157
+ and args .strategy in packable_strategies
160
158
)
161
159
162
- return not symmetric and not packed
160
+ return symmetric or packed
163
161
164
162
def decompress (
165
163
self ,
0 commit comments