mct-nightly 2.1.0.20240813.442__py3-none-any.whl → 2.1.0.20240813.135859__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mct-nightly
3
- Version: 2.1.0.20240813.442
3
+ Version: 2.1.0.20240813.135859
4
4
  Summary: A Model Compression Toolkit for neural networks
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -1,4 +1,4 @@
1
- model_compression_toolkit/__init__.py,sha256=TfJUGlJPIuxH63h0s2ppXvyeiTCGanUIGaxWyU1e6XE,1573
1
+ model_compression_toolkit/__init__.py,sha256=H0N0NPHx0iBk8p7iU9CN4l8cMWW28GThyz8IHeo8QjU,1573
2
2
  model_compression_toolkit/constants.py,sha256=i4wYheBkIdQmsQA-axIpcT3YiSO1USNc-jaNiNE8w6E,3920
3
3
  model_compression_toolkit/defaultdict.py,sha256=LSc-sbZYXENMCw3U9F4GiXuv67IKpdn0Qm7Fr11jy-4,2277
4
4
  model_compression_toolkit/logger.py,sha256=3DByV41XHRR3kLTJNbpaMmikL8icd9e1N-nkQAY9oDk,4567
@@ -99,7 +99,7 @@ model_compression_toolkit/core/common/pruning/mask/__init__.py,sha256=huHoBUcKNB
99
99
  model_compression_toolkit/core/common/pruning/mask/per_channel_mask.py,sha256=APY8BsM9B7ZxVCH6n1xs9fSCTB_A9ou9gHrCQl1DOdI,5131
100
100
  model_compression_toolkit/core/common/pruning/mask/per_simd_group_mask.py,sha256=4ohJrJHNzZk5uMnZEYkwLx2TDGzkh5kRhLGNVYNC6dc,5978
101
101
  model_compression_toolkit/core/common/quantization/__init__.py,sha256=sw7LOPN1bM82o3SkMaklyH0jw-TLGK0-fl2Wq73rffI,697
102
- model_compression_toolkit/core/common/quantization/bit_width_config.py,sha256=r6VQXgyJxX_AM1JTzv-sTcrvCTnktBfOkVP20RllNmk,4586
102
+ model_compression_toolkit/core/common/quantization/bit_width_config.py,sha256=IXHkpI9bH3AbrpC5T5bNYHcojHzeWQrrCpV-xZj5pks,5021
103
103
  model_compression_toolkit/core/common/quantization/candidate_node_quantization_config.py,sha256=yU-Cr6S4wOSkDk57iH2NVe-WII0whOhLryejkomCOt4,4940
104
104
  model_compression_toolkit/core/common/quantization/core_config.py,sha256=f0uSuY9mX-vLX_1s2DemPARQlAXmLPKJKPtCArz3pZI,2670
105
105
  model_compression_toolkit/core/common/quantization/debug_config.py,sha256=8G8SpE_4rb8xBp8d6mMq8R_OnXJ_1oxB2g-Lxk9EJCM,1691
@@ -202,7 +202,7 @@ model_compression_toolkit/core/keras/quantizer/lut_fake_quant.py,sha256=Up3-sbuA
202
202
  model_compression_toolkit/core/keras/reader/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
203
203
  model_compression_toolkit/core/keras/reader/common.py,sha256=eZWjBcvTDUX7fCWmy1OAH4lYLFTh59_UQ_nP_Gjp4yw,2594
204
204
  model_compression_toolkit/core/keras/reader/connectivity_handler.py,sha256=AgF6qXZOJMeXvc-pBnGY23BJz7wPBx2aTYxHiO8efec,11303
205
- model_compression_toolkit/core/keras/reader/node_builder.py,sha256=NDgrEiy2WEe9k5ZuBaTynCFpwNrVIEIDdG_HNjI4MAM,14129
205
+ model_compression_toolkit/core/keras/reader/node_builder.py,sha256=2LXL4Vv5nHiRIX9lBpY4nRrJwDm8JhHeybS9V_QtqJQ,14211
206
206
  model_compression_toolkit/core/keras/reader/reader.py,sha256=wS9UQ2wJKnkZYe9JHwQp7ygDr6CRlzrxmIyLDv1Qz6U,8109
207
207
  model_compression_toolkit/core/keras/reader/nested_model/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
208
208
  model_compression_toolkit/core/keras/reader/nested_model/edges_merger.py,sha256=K6KAH9o8KSG6baLmhKoCrYK-i-wb6gRKiZmoijFqEYA,7906
@@ -520,16 +520,16 @@ model_compression_toolkit/xquant/keras/facade_xquant_report.py,sha256=7pf3PUMAj7
520
520
  model_compression_toolkit/xquant/keras/keras_report_utils.py,sha256=zUvhqehKKRHEkk6y8g1xQH47b6fTMuPy6stGEZ6mI24,3081
521
521
  model_compression_toolkit/xquant/keras/model_analyzer.py,sha256=WXi9BPI9_TzRWn50lM1i-6cwPPRW0p43Shg_xpHFclU,6521
522
522
  model_compression_toolkit/xquant/keras/similarity_functions.py,sha256=P2qMJAo94Sz_BCao-bnhEeewKtjeLLDDH2r9luDXJ04,2710
523
- model_compression_toolkit/xquant/keras/tensorboard_utils.py,sha256=635ZcK6_5jdpa7G6Tjq0hkveEYLJQyYRXCFCKL0EioM,9163
523
+ model_compression_toolkit/xquant/keras/tensorboard_utils.py,sha256=h67lf_agZwOuzF37or1YSF1dbTCdw-b3UyvTeRXhTp8,9225
524
524
  model_compression_toolkit/xquant/pytorch/__init__.py,sha256=ycb1Xt7PtixY2Uabr94JGSwBMcct66O8ZMVf3Qa3ud8,719
525
525
  model_compression_toolkit/xquant/pytorch/dataset_utils.py,sha256=KFKiFkhIPpEr1ZH5jekZFrgs20VzzKVxSV9YMgH68yI,2894
526
526
  model_compression_toolkit/xquant/pytorch/facade_xquant_report.py,sha256=sr_7TkmkRE0FhdJ7BwXGLFELmR4l_nK7IlTys6oYgoU,3179
527
527
  model_compression_toolkit/xquant/pytorch/model_analyzer.py,sha256=b93o800yVB3Z-ihJBLy5Cic-MQiUM_ZGV6SCXoNdscE,5549
528
528
  model_compression_toolkit/xquant/pytorch/pytorch_report_utils.py,sha256=bOc-hFL3gdoSM1Th_S2N_-9JJSlPGpZCTx_QLJHS6lg,3388
529
529
  model_compression_toolkit/xquant/pytorch/similarity_functions.py,sha256=CERxq5K8rqaiE-DlwhZBTUd9x69dtYJlkHOPLB54vm8,2354
530
- model_compression_toolkit/xquant/pytorch/tensorboard_utils.py,sha256=yjghWXxqOtT-QXoXBOuJyh45yUpFI0pKjdDegum2i68,9705
531
- mct_nightly-2.1.0.20240813.442.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
532
- mct_nightly-2.1.0.20240813.442.dist-info/METADATA,sha256=BuAU5P_gzUVjd4HUhpx1TKL9kRd878YqLWwXvz8pglY,19718
533
- mct_nightly-2.1.0.20240813.442.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
534
- mct_nightly-2.1.0.20240813.442.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
535
- mct_nightly-2.1.0.20240813.442.dist-info/RECORD,,
530
+ model_compression_toolkit/xquant/pytorch/tensorboard_utils.py,sha256=mkoEktLFFHtEKzzFRn_jCnxjhJolK12TZ5AQeDHzUO8,9767
531
+ mct_nightly-2.1.0.20240813.135859.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
532
+ mct_nightly-2.1.0.20240813.135859.dist-info/METADATA,sha256=FFcLCn7P4G8bVCT1qw_bOqHuRysEutjenTdGbuY2Wa4,19721
533
+ mct_nightly-2.1.0.20240813.135859.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
534
+ mct_nightly-2.1.0.20240813.135859.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
535
+ mct_nightly-2.1.0.20240813.135859.dist-info/RECORD,,
@@ -27,4 +27,4 @@ from model_compression_toolkit import data_generation
27
27
  from model_compression_toolkit import pruning
28
28
  from model_compression_toolkit.trainable_infrastructure.keras.load_model import keras_load_quantized_model
29
29
 
30
- __version__ = "2.1.0.20240813.000442"
30
+ __version__ = "2.1.0.20240813.135859"
@@ -87,5 +87,10 @@ class BitWidthConfig:
87
87
  if len(filtered_nodes) == 0:
88
88
  Logger.critical(f"Node Filtering Error: No nodes found in the graph for filter {manual_bit_width_selection.filter.__dict__} "
89
89
  f"to change their bit width to {manual_bit_width_selection.bit_width}.")
90
- nodes_to_change_bit_width.update({n: manual_bit_width_selection.bit_width for n in filtered_nodes})
90
+ for n in filtered_nodes:
91
+ # check if a manual configuration exists for this node
92
+ if n in nodes_to_change_bit_width:
93
+ Logger.info(
94
+ f"Node {n} has an existing manual bit width configuration of {nodes_to_change_bit_width.get(n)}. A new manual configuration request of {manual_bit_width_selection.bit_width} has been received, and the previous value is being overridden.")
95
+ nodes_to_change_bit_width.update({n: manual_bit_width_selection.bit_width})
91
96
  return nodes_to_change_bit_width
@@ -43,7 +43,8 @@ layers = keras.layers
43
43
 
44
44
  REUSED_IDENTIFIER = '_reused_'
45
45
 
46
- is_const = lambda x: isinstance(x, (tf.Variable, tf.Tensor, np.ndarray, tuple, list))
46
+ is_const = lambda x: isinstance(x, (tf.Variable, tf.Tensor, np.ndarray)) or \
47
+ (isinstance(x, (tuple, list)) and not isinstance(x[0], (int, dict)))
47
48
  is_tensor = lambda x: isinstance(x, KerasTensor)
48
49
 
49
50
 
@@ -76,7 +76,8 @@ class KerasTensorboardUtils(TensorboardUtils):
76
76
  # Read the quantized model into a graph structure.
77
77
  quant_graph = model_reader(quantized_model)
78
78
 
79
- insert_cut_info_into_graph(quant_graph, quantized_model_metadata)
79
+ if 'scheduling_info' in quantized_model_metadata:
80
+ insert_cut_info_into_graph(quant_graph, quantized_model_metadata)
80
81
 
81
82
  # Iterate over each node in the graph.
82
83
  for node in quant_graph.nodes:
@@ -79,7 +79,8 @@ class PytorchTensorboardUtils(TensorboardUtils):
79
79
  to_tensor=self.fw_impl.to_tensor,
80
80
  to_numpy=self.fw_impl.to_numpy)
81
81
 
82
- insert_cut_info_into_graph(quant_graph, quantized_model_metadata, quantized_model)
82
+ if 'scheduling_info' in quantized_model_metadata:
83
+ insert_cut_info_into_graph(quant_graph, quantized_model_metadata, quantized_model)
83
84
 
84
85
  # Iterate through each node in the graph
85
86
  for node in quant_graph.nodes: