compressed-tensors-nightly 0.8.0.20241201__tar.gz → 0.8.0.20241203__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {compressed-tensors-nightly-0.8.0.20241201/src/compressed_tensors_nightly.egg-info → compressed-tensors-nightly-0.8.0.20241203}/PKG-INFO +1 -1
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/quant_args.py +16 -3
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/quant_scheme.py +1 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/helpers.py +33 -1
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203/src/compressed_tensors_nightly.egg-info}/PKG-INFO +1 -1
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/LICENSE +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/README.md +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/pyproject.toml +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/setup.cfg +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/setup.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/base.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/base.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/helpers.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/model_compressors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/model_compressors/model_compressor.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/quantized_compressors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/quantized_compressors/base.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/quantized_compressors/naive_quantized.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/quantized_compressors/pack_quantized.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_compressors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_compressors/base.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_compressors/dense.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_compressors/sparse_bitmask.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_quantized_compressors/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/compressors/sparse_quantized_compressors/marlin_24.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/config/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/config/base.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/config/dense.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/config/sparse_bitmask.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/linear/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/linear/compressed_linear.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/apply.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/compressed.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/forward.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/helpers.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/lifecycle/initialize.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/quant_config.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/utils/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/quantization/utils/helpers.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/registry/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/registry/registry.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/__init__.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/offload.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/permutations_24.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/permute.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/safetensors_load.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/utils/semi_structured_conversions.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors/version.py +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors_nightly.egg-info/SOURCES.txt +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors_nightly.egg-info/dependency_links.txt +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors_nightly.egg-info/requires.txt +0 -0
- {compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/src/compressed_tensors_nightly.egg-info/top_level.txt +0 -0
@@ -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.20241203
|
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.
|
@@ -17,6 +17,7 @@ from enum import Enum
|
|
17
17
|
from typing import Any, Dict, Optional, Union
|
18
18
|
|
19
19
|
import torch
|
20
|
+
from compressed_tensors.utils import Aliasable
|
20
21
|
from pydantic import BaseModel, Field, field_validator, model_validator
|
21
22
|
|
22
23
|
|
@@ -53,17 +54,29 @@ class QuantizationStrategy(str, Enum):
|
|
53
54
|
TOKEN = "token"
|
54
55
|
|
55
56
|
|
56
|
-
class ActivationOrdering(str, Enum):
|
57
|
+
class ActivationOrdering(Aliasable, str, Enum):
|
57
58
|
"""
|
58
59
|
Enum storing strategies for activation ordering
|
59
60
|
|
60
61
|
Group: reorder groups and weight\n
|
61
|
-
Weight: only reorder weight, not groups. Slightly lower
|
62
|
-
|
62
|
+
Weight: only reorder weight, not groups. Slightly lower accuracy but also lower
|
63
|
+
latency when compared to group actorder\n
|
64
|
+
Dynamic: alias for Group\n
|
65
|
+
Static: alias for Weight\n
|
63
66
|
"""
|
64
67
|
|
65
68
|
GROUP = "group"
|
66
69
|
WEIGHT = "weight"
|
70
|
+
# aliases
|
71
|
+
DYNAMIC = "dynamic"
|
72
|
+
STATIC = "static"
|
73
|
+
|
74
|
+
@staticmethod
|
75
|
+
def get_aliases() -> Dict[str, str]:
|
76
|
+
return {
|
77
|
+
"dynamic": "group",
|
78
|
+
"static": "weight",
|
79
|
+
}
|
67
80
|
|
68
81
|
|
69
82
|
class QuantizationArgs(BaseModel, use_enum_values=True):
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
from typing import Any, Optional
|
15
|
+
from typing import Any, Dict, Optional
|
16
16
|
|
17
17
|
import torch
|
18
18
|
from transformers import AutoConfig
|
@@ -24,6 +24,7 @@ __all__ = [
|
|
24
24
|
"tensor_follows_mask_structure",
|
25
25
|
"replace_module",
|
26
26
|
"is_compressed_tensors_config",
|
27
|
+
"Aliasable",
|
27
28
|
]
|
28
29
|
|
29
30
|
FSDP_WRAPPER_NAME = "_fsdp_wrapped_module"
|
@@ -119,3 +120,34 @@ def is_compressed_tensors_config(compression_config: Any) -> bool:
|
|
119
120
|
return isinstance(compression_config, CompressedTensorsConfig)
|
120
121
|
except ImportError:
|
121
122
|
return False
|
123
|
+
|
124
|
+
|
125
|
+
class Aliasable:
|
126
|
+
"""
|
127
|
+
A mixin for enums to allow aliasing of enum members
|
128
|
+
|
129
|
+
Example:
|
130
|
+
>>> class MyClass(Aliasable, int, Enum):
|
131
|
+
>>> ...
|
132
|
+
"""
|
133
|
+
|
134
|
+
@staticmethod
|
135
|
+
def get_aliases() -> Dict[str, str]:
|
136
|
+
raise NotImplementedError()
|
137
|
+
|
138
|
+
def __eq__(self, other):
|
139
|
+
if isinstance(other, self.__class__):
|
140
|
+
aliases = self.get_aliases()
|
141
|
+
return self.value == other.value or (
|
142
|
+
aliases.get(self.value, self.value)
|
143
|
+
== aliases.get(other.value, other.value)
|
144
|
+
)
|
145
|
+
else:
|
146
|
+
aliases = self.get_aliases()
|
147
|
+
self_value = aliases.get(self.value, self.value)
|
148
|
+
other_value = aliases.get(other, other)
|
149
|
+
return self_value == other_value
|
150
|
+
|
151
|
+
def __hash__(self):
|
152
|
+
canonical_value = self.aliases.get(self.value, self.value)
|
153
|
+
return hash(canonical_value)
|
@@ -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.20241203
|
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.
|
{compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/LICENSE
RENAMED
File without changes
|
{compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/README.md
RENAMED
File without changes
|
File without changes
|
{compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/setup.cfg
RENAMED
File without changes
|
{compressed-tensors-nightly-0.8.0.20241201 → compressed-tensors-nightly-0.8.0.20241203}/setup.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|