compressed-tensors-nightly 0.6.0.20240919__py3-none-any.whl → 0.6.0.20240921__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.
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  from enum import Enum
16
- from typing import Optional
16
+ from typing import List, Optional
17
17
 
18
18
  from compressed_tensors.registry import RegistryMixin
19
19
  from pydantic import BaseModel
@@ -37,11 +37,16 @@ class SparsityCompressionConfig(RegistryMixin, BaseModel):
37
37
  Base data class for storing sparsity compression parameters
38
38
 
39
39
  :param format: name of compression format
40
+ :param targets: List of layer names or layer types that aren't sparse and should
41
+ be ignored during compression. By default, assume all layers are targeted
42
+ :param ignore: List of layer names (unique) to ignore from targets. Defaults to None
40
43
  :param global_sparsity: average sparsity of the entire model
41
44
  :param sparsity_structure: structure of the sparsity, such as
42
45
  "unstructured", "2:4", "8:16" etc
43
46
  """
44
47
 
45
48
  format: str
49
+ targets: Optional[List[str]] = None
50
+ ignore: Optional[List[str]] = None
46
51
  global_sparsity: Optional[float] = 0.0
47
52
  sparsity_structure: Optional[str] = "unstructured"
@@ -57,15 +57,9 @@ class QuantizationScheme(BaseModel):
57
57
  # default to quantizing all Linear layers
58
58
  targets = ["Linear"]
59
59
 
60
- # default to 8 bit integer symmetric quantization
61
- # for weights
62
- weights = QuantizationArgs(num_bits=8, symmetric=True)
63
-
64
- # default to 8 bit integer asymmetric quantization
65
- input_activations = QuantizationArgs(num_bits=8, symmetric=True)
66
-
67
- # Do not quantize the output activations
68
- # by default
60
+ # by default, activations and weights are left unquantized
61
+ weights = None
62
+ input_activations = None
69
63
  output_activations = None
70
64
 
71
65
  return cls(
@@ -110,6 +104,7 @@ def is_preset_scheme(name: str) -> bool:
110
104
  """
111
105
  return name.upper() in PRESET_SCHEMES
112
106
 
107
+
113
108
  UNQUANTIZED = dict()
114
109
 
115
110
  # 8 bit integer weights and 8 bit activations quantization
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: compressed-tensors-nightly
3
- Version: 0.6.0.20240919
3
+ Version: 0.6.0.20240921
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.
@@ -11,7 +11,7 @@ compressed_tensors/compressors/naive_quantized.py,sha256=z3h3ca5xKCN69mahutxcbzd
11
11
  compressed_tensors/compressors/pack_quantized.py,sha256=27RVmJ2wg2dvCoawj407HSmKT3VPGJ6ujAMHlT26WlI,7571
12
12
  compressed_tensors/compressors/sparse_bitmask.py,sha256=kiDwBlFV0sJGLcIdDYxIiuF64ccgwDfqq1hWRQThYDc,8647
13
13
  compressed_tensors/config/__init__.py,sha256=ZBqWn3r6ku1qfmlHHYp0mQueY0i7Pwhr9rbQk9dDlMc,704
14
- compressed_tensors/config/base.py,sha256=caSZ7xZ_kgcHRMXZ5hM1i6TKbgY__CkiSjZ93imHZQ0,1562
14
+ compressed_tensors/config/base.py,sha256=BNTFKy12isY7qblwxdi_R1f00EzgrNOXLrfxqLCPT8w,1903
15
15
  compressed_tensors/config/dense.py,sha256=NgSxnFCnckU9-iunxEaqiFwqgdO7YYxlWKR74jNbjks,1317
16
16
  compressed_tensors/config/sparse_bitmask.py,sha256=pZUboRNZTu6NajGOQEFExoPknak5ynVAUeiiYpS1Gt8,1308
17
17
  compressed_tensors/linear/__init__.py,sha256=fH6rjBYAxuwrTzBTlTjTgCYNyh6TCvCqajCz4Im4YrA,617
@@ -19,7 +19,7 @@ compressed_tensors/linear/compressed_linear.py,sha256=G0gEFfxLAUsgRcnfSV-PKz1ZBN
19
19
  compressed_tensors/quantization/__init__.py,sha256=83J5bPB7PavN2TfCoW7_vEDhfYpm4TDrqYO9vdSQ5bk,760
20
20
  compressed_tensors/quantization/quant_args.py,sha256=CmyVtjJeHlqCW-7R5Z7tIw6lXUrzCX6Y9bwgmMxEudY,8069
21
21
  compressed_tensors/quantization/quant_config.py,sha256=NpVu8YJ4Xw2pIQW_PGaNaml8kx1bUnxkvb0jBYWbKdE,9971
22
- compressed_tensors/quantization/quant_scheme.py,sha256=VRvWweqwlhjYMrKf62fXKQTeoJGhjJa3tXnE-TuFdFA,6093
22
+ compressed_tensors/quantization/quant_scheme.py,sha256=HmR1DcFZcjuqX7KHUYI0NFXsCIzJ8sxFGH6zhYuHmEs,5870
23
23
  compressed_tensors/quantization/lifecycle/__init__.py,sha256=MXE2E7GfIfRRfhrdGy2Og3AZOz5N59B0ZGFcsD89y6c,821
24
24
  compressed_tensors/quantization/lifecycle/apply.py,sha256=uftWFunr_CpCZM_qWfo2O1USXKB2qSYD1pBJsO8BuCU,15285
25
25
  compressed_tensors/quantization/lifecycle/calibration.py,sha256=PlS_EqCOPqJD3QKuLPXO9AOtDzXtQWvEBTynFv-FFVw,2698
@@ -45,8 +45,8 @@ compressed_tensors/utils/permutations_24.py,sha256=kx6fsfDHebx94zsSzhXGyCyuC9sVy
45
45
  compressed_tensors/utils/permute.py,sha256=V6tJLKo3Syccj-viv4F7ZKZgJeCB-hl-dK8RKI_kBwI,2355
46
46
  compressed_tensors/utils/safetensors_load.py,sha256=m08ANVuTBxQdoa6LufDgcNJ7wCLDJolyZljB8VEybAU,8578
47
47
  compressed_tensors/utils/semi_structured_conversions.py,sha256=XKNffPum54kPASgqKzgKvyeqWPAkair2XEQXjkp7ho8,13489
48
- compressed_tensors_nightly-0.6.0.20240919.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
- compressed_tensors_nightly-0.6.0.20240919.dist-info/METADATA,sha256=JmbnkwGkEWb_arRR92r2CV10KcYDayZvLgS0gWuG-bs,6799
50
- compressed_tensors_nightly-0.6.0.20240919.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
51
- compressed_tensors_nightly-0.6.0.20240919.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
52
- compressed_tensors_nightly-0.6.0.20240919.dist-info/RECORD,,
48
+ compressed_tensors_nightly-0.6.0.20240921.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
49
+ compressed_tensors_nightly-0.6.0.20240921.dist-info/METADATA,sha256=VvF40t86UhlxctGKFqedC0jd-Fkef3ahcnb5ZgjJD44,6799
50
+ compressed_tensors_nightly-0.6.0.20240921.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
51
+ compressed_tensors_nightly-0.6.0.20240921.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
52
+ compressed_tensors_nightly-0.6.0.20240921.dist-info/RECORD,,