compressed-tensors-nightly 0.3.3.20240526__py3-none-any.whl → 0.3.3.20240528__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- compressed_tensors/compressors/pack_quantized.py +7 -4
- {compressed_tensors_nightly-0.3.3.20240526.dist-info → compressed_tensors_nightly-0.3.3.20240528.dist-info}/METADATA +1 -1
- {compressed_tensors_nightly-0.3.3.20240526.dist-info → compressed_tensors_nightly-0.3.3.20240528.dist-info}/RECORD +6 -6
- {compressed_tensors_nightly-0.3.3.20240526.dist-info → compressed_tensors_nightly-0.3.3.20240528.dist-info}/LICENSE +0 -0
- {compressed_tensors_nightly-0.3.3.20240526.dist-info → compressed_tensors_nightly-0.3.3.20240528.dist-info}/WHEEL +0 -0
- {compressed_tensors_nightly-0.3.3.20240526.dist-info → compressed_tensors_nightly-0.3.3.20240528.dist-info}/top_level.txt +0 -0
@@ -41,7 +41,7 @@ class PackedQuantizationCompressor(Compressor):
|
|
41
41
|
"""
|
42
42
|
|
43
43
|
COMPRESSION_PARAM_NAMES = [
|
44
|
-
"
|
44
|
+
"weight_packed",
|
45
45
|
"weight_scale",
|
46
46
|
"weight_zero_point",
|
47
47
|
"weight_shape",
|
@@ -73,7 +73,6 @@ class PackedQuantizationCompressor(Compressor):
|
|
73
73
|
zp = model_state.get(merge_names(prefix, "weight_zero_point"), None)
|
74
74
|
shape = torch.tensor(value.shape)
|
75
75
|
if scale is not None and zp is not None:
|
76
|
-
# weight is quantized, compress it
|
77
76
|
# weight is quantized, compress it
|
78
77
|
quant_args = model_quant_args[prefix]
|
79
78
|
if can_quantize(value, quant_args):
|
@@ -85,13 +84,17 @@ class PackedQuantizationCompressor(Compressor):
|
|
85
84
|
args=quant_args,
|
86
85
|
dtype=torch.int8,
|
87
86
|
)
|
88
|
-
|
87
|
+
value = pack_4bit_ints(value.cpu())
|
89
88
|
compressed_dict[merge_names(prefix, "weight_shape")] = shape
|
89
|
+
compressed_dict[merge_names(prefix, "weight_packed")] = value
|
90
|
+
continue
|
91
|
+
|
90
92
|
elif name.endswith("zero_point"):
|
91
93
|
if torch.all(value == 0):
|
92
94
|
# all zero_points are 0, no need to include in
|
93
95
|
# compressed state_dict
|
94
96
|
continue
|
97
|
+
|
95
98
|
compressed_dict[name] = value.to("cpu")
|
96
99
|
|
97
100
|
return compressed_dict
|
@@ -126,7 +129,7 @@ class PackedQuantizationCompressor(Compressor):
|
|
126
129
|
# zero_point assumed to be 0 if not included in state_dict
|
127
130
|
zero_point = torch.zeros_like(scale)
|
128
131
|
|
129
|
-
weight = weight_data["
|
132
|
+
weight = weight_data["weight_packed"]
|
130
133
|
original_shape = torch.Size(weight_data["weight_shape"])
|
131
134
|
unpacked = unpack_4bit_ints(weight, original_shape)
|
132
135
|
decompressed = dequantize(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: compressed-tensors-nightly
|
3
|
-
Version: 0.3.3.
|
3
|
+
Version: 0.3.3.20240528
|
4
4
|
Summary: Library for utilization of compressed safetensors of neural network models
|
5
5
|
Home-page: https://github.com/neuralmagic/compressed-tensors
|
6
6
|
Author: Neuralmagic, Inc.
|
@@ -7,7 +7,7 @@ compressed_tensors/compressors/dense.py,sha256=G_XHbvuENyupIKlXSITOQgvPkNkcMEOLc
|
|
7
7
|
compressed_tensors/compressors/helpers.py,sha256=k9avlkmeYj6vkOAvl-MgcixtP7ib24SCfhzZ-RusXfw,5403
|
8
8
|
compressed_tensors/compressors/int_quantized.py,sha256=bPi62n1MjySOeBat_yWMyc_LvDNDeSihu1gxzo_YrNY,5203
|
9
9
|
compressed_tensors/compressors/model_compressor.py,sha256=gHD2VMbXkXaZiJu3ibOaWiYb4oJDz2hxX03wDuu1yhI,10481
|
10
|
-
compressed_tensors/compressors/pack_quantized.py,sha256=
|
10
|
+
compressed_tensors/compressors/pack_quantized.py,sha256=zNQnnefK3qWpIzeGTBldQrRc8LM0p-nfSAN9Q9zUAIE,8412
|
11
11
|
compressed_tensors/compressors/sparse_bitmask.py,sha256=H9oZSTYI1oRCzAMbd4zThUnZd1h2rfs8DmA3tPcvuNE,8637
|
12
12
|
compressed_tensors/config/__init__.py,sha256=ZBqWn3r6ku1qfmlHHYp0mQueY0i7Pwhr9rbQk9dDlMc,704
|
13
13
|
compressed_tensors/config/base.py,sha256=grf5tDaLep8i2-W_p7H-fW9DOGXDi4Zz7su7zjs1Qqc,1454
|
@@ -36,8 +36,8 @@ compressed_tensors/registry/registry.py,sha256=fxjOjh2wklCvJhQxwofdy-zV8q7MkQ85S
|
|
36
36
|
compressed_tensors/utils/__init__.py,sha256=5DrYjoZbaEvSkJcC-GRSbM_RBHVF4tG9gMd3zsJnjLw,665
|
37
37
|
compressed_tensors/utils/helpers.py,sha256=h0jfl9drs5FAx40tCHRcVtJqXixB5hT5yq_IG2aY_-w,1735
|
38
38
|
compressed_tensors/utils/safetensors_load.py,sha256=wo9UirGrGlenBqZeqotvpCT7D5MEdjCo2J3HeRaIFoU,8502
|
39
|
-
compressed_tensors_nightly-0.3.3.
|
40
|
-
compressed_tensors_nightly-0.3.3.
|
41
|
-
compressed_tensors_nightly-0.3.3.
|
42
|
-
compressed_tensors_nightly-0.3.3.
|
43
|
-
compressed_tensors_nightly-0.3.3.
|
39
|
+
compressed_tensors_nightly-0.3.3.20240528.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
40
|
+
compressed_tensors_nightly-0.3.3.20240528.dist-info/METADATA,sha256=Xl260iCZ0lSPgSbvxBHUqPPC7c75L1nIxfOtXoc08kU,5633
|
41
|
+
compressed_tensors_nightly-0.3.3.20240528.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
42
|
+
compressed_tensors_nightly-0.3.3.20240528.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
|
43
|
+
compressed_tensors_nightly-0.3.3.20240528.dist-info/RECORD,,
|
File without changes
|
File without changes
|