mct-nightly 2.0.0.20240417.406__py3-none-any.whl → 2.0.0.20240419.358__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.
Files changed (60) hide show
  1. {mct_nightly-2.0.0.20240417.406.dist-info → mct_nightly-2.0.0.20240419.358.dist-info}/METADATA +1 -1
  2. {mct_nightly-2.0.0.20240417.406.dist-info → mct_nightly-2.0.0.20240419.358.dist-info}/RECORD +60 -57
  3. model_compression_toolkit/__init__.py +1 -1
  4. model_compression_toolkit/constants.py +2 -0
  5. model_compression_toolkit/core/common/graph/base_graph.py +2 -2
  6. model_compression_toolkit/core/common/graph/base_node.py +26 -9
  7. model_compression_toolkit/core/common/graph/functional_node.py +18 -1
  8. model_compression_toolkit/core/common/hessian/hessian_info_service.py +2 -3
  9. model_compression_toolkit/core/common/hessian/trace_hessian_request.py +1 -3
  10. model_compression_toolkit/core/common/network_editors/node_filters.py +4 -3
  11. model_compression_toolkit/core/common/quantization/node_quantization_config.py +0 -5
  12. model_compression_toolkit/core/common/quantization/quantization_config.py +5 -2
  13. model_compression_toolkit/core/common/quantization/quantization_params_generation/error_functions.py +67 -4
  14. model_compression_toolkit/core/common/quantization/quantization_params_generation/lut_kmeans_params.py +12 -4
  15. model_compression_toolkit/core/common/quantization/quantization_params_generation/power_of_two_selection.py +14 -4
  16. model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_computation.py +30 -3
  17. model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_weights_computation.py +17 -7
  18. model_compression_toolkit/core/common/quantization/quantization_params_generation/symmetric_selection.py +14 -3
  19. model_compression_toolkit/core/common/quantization/quantization_params_generation/uniform_selection.py +13 -3
  20. model_compression_toolkit/core/common/quantization/set_node_quantization_config.py +16 -3
  21. model_compression_toolkit/core/common/similarity_analyzer.py +16 -4
  22. model_compression_toolkit/core/common/substitutions/remove_identity.py +48 -0
  23. model_compression_toolkit/core/graph_prep_runner.py +10 -4
  24. model_compression_toolkit/core/keras/back2framework/keras_model_builder.py +4 -1
  25. model_compression_toolkit/core/keras/graph_substitutions/substitutions/batchnorm_folding.py +7 -7
  26. model_compression_toolkit/core/keras/graph_substitutions/substitutions/linear_collapsing.py +1 -1
  27. model_compression_toolkit/core/keras/graph_substitutions/substitutions/remove_identity.py +51 -0
  28. model_compression_toolkit/core/keras/graph_substitutions/substitutions/residual_collapsing.py +1 -1
  29. model_compression_toolkit/core/keras/keras_implementation.py +13 -11
  30. model_compression_toolkit/core/keras/keras_node_prior_info.py +4 -4
  31. model_compression_toolkit/core/keras/pruning/pruning_keras_implementation.py +4 -5
  32. model_compression_toolkit/core/keras/reader/common.py +2 -2
  33. model_compression_toolkit/core/keras/reader/node_builder.py +28 -9
  34. model_compression_toolkit/core/keras/tf_tensor_numpy.py +5 -2
  35. model_compression_toolkit/core/pytorch/back2framework/pytorch_model_builder.py +34 -21
  36. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/batchnorm_folding.py +8 -8
  37. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/const_holder_conv.py +2 -2
  38. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/linear_collapsing.py +1 -1
  39. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/relu_bound_to_power_of_2.py +4 -4
  40. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/remove_identity.py +50 -0
  41. model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/residual_collapsing.py +1 -1
  42. model_compression_toolkit/core/pytorch/pruning/pruning_pytorch_implementation.py +8 -8
  43. model_compression_toolkit/core/pytorch/pytorch_implementation.py +7 -6
  44. model_compression_toolkit/core/pytorch/pytorch_node_prior_info.py +2 -2
  45. model_compression_toolkit/core/quantization_prep_runner.py +6 -2
  46. model_compression_toolkit/core/runner.py +5 -2
  47. model_compression_toolkit/exporter/model_wrapper/keras/builder/fully_quantized_model_builder.py +5 -1
  48. model_compression_toolkit/exporter/model_wrapper/pytorch/builder/fully_quantized_model_builder.py +9 -2
  49. model_compression_toolkit/gptq/keras/quantization_facade.py +2 -1
  50. model_compression_toolkit/gptq/pytorch/quantization_facade.py +3 -1
  51. model_compression_toolkit/gptq/runner.py +1 -0
  52. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/latest/__init__.py +5 -5
  53. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py +1 -1
  54. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tp_model.py +20 -6
  55. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tpc_keras.py +1 -1
  56. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tp_model.py +22 -8
  57. model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tpc_keras.py +1 -1
  58. {mct_nightly-2.0.0.20240417.406.dist-info → mct_nightly-2.0.0.20240419.358.dist-info}/LICENSE.md +0 -0
  59. {mct_nightly-2.0.0.20240417.406.dist-info → mct_nightly-2.0.0.20240419.358.dist-info}/WHEEL +0 -0
  60. {mct_nightly-2.0.0.20240417.406.dist-info → mct_nightly-2.0.0.20240419.358.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mct-nightly
3
- Version: 2.0.0.20240417.406
3
+ Version: 2.0.0.20240419.358
4
4
  Summary: A Model Compression Toolkit for neural networks
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -1,13 +1,13 @@
1
- model_compression_toolkit/__init__.py,sha256=HSq5ybA5NctJln9ucs7HnIcj00pgOGdhjVxEY-2w5dY,1573
2
- model_compression_toolkit/constants.py,sha256=f9at1H_-vb5nvdHRmAHUco4ja4_QermK6yu0N9qbRGE,3723
1
+ model_compression_toolkit/__init__.py,sha256=Z7k-QRaYZPcLBEUjLrvduEEioZo1wiTlhZ9VQyP7PFk,1573
2
+ model_compression_toolkit/constants.py,sha256=yIJyJ-e1WrDeKD9kG15qkqfYnoj7J1J2CxnJDt008ik,3756
3
3
  model_compression_toolkit/defaultdict.py,sha256=LSc-sbZYXENMCw3U9F4GiXuv67IKpdn0Qm7Fr11jy-4,2277
4
4
  model_compression_toolkit/logger.py,sha256=3DByV41XHRR3kLTJNbpaMmikL8icd9e1N-nkQAY9oDk,4567
5
5
  model_compression_toolkit/metadata.py,sha256=IyoON37lBv3TI0rZGCP4K5t3oYI4TOmYy-LRXOwHGpE,1136
6
6
  model_compression_toolkit/core/__init__.py,sha256=TrRgkWpT1AN2Faw1M_1HXyJkJnbxfn9p-RigDZl7pg0,1982
7
7
  model_compression_toolkit/core/analyzer.py,sha256=X-2ZpkH1xdXnISnw1yJvXnvV-ssoUh-9LkLISSWNqiY,3691
8
- model_compression_toolkit/core/graph_prep_runner.py,sha256=Ftqm59hT5TGWmSNkY9bFZkVfCacpGyZfCe-6yZR5WY0,10100
9
- model_compression_toolkit/core/quantization_prep_runner.py,sha256=hFhDkS8GwzXZ7Ho_9qbbb8DAAWs3OONOfMSD5OU_b0o,6153
10
- model_compression_toolkit/core/runner.py,sha256=NKSC6ujfQPy6dKtJVwxyK2zNDd64eyR5csYy9lBrCPA,11836
8
+ model_compression_toolkit/core/graph_prep_runner.py,sha256=kM70wmNG3yMFiGQc0uO0wn9j4ZbSWxUEykpxDK55doc,10567
9
+ model_compression_toolkit/core/quantization_prep_runner.py,sha256=0ga95vh_ZXO79r8FB26L5GIZKHkG98wq1hMsNH1bIeU,6453
10
+ model_compression_toolkit/core/runner.py,sha256=E_gXj95Az3C3swsv7v1zeKZx25keWjnD30uhI7ONZkY,12028
11
11
  model_compression_toolkit/core/common/__init__.py,sha256=Wh127PbXcETZX_d1PQqZ71ETK3J9XO5A-HpadGUbj6o,1447
12
12
  model_compression_toolkit/core/common/base_substitutions.py,sha256=xDFSmVVs_iFSZfajytI0cuQaNRNcwHX3uqOoHgVUvxQ,1666
13
13
  model_compression_toolkit/core/common/framework_implementation.py,sha256=pOT9ZmRFL9FY92uUtigrO3sbWGiyVDhHAM1fbA4b5yo,20752
@@ -17,7 +17,7 @@ model_compression_toolkit/core/common/model_builder_mode.py,sha256=jll9-59OPaE3u
17
17
  model_compression_toolkit/core/common/model_collector.py,sha256=ofcepKtxc3j2Ouz6BpAKXTzPgjABnpRP47ndmJCXAkk,8352
18
18
  model_compression_toolkit/core/common/model_validation.py,sha256=LaG8wd6aZl0OJgieE3SeiVDEPxtk8IHq9-3wSnmWhY4,1214
19
19
  model_compression_toolkit/core/common/node_prior_info.py,sha256=WXX_PrGVG9M9I_REG5ZzFBohwmV4yf356sZnrja_FLo,2832
20
- model_compression_toolkit/core/common/similarity_analyzer.py,sha256=98l9ttnXHf6VYxBW4852h2CPJKg3A6nLOovpHn-tnKs,8560
20
+ model_compression_toolkit/core/common/similarity_analyzer.py,sha256=FikcIqgQQpfiXr9VJvgl-wk8OyH7-LvC8ku7TkhJfJM,9200
21
21
  model_compression_toolkit/core/common/user_info.py,sha256=dSRMnT-oewmdOziIpEuW-s9K7vTSeyUBxT4z9neXurI,1648
22
22
  model_compression_toolkit/core/common/back2framework/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
23
23
  model_compression_toolkit/core/common/back2framework/base_model_builder.py,sha256=V1oShKzbSkdcTvREn8VnQQBzvm-tTHkWMXqMkYozF2s,2023
@@ -30,10 +30,10 @@ model_compression_toolkit/core/common/collectors/statistics_collector.py,sha256=
30
30
  model_compression_toolkit/core/common/fusion/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
31
31
  model_compression_toolkit/core/common/fusion/layer_fusing.py,sha256=lOubqpc18TslhXZijWUJQAa1c3jIB2S-M-5HK78wJPQ,5548
32
32
  model_compression_toolkit/core/common/graph/__init__.py,sha256=Xr-Lt_qXMdrCnnOaUS_OJP_3iTTGfPCLf8_vSrQgCs0,773
33
- model_compression_toolkit/core/common/graph/base_graph.py,sha256=06mvCb_HHA5iIOdQ31a-nimhrpSA-jYnuV1Ir76QGa8,38259
34
- model_compression_toolkit/core/common/graph/base_node.py,sha256=jPYpf6sci8LswatxTyygD8ZM5OvsCnxBEWsSl-g64wI,28492
33
+ model_compression_toolkit/core/common/graph/base_graph.py,sha256=VKw50YwgGfyA7sdtEeU9qaSDnN31p4fHX1JVx7wNF9c,38265
34
+ model_compression_toolkit/core/common/graph/base_node.py,sha256=IaHrvgtUZvPshhUjS4j2lqIP22Mlny82BQZaL2iVJew,29079
35
35
  model_compression_toolkit/core/common/graph/edge.py,sha256=buoSEUZwilWBK3WeBKpJ-GeDaUA1SDdOHxDpxU_bGpk,3784
36
- model_compression_toolkit/core/common/graph/functional_node.py,sha256=RgwWAoMX7YV5c2gZdTBSX-ziTh3OLbebZXr3jitkxDs,3173
36
+ model_compression_toolkit/core/common/graph/functional_node.py,sha256=71_4TrCdqR_r0mtgxmAyqI05iP5YoQQGeSmDgynuzTw,3902
37
37
  model_compression_toolkit/core/common/graph/graph_matchers.py,sha256=CrDoHYq4iPaflgJWmoJ1K4ziLrRogJvFTVWg8P0UcDU,4744
38
38
  model_compression_toolkit/core/common/graph/graph_searches.py,sha256=2oKuW6L8hP-oL0lFO9PhQFt9fEFgVJwpc1u4fHExAtE,5128
39
39
  model_compression_toolkit/core/common/graph/virtual_activation_weights_node.py,sha256=3el-A7j1oyoo1_9zq3faQp7IeRsFXFCvnrb3zZFXpU0,9803
@@ -45,10 +45,10 @@ model_compression_toolkit/core/common/graph/memory_graph/max_cut_astar.py,sha256
45
45
  model_compression_toolkit/core/common/graph/memory_graph/memory_element.py,sha256=gRmBEFRmyJsNKezQfiwDwQu1cmbGd2wgKCRTH6iw8mw,3961
46
46
  model_compression_toolkit/core/common/graph/memory_graph/memory_graph.py,sha256=gw4av_rzn_3oEAPpD3B7PHZDqnxHMjIESevl6ppPnkk,7175
47
47
  model_compression_toolkit/core/common/hessian/__init__.py,sha256=bxPVbkIlHFJMiOgTdWMVCqcD9JKV5kb2bVdWUTeLpj8,1021
48
- model_compression_toolkit/core/common/hessian/hessian_info_service.py,sha256=8B-B5G_0ukNq6ICQNyMUuopSD8viWa72mUPXF3zFlFM,9721
48
+ model_compression_toolkit/core/common/hessian/hessian_info_service.py,sha256=wUmyekByJIMjupAb4qttVQHsv2pJ1ydDg17U8d5azWE,9660
49
49
  model_compression_toolkit/core/common/hessian/hessian_info_utils.py,sha256=FpXQvJmhiF6PAWX9M_0XZ2Qe8Wv8bXcv0Sj3si5YIjQ,1325
50
50
  model_compression_toolkit/core/common/hessian/trace_hessian_calculator.py,sha256=bWxavhwDrSHTQPQclUzzW_Q3FVgKEtwrnD7a9lmHNbo,4379
51
- model_compression_toolkit/core/common/hessian/trace_hessian_request.py,sha256=EvdZFWlpkN9pBqWZ7jReWHIN0FTUy-9x5KgAErXWwSw,3321
51
+ model_compression_toolkit/core/common/hessian/trace_hessian_request.py,sha256=lgZZgkpCURkMNaipFoRqwsONU74OWmMXSZvh4Dc4aMk,3251
52
52
  model_compression_toolkit/core/common/matchers/__init__.py,sha256=sw7LOPN1bM82o3SkMaklyH0jw-TLGK0-fl2Wq73rffI,697
53
53
  model_compression_toolkit/core/common/matchers/base_graph_filter.py,sha256=mTk54z0mIbFmPOb4h0xfLtLDookcFyNh8H0pIN5js_M,3091
54
54
  model_compression_toolkit/core/common/matchers/base_matcher.py,sha256=JCj-NLAXOJa-GcSX-94PVUTWjooQUd0NemiyNg5uKGQ,2210
@@ -78,7 +78,7 @@ model_compression_toolkit/core/common/mixed_precision/search_methods/linear_prog
78
78
  model_compression_toolkit/core/common/network_editors/__init__.py,sha256=vZmu55bYqiaOQs3AjfwWDXHmuKZcLHt-wm7uR5fPEqg,1307
79
79
  model_compression_toolkit/core/common/network_editors/actions.py,sha256=nid0_j-Cn10xvmztT8yCKW_6uA7JEnom9SW9syx7wc0,19594
80
80
  model_compression_toolkit/core/common/network_editors/edit_network.py,sha256=dfgawi-nB0ocAJ0xcGn9E-Zv203oUnQLuMiXpX8vTgA,1748
81
- model_compression_toolkit/core/common/network_editors/node_filters.py,sha256=uML5o4o80q4GaEG_D4ZXeb7ocsfuPeV0DRCWJK3HYXY,3149
81
+ model_compression_toolkit/core/common/network_editors/node_filters.py,sha256=Pc_MCohCIbibIKI8Sz8RuQjEAHn-vRZMpuWCCliMqFk,3236
82
82
  model_compression_toolkit/core/common/pruning/__init__.py,sha256=DGJybkDQtKMSMFoZ-nZ3ZifA8uJ6G_D20wHhKHNlmU0,699
83
83
  model_compression_toolkit/core/common/pruning/channels_grouping.py,sha256=4jsr1xEBNpV2c4ipi366IfHoHCJVqoRUTTOJdlRomvc,3892
84
84
  model_compression_toolkit/core/common/pruning/greedy_mask_calculator.py,sha256=cKcSkrQkTFm6Ns7Uq9IXWEMDPQfr9Ew9RvZXmr4p4cM,7928
@@ -101,24 +101,24 @@ model_compression_toolkit/core/common/quantization/candidate_node_quantization_c
101
101
  model_compression_toolkit/core/common/quantization/core_config.py,sha256=KYdyfSmjSL4ye24nKlC_c4_AxYb14qoqaeMnZj4-8kE,2257
102
102
  model_compression_toolkit/core/common/quantization/debug_config.py,sha256=HtkMmneN-EmAzgZK4Vp4M8Sqm5QKdrvNyyZMpaVqYzY,1482
103
103
  model_compression_toolkit/core/common/quantization/filter_nodes_candidates.py,sha256=fwF4VILaX-u3ZaFd81xjbJuhg8Ef-JX_KfMXW0TPV-I,7136
104
- model_compression_toolkit/core/common/quantization/node_quantization_config.py,sha256=TCgpvtfyzFUedv4sZ6sKzsTyikaVl2ixLj_aHPSC2r0,27014
105
- model_compression_toolkit/core/common/quantization/quantization_config.py,sha256=BieZDv9oc-Mc78S_LRMGo-s_2acbqiLE0ewaSE1v2VY,6818
104
+ model_compression_toolkit/core/common/quantization/node_quantization_config.py,sha256=q5e1XRIZc2APtdHRW_8bucoFqxaoc0srKWMUgYJ6dAM,26723
105
+ model_compression_toolkit/core/common/quantization/quantization_config.py,sha256=Y76BZ-X2vE_PXeM9r7D93VsFnbC_evoHhN7zYuvFdzw,7041
106
106
  model_compression_toolkit/core/common/quantization/quantization_fn_selection.py,sha256=T1nVWdRJfBQ_iuMQYQSIkjfkR-2n3lAOKGAz_rUZZN0,2190
107
107
  model_compression_toolkit/core/common/quantization/quantization_params_fn_selection.py,sha256=MwIOBZ4BlZSTIOG75PDvlI3JmZ6t8YjPc1VP9Adei60,3847
108
108
  model_compression_toolkit/core/common/quantization/quantize_graph_weights.py,sha256=N005MSvx8UypVpa7XrxNrB2G732n2wHj3RmLyjTgd3I,2728
109
109
  model_compression_toolkit/core/common/quantization/quantize_node.py,sha256=cdzGNWfT4MRogIU8ehs0tr3lVjnzAI-jeoS9b4TwVBo,2854
110
- model_compression_toolkit/core/common/quantization/set_node_quantization_config.py,sha256=9BEv2l0z2trDEsr40VB8tO3ToBA_b2sd_jH9uqZ5Wo8,11503
110
+ model_compression_toolkit/core/common/quantization/set_node_quantization_config.py,sha256=O4qFJw3nBYUD4cGbO8haGXZ2-piSqoRpDKDD74iXSxw,12417
111
111
  model_compression_toolkit/core/common/quantization/quantization_params_generation/__init__.py,sha256=eCDGwsWYLU6z7qbEVb4TozMW_nd5VEP_iCJ6PcvyEPw,1486
112
- model_compression_toolkit/core/common/quantization/quantization_params_generation/error_functions.py,sha256=TUJuSpX8pcsIPbJ6z_YGWgD_uafqlKRJcpsTIFpjMKU,19936
113
- model_compression_toolkit/core/common/quantization/quantization_params_generation/lut_kmeans_params.py,sha256=HSbAlDKXZMn8BtQQGL8TnlXvO2f_2oTLXAK1khraX7g,7410
112
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/error_functions.py,sha256=4x6rgQ5bCz2kysVkjBXxbb2dNEC9N1S2TE46kOFXU_c,23305
113
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/lut_kmeans_params.py,sha256=FWyOcjENAK-bFPpVjgczDiGAWZi--OgJ60jZjPUPqzo,8059
114
114
  model_compression_toolkit/core/common/quantization/quantization_params_generation/outlier_filter.py,sha256=9gnfJV89jpGwAx8ImJ5E9NjCv3lDtbyulP4OtgWb62M,1772
115
- model_compression_toolkit/core/common/quantization/quantization_params_generation/power_of_two_selection.py,sha256=BiwDqt5CeU6CW0Qusy3LwWhFtf2J9BvSuGMsTsG6rSw,8538
115
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/power_of_two_selection.py,sha256=ejc_obamUndJsv3F1FuOGMrIibS__qDUbAia1H9vwUM,9487
116
116
  model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_activations_computation.py,sha256=noEdvGiyyW7acgQ2OFWLedCODibTGYJifC9qo8YIU5U,4558
117
- model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_computation.py,sha256=H2D9rdChIviL_j0mF6zy8Qeu_ZXKRu-hLqckSAT1MR8,4352
117
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_computation.py,sha256=7ITrOw5ykncpHNghlPNTaDZExFYrPmhRck4oW0GaPe0,6213
118
118
  model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_search.py,sha256=7kt0JB8PQE0SW9kg8fCwZ5mBkHNgiRrn0of4ZQYQN2A,41524
119
- model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_weights_computation.py,sha256=nug6XgsywxYf57XF_Tnt2xwdf0zLLsajiZKEblo4lFc,3882
120
- model_compression_toolkit/core/common/quantization/quantization_params_generation/symmetric_selection.py,sha256=QtSAtdAb7sTgtoe9L6DnMFO7rjkOtpzE9kD9xmG7eYM,9743
121
- model_compression_toolkit/core/common/quantization/quantization_params_generation/uniform_selection.py,sha256=nsaM-AJ6WMUBT31jFIJ2wkYAiGM8qqm9lleMS8AwINI,7933
119
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/qparams_weights_computation.py,sha256=kAqVKZYu6FHWlC_PUiytsmXdTX1GzO_S5DWrTXuJBjs,4894
120
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/symmetric_selection.py,sha256=_ULwlPvzVL_UcYVlUPjDIeXz_99eW26l9FwGzaUu-_M,10789
121
+ model_compression_toolkit/core/common/quantization/quantization_params_generation/uniform_selection.py,sha256=VG0UqFOQk_7ALdJsUl1wwwFLjE38DxN6-NRZx161XiY,8902
122
122
  model_compression_toolkit/core/common/quantization/quantizers/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
123
123
  model_compression_toolkit/core/common/quantization/quantizers/lut_kmeans_quantizer.py,sha256=P0x_y18LypBxP2tV9OWizheYfILqvaMC8RwHo04sUpQ,2761
124
124
  model_compression_toolkit/core/common/quantization/quantizers/quantizers_helpers.py,sha256=CCFhi5LUIcHCCIzDyORvm0FDZLknrctdNwNlPphOQgI,14245
@@ -135,6 +135,7 @@ model_compression_toolkit/core/common/substitutions/batchnorm_reconstruction.py,
135
135
  model_compression_toolkit/core/common/substitutions/batchnorm_refusing.py,sha256=YqLKiO5gFBEvI6noAWeMME1JHaYUaGFMglVFg8AqGjc,10028
136
136
  model_compression_toolkit/core/common/substitutions/linear_collapsing.py,sha256=iEtzbWCDXP6EDkTZCtREQ0rpMxhQ2kM9zlcP_0KLq9I,12367
137
137
  model_compression_toolkit/core/common/substitutions/linear_collapsing_substitution.py,sha256=uoauhmncQqUBNvD-qCLIXsIbl_IzrbxSKdxiMig-5W4,2406
138
+ model_compression_toolkit/core/common/substitutions/remove_identity.py,sha256=LjkedR5fnXy4LCEQ7rnVTBI-cTkdDxXtufge5Llj2J0,2038
138
139
  model_compression_toolkit/core/common/substitutions/residual_collapsing.py,sha256=doErjlMq-uSObYMSjA6IywSHb3Hz3QCc0HKU68ccrQ4,4767
139
140
  model_compression_toolkit/core/common/substitutions/scale_equalization.py,sha256=p57u25qdW2pimxzGwgMXEBV4S-LzXuTVAlIM7830WfU,10966
140
141
  model_compression_toolkit/core/common/substitutions/shift_negative_activation.py,sha256=cyy4qnlD-v1Gou62oHNDsf1hWLWkYfcjVv1otFrUltY,29865
@@ -149,32 +150,33 @@ model_compression_toolkit/core/keras/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7V
149
150
  model_compression_toolkit/core/keras/constants.py,sha256=Uv3c0UdW55pIVQNW_1HQlgl-dHXREkltOLyzp8G1mTQ,3163
150
151
  model_compression_toolkit/core/keras/custom_layer_validation.py,sha256=f-b14wuiIgitBe7d0MmofYhDCTO3IhwJgwrh-Hq_t_U,1192
151
152
  model_compression_toolkit/core/keras/default_framework_info.py,sha256=Ha4HTHuiw_KTS5Po1Xnv6GyK9eprpDhYWf-eooS62Ys,4961
152
- model_compression_toolkit/core/keras/keras_implementation.py,sha256=RS2UEtZ_anZeDxz7Zv6sNv7v9tFVct6d9KVrUlxTGpo,29309
153
+ model_compression_toolkit/core/keras/keras_implementation.py,sha256=04vZfpSzDq8jwUlsT88FXp4ngTnTIxKVdIxiYWAwmbg,29673
153
154
  model_compression_toolkit/core/keras/keras_model_validation.py,sha256=1wNV2clFdC9BzIELRLSO2uKf0xqjLqlkTJudwtCeaJk,1722
154
- model_compression_toolkit/core/keras/keras_node_prior_info.py,sha256=Aqh31wOPaiZcJIOm-uJwzev0eTMdJyXaOk97rs4z7BU,3879
155
+ model_compression_toolkit/core/keras/keras_node_prior_info.py,sha256=TIqazcbeoMxZgneQ-i24myCPyBpy_RJ7GcDxxWHbb4U,3907
155
156
  model_compression_toolkit/core/keras/resource_utilization_data_facade.py,sha256=Xmk2ZL5CaYdb7iG62HdtZ1F64vap7ffnrsuR3e3G5hc,4851
156
- model_compression_toolkit/core/keras/tf_tensor_numpy.py,sha256=7Qkgz8ON04FMaHJlSZ5Wp5peWuc0MoT1f_MpUHIGeHo,2491
157
+ model_compression_toolkit/core/keras/tf_tensor_numpy.py,sha256=moMFP7hOagAbd09bWa2AX5uxN7XOJqLB-mV3mA30kLQ,2651
157
158
  model_compression_toolkit/core/keras/back2framework/__init__.py,sha256=rhIiXg_nBgUZ-baE3M6SzCuQbcnq4iebY1jtJBvKHOM,808
158
159
  model_compression_toolkit/core/keras/back2framework/factory_model_builder.py,sha256=urpfyHvIzD08QzPBWusVBT_dKZ8ZUf1I1zIQNb4qe5Y,2233
159
160
  model_compression_toolkit/core/keras/back2framework/float_model_builder.py,sha256=9SFHhX-JnkB8PvYIIHRYlReBDI_RkZY9LditzW_ElLk,2444
160
161
  model_compression_toolkit/core/keras/back2framework/instance_builder.py,sha256=fBj13c6zkVoWX4JJG18_uXPptiEJqXClE_zFbaFB6Q8,4517
161
- model_compression_toolkit/core/keras/back2framework/keras_model_builder.py,sha256=ghRSEvJOVkmq5RJQ-Xg4PS9umWLx0UyWFOCTAICrTTQ,16001
162
+ model_compression_toolkit/core/keras/back2framework/keras_model_builder.py,sha256=7xEasszjyqbkv5UJuBfEr2kxRPtcrdNP26ivELoIVI4,16227
162
163
  model_compression_toolkit/core/keras/back2framework/mixed_precision_model_builder.py,sha256=psJzQJ_Hv_wyHuXZotN5dopwoKIu87-xnaILfINWXf0,15567
163
164
  model_compression_toolkit/core/keras/back2framework/quantized_model_builder.py,sha256=5wFb4nx_F0Wu4c8pLf6n6OzxOHtpOJ6_3mQsNSXIudU,2481
164
165
  model_compression_toolkit/core/keras/graph_substitutions/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
165
166
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
166
167
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/activation_decomposition.py,sha256=3FVqVfEeEve8vRejmMex079HZDnoRsF21kNY53ZjIM8,5140
167
- model_compression_toolkit/core/keras/graph_substitutions/substitutions/batchnorm_folding.py,sha256=9YCNPiK5BD7tLs1meabPhzfb2VsyPxrZM17zMFsW_Fo,8158
168
+ model_compression_toolkit/core/keras/graph_substitutions/substitutions/batchnorm_folding.py,sha256=Oe2QNsU49rp6qW1jUuOG_fKrE3DqXXDmVWN0fiyWo4c,8207
168
169
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/batchnorm_reconstruction.py,sha256=GR1a3mCZpNUu4WxixJXF_aSm57phAdxaRoHecNx3hxw,3168
169
170
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/batchnorm_refusing.py,sha256=5df_xGfXkqNub4xVRnCWQvSohWqdv12axjJ6edVU2H0,2478
170
171
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/concat_threshold_update.py,sha256=Hl4LEQ_bw_Vpmf3ZqHujYUqVdvTNsPlEMvr9dZhwg2U,2806
171
172
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/dwconv_to_conv.py,sha256=R3U7cjc2E0zheMem16GHygp5jZFGSaomkNOTxTjcAgw,5794
172
173
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/input_scaling.py,sha256=V6hp67CkS_A3WqdsjLjs0ETtdZAOo4P9mhy4aT7W5FE,5940
173
- model_compression_toolkit/core/keras/graph_substitutions/substitutions/linear_collapsing.py,sha256=dyhqZrxSTclXyarT2JYnI5WPX0OvWR_CQiwddIr632U,8143
174
+ model_compression_toolkit/core/keras/graph_substitutions/substitutions/linear_collapsing.py,sha256=CjBbw20BcD9NFBftc9d28TYLmBI9wUzjfZ33c22hgHU,8157
174
175
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/matmul_substitution.py,sha256=kjwlKtm5yhNgWVVcW6mN-hn7enwAnn_8-TUZvxZBiQs,4112
175
176
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/multi_head_attention_decomposition.py,sha256=l9PUREBf4aRwWILiybdteveeUbh7js-i-hLt8Ma0e4c,26771
176
177
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/relu_bound_to_power_of_2.py,sha256=IdKOg6AWZWMcmDbOuNdxetS5_zTarXIIffdYL7JTdvk,3872
177
- model_compression_toolkit/core/keras/graph_substitutions/substitutions/residual_collapsing.py,sha256=gSqUYh76tP7NcZfqFSnuPIrUpyBh6UjjcPJtJxZtOZk,3181
178
+ model_compression_toolkit/core/keras/graph_substitutions/substitutions/remove_identity.py,sha256=z2J2Xk7b_w_fEgJmK87lwwBmEoAZpGxPmsBrR24IkZs,2035
179
+ model_compression_toolkit/core/keras/graph_substitutions/substitutions/residual_collapsing.py,sha256=MdRl2CLF_EsjHcpqa_kzgD7gKZI1kM4E1qDLarCH9Cw,3188
178
180
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/scale_equalization.py,sha256=ryes9y1ie-vjBGso2TeO4EXxVk69Ew3iSAhshPz1Ou4,5542
179
181
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/separableconv_decomposition.py,sha256=TEaHlIbXj_ZjIdT5TmAICD3WLD3u_7g0fLWQcNzTJuM,7941
180
182
  model_compression_toolkit/core/keras/graph_substitutions/substitutions/shift_negative_activation.py,sha256=JCK--hQMKzbx4MOQZBPZqK015JWZELUO5YdA30IU4bI,11149
@@ -189,15 +191,15 @@ model_compression_toolkit/core/keras/mixed_precision/__init__.py,sha256=sw7LOPN1
189
191
  model_compression_toolkit/core/keras/mixed_precision/configurable_activation_quantizer.py,sha256=aW8wR13fK6P6xzbU9XGU60IO1yYzXSo_Hk4qeq486kg,5137
190
192
  model_compression_toolkit/core/keras/mixed_precision/configurable_weights_quantizer.py,sha256=Ziydik2j-LvNBXP3TSfUD6rEezPAikzQGib0_IXkmGM,6729
191
193
  model_compression_toolkit/core/keras/pruning/__init__.py,sha256=3Lkr37Exk9u8811hw8hVqkGcbTQGcLjd3LLuLC3fa_E,698
192
- model_compression_toolkit/core/keras/pruning/pruning_keras_implementation.py,sha256=WEa_ihS2umfj0dv0I0RWzFwmrtQVF2M8a80BjY4b1fs,12710
194
+ model_compression_toolkit/core/keras/pruning/pruning_keras_implementation.py,sha256=EJkblZ4OAjI5l29GKsUraam5Jn58Sogld47_rFFyr3k,12777
193
195
  model_compression_toolkit/core/keras/quantizer/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
194
196
  model_compression_toolkit/core/keras/quantizer/base_quantizer.py,sha256=eMRjAUU189-AVwNGMlV0M-ZlL48ZYmILzutheUT00xU,1628
195
197
  model_compression_toolkit/core/keras/quantizer/fake_quant_builder.py,sha256=ymBSCN7IeJnS305fpVO866WJxW456yV8cZAD4kMD308,6274
196
198
  model_compression_toolkit/core/keras/quantizer/lut_fake_quant.py,sha256=Up3-sbuAcaJ6kfe7Sz3XN6iiJ9hlxzOMncLCFEXJFjk,4475
197
199
  model_compression_toolkit/core/keras/reader/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
198
- model_compression_toolkit/core/keras/reader/common.py,sha256=RFrj_gprrhRKnrO8I5bDMuq4JJypumDz2bUHb3lcPqU,2484
200
+ model_compression_toolkit/core/keras/reader/common.py,sha256=lVy_dRfIfx4mrijdh8HO9HAx4Jq7QyLY9VGB6dxwDx8,2518
199
201
  model_compression_toolkit/core/keras/reader/connectivity_handler.py,sha256=AgF6qXZOJMeXvc-pBnGY23BJz7wPBx2aTYxHiO8efec,11303
200
- model_compression_toolkit/core/keras/reader/node_builder.py,sha256=B-MQe-DqDgWsvY1TI7HNI28dmJ5p6AVGJmd9L5qjIv4,9666
202
+ model_compression_toolkit/core/keras/reader/node_builder.py,sha256=URmE3lM9CskS-9a3TuqfReLdHh36Dti08RL8qxzrBjc,10471
201
203
  model_compression_toolkit/core/keras/reader/reader.py,sha256=wS9UQ2wJKnkZYe9JHwQp7ygDr6CRlzrxmIyLDv1Qz6U,8109
202
204
  model_compression_toolkit/core/keras/reader/nested_model/__init__.py,sha256=mjbqLD-KcG3eNeCYpu1GBS7VclGVOQ63x2p6mAAuba4,698
203
205
  model_compression_toolkit/core/keras/reader/nested_model/edges_merger.py,sha256=K6KAH9o8KSG6baLmhKoCrYK-i-wb6gRKiZmoijFqEYA,7906
@@ -211,8 +213,8 @@ model_compression_toolkit/core/pytorch/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKW
211
213
  model_compression_toolkit/core/pytorch/constants.py,sha256=NI-J7REuxn06oEIHsmJ4GqtNC3TbV8xlkJjt5Ar-c4U,2626
212
214
  model_compression_toolkit/core/pytorch/default_framework_info.py,sha256=r1XyzUFvrjGcJHQM5ETLsMZIG2yHCr9HMjqf0ti9inw,4175
213
215
  model_compression_toolkit/core/pytorch/pytorch_device_config.py,sha256=IoMvTch5awAEPvB6Tg6ANhFGXvfSgv7JLsUBlxpMwk4,4330
214
- model_compression_toolkit/core/pytorch/pytorch_implementation.py,sha256=mT4jd8E1saCpAgrsClufQbnVJ0eYn1xaTQ3teALu4jk,27117
215
- model_compression_toolkit/core/pytorch/pytorch_node_prior_info.py,sha256=n_B4a6FMwM9D2w8kzy3oenBWZgXNZuIZgTJC6JEuTy0,3250
216
+ model_compression_toolkit/core/pytorch/pytorch_implementation.py,sha256=sEtlxpWdt0rzuTN3R0bNCC_l75Xy7rIBMUWY7LuhYKI,27351
217
+ model_compression_toolkit/core/pytorch/pytorch_node_prior_info.py,sha256=2LDQ7qupglHQ7o1Am7LWdfYVacfQnl-aW2N6l9det1w,3264
216
218
  model_compression_toolkit/core/pytorch/resource_utilization_data_facade.py,sha256=E6ifk1HdO60k4IRH2EFBzAYWtwUlrGqJoQ66nknpHoQ,4983
217
219
  model_compression_toolkit/core/pytorch/utils.py,sha256=dRPiteBg2dBNsHwZyYzXiCIAjnelSoeZZsDXlsTw5JQ,2880
218
220
  model_compression_toolkit/core/pytorch/back2framework/__init__.py,sha256=H_WixgN0elVWf3exgGYsi58imPoYDj5eYPeh6x4yfug,813
@@ -220,26 +222,27 @@ model_compression_toolkit/core/pytorch/back2framework/factory_model_builder.py,s
220
222
  model_compression_toolkit/core/pytorch/back2framework/float_model_builder.py,sha256=tLrlUyYhxVKVjkad1ZAtbRra0HedB3iVfIkZ_dYnQ-4,3419
221
223
  model_compression_toolkit/core/pytorch/back2framework/instance_builder.py,sha256=BxX0e6kKoV29UNT-Yee28f7rXID5_KBz1RiSDYo2Vjk,1848
222
224
  model_compression_toolkit/core/pytorch/back2framework/mixed_precision_model_builder.py,sha256=D7lU1r9Uq_7fdNuKk2BMF8ho5GrsY-8gyGN6yYoHaVg,15060
223
- model_compression_toolkit/core/pytorch/back2framework/pytorch_model_builder.py,sha256=mwlZJhiWbtRQYbc8LNBLp4TbpV6hX3tB4atZkBf0uAM,17443
225
+ model_compression_toolkit/core/pytorch/back2framework/pytorch_model_builder.py,sha256=i0U4EQfaTbbBHMrv9oJHJ5ltybfGTGz17KETnNpci3k,18299
224
226
  model_compression_toolkit/core/pytorch/back2framework/quantized_model_builder.py,sha256=qZNNOlNTTV4ZKPG3q5GDXkIVTPUEr8dvxAS_YiMORmg,3456
225
227
  model_compression_toolkit/core/pytorch/back2framework/quantization_wrapper/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
226
228
  model_compression_toolkit/core/pytorch/back2framework/quantization_wrapper/quantized_layer_wrapper.py,sha256=q2JDw10NKng50ee2i9faGzWZ-IydnR2aOMGSn9RoZmc,5773
227
229
  model_compression_toolkit/core/pytorch/back2framework/quantization_wrapper/wrapper_quantize_config.py,sha256=F2hH2nbFQHtuS8CcG2GmNYfJ9gdrpHccnijHsX_CYgM,1640
228
230
  model_compression_toolkit/core/pytorch/graph_substitutions/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
229
231
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
230
- model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/batchnorm_folding.py,sha256=j3q5DzbH3ys5MPFfSOVnAXdD7-g4XEKj2ADrdihVr30,8292
232
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/batchnorm_folding.py,sha256=tWlGdjQxkcIokoIIhYhzAFniyJWtw6bVlSjxAFjZyww,8360
231
233
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/batchnorm_reconstruction.py,sha256=B7aC2TZNrQJ2oQVGBFhKAVqdUU5lYVJSMmwKhjxOHWk,2822
232
234
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/batchnorm_refusing.py,sha256=JDWOaNwYrZG0zTwd3HwoZUM3tKu7zPbzLOrqNQsu8xA,2162
233
235
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/concat_threshold_update.py,sha256=SBrR24ZAnWPftLinv4FuIqdBGjfYtfXbYQJN5mgy5V4,2861
234
- model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/const_holder_conv.py,sha256=dYGyb5ebnoeFBF0EaHPQU7CkXvoARdznEEe0laM47LA,3919
236
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/const_holder_conv.py,sha256=Fs2YQBD4KJV-pGLOMqm-p485bfq2JDYgCzFroRljCoM,3933
235
237
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/functional_batch_norm.py,sha256=iX8bLHtw2osP42-peNLTRmbpX3cUxdGsAbEfw7NLpx0,3935
236
238
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/functional_layer_norm.py,sha256=zKSgtVw_P9fUvdq4e7P9yaLDPG_vZ0cecM9sVPtm1ns,3799
237
- model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/linear_collapsing.py,sha256=7vLh0yEOCua3ck7a3Rf8gi1XAwS_O4V-0uNL_21c3Kw,5815
239
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/linear_collapsing.py,sha256=8KtuyqKgu7VTk6zffTmIteZ5Eq90ffPXgYWqca0NZj0,5829
238
240
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/multi_head_attention_decomposition.py,sha256=VNg-VgzCxSyqy2J3neEPl6U0SPO8UIVU_T47bGhz4FE,38459
239
241
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/permute_call_method.py,sha256=EMCviyFyJFLEKuAUz3rZHLfB9MAU1kywSBL2XQNzLlg,1953
240
- model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/relu_bound_to_power_of_2.py,sha256=9tI14dWDQkTCgLwVZdqmHxEek5KgYPL3x5fnJWWq7bg,5667
242
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/relu_bound_to_power_of_2.py,sha256=q1a3HieQtaOmWG2WGXp6GHYAvxa3CZ9dJUx9dqMAsS8,5695
243
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/remove_identity.py,sha256=joHjwiUxccypMHkTy46rI91VyapLn9yJ2YRo5ISnOH4,1987
241
244
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/reshape_with_static_shapes.py,sha256=jOqlelGhADEZiYUEyYj9oJZ5YLXx8jWNUlVTG6Td79Y,4919
242
- model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/residual_collapsing.py,sha256=dwRy3ZZ0qShBEQLknkYUVPtgZsk6rjJ4IXf553mcch8,2902
245
+ model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/residual_collapsing.py,sha256=flHJU-hSvih3bi8c24SYArqN00UnOVImu8HZBZAzzVo,2909
243
246
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/scale_equalization.py,sha256=XFtU9yuBmoZlX0f0mS6otMPWMk-RcWs94XdvvTNhW8Y,3303
244
247
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/shift_negative_activation.py,sha256=lOPl5zDU3FoR9WmlxO04Pfi65MimK0gmnuHzQJodQdY,10668
245
248
  model_compression_toolkit/core/pytorch/graph_substitutions/substitutions/softmax_shift.py,sha256=05lV4pIL3hJkZl4JQPV4wk_EFD0eYLG5b8cdzvZk4P8,1588
@@ -253,7 +256,7 @@ model_compression_toolkit/core/pytorch/mixed_precision/__init__.py,sha256=Rf1RcY
253
256
  model_compression_toolkit/core/pytorch/mixed_precision/configurable_activation_quantizer.py,sha256=-6oep2WJ85-JmIxZa-e2AmBpbORoKe4Xdduz2ZidwvM,4871
254
257
  model_compression_toolkit/core/pytorch/mixed_precision/configurable_weights_quantizer.py,sha256=KVZTKCYzJqqzF5nFEiuGMv_sNeVuBTxhmxWMFacKOxE,6337
255
258
  model_compression_toolkit/core/pytorch/pruning/__init__.py,sha256=RAe8mgIr1V8dRIQtLf_dSG5zTUCKuQzxyybYx1dzEAs,697
256
- model_compression_toolkit/core/pytorch/pruning/pruning_pytorch_implementation.py,sha256=0X-f4x_fQpIzqsL9e7aIj5lBwqiAFMbKc7mRaPAcLiE,14648
259
+ model_compression_toolkit/core/pytorch/pruning/pruning_pytorch_implementation.py,sha256=VfEEVwWEXKpVlZFnr7N6mvEjcpq85ROLg05ZvXfD1Pg,14764
257
260
  model_compression_toolkit/core/pytorch/quantizer/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
258
261
  model_compression_toolkit/core/pytorch/quantizer/fake_quant_builder.py,sha256=rox-f5wbRyxU1UHeHyaoIDXB9r9fCXm1dPN4FVwHqTc,6464
259
262
  model_compression_toolkit/core/pytorch/quantizer/lut_fake_quant.py,sha256=uyeBtNokyDUikk-YkDP_mN_2DX0J5oPm3kSfdSUT2Ck,4420
@@ -321,15 +324,15 @@ model_compression_toolkit/exporter/model_wrapper/fw_agnostic/get_inferable_quant
321
324
  model_compression_toolkit/exporter/model_wrapper/keras/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
322
325
  model_compression_toolkit/exporter/model_wrapper/keras/validate_layer.py,sha256=YffgbVYJG5LKeIsW84Pi7NqzQcvJMeQRnAKQCCmIL6c,3776
323
326
  model_compression_toolkit/exporter/model_wrapper/keras/builder/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
324
- model_compression_toolkit/exporter/model_wrapper/keras/builder/fully_quantized_model_builder.py,sha256=k3UrGAw6vKTmZ-oO1lv0VqK3IpAiet9jlIHyEIoL2u0,5132
327
+ model_compression_toolkit/exporter/model_wrapper/keras/builder/fully_quantized_model_builder.py,sha256=T2wgd7b86cpA5Ffq5eVCb8YlmnJ7vDxtmFeRkZtpLZc,5422
325
328
  model_compression_toolkit/exporter/model_wrapper/keras/builder/node_to_quantizer.py,sha256=uL6tJWC4s2IWUy8GJVwtMWpwZZioRRztfKyPJHo14xI,9442
326
329
  model_compression_toolkit/exporter/model_wrapper/pytorch/__init__.py,sha256=Rf1RcYmelmdZmBV5qOKvKWF575ofc06JFQSq83Jz99A,696
327
330
  model_compression_toolkit/exporter/model_wrapper/pytorch/validate_layer.py,sha256=uTQcnzvP44CgPO0twsUdiMmTBE_Td6ZdQtz5U0GZuPI,3464
328
331
  model_compression_toolkit/exporter/model_wrapper/pytorch/builder/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
329
- model_compression_toolkit/exporter/model_wrapper/pytorch/builder/fully_quantized_model_builder.py,sha256=D_mEUK1sb4kY5946oErfw3RC5mfBTVaw3LZRIKWYKcE,4918
332
+ model_compression_toolkit/exporter/model_wrapper/pytorch/builder/fully_quantized_model_builder.py,sha256=YT9IVdpKaJbAW3msYRoQNIgqRSEVwSarRy6qlWCrBfk,5389
330
333
  model_compression_toolkit/exporter/model_wrapper/pytorch/builder/node_to_quantizer.py,sha256=4sN5z-6BXrTE5Dp2FX_jKO9ty5iZ2r4RM7XvXtDVLSI,9348
331
334
  model_compression_toolkit/gptq/__init__.py,sha256=YKg-tMj9D4Yd0xW9VRD5EN1J5JrmlRbNEF2fOSgodqA,1228
332
- model_compression_toolkit/gptq/runner.py,sha256=MIg-oBtR1nbHkexySdCJD_XfjRoHSknLotmGBMuD5qM,5924
335
+ model_compression_toolkit/gptq/runner.py,sha256=PQoLK3WhdRuUwZMd1VbtA7KZ9c-zWig_0ShmTtvJSHY,5970
333
336
  model_compression_toolkit/gptq/common/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
334
337
  model_compression_toolkit/gptq/common/gptq_config.py,sha256=6xP99B-lK1bwGv3AdqxnW1V51z2VdzQcjvoSgJOmygA,5288
335
338
  model_compression_toolkit/gptq/common/gptq_constants.py,sha256=QSm6laLkIV0LYmU0BLtmKp3Fi3SqDfbncFQWOGA1cGU,611
@@ -341,7 +344,7 @@ model_compression_toolkit/gptq/keras/gptq_keras_implementation.py,sha256=axBwnCS
341
344
  model_compression_toolkit/gptq/keras/gptq_loss.py,sha256=rbRkF15MYd6nq4G49kcjb_dPTa-XNq9cTkrb93mXawo,6241
342
345
  model_compression_toolkit/gptq/keras/gptq_training.py,sha256=zyVcEQzdnNsrIz32U1pqqoi08hzxRdJ2CumaPFGwbDM,19123
343
346
  model_compression_toolkit/gptq/keras/graph_info.py,sha256=5IvgGlJlgOmQYmldjdCBv7tuzAoY0HazatG5Pedrg0Q,4639
344
- model_compression_toolkit/gptq/keras/quantization_facade.py,sha256=CCV9uyaq-qUGDeXL5OgEWFXSiUkerXrNwFVyA1brrKM,14663
347
+ model_compression_toolkit/gptq/keras/quantization_facade.py,sha256=L5yqjkzw_oszL--dV9EjGoXUYmqM9GmDP7kS7_k96xw,14748
345
348
  model_compression_toolkit/gptq/keras/quantizer/__init__.py,sha256=-DK1CDXvlsnEbki4lukZLpl6Xrbo91_jcqxXlG5Eg6Q,963
346
349
  model_compression_toolkit/gptq/keras/quantizer/base_keras_gptq_quantizer.py,sha256=2YU-x4-Q5f6hkUJf0tw6vcwdNwRMHdefrFjhhyHYsvA,4782
347
350
  model_compression_toolkit/gptq/keras/quantizer/quant_utils.py,sha256=Vt7Qb8i4JsE4sFtcjpfM4FTXTtfV1t6SwfoNH8a_Iaw,5055
@@ -358,7 +361,7 @@ model_compression_toolkit/gptq/pytorch/gptq_loss.py,sha256=kDuWw-6zh17wZpYWh4Xa9
358
361
  model_compression_toolkit/gptq/pytorch/gptq_pytorch_implementation.py,sha256=tECPTavxn8EEwgLaP2zvxdJH6Vg9jC0YOIMJ7857Sdc,1268
359
362
  model_compression_toolkit/gptq/pytorch/gptq_training.py,sha256=xkDa62AdIRwv8dEshffALW9Ri66eseEpyUF9taMUKns,16509
360
363
  model_compression_toolkit/gptq/pytorch/graph_info.py,sha256=yXJzDd24zfGs2_vfMovxD1WSh1RxXoPxN4GztOf3P5c,3967
361
- model_compression_toolkit/gptq/pytorch/quantization_facade.py,sha256=iBLEbLgde6JQNPhJysfT2rl_Sc7-wyoIZnXRAXQWnR0,13065
364
+ model_compression_toolkit/gptq/pytorch/quantization_facade.py,sha256=bZvrMKN2jFJH9fodtbCCAtKNVXIvlOAnIaxcGov320o,13154
362
365
  model_compression_toolkit/gptq/pytorch/quantizer/__init__.py,sha256=ZHNHo1yzye44m9_ht4UUZfTpK01RiVR3Tr74-vtnOGI,968
363
366
  model_compression_toolkit/gptq/pytorch/quantizer/base_pytorch_gptq_quantizer.py,sha256=TCA1hAc7raPnrjl06sjFtVM4XUtLtuwAhCGX4U3KGZo,4137
364
367
  model_compression_toolkit/gptq/pytorch/quantizer/quant_utils.py,sha256=OocYYRqvl7rZ37QT0hTzfJnWGiNCPskg7cziTlR7TRk,3893
@@ -429,13 +432,13 @@ model_compression_toolkit/target_platform_capabilities/tpc_models/__init__.py,sh
429
432
  model_compression_toolkit/target_platform_capabilities/tpc_models/get_target_platform_capabilities.py,sha256=aHoAu5Iye9YVn2HLwNb4X9cUDX1WJt20R5GsNGIAk9E,3337
430
433
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/__init__.py,sha256=lNJ29DYxaLUPDstRDA1PGI5r9Fulq_hvrZMlhst1Z5g,697
431
434
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/target_platform_capabilities.py,sha256=fPOzybGECCWPkAD1hmJryWZrf9vd5Od-UOH6PE0lH94,3820
432
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/latest/__init__.py,sha256=v1eush7kGZ_Pdl8iyIVkKIqCmix2afiuPZDMgm6kBrE,1522
435
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/latest/__init__.py,sha256=F5RG4MnuAwKcNXbfVbPFLQu30-lNax-7knqu20B6udQ,1522
433
436
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/__init__.py,sha256=1mMOREEMoNHu_KTMGDp4crN61opKWX6aFn1DrDLvqcc,717
434
437
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tp_model.py,sha256=S-GwMI-JiuPpbtOdd6TSOEjiUFiIs6M2RAiJNJ3O950,10883
435
438
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tpc_keras.py,sha256=bPBWxopMUHFgiaJjaAfoompwShvfH2wHAouN56PQn0A,6484
436
439
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tpc_pytorch.py,sha256=iCBfBmIRozoeGVPC3MjZpVyp-Nx4fC94_PKILC82K-Y,5731
437
440
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/__init__.py,sha256=vFDyiMymNZSRCdTgAyWn4A-tZD3vzze_PTLBSF2OYe8,721
438
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py,sha256=i9pRGgMdsY8pzV1Dj0Qzg4mcSyIokQzm0lbLzLhkVaM,10616
441
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py,sha256=InFx2Uh6dG30U9YIvVH_1jb34r1wJw7ms3J295lRKvM,10619
439
442
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tpc_keras.py,sha256=bU74t-ZIkIptXuNaPI_YIC5w9TX6nDgJUpJwxHAPOSI,6493
440
443
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tpc_pytorch.py,sha256=09fbd5vEnSQDWfCkMRtYZYy7kIYiWkXDcH_dT1cAmoY,5739
441
444
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/__init__.py,sha256=NUuczImqUxzdfflqSdqkeAN8aCU6Tuiu6U0Fnj9Tzmw,721
@@ -443,12 +446,12 @@ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_
443
446
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tpc_keras.py,sha256=NkAGCZbSgXYeRAiJRzt19h2cxkrVQJaHu8-2jHZLOYg,6505
444
447
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tpc_pytorch.py,sha256=X853xDEF-3rcPoqxbrlYN28vvW3buSdM36c_eN_LKx8,5758
445
448
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/__init__.py,sha256=vKWAoQ2KkhuptS5HZB50zHG6KY8wHpHTxPugw_nGCRo,717
446
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tp_model.py,sha256=8FZjOCaQRwrQLbtmzNrrRj2-VyZMUGzsIWKIDpGVEoQ,10947
447
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tpc_keras.py,sha256=QVIOc_DrFHBb81q3N8Fmx5GkOBviWsulxEwHpsyFik4,6570
449
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tp_model.py,sha256=9LWG0GjFdtxdCbng8P6lCCqCKt8ou0Jb3VuH62a2HUQ,12037
450
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tpc_keras.py,sha256=U5lYwk6vJkRt5fo5v_1_h5POTwf9zfia1XQ_cDoOZAI,6587
448
451
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tpc_pytorch.py,sha256=jAyTXhcChO124odtWC3bYKRH4ZyqLPkKQluJFOoyPIM,5726
449
452
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/__init__.py,sha256=wUk4Xsg7jpxOWYjq2K3WUwLcI185p_sVPK-ttG0ydhA,721
450
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tp_model.py,sha256=T6Hp_Rk15SAz22g_SWDyHJecBpBAjxKt3ezuVEYf4LE,10680
451
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tpc_keras.py,sha256=n9HA61-bFm8g0rals9aTvH7i09EU4B788nymFofLwkw,6578
453
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tp_model.py,sha256=GBKLH6RfwSVIyvtFZ83BkbJOYu4MBcg5-n5_9MsE9TU,11770
454
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tpc_keras.py,sha256=6PVKQKGpJpM2B1qvmf6fID_-MACaSQZkaL_9J_fj2SQ,6595
452
455
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tpc_pytorch.py,sha256=dFQjzFlLDwoUqKNP1at1fS1N1WJadSSasRyzHl6vaB8,5733
453
456
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
454
457
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/target_platform_capabilities.py,sha256=lnhJcwvTF0t7ybeiTleIS1p0aD8xzFZxVPx4ISk5uWQ,2090
@@ -480,8 +483,8 @@ model_compression_toolkit/trainable_infrastructure/keras/quantize_wrapper.py,sha
480
483
  model_compression_toolkit/trainable_infrastructure/keras/quantizer_utils.py,sha256=MVwXNymmFRB2NXIBx4e2mdJ1RfoHxRPYRgjb1MQP5kY,1797
481
484
  model_compression_toolkit/trainable_infrastructure/pytorch/__init__.py,sha256=huHoBUcKNB6BnY6YaUCcFvdyBtBI172ZoUD8ZYeNc6o,696
482
485
  model_compression_toolkit/trainable_infrastructure/pytorch/base_pytorch_quantizer.py,sha256=7bbzqJN8ZAycVDvZr_5xC-niTAR5df8f03Kooev_pfg,3047
483
- mct_nightly-2.0.0.20240417.406.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
484
- mct_nightly-2.0.0.20240417.406.dist-info/METADATA,sha256=wDYGNbzlScIweXxmrfcYA9RSLM_OaB2fYaIsx28fm-Y,18795
485
- mct_nightly-2.0.0.20240417.406.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
486
- mct_nightly-2.0.0.20240417.406.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
487
- mct_nightly-2.0.0.20240417.406.dist-info/RECORD,,
486
+ mct_nightly-2.0.0.20240419.358.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
487
+ mct_nightly-2.0.0.20240419.358.dist-info/METADATA,sha256=uV2pmWXST6Ex8kXxTv99ak6eArTAmCbkX4zXWfJpVbY,18795
488
+ mct_nightly-2.0.0.20240419.358.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
489
+ mct_nightly-2.0.0.20240419.358.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
490
+ mct_nightly-2.0.0.20240419.358.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.0.0.20240417.000406"
30
+ __version__ = "2.0.0.20240419.000358"
@@ -97,6 +97,8 @@ UPPER_FACTOR = 1.2
97
97
  DEC_RANGE_BOTTOM = 0.97
98
98
  DEC_RANGE_UPPER = 1.03
99
99
 
100
+ NUM_QPARAM_HESSIAN_SAMPLES = 16
101
+
100
102
  # Resource utilization computation parameters
101
103
  BITS_TO_BYTES = 8.0
102
104
 
@@ -98,8 +98,8 @@ class Graph(nx.MultiDiGraph, GraphSearches):
98
98
  tpc_layers = tpc.op_sets_to_layers.get_layers()
99
99
  tpc_filtered_layers = [layer for layer in tpc_layers if isinstance(layer, LayerFilterParams)]
100
100
  for n in self.nodes:
101
- is_node_in_tpc = n.type in tpc_layers or any([n.is_match_filter_params(filtered_layer)
102
- for filtered_layer in tpc_filtered_layers])
101
+ is_node_in_tpc = any([n.is_match_type(_type) for _type in tpc_layers]) or \
102
+ any([n.is_match_filter_params(filtered_layer) for filtered_layer in tpc_filtered_layers])
103
103
  if n.is_custom:
104
104
  if not is_node_in_tpc:
105
105
  Logger.critical(f'MCT does not support optimizing Keras custom layers. Found a layer of type {n.type}. '
@@ -14,7 +14,7 @@
14
14
  # ==============================================================================
15
15
 
16
16
  import copy
17
- from typing import Dict, Any, Tuple, List, Type
17
+ from typing import Dict, Any, Tuple, List, Type, Union
18
18
 
19
19
  import numpy as np
20
20
 
@@ -151,7 +151,21 @@ class BaseNode:
151
151
  """
152
152
  return self.reuse or self.reuse_group is not None
153
153
 
154
- def get_weights_by_keys(self, name: str) -> np.ndarray:
154
+ def _get_weight_name(self, name: Union[str, int]) -> List[Union[str, int]]:
155
+ """
156
+ Get weight names that match argument name (either string weights or integer for
157
+ positional weights).
158
+ Args:
159
+ name: weight name
160
+
161
+ Returns:
162
+ A list of weight names that match input "name"
163
+
164
+ """
165
+ return [k for k in self.weights.keys()
166
+ if (isinstance(k, int) and name == k) or (isinstance(k, str) and name in k)]
167
+
168
+ def get_weights_by_keys(self, name: Union[str, int]) -> np.ndarray:
155
169
  """
156
170
  Get a node's weight by its name.
157
171
  Args:
@@ -163,7 +177,7 @@ class BaseNode:
163
177
  if name is None:
164
178
  return None
165
179
 
166
- res = [k for k in self.weights.keys() if name in k]
180
+ res = self._get_weight_name(name)
167
181
  if len(res) == 1: # Make sure there are no duplicates
168
182
  return self.weights[res[0]]
169
183
  else:
@@ -179,7 +193,7 @@ class BaseNode:
179
193
 
180
194
  """
181
195
 
182
- res = [k for k in self.weights.keys() if name in k]
196
+ res = self._get_weight_name(name)
183
197
  if len(res) == 1:
184
198
  self.weights[res[0]] = tensor
185
199
  else: # Add if not exist
@@ -552,14 +566,17 @@ class BaseNode:
552
566
  for fl, qco in tpc.filterlayer2qco.items():
553
567
  if self.is_match_filter_params(fl):
554
568
  return qco
555
- if self.type in tpc.layer2qco:
556
- return tpc.layer2qco.get(self.type)
569
+ # Extract qco with is_match_type to overcome mismatch of function types in TF 2.15
570
+ matching_qcos = [_qco for _type, _qco in tpc.layer2qco.items() if self.is_match_type(_type)]
571
+ if matching_qcos:
572
+ if len(matching_qcos) > 1:
573
+ Logger.error('Found duplicate qco types!')
574
+ return matching_qcos[0]
557
575
  return tpc.tp_model.default_qco
558
576
 
559
577
  def is_match_type(self, _type: Type) -> bool:
560
578
  """
561
- Check if input type matches the node type, either in instance type or in type name. Checking the
562
- name string is required because of function types changes that occurred in TF 2.15.
579
+ Check if input type matches the node type, either in instance type or in type name.
563
580
 
564
581
  Args:
565
582
  _type: other node type
@@ -567,7 +584,7 @@ class BaseNode:
567
584
  Whether _type matches the self node type
568
585
 
569
586
  """
570
- return _type == self.type or _type.__name__ == self.type.__name__
587
+ return _type == self.type
571
588
 
572
589
  def is_match_filter_params(self, layer_filter_params: LayerFilterParams) -> bool:
573
590
  """
@@ -1,5 +1,6 @@
1
- from typing import Dict, Any, Tuple, List
1
+ from typing import Dict, Any, Tuple, Type
2
2
 
3
+ from model_compression_toolkit.constants import FOUND_TF
3
4
  from model_compression_toolkit.core.common.graph.base_node import BaseNode
4
5
  import numpy as np
5
6
 
@@ -71,3 +72,19 @@ class FunctionalNode(BaseNode):
71
72
  :return: the node's functional_op
72
73
  """
73
74
  return self.functional_op
75
+
76
+ def is_match_type(self, _type: Type) -> bool:
77
+ """
78
+ Check if input type matches the node type, either in instance type or in type name. Checking the
79
+ name string is required because of function types changes that occurred in TF 2.15, because it
80
+ changes the "function" attribute object (e.g. a different tf.add function that will fail the
81
+ equal operation).
82
+
83
+ Args:
84
+ _type: other node type
85
+ Returns:
86
+ Whether _type matches the self node type
87
+
88
+ """
89
+ names_match = _type.__name__ == self.type.__name__ if FOUND_TF else False
90
+ return super().is_match_type(_type) or names_match
@@ -17,7 +17,6 @@ from functools import partial
17
17
  from typing import Callable, List
18
18
 
19
19
  from model_compression_toolkit.constants import HESSIAN_NUM_ITERATIONS
20
- from model_compression_toolkit.core.common import Graph
21
20
  from model_compression_toolkit.core.common.hessian.trace_hessian_request import TraceHessianRequest
22
21
  from model_compression_toolkit.logger import Logger
23
22
 
@@ -38,7 +37,7 @@ class HessianInfoService:
38
37
  """
39
38
 
40
39
  def __init__(self,
41
- graph: Graph,
40
+ graph,
42
41
  representative_dataset: Callable,
43
42
  fw_impl,
44
43
  num_iterations_for_approximation: int = HESSIAN_NUM_ITERATIONS
@@ -151,7 +150,7 @@ class HessianInfoService:
151
150
  if required_size==0:
152
151
  return []
153
152
 
154
- Logger.info(f"Ensuring {required_size} Hessian-trace approximation for node {trace_hessian_request.target_node}.")
153
+ Logger.info(f"\nEnsuring {required_size} Hessian-trace approximation for node {trace_hessian_request.target_node}.")
155
154
 
156
155
  # Replace request of a reused target node with a request of the 'reuse group'.
157
156
  if trace_hessian_request.target_node.reuse_group:
@@ -16,8 +16,6 @@ from typing import List
16
16
 
17
17
  from enum import Enum
18
18
 
19
- from model_compression_toolkit.core.common import BaseNode
20
-
21
19
 
22
20
  class HessianMode(Enum):
23
21
  """
@@ -54,7 +52,7 @@ class TraceHessianRequest:
54
52
  def __init__(self,
55
53
  mode: HessianMode,
56
54
  granularity: HessianInfoGranularity,
57
- target_node: BaseNode,
55
+ target_node,
58
56
  ):
59
57
  """
60
58
  Attributes:
@@ -15,6 +15,7 @@
15
15
 
16
16
  from typing import Any
17
17
  from model_compression_toolkit.core.common.matchers.node_matcher import BaseNodeMatcher
18
+ from model_compression_toolkit.core.common.graph.base_node import BaseNode
18
19
 
19
20
 
20
21
  class NodeTypeFilter(BaseNodeMatcher):
@@ -30,7 +31,7 @@ class NodeTypeFilter(BaseNodeMatcher):
30
31
  """
31
32
  self.node_type = node_type
32
33
 
33
- def apply(self, input_object: Any) -> bool:
34
+ def apply(self, input_object: BaseNode) -> bool:
34
35
  """
35
36
  Check if input_object is of the type that NodeTypeFilter contains.
36
37
 
@@ -38,9 +39,9 @@ class NodeTypeFilter(BaseNodeMatcher):
38
39
  input_object: Node object to check for its type.
39
40
 
40
41
  Returns:
41
- True if the node if of the type that was passed during the initialization of NodeTypeFilter.
42
+ True if the node is of the type that was passed during the initialization of NodeTypeFilter.
42
43
  """
43
- if input_object.type == self.node_type:
44
+ if input_object.is_match_type(self.node_type):
44
45
  return True
45
46
 
46
47
 
@@ -265,8 +265,6 @@ class WeightsAttrQuantizationConfig:
265
265
  self.enable_weights_quantization = weights_attr_cfg.enable_weights_quantization
266
266
  self.l_p_value = qc.l_p_value
267
267
 
268
-
269
-
270
268
  @property
271
269
  def weights_error_method(self) -> QuantizationErrorMethod:
272
270
  """
@@ -412,9 +410,6 @@ class NodeWeightsQuantizationConfig(BaseNodeQuantizationConfig):
412
410
  for attr in node_attrs_list:
413
411
  if isinstance(attr, int):
414
412
  # this is a positional attribute, so it needs to be handled separately.
415
- # we assume that a positional attribute is quantized with the default configuration provided in the TPC.
416
- if op_cfg.default_weight_attr_config.enable_weights_quantization:
417
- Logger.critical(f"Quantizing constant weights is not supported.")
418
413
  self.pos_attributes_config_mapping[attr] = WeightsAttrQuantizationConfig(qc=qc,
419
414
  weights_attr_cfg=op_cfg.default_weight_attr_config,
420
415
  weights_channels_axis=weights_channels_axis)
@@ -26,14 +26,16 @@ class QuantizationErrorMethod(Enum):
26
26
 
27
27
  NOCLIPPING - Use min/max values as thresholds.
28
28
 
29
- MSE - Use min square error for minimizing quantization noise.
29
+ MSE - Use mean square error for minimizing quantization noise.
30
30
 
31
- MAE - Use min absolute error for minimizing quantization noise.
31
+ MAE - Use mean absolute error for minimizing quantization noise.
32
32
 
33
33
  KL - Use KL-divergence to make signals distributions to be similar as possible.
34
34
 
35
35
  Lp - Use Lp-norm to minimizing quantization noise.
36
36
 
37
+ HMSE - Use Hessian-based mean squared error for minimizing quantization noise. This method is using Hessian scores to factorize more valuable parameters when computing the error induced by quantization.
38
+
37
39
  """
38
40
 
39
41
  NOCLIPPING = 0
@@ -41,6 +43,7 @@ class QuantizationErrorMethod(Enum):
41
43
  MAE = 2
42
44
  KL = 4
43
45
  LP = 5
46
+ HMSE = 6
44
47
 
45
48
 
46
49
  class QuantizationConfig: