compressed-tensors 0.10.3a20250709__py3-none-any.whl → 0.10.3a20250711__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.
@@ -392,8 +392,8 @@ class ModelCompressor:
392
392
  for prefix, module in tqdm(model.named_modules(), desc="Compressing model"):
393
393
 
394
394
  if prefix in module_to_scheme or prefix in sparse_compression_targets:
395
- module_device = get_execution_device(module).type
396
- is_meta = (module_device == "meta")
395
+ module_device = get_execution_device(module)
396
+ is_meta = module_device.type == "meta"
397
397
 
398
398
  exec_device = "meta" if is_meta else "cpu"
399
399
  onloading_device = "meta" if is_meta else module_device
@@ -747,12 +747,16 @@ class ModelCompressor:
747
747
 
748
748
  def map_module_to_scheme(model: Module) -> Dict[str, QuantizationScheme]:
749
749
  """
750
- Returns a dictionary which maps quantized module names to their quantization schemes
750
+ Returns a dictionary which maps quantized module names to their quantization
751
+ schemes. Only includes modules with weight quantization
751
752
  """
752
753
  return {
753
754
  fix_fsdp_module_name(name): module.quantization_scheme
754
755
  for name, module in model.named_modules()
755
- if is_module_quantized(module)
756
+ if (
757
+ hasattr(module, "quantization_scheme") and
758
+ module.quantization_scheme.weights is not None
759
+ )
756
760
  }
757
761
 
758
762
 
@@ -178,9 +178,13 @@ def sparse24_bitmask_compress(
178
178
 
179
179
  if tensor.is_meta:
180
180
  num_rows, num_cols = tensor.shape
181
- compressed_values = torch.empty((num_rows, num_cols // 2), dtype=tensor.dtype, device="meta")
181
+ compressed_values = torch.empty(
182
+ (num_rows, num_cols // 2), dtype=tensor.dtype, device="meta"
183
+ )
182
184
  packed_cols = (num_cols + 7) // 8
183
- bitmasks_packed = torch.empty((num_rows, packed_cols), dtype=torch.uint8, device="meta")
185
+ bitmasks_packed = torch.empty(
186
+ (num_rows, packed_cols), dtype=torch.uint8, device="meta"
187
+ )
184
188
  return compressed_values, bitmasks_packed
185
189
 
186
190
  bytemasks = get_24_bytemasks(tensor=tensor)
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.10.3.a20250709'
20
+ __version__ = version = '0.10.3.a20250711'
21
21
  __version_tuple__ = version_tuple = (0, 10, 3)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: compressed-tensors
3
- Version: 0.10.3a20250709
3
+ Version: 0.10.3a20250711
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,11 +1,11 @@
1
1
  compressed_tensors/__init__.py,sha256=UtKmifNeBCSE2TZSAfduVNNzHY-3V7bLjZ7n7RuXLOE,812
2
2
  compressed_tensors/base.py,sha256=73HYH7HY7O2roC89yG_piPFnZwrBfn_i7HmKl90SKc0,875
3
- compressed_tensors/version.py,sha256=W6EPpFFl6jLcV1lto1KzNfA-q89i7t3iPuaMgP0ddkI,523
3
+ compressed_tensors/version.py,sha256=S11uf7PlZb4aZTrdFIT3CUNVegXSY80RCGN3qLFo2UQ,523
4
4
  compressed_tensors/compressors/__init__.py,sha256=smSygTSfcfuujRrAXDc6uZm4L_ccV1tWZewqVnOb4lM,825
5
5
  compressed_tensors/compressors/base.py,sha256=nvWsv4xEw1Tkxkxth6TmHplDYXfBeP22xWxOsZERyDY,7204
6
6
  compressed_tensors/compressors/helpers.py,sha256=OK6qxX9j3bHwF9JfIYSGMgBJe2PWjlTA3byXKCJaTIQ,5431
7
7
  compressed_tensors/compressors/model_compressors/__init__.py,sha256=5RGGPFu4YqEt_aOdFSQYFYFDjcZFJN0CsMqRtDZz3Js,666
8
- compressed_tensors/compressors/model_compressors/model_compressor.py,sha256=TAuCA55UC_qEl4itA7m4MQTw1wEd9XWgNuXH6vDwb1Q,32908
8
+ compressed_tensors/compressors/model_compressors/model_compressor.py,sha256=MIMgjLK0VJu4bF_CwyvSftFrC5tvIIMfRt6XB0yLjOE,33056
9
9
  compressed_tensors/compressors/quantized_compressors/__init__.py,sha256=KvaFBL_Q84LxRGJOV035M8OBoCkAx8kOkfphswgkKWk,745
10
10
  compressed_tensors/compressors/quantized_compressors/base.py,sha256=YGUMzbxekj_36ChgQnVZN6T8uDjXtGG1zfMIBGBLWco,10354
11
11
  compressed_tensors/compressors/quantized_compressors/naive_quantized.py,sha256=0ANDcuD8aXPqTYNPY6GnX9iS6eXJw6P0TzNV_rYS2l8,5369
@@ -14,7 +14,7 @@ compressed_tensors/compressors/quantized_compressors/pack_quantized.py,sha256=47
14
14
  compressed_tensors/compressors/sparse_compressors/__init__.py,sha256=Atuz-OdEgn8OCUhx7Ovd6gXdyImAI186uCR-uR0t_Nk,737
15
15
  compressed_tensors/compressors/sparse_compressors/base.py,sha256=YNZWcHjDleAlqbgRZQ6oJf44MQb_UDNvJGOqhl26uFA,8098
16
16
  compressed_tensors/compressors/sparse_compressors/dense.py,sha256=-OujJ1e0iXBvxYVULrIGvAZ9l-IC0mXczZRnimQdgo4,2314
17
- compressed_tensors/compressors/sparse_compressors/sparse_24_bitmask.py,sha256=4MyERbYOnBgXPr9eCDqwkbAecp4npRBeXNbfdR3H0E0,9218
17
+ compressed_tensors/compressors/sparse_compressors/sparse_24_bitmask.py,sha256=p8cNV-W4TZKaWDlCwjptQyaIrwqlHizZ1Pn4Vx3-ANk,9262
18
18
  compressed_tensors/compressors/sparse_compressors/sparse_bitmask.py,sha256=S8vW0FI9ep_XtUQOxj0P5utJt3vKEYOHjWEPp-Xd9aY,5820
19
19
  compressed_tensors/compressors/sparse_quantized_compressors/__init__.py,sha256=4f_cwcKXB1nVVMoiKgTFAc8jAPjPLElo-Df_EDm1_xw,675
20
20
  compressed_tensors/compressors/sparse_quantized_compressors/marlin_24.py,sha256=7F9J6wgkecitK5hHuqjetZ18HExHIF4QIw1wgm2Y6U8,10099
@@ -61,8 +61,8 @@ compressed_tensors/utils/permutations_24.py,sha256=kx6fsfDHebx94zsSzhXGyCyuC9sVy
61
61
  compressed_tensors/utils/permute.py,sha256=V6tJLKo3Syccj-viv4F7ZKZgJeCB-hl-dK8RKI_kBwI,2355
62
62
  compressed_tensors/utils/safetensors_load.py,sha256=DMfZBuUbA6qp_BG_zIWT3ckiEE33K9ob34s-OgzReO4,12057
63
63
  compressed_tensors/utils/semi_structured_conversions.py,sha256=XKNffPum54kPASgqKzgKvyeqWPAkair2XEQXjkp7ho8,13489
64
- compressed_tensors-0.10.3a20250709.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
- compressed_tensors-0.10.3a20250709.dist-info/METADATA,sha256=OlbI5O9HtKj34JBHiFL5EKvk4-NnH8O-S97Jg3lrmZk,7031
66
- compressed_tensors-0.10.3a20250709.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
67
- compressed_tensors-0.10.3a20250709.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
68
- compressed_tensors-0.10.3a20250709.dist-info/RECORD,,
64
+ compressed_tensors-0.10.3a20250711.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
65
+ compressed_tensors-0.10.3a20250711.dist-info/METADATA,sha256=hKMAAe8C0-WWW8kZ40-9a3tEJy0gzknT3u9xQmww6w8,7031
66
+ compressed_tensors-0.10.3a20250711.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
67
+ compressed_tensors-0.10.3a20250711.dist-info/top_level.txt,sha256=w2i-GyPs2s1UwVxvutSvN_lM22SXC2hQFBmoMcPnV7Y,19
68
+ compressed_tensors-0.10.3a20250711.dist-info/RECORD,,