compressed-tensors-nightly 0.6.0.20240926__py3-none-any.whl → 0.6.0.20240928__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.
@@ -216,6 +216,11 @@ class ModelCompressor:
216
216
  self.sparsity_compressor = None
217
217
  self.quantization_compressor = None
218
218
 
219
+
220
+ if sparsity_config and sparsity_config.format == CompressionFormat.dense.value:
221
+ # ignore dense sparsity config
222
+ self.sparsity_config = None
223
+
219
224
  if sparsity_config is not None:
220
225
  self.sparsity_compressor = Compressor.load_from_registry(
221
226
  sparsity_config.format, config=sparsity_config
@@ -306,16 +311,16 @@ class ModelCompressor:
306
311
  with open(config_file_path, "r") as config_file:
307
312
  config_data = json.load(config_file)
308
313
 
309
- config_data[COMPRESSION_CONFIG_NAME] = {}
314
+ config_data[QUANTIZATION_CONFIG_NAME] = {}
310
315
  if self.quantization_config is not None:
311
316
  quant_config_data = self.quantization_config.model_dump()
312
- config_data[COMPRESSION_CONFIG_NAME] = quant_config_data
317
+ config_data[QUANTIZATION_CONFIG_NAME] = quant_config_data
313
318
  if self.sparsity_config is not None:
314
319
  sparsity_config_data = self.sparsity_config.model_dump()
315
- config_data[COMPRESSION_CONFIG_NAME][
320
+ config_data[QUANTIZATION_CONFIG_NAME][
316
321
  SPARSITY_CONFIG_NAME
317
322
  ] = sparsity_config_data
318
- config_data[COMPRESSION_CONFIG_NAME][
323
+ config_data[QUANTIZATION_CONFIG_NAME][
319
324
  COMPRESSION_VERSION_NAME
320
325
  ] = compressed_tensors.__version__
321
326
 
@@ -75,7 +75,10 @@ def initialize_module_for_quantization(
75
75
 
76
76
  if scheme.input_activations is not None:
77
77
  _initialize_scale_zero_point_observer(
78
- module, "input", scheme.input_activations
78
+ module,
79
+ "input",
80
+ scheme.input_activations,
81
+ force_zero_point=force_zero_point,
79
82
  )
80
83
  if scheme.weights is not None:
81
84
  if hasattr(module, "weight"):
@@ -83,7 +86,11 @@ def initialize_module_for_quantization(
83
86
  if isinstance(module, torch.nn.Linear):
84
87
  weight_shape = module.weight.shape
85
88
  _initialize_scale_zero_point_observer(
86
- module, "weight", scheme.weights, weight_shape=weight_shape
89
+ module,
90
+ "weight",
91
+ scheme.weights,
92
+ weight_shape=weight_shape,
93
+ force_zero_point=force_zero_point,
87
94
  )
88
95
  else:
89
96
  _LOGGER.warning(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: compressed-tensors-nightly
3
- Version: 0.6.0.20240926
3
+ Version: 0.6.0.20240928
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.
@@ -6,7 +6,7 @@ compressed_tensors/compressors/base.py,sha256=NfVkhq6PRiq2cvAXaUXLoqC_nVYWdSrkE1
6
6
  compressed_tensors/compressors/dense.py,sha256=xcWECjcRY4INN6jC7vHx5wvUX3NmnKlxA9SVE1A6m2Q,1267
7
7
  compressed_tensors/compressors/helpers.py,sha256=k9avlkmeYj6vkOAvl-MgcixtP7ib24SCfhzZ-RusXfw,5403
8
8
  compressed_tensors/compressors/marlin_24.py,sha256=e7fGUyZbjUpA5VUMCPxqcYPGNiwoDKupHJaXWCoVKRw,9410
9
- compressed_tensors/compressors/model_compressor.py,sha256=EZC2-ehWEOsJXMl1ywF_7UnT90g_ALqx9SVNDOs5QIM,14178
9
+ compressed_tensors/compressors/model_compressor.py,sha256=3pMfGTTb8bN8PRNCFuH5k0RbP38r8GS_-cPgCkzL9vk,14355
10
10
  compressed_tensors/compressors/naive_quantized.py,sha256=z3h3ca5xKCN69mahutxcbzdv-OysiaxaM8P-Qum6zUQ,4823
11
11
  compressed_tensors/compressors/pack_quantized.py,sha256=27RVmJ2wg2dvCoawj407HSmKT3VPGJ6ujAMHlT26WlI,7571
12
12
  compressed_tensors/compressors/sparse_bitmask.py,sha256=kiDwBlFV0sJGLcIdDYxIiuF64ccgwDfqq1hWRQThYDc,8647
@@ -28,7 +28,7 @@ compressed_tensors/quantization/lifecycle/compressed.py,sha256=Fj9n66IN0EWsOAkBH
28
28
  compressed_tensors/quantization/lifecycle/forward.py,sha256=eLup6QDRUUp_Ozcas7RDRLIXBWjFbxn5gWbcAIJEGlw,15715
29
29
  compressed_tensors/quantization/lifecycle/frozen.py,sha256=NiJw7NP7pcT6idWFa8vksgiLoT8oQ975e57S4QfD2QQ,1874
30
30
  compressed_tensors/quantization/lifecycle/helpers.py,sha256=TmLY_G5VP_Fg2Ywio_dxoHRTxOKZdT7_aG5S9WtD4zI,2424
31
- compressed_tensors/quantization/lifecycle/initialize.py,sha256=vT5v3gevoSvXcyswMv96Pkv3j3NEftZzXhl7ATWkPZQ,8619
31
+ compressed_tensors/quantization/lifecycle/initialize.py,sha256=HAtSm7vKOZ3kGZuWe2B8LsmfC5B5vIKlc0V8C4rAF4Y,8819
32
32
  compressed_tensors/quantization/observers/__init__.py,sha256=4Sa7rqi5RB_S5bPO8KmncETiqDsoMBhwP37arlQym8s,764
33
33
  compressed_tensors/quantization/observers/base.py,sha256=5ovQicWPYHjIxr6-EkQ4lgOX0PpI9g23iSzKpxjM1Zg,8420
34
34
  compressed_tensors/quantization/observers/helpers.py,sha256=s_A23Qa_BLfOdHJCN5bm-qPWkhjjj_RIVrhSp1Y9Dtk,4211
@@ -46,8 +46,8 @@ compressed_tensors/utils/permutations_24.py,sha256=kx6fsfDHebx94zsSzhXGyCyuC9sVy
46
46
  compressed_tensors/utils/permute.py,sha256=V6tJLKo3Syccj-viv4F7ZKZgJeCB-hl-dK8RKI_kBwI,2355
47
47
  compressed_tensors/utils/safetensors_load.py,sha256=m08ANVuTBxQdoa6LufDgcNJ7wCLDJolyZljB8VEybAU,8578
48
48
  compressed_tensors/utils/semi_structured_conversions.py,sha256=XKNffPum54kPASgqKzgKvyeqWPAkair2XEQXjkp7ho8,13489
49
- compressed_tensors_nightly-0.6.0.20240926.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
- compressed_tensors_nightly-0.6.0.20240926.dist-info/METADATA,sha256=CGom6d3C4KL1JOAfJ60DYRFBytlAekz_NhPVECfBK-A,6799
51
- compressed_tensors_nightly-0.6.0.20240926.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
52
- compressed_tensors_nightly-0.6.0.20240926.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
53
- compressed_tensors_nightly-0.6.0.20240926.dist-info/RECORD,,
49
+ compressed_tensors_nightly-0.6.0.20240928.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
50
+ compressed_tensors_nightly-0.6.0.20240928.dist-info/METADATA,sha256=vndAZXPsHUGFnoR1oLqalmP1tnMaAUx7QgXHPVrwarE,6799
51
+ compressed_tensors_nightly-0.6.0.20240928.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
52
+ compressed_tensors_nightly-0.6.0.20240928.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
53
+ compressed_tensors_nightly-0.6.0.20240928.dist-info/RECORD,,