compressed-tensors-nightly 0.8.0.20241125__py3-none-any.whl → 0.8.0.20241127__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -93,9 +93,11 @@ class NaiveQuantizationCompressor(BaseQuantizationCompressor):
93
93
  args=quantization_args,
94
94
  dtype=quantization_args.pytorch_dtype(),
95
95
  )
96
+ else:
97
+ quantized_weight = weight
96
98
 
97
- if device is not None:
98
- quantized_weight = quantized_weight.to(device)
99
+ if device is not None:
100
+ quantized_weight = quantized_weight.to(device)
99
101
 
100
102
  return {"weight": quantized_weight}
101
103
 
@@ -94,6 +94,8 @@ class PackedQuantizationCompressor(BaseQuantizationCompressor):
94
94
  args=quantization_args,
95
95
  dtype=torch.int8,
96
96
  )
97
+ else:
98
+ quantized_weight = weight
97
99
 
98
100
  packed_weight = pack_to_int32(quantized_weight, quantization_args.num_bits)
99
101
  weight_shape = torch.tensor(weight.shape)
@@ -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.20241125
3
+ Version: 0.8.0.20241127
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.
@@ -8,8 +8,8 @@ compressed_tensors/compressors/model_compressors/__init__.py,sha256=5RGGPFu4YqEt
8
8
  compressed_tensors/compressors/model_compressors/model_compressor.py,sha256=sxh1TvW1Bp9YJE41hW0XZfd0kYYB85nhJvBLVRTDcV0,15886
9
9
  compressed_tensors/compressors/quantized_compressors/__init__.py,sha256=09UJq68Pht6Bf-4iP9xYl3tetKsncNPHD8IAGbePsr4,714
10
10
  compressed_tensors/compressors/quantized_compressors/base.py,sha256=K1KOnS6Y8nUA1-HN7VhyfsDc01nilW0WfXMUhuD-l8w,5954
11
- compressed_tensors/compressors/quantized_compressors/naive_quantized.py,sha256=Mmfr-hap-4zw7CzE1mXi0UirknqGidNxw38GGWVgTqM,4916
12
- compressed_tensors/compressors/quantized_compressors/pack_quantized.py,sha256=9H8UrG5v1GRtslLjOEiUM2dnyxJnR-HJmlsFezQs_r0,7706
11
+ compressed_tensors/compressors/quantized_compressors/naive_quantized.py,sha256=MMUya3Iwarm0BkeYXqKTUnEDPiBw98GKF09QiNST45k,4960
12
+ compressed_tensors/compressors/quantized_compressors/pack_quantized.py,sha256=1CLwvBlu4AtGkuo3IisD1-rQzwLiA6hE1bCc-pF_XGo,7758
13
13
  compressed_tensors/compressors/sparse_compressors/__init__.py,sha256=i2TESH27l7KXeOhJ6hShIoI904XX96l-cRQiMR6MAaU,704
14
14
  compressed_tensors/compressors/sparse_compressors/base.py,sha256=Ua4rUSGyucEs-YJI5z3oIUF-zqQLrFsQ9f-qKasEdUM,4410
15
15
  compressed_tensors/compressors/sparse_compressors/dense.py,sha256=lSKNWRx6H7aUqaJj1j4qbXk8Gkm1UohbnvW1Rvq6Ra4,1284
@@ -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=o3SaeNKWFVqbOtk0cLlwHh_YenU4hnteXFtH5ey9zLk,5452
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.20241125.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
- compressed_tensors_nightly-0.8.0.20241125.dist-info/METADATA,sha256=knIDwRFNO49BK7z2eaJ_xDU7ahdMcdPp9JQYg7XLvl0,6799
48
- compressed_tensors_nightly-0.8.0.20241125.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
49
- compressed_tensors_nightly-0.8.0.20241125.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
50
- compressed_tensors_nightly-0.8.0.20241125.dist-info/RECORD,,
46
+ compressed_tensors_nightly-0.8.0.20241127.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
47
+ compressed_tensors_nightly-0.8.0.20241127.dist-info/METADATA,sha256=JxFY_KbCnr3oLtEZrQLaEtR4HXUhSuUoYKKeyMZmX9U,6799
48
+ compressed_tensors_nightly-0.8.0.20241127.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
49
+ compressed_tensors_nightly-0.8.0.20241127.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
50
+ compressed_tensors_nightly-0.8.0.20241127.dist-info/RECORD,,