compressed-tensors-nightly 0.8.0.20241125__py3-none-any.whl → 0.8.0.20241126__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- compressed_tensors/quantization/quant_scheme.py +16 -2
- {compressed_tensors_nightly-0.8.0.20241125.dist-info → compressed_tensors_nightly-0.8.0.20241126.dist-info}/METADATA +1 -1
- {compressed_tensors_nightly-0.8.0.20241125.dist-info → compressed_tensors_nightly-0.8.0.20241126.dist-info}/RECORD +6 -6
- {compressed_tensors_nightly-0.8.0.20241125.dist-info → compressed_tensors_nightly-0.8.0.20241126.dist-info}/LICENSE +0 -0
- {compressed_tensors_nightly-0.8.0.20241125.dist-info → compressed_tensors_nightly-0.8.0.20241126.dist-info}/WHEEL +0 -0
- {compressed_tensors_nightly-0.8.0.20241125.dist-info → compressed_tensors_nightly-0.8.0.20241126.dist-info}/top_level.txt +0 -0
@@ -13,14 +13,14 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
from copy import deepcopy
|
16
|
-
from typing import List, Optional
|
16
|
+
from typing import Any, Dict, List, Optional
|
17
17
|
|
18
18
|
from compressed_tensors.quantization.quant_args import (
|
19
19
|
QuantizationArgs,
|
20
20
|
QuantizationStrategy,
|
21
21
|
QuantizationType,
|
22
22
|
)
|
23
|
-
from pydantic import BaseModel
|
23
|
+
from pydantic import BaseModel, model_validator
|
24
24
|
|
25
25
|
|
26
26
|
__all__ = [
|
@@ -47,6 +47,20 @@ class QuantizationScheme(BaseModel):
|
|
47
47
|
input_activations: Optional[QuantizationArgs] = None
|
48
48
|
output_activations: Optional[QuantizationArgs] = None
|
49
49
|
|
50
|
+
@model_validator(mode="after")
|
51
|
+
def validate_model_after(model: "QuantizationArgs") -> Dict[str, Any]:
|
52
|
+
inputs = model.input_activations
|
53
|
+
outputs = model.output_activations
|
54
|
+
|
55
|
+
if inputs is not None:
|
56
|
+
if inputs.actorder is not None:
|
57
|
+
raise ValueError("Cannot apply actorder to input activations")
|
58
|
+
|
59
|
+
if outputs is not None:
|
60
|
+
if outputs.actorder is not None:
|
61
|
+
raise ValueError("Cannot apply actorder to output activations")
|
62
|
+
|
63
|
+
return model
|
50
64
|
|
51
65
|
"""
|
52
66
|
Pre-Set Quantization Scheme Args
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: compressed-tensors-nightly
|
3
|
-
Version: 0.8.0.
|
3
|
+
Version: 0.8.0.20241126
|
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.
|
@@ -25,7 +25,7 @@ compressed_tensors/linear/compressed_linear.py,sha256=MJa-UfoKhIkdUWRD1shrXXri2c
|
|
25
25
|
compressed_tensors/quantization/__init__.py,sha256=83J5bPB7PavN2TfCoW7_vEDhfYpm4TDrqYO9vdSQ5bk,760
|
26
26
|
compressed_tensors/quantization/quant_args.py,sha256=osjNwCSB6tcyH9Qeg5sHEiB-bHyi3XJ8TzkGVJuGTc4,8711
|
27
27
|
compressed_tensors/quantization/quant_config.py,sha256=K6kOZ6LDXpFlqsVzR4NEATV6y6Ea83rJWnNyVlvw-pI,10379
|
28
|
-
compressed_tensors/quantization/quant_scheme.py,sha256=
|
28
|
+
compressed_tensors/quantization/quant_scheme.py,sha256=w1RbYA3TzbCt9Us21hPvjxZW0jg2vVF1h9mWYUFhJpo,6009
|
29
29
|
compressed_tensors/quantization/lifecycle/__init__.py,sha256=_uItzFWusyV74Zco_pHLOTdE9a83cL-R-ZdyQrBkIyw,772
|
30
30
|
compressed_tensors/quantization/lifecycle/apply.py,sha256=jCUSgeOBtagE5IhgIbyYMZ4kv8Rm20VGJ4IxXZ5HAnw,15066
|
31
31
|
compressed_tensors/quantization/lifecycle/compressed.py,sha256=Fj9n66IN0EWsOAkBHg3O0GlOQpxstqjCcs0ttzMXrJ0,2296
|
@@ -43,8 +43,8 @@ compressed_tensors/utils/permutations_24.py,sha256=kx6fsfDHebx94zsSzhXGyCyuC9sVy
|
|
43
43
|
compressed_tensors/utils/permute.py,sha256=V6tJLKo3Syccj-viv4F7ZKZgJeCB-hl-dK8RKI_kBwI,2355
|
44
44
|
compressed_tensors/utils/safetensors_load.py,sha256=m08ANVuTBxQdoa6LufDgcNJ7wCLDJolyZljB8VEybAU,8578
|
45
45
|
compressed_tensors/utils/semi_structured_conversions.py,sha256=XKNffPum54kPASgqKzgKvyeqWPAkair2XEQXjkp7ho8,13489
|
46
|
-
compressed_tensors_nightly-0.8.0.
|
47
|
-
compressed_tensors_nightly-0.8.0.
|
48
|
-
compressed_tensors_nightly-0.8.0.
|
49
|
-
compressed_tensors_nightly-0.8.0.
|
50
|
-
compressed_tensors_nightly-0.8.0.
|
46
|
+
compressed_tensors_nightly-0.8.0.20241126.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
47
|
+
compressed_tensors_nightly-0.8.0.20241126.dist-info/METADATA,sha256=RidYX1wZkyvfgSYQZcMm5l4jiFrE2vtfhfwB5XXWsp4,6799
|
48
|
+
compressed_tensors_nightly-0.8.0.20241126.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
49
|
+
compressed_tensors_nightly-0.8.0.20241126.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
|
50
|
+
compressed_tensors_nightly-0.8.0.20241126.dist-info/RECORD,,
|
File without changes
|
File without changes
|