Skip to content

Commit f324af7

Browse files
committed
rename to _skip_zp
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent 9e82ddb commit f324af7

File tree

1 file changed

+6
-8
lines changed
  • src/compressed_tensors/compressors/quantized_compressors

1 file changed

+6
-8
lines changed

src/compressed_tensors/compressors/quantized_compressors/base.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ def compress(
119119
compressed_dict[prefix + key] = value.to(save_device)
120120

121121
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):
126124
continue
127125

128126
# omit saving for g_idx if uninitialized
@@ -134,7 +132,7 @@ def compress(
134132

135133
return compressed_dict
136134

137-
def _should_save_zp(
135+
def _skip_zp(
138136
self, name: str, names_to_scheme: Dict[str, QuantizationScheme]
139137
) -> bool:
140138
from compressed_tensors.compressors import PackedQuantizationCompressor
@@ -150,16 +148,16 @@ def _should_save_zp(
150148
args = scheme.output_activations
151149

152150
symmetric = args.symmetric
153-
packable_strats = [
151+
packable_strategies = [
154152
QuantizationStrategy.GROUP.value,
155153
QuantizationStrategy.CHANNEL.value,
156154
]
157155
packed = (
158156
isinstance(self, PackedQuantizationCompressor)
159-
and args.strategy in packable_strats
157+
and args.strategy in packable_strategies
160158
)
161159

162-
return not symmetric and not packed
160+
return symmetric or packed
163161

164162
def decompress(
165163
self,

0 commit comments

Comments
 (0)