mct-nightly 1.10.0.20231025.post409__py3-none-any.whl → 1.10.0.20231026.post415__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: 1.10.0.20231025.post409
3
+ Version: 1.10.0.20231026.post415
4
4
  Summary: A Model Compression Toolkit for neural networks
5
5
  Home-page: UNKNOWN
6
6
  License: UNKNOWN
@@ -1,5 +1,5 @@
1
1
  model_compression_toolkit/__init__.py,sha256=HM7kIyeSnGNpCnoO8d6S5gF186LcHffHDj4HoesmGWM,3663
2
- model_compression_toolkit/constants.py,sha256=jJRnypFBD44YExKPycMnxl4xpT6DXYuLX_eYdVkQXbI,3915
2
+ model_compression_toolkit/constants.py,sha256=lhwqcgu1o-wlKAOUPwO_KfrhdgLLAkB0DKvRPGxMx0s,4001
3
3
  model_compression_toolkit/logger.py,sha256=b9DVktZ-LymFcRxv2aL_sdiE6S2sSrFGWltx6dgEuUY,4863
4
4
  model_compression_toolkit/core/__init__.py,sha256=qnBA6aaojI7RpEQZU2vXWiELHfVJf-MnAP-4T0tcFDY,2008
5
5
  model_compression_toolkit/core/analyzer.py,sha256=dbsD61pakp_9JXNyAScLdtJvcXny9jr_cMbET0Bd3Sg,2975
@@ -408,15 +408,15 @@ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/tar
408
408
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/latest/__init__.py,sha256=F5RG4MnuAwKcNXbfVbPFLQu30-lNax-7knqu20B6udQ,1522
409
409
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/__init__.py,sha256=1mMOREEMoNHu_KTMGDp4crN61opKWX6aFn1DrDLvqcc,717
410
410
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tp_model.py,sha256=andraAMf9fXF4THt9PCp6edtK3hcB6JfgyUfJLXpP7I,8314
411
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tpc_keras.py,sha256=4o1Ohxc0w9fEZGgLSqXynbTcOX1eXMUvutduXr7TZk8,5530
411
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tpc_keras.py,sha256=aTmLEha4ZHqq2P9gQQP68KeuPbD6Hb-nPwqG0CvDSy4,5185
412
412
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tpc_pytorch.py,sha256=4liNmjx5lKxlkekqRlkJ0CPUMlsFcuktLxkIBB8lrI0,4721
413
413
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/__init__.py,sha256=vFDyiMymNZSRCdTgAyWn4A-tZD3vzze_PTLBSF2OYe8,721
414
414
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py,sha256=-KYKgxLgUcldGHS30UUl5fDt4ZpwoVdVAyzPmk4f4Gw,8624
415
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tpc_keras.py,sha256=R9-utIQFQ5K89o7r7JSYlYvpibl9ZTN-uz6CWsfKvzE,5446
415
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tpc_keras.py,sha256=2LT1u7D9N8dJurQx20P-yUQNTTs195AxoPav0aLIcFk,5193
416
416
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tpc_pytorch.py,sha256=CsRgw4_QapBQ7Y1_QQ-kI_RewooBwqyRsMrmlB_k-kc,4729
417
417
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/__init__.py,sha256=NUuczImqUxzdfflqSdqkeAN8aCU6Tuiu6U0Fnj9Tzmw,721
418
418
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tp_model.py,sha256=fSCta6vdznvRcDsqCLQrRM6txK6eoye6HLGehKGZpIs,8320
419
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tpc_keras.py,sha256=FYqpjDM8zHlHWKo0B-EwZOHiiZkqRc9MpCHQ1r1U7jc,5459
419
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tpc_keras.py,sha256=N1agnOoW0lRm7QjH2LRfkjOw6PhbHIHEK1ftoy8VjKM,5205
420
420
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tpc_pytorch.py,sha256=yGXYpxy0C6pJK0Jmm98bFZsyBBo2-ctwyMjx9GO3Ku8,4748
421
421
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
422
422
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/target_platform_capabilities.py,sha256=lnhJcwvTF0t7ybeiTleIS1p0aD8xzFZxVPx4ISk5uWQ,2090
@@ -448,8 +448,8 @@ model_compression_toolkit/trainable_infrastructure/keras/quantize_wrapper.py,sha
448
448
  model_compression_toolkit/trainable_infrastructure/keras/quantizer_utils.py,sha256=MVwXNymmFRB2NXIBx4e2mdJ1RfoHxRPYRgjb1MQP5kY,1797
449
449
  model_compression_toolkit/trainable_infrastructure/pytorch/__init__.py,sha256=huHoBUcKNB6BnY6YaUCcFvdyBtBI172ZoUD8ZYeNc6o,696
450
450
  model_compression_toolkit/trainable_infrastructure/pytorch/base_pytorch_quantizer.py,sha256=SbvRlIdE32PEBsINt1bhSqvrKL_zbM9V-aeSkOn-sw4,3083
451
- mct_nightly-1.10.0.20231025.post409.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
452
- mct_nightly-1.10.0.20231025.post409.dist-info/METADATA,sha256=enujcBKkDIYiXz3Y-6noNNsl5tcRYP730JhUujVkafk,16303
453
- mct_nightly-1.10.0.20231025.post409.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
454
- mct_nightly-1.10.0.20231025.post409.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
455
- mct_nightly-1.10.0.20231025.post409.dist-info/RECORD,,
451
+ mct_nightly-1.10.0.20231026.post415.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
452
+ mct_nightly-1.10.0.20231026.post415.dist-info/METADATA,sha256=6O8FHiHVqP6FWoxGqpXIIlnxlOFe6taM2e9yBZTqImw,16303
453
+ mct_nightly-1.10.0.20231026.post415.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
454
+ mct_nightly-1.10.0.20231026.post415.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
455
+ mct_nightly-1.10.0.20231026.post415.dist-info/RECORD,,
@@ -22,6 +22,7 @@ FOUND_TF = importlib.util.find_spec(TENSORFLOW) is not None
22
22
  FOUND_TORCH = importlib.util.find_spec("torch") is not None
23
23
  FOUND_ONNX = importlib.util.find_spec("onnx") is not None
24
24
  FOUND_ONNXRUNTIME = importlib.util.find_spec("onnxruntime") is not None
25
+ FOUND_SONY_CUSTOM_LAYERS = importlib.util.find_spec('sony_custom_layers') is not None
25
26
 
26
27
  WEIGHTS_SIGNED = True
27
28
  # Minimal threshold to use for quantization ranges:
@@ -14,7 +14,10 @@
14
14
  # ==============================================================================
15
15
  import tensorflow as tf
16
16
  from packaging import version
17
+ from model_compression_toolkit.constants import FOUND_SONY_CUSTOM_LAYERS
17
18
 
19
+ if FOUND_SONY_CUSTOM_LAYERS:
20
+ from sony_custom_layers.keras.object_detection.ssd_post_process import SSDPostProcess
18
21
 
19
22
  if version.parse(tf.__version__) >= version.parse("2.13"):
20
23
  from keras.src.layers import Conv2D, DepthwiseConv2D, Dense, Reshape, ZeroPadding2D, Dropout, \
@@ -54,29 +57,34 @@ def generate_keras_tpc(name: str, tp_model: tp.TargetPlatformModel):
54
57
 
55
58
  keras_tpc = tp.TargetPlatformCapabilities(tp_model, name=name, version=TPC_VERSION)
56
59
 
60
+ no_quant_list = [Reshape,
61
+ tf.reshape,
62
+ Permute,
63
+ tf.transpose,
64
+ Flatten,
65
+ Cropping2D,
66
+ ZeroPadding2D,
67
+ Dropout,
68
+ MaxPooling2D,
69
+ tf.split,
70
+ tf.quantization.fake_quant_with_min_max_vars,
71
+ tf.math.argmax,
72
+ tf.shape,
73
+ tf.math.equal,
74
+ tf.gather,
75
+ tf.cast,
76
+ tf.unstack,
77
+ tf.compat.v1.gather,
78
+ tf.nn.top_k,
79
+ tf.__operators__.getitem,
80
+ tf.image.combined_non_max_suppression,
81
+ tf.compat.v1.shape]
82
+
83
+ if FOUND_SONY_CUSTOM_LAYERS:
84
+ no_quant_list.append(SSDPostProcess)
85
+
57
86
  with keras_tpc:
58
- tp.OperationsSetToLayers("NoQuantization", [Reshape,
59
- tf.reshape,
60
- Permute,
61
- tf.transpose,
62
- Flatten,
63
- Cropping2D,
64
- ZeroPadding2D,
65
- Dropout,
66
- MaxPooling2D,
67
- tf.split,
68
- tf.quantization.fake_quant_with_min_max_vars,
69
- tf.math.argmax,
70
- tf.shape,
71
- tf.math.equal,
72
- tf.gather,
73
- tf.cast,
74
- tf.unstack,
75
- tf.compat.v1.gather,
76
- tf.nn.top_k,
77
- tf.__operators__.getitem,
78
- tf.image.combined_non_max_suppression,
79
- tf.compat.v1.shape])
87
+ tp.OperationsSetToLayers("NoQuantization", no_quant_list)
80
88
 
81
89
  tp.OperationsSetToLayers("Conv", [Conv2D,
82
90
  DepthwiseConv2D,
@@ -14,6 +14,10 @@
14
14
  # ==============================================================================
15
15
  import tensorflow as tf
16
16
  from packaging import version
17
+ from model_compression_toolkit.constants import FOUND_SONY_CUSTOM_LAYERS
18
+
19
+ if FOUND_SONY_CUSTOM_LAYERS:
20
+ from sony_custom_layers.keras.object_detection.ssd_post_process import SSDPostProcess
17
21
 
18
22
  if version.parse(tf.__version__) >= version.parse("2.13"):
19
23
  from keras.src.layers import Conv2D, DepthwiseConv2D, Dense, Reshape, ZeroPadding2D, Dropout, \
@@ -53,28 +57,34 @@ def generate_keras_tpc(name: str, tp_model: tp.TargetPlatformModel):
53
57
 
54
58
  keras_tpc = tp.TargetPlatformCapabilities(tp_model, name=name, version=TPC_VERSION)
55
59
 
60
+ no_quant_list = [Reshape,
61
+ tf.reshape,
62
+ Permute,
63
+ tf.transpose,
64
+ Flatten,
65
+ Cropping2D,
66
+ ZeroPadding2D,
67
+ Dropout,
68
+ MaxPooling2D,
69
+ tf.split,
70
+ tf.quantization.fake_quant_with_min_max_vars,
71
+ tf.math.argmax,
72
+ tf.shape,
73
+ tf.math.equal,
74
+ tf.gather,
75
+ tf.cast,
76
+ tf.unstack,
77
+ tf.compat.v1.gather,
78
+ tf.nn.top_k,
79
+ tf.__operators__.getitem,
80
+ tf.image.combined_non_max_suppression,
81
+ tf.compat.v1.shape]
82
+
83
+ if FOUND_SONY_CUSTOM_LAYERS:
84
+ no_quant_list.append(SSDPostProcess)
85
+
56
86
  with keras_tpc:
57
- tp.OperationsSetToLayers("NoQuantization", [Reshape,
58
- tf.reshape,
59
- Permute,
60
- tf.transpose,
61
- Flatten,
62
- Cropping2D,
63
- ZeroPadding2D,
64
- Dropout,
65
- MaxPooling2D,
66
- tf.split,
67
- tf.quantization.fake_quant_with_min_max_vars,
68
- tf.math.argmax,
69
- tf.shape,
70
- tf.math.equal,
71
- tf.gather,
72
- tf.cast,
73
- tf.unstack,
74
- tf.compat.v1.gather,
75
- tf.nn.top_k,
76
- tf.__operators__.getitem,
77
- tf.compat.v1.shape])
87
+ tp.OperationsSetToLayers("NoQuantization", no_quant_list)
78
88
 
79
89
  tp.OperationsSetToLayers("Conv", [Conv2D,
80
90
  DepthwiseConv2D,
@@ -14,7 +14,10 @@
14
14
  # ==============================================================================
15
15
  import tensorflow as tf
16
16
  from packaging import version
17
+ from model_compression_toolkit.constants import FOUND_SONY_CUSTOM_LAYERS
17
18
 
19
+ if FOUND_SONY_CUSTOM_LAYERS:
20
+ from sony_custom_layers.keras.object_detection.ssd_post_process import SSDPostProcess
18
21
 
19
22
  if version.parse(tf.__version__) >= version.parse("2.13"):
20
23
  from keras.src.layers import Conv2D, DepthwiseConv2D, Dense, Reshape, ZeroPadding2D, Dropout, \
@@ -54,28 +57,34 @@ def generate_keras_tpc(name: str, tp_model: tp.TargetPlatformModel):
54
57
 
55
58
  keras_tpc = tp.TargetPlatformCapabilities(tp_model, name=name, version=TPC_VERSION)
56
59
 
60
+ no_quant_list = [Reshape,
61
+ tf.reshape,
62
+ Permute,
63
+ tf.transpose,
64
+ Flatten,
65
+ Cropping2D,
66
+ ZeroPadding2D,
67
+ Dropout,
68
+ MaxPooling2D,
69
+ tf.split,
70
+ tf.quantization.fake_quant_with_min_max_vars,
71
+ tf.math.argmax,
72
+ tf.shape,
73
+ tf.math.equal,
74
+ tf.gather,
75
+ tf.cast,
76
+ tf.unstack,
77
+ tf.compat.v1.gather,
78
+ tf.nn.top_k,
79
+ tf.__operators__.getitem,
80
+ tf.image.combined_non_max_suppression,
81
+ tf.compat.v1.shape]
82
+
83
+ if FOUND_SONY_CUSTOM_LAYERS:
84
+ no_quant_list.append(SSDPostProcess)
85
+
57
86
  with keras_tpc:
58
- tp.OperationsSetToLayers("NoQuantization", [Reshape,
59
- tf.reshape,
60
- Permute,
61
- tf.transpose,
62
- Flatten,
63
- Cropping2D,
64
- ZeroPadding2D,
65
- Dropout,
66
- MaxPooling2D,
67
- tf.split,
68
- tf.quantization.fake_quant_with_min_max_vars,
69
- tf.math.argmax,
70
- tf.shape,
71
- tf.math.equal,
72
- tf.gather,
73
- tf.cast,
74
- tf.unstack,
75
- tf.compat.v1.gather,
76
- tf.nn.top_k,
77
- tf.__operators__.getitem,
78
- tf.compat.v1.shape])
87
+ tp.OperationsSetToLayers("NoQuantization", no_quant_list)
79
88
 
80
89
  tp.OperationsSetToLayers("Conv", [Conv2D,
81
90
  DepthwiseConv2D,