compressed-tensors 0.12.1__py3-none-any.whl → 0.12.2__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.
@@ -165,7 +165,7 @@ def compute_dynamic_scales_and_zp(
165
165
 
166
166
  keep_dims = True
167
167
  if args.strategy == QuantizationStrategy.TOKEN:
168
- dim = {1, 2}
168
+ dim = {0, 1}
169
169
  reduce_dims = tuple(idx for idx in range(value.ndim) if idx not in dim)
170
170
  elif args.strategy == QuantizationStrategy.TENSOR:
171
171
  reduce_dims = None
@@ -15,9 +15,9 @@
15
15
  from typing import Dict
16
16
 
17
17
  import torch
18
- from accelerate.utils import has_offloaded_params
19
18
  from compressed_tensors import TRANSFORM_CONFIG_NAME
20
19
  from compressed_tensors.transform import TransformConfig, TransformFactory
20
+ from compressed_tensors.utils.offload import has_offloaded_params
21
21
 
22
22
 
23
23
  __all__ = ["apply_transform_config"]
@@ -18,7 +18,6 @@ from .internal import *
18
18
  from .match import *
19
19
  from .offload import *
20
20
  from .permutations_24 import *
21
- from .permute import *
22
21
  from .safetensors_load import *
23
22
  from .semi_structured_conversions import *
24
23
  from .type import *
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.12.1'
21
- __version_tuple__ = version_tuple = (0, 12, 1)
20
+ __version__ = version = '0.12.2'
21
+ __version_tuple__ = version_tuple = (0, 12, 2)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compressed-tensors
3
- Version: 0.12.1
3
+ Version: 0.12.2
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.
@@ -1,7 +1,7 @@
1
1
  compressed_tensors/__init__.py,sha256=SRqNYFVvxAaLa4SImhoiIBKfoOSj7EUdx0CxXjGC2PA,884
2
2
  compressed_tensors/base.py,sha256=-gxWvDF4LCkyeDP8YlGzvBBKxo4Dk9h4NINPD61drFU,921
3
3
  compressed_tensors/logger.py,sha256=sTm1Od1cV0aDxBm3YN-PPvsOATxY_2tBV62TQE4HiPw,4032
4
- compressed_tensors/version.py,sha256=DzB47l1iPNTY8yuA60VuZvneNqNdRBd1svEjKxC37o4,513
4
+ compressed_tensors/version.py,sha256=zZwBOgFsGuwXoMQE3ufj9-wsWZuT7V5jwWvKP04rOSE,513
5
5
  compressed_tensors/compressors/__init__.py,sha256=smSygTSfcfuujRrAXDc6uZm4L_ccV1tWZewqVnOb4lM,825
6
6
  compressed_tensors/compressors/base.py,sha256=nvWsv4xEw1Tkxkxth6TmHplDYXfBeP22xWxOsZERyDY,7204
7
7
  compressed_tensors/compressors/helpers.py,sha256=OK6qxX9j3bHwF9JfIYSGMgBJe2PWjlTA3byXKCJaTIQ,5431
@@ -39,11 +39,11 @@ compressed_tensors/quantization/lifecycle/forward.py,sha256=MAw049L4a9ha4P5D4MjO
39
39
  compressed_tensors/quantization/lifecycle/helpers.py,sha256=C0mhy2vJ0fCjVeN4kFNhw8Eq1wkteBGHiZ36RVLThRY,944
40
40
  compressed_tensors/quantization/lifecycle/initialize.py,sha256=1vCHN1LLSIoh6IgGAyE-Jan64HvuiChwdGhslbYkXhk,9832
41
41
  compressed_tensors/quantization/utils/__init__.py,sha256=VdtEmP0bvuND_IGQnyqUPc5lnFp-1_yD7StKSX4x80w,656
42
- compressed_tensors/quantization/utils/helpers.py,sha256=OKBczzf0wPXVah4zch3NIET81gNsonMm3uU2PCyrtoo,16420
42
+ compressed_tensors/quantization/utils/helpers.py,sha256=fyAjq0YbrZG6_UbEU7n6Z1i-Bg4PLA-mQiu7mHS9fs0,16420
43
43
  compressed_tensors/registry/__init__.py,sha256=FwLSNYqfIrb5JD_6OK_MT4_svvKTN_nEhpgQlQvGbjI,658
44
44
  compressed_tensors/registry/registry.py,sha256=cWnlwZ66lgG0w9OAUEAgq5XVxqsgFm1o8ZYdNhkNvJY,11957
45
45
  compressed_tensors/transform/__init__.py,sha256=v2wfl4CMfA6KbD7Hxx_MbRev63y_6QLDlccZq-WTtdw,907
46
- compressed_tensors/transform/apply.py,sha256=YldYh3DGY09wJEKlFRSbg7-kRdCv7uFEuGkr5ZWCEXs,2984
46
+ compressed_tensors/transform/apply.py,sha256=pnNans9hW78Mb1-P2IY46LV5V6o2LvDbA3txKnEFUkE,3000
47
47
  compressed_tensors/transform/transform_args.py,sha256=rVgReFp7wMXcYugkfd325e2tTFh8pGV3FnYTGCEv5jY,3429
48
48
  compressed_tensors/transform/transform_config.py,sha256=3YdtGcau3qkcapX9GMUiLuhQHFQZKFYT3eLgJGj1L6s,1204
49
49
  compressed_tensors/transform/transform_scheme.py,sha256=YR7Ri5hXWYQ8MSgMcpYg_BMyZtvXVPShz6iUf4giI8g,2475
@@ -56,18 +56,17 @@ compressed_tensors/transform/utils/__init__.py,sha256=fH6rjBYAxuwrTzBTlTjTgCYNyh
56
56
  compressed_tensors/transform/utils/hadamard.py,sha256=9JMJPtlYI2HwJ2Y2I6uyVCBhKju8yXuQ9DhK4ZpEpvY,5753
57
57
  compressed_tensors/transform/utils/hadamards.safetensors,sha256=mFd1GzNodGG-ifA1IoH-0nHYzfraCOvrq_dX2zFI1B4,1436901
58
58
  compressed_tensors/transform/utils/matrix.py,sha256=3sPatOCzcLRE8ROLCGTKHr2c51DubJOFgmuNCgYdJP4,6164
59
- compressed_tensors/utils/__init__.py,sha256=spzbjUO4-hZ2jXGST27r3MIt2yzIXsjdbEaYyaMcizo,873
59
+ compressed_tensors/utils/__init__.py,sha256=eXvtlJEUiV4XPcfsxVrOwL7DyY8r-L0XG_Rr5qmZrmU,850
60
60
  compressed_tensors/utils/helpers.py,sha256=DDvjVwjK7uD6PH0jBP6Wn_MRqKkPFRbMyI6QRCzpzc0,12592
61
61
  compressed_tensors/utils/internal.py,sha256=7SSWgDoNFRnlfadwkoFhLW-T2jOc7Po_WzWv5h32Sa8,982
62
62
  compressed_tensors/utils/match.py,sha256=h8jYZS6XRgNplzu3c3SPXKcY-sVPa5niChTCLfUVHGE,11256
63
63
  compressed_tensors/utils/offload.py,sha256=eXqLzl8kUkVDlNtcO5sn_4QoDcbAaxbCAS3tyZ-aGr8,23538
64
64
  compressed_tensors/utils/permutations_24.py,sha256=kx6fsfDHebx94zsSzhXGyCyuC9sVyah6BUUir_StT28,2530
65
- compressed_tensors/utils/permute.py,sha256=wB8LCvQxmI7xnm67S8pbHzM5CDFgG8t4D8emaXPnv0M,1212
66
65
  compressed_tensors/utils/safetensors_load.py,sha256=Vql34aCTDHwmTZXJHzCyBISJo7iA7EQ78LdTlMjdpZo,12023
67
66
  compressed_tensors/utils/semi_structured_conversions.py,sha256=XKNffPum54kPASgqKzgKvyeqWPAkair2XEQXjkp7ho8,13489
68
67
  compressed_tensors/utils/type.py,sha256=bNwoo_FWlvLuDpYAGGzZJITRg0JA_Ngk9LGPo-kvjeU,2554
69
- compressed_tensors-0.12.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
70
- compressed_tensors-0.12.1.dist-info/METADATA,sha256=rGHOzy2FZFRUNCuiBKb99tnWtlks5mAIBrR76QltFkM,7018
71
- compressed_tensors-0.12.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- compressed_tensors-0.12.1.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
73
- compressed_tensors-0.12.1.dist-info/RECORD,,
68
+ compressed_tensors-0.12.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
69
+ compressed_tensors-0.12.2.dist-info/METADATA,sha256=3RfdKY_N1p4jMxQf6KlohI6ITB5vop9PKKKrtB5qowc,7018
70
+ compressed_tensors-0.12.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
71
+ compressed_tensors-0.12.2.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
72
+ compressed_tensors-0.12.2.dist-info/RECORD,,
@@ -1,33 +0,0 @@
1
- # Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing,
10
- # software distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- import torch
16
- from compressed_tensors.utils.helpers import deprecated
17
-
18
-
19
- __all__ = ["safe_permute"]
20
-
21
-
22
- @deprecated("Tensor.index_select")
23
- def safe_permute(value: torch.Tensor, perm: torch.Tensor, dim: int = 0) -> torch.Tensor:
24
- """
25
- Perform out-of-place permutation without using torch.Tensor.index_put_,
26
- whose implementation is missing for datatypes such as `torch.float8_e4m3fn`
27
-
28
- :param value: tensor to permute
29
- :param perm: permutation map
30
- :param dim: dimension along which to apply permutation
31
- :return: permuted value
32
- """
33
- return value.index_select(dim, perm)