mct-nightly 2.2.0.20241230.534__py3-none-any.whl → 2.2.0.20241231.516__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.2.0.20241230.534
3
+ Version: 2.2.0.20241231.516
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=iPjPjwwH50JpoFzcLJDS6XEjBVsJQmsuUenuZxUXTPg,1573
1
+ model_compression_toolkit/__init__.py,sha256=BKJvBXohfBVQ4uiANJjSSxeE1wGUmbOEQBQbqdMmAX8,1573
2
2
  model_compression_toolkit/constants.py,sha256=i_R6uXBfO1ph_X6DNJych2x59SUojfJbn7dNjs_mZnc,3846
3
3
  model_compression_toolkit/defaultdict.py,sha256=LSc-sbZYXENMCw3U9F4GiXuv67IKpdn0Qm7Fr11jy-4,2277
4
4
  model_compression_toolkit/logger.py,sha256=3DByV41XHRR3kLTJNbpaMmikL8icd9e1N-nkQAY9oDk,4567
@@ -479,9 +479,9 @@ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3_
479
479
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3_lut/tpc_keras.py,sha256=hHK7MY6xfSCRnXQ6Qz0hbN_hM18f-gf3uZmxdl44khU,6679
480
480
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3_lut/tpc_pytorch.py,sha256=GmS3CuSQPwLSgPdruXCSHN49_fRiRBn9PKA9CPmtqM8,5789
481
481
  model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/__init__.py,sha256=tHTUvsaerSfbe22pU0kIDauPpFD7Pq5EmZytVIDkHz4,717
482
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tp_model.py,sha256=Ya0IZVDO6TAe_fBGV6Rg1BvENkzeCsbULaEjKDtzjck,17779
483
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_keras.py,sha256=9LToJzBBCXEZ5AOj2zzJMRr6S0uwlKKEg3stLK2u1fw,8341
484
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_pytorch.py,sha256=v1Fyp9YKWfdxF9tLfD0fAV41mqEH0S9z-jqr4QFH5CQ,7221
482
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tp_model.py,sha256=l2h5Wql5_3UM_qd1p_BrQHjPpuZRTPcXNXgVbDyPlmA,18671
483
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_keras.py,sha256=IlaTaq2VnGibqwr-rKkqRTD-FK58H1CHGiPiopXD5VA,8291
484
+ model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_pytorch.py,sha256=7AhR56oCyXVLvWPB36tNiaLRIGzDLWYXghUjTRADX5s,7094
485
485
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/__init__.py,sha256=cco4TmeIDIh32nj9ZZXVkws4dd9F2UDrmjKzTN8G0V0,697
486
486
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/target_platform_capabilities.py,sha256=is00rNrDmmirYsyMtMkWz0DwOA92-x7hAJwpd6z1n2E,2806
487
487
  model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/latest/__init__.py,sha256=CXC-HQolSDu7j8V-Xm-SWGCd74gXB3XnAkEhI_TVbIQ,1516
@@ -560,8 +560,8 @@ model_compression_toolkit/xquant/pytorch/model_analyzer.py,sha256=b93o800yVB3Z-i
560
560
  model_compression_toolkit/xquant/pytorch/pytorch_report_utils.py,sha256=bOc-hFL3gdoSM1Th_S2N_-9JJSlPGpZCTx_QLJHS6lg,3388
561
561
  model_compression_toolkit/xquant/pytorch/similarity_functions.py,sha256=CERxq5K8rqaiE-DlwhZBTUd9x69dtYJlkHOPLB54vm8,2354
562
562
  model_compression_toolkit/xquant/pytorch/tensorboard_utils.py,sha256=mkoEktLFFHtEKzzFRn_jCnxjhJolK12TZ5AQeDHzUO8,9767
563
- mct_nightly-2.2.0.20241230.534.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
564
- mct_nightly-2.2.0.20241230.534.dist-info/METADATA,sha256=yyeiq5zHdWmEdPcLFzs1V6GQR86hrjTPm05Nbj-rGCs,26453
565
- mct_nightly-2.2.0.20241230.534.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
566
- mct_nightly-2.2.0.20241230.534.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
567
- mct_nightly-2.2.0.20241230.534.dist-info/RECORD,,
563
+ mct_nightly-2.2.0.20241231.516.dist-info/LICENSE.md,sha256=aYSSIb-5AFPeITTvXm1UAoe0uYBiMmSS8flvXaaFUks,10174
564
+ mct_nightly-2.2.0.20241231.516.dist-info/METADATA,sha256=lfsmkINpoJ-Ael_k81Ushjyw4Mk2tATpOjigEWaok3E,26453
565
+ mct_nightly-2.2.0.20241231.516.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
566
+ mct_nightly-2.2.0.20241231.516.dist-info/top_level.txt,sha256=gsYA8juk0Z-ZmQRKULkb3JLGdOdz8jW_cMRjisn9ga4,26
567
+ mct_nightly-2.2.0.20241231.516.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.2.0.20241230.000534"
30
+ __version__ = "2.2.0.20241231.000516"
@@ -29,6 +29,7 @@ OPSET_NO_QUANTIZATION = "NoQuantization"
29
29
  OPSET_QUANTIZATION_PRESERVING = "QuantizationPreserving"
30
30
  OPSET_DIMENSION_MANIPULATION_OPS_WITH_WEIGHTS = "DimensionManipulationOpsWithWeights"
31
31
  OPSET_DIMENSION_MANIPULATION_OPS = "DimensionManipulationOps"
32
+ OPSET_SPLIT_OPS = "SplitOps"
32
33
  OPSET_MERGE_OPS = "MergeOps"
33
34
  OPSET_CONV = "Conv"
34
35
  OPSET_FULLY_CONNECTED = "FullyConnected"
@@ -186,6 +187,15 @@ def generate_tp_model(default_config: OpQuantizationConfig,
186
187
  signedness=Signedness.SIGNED)]),
187
188
  base_config=default_config_input16)
188
189
 
190
+ qpreseving_config = default_config.clone_and_edit(enable_activation_quantization=False,
191
+ quantization_preserving=True,
192
+ supported_input_activation_n_bits=(8, 16))
193
+ qpreseving_config_options = schema.QuantizationConfigOptions(tuple([qpreseving_config,
194
+ qpreseving_config.clone_and_edit(
195
+ activation_n_bits=16,
196
+ signedness=Signedness.SIGNED)]),
197
+ base_config=qpreseving_config)
198
+
189
199
  # Create a QuantizationConfigOptions for quantizing constants in functional ops.
190
200
  # Constant configuration is similar to the default eight bit configuration except for PoT
191
201
  # quantization method for the constant.
@@ -259,6 +269,7 @@ def generate_tp_model(default_config: OpQuantizationConfig,
259
269
  quantization_preserving=True,
260
270
  supported_input_activation_n_bits=(8, 16))
261
271
  .clone_and_edit_weight_attribute(enable_weights_quantization=False)))
272
+ operator_set.append(schema.OperatorsSet(OPSET_SPLIT_OPS, qpreseving_config_options))
262
273
  operator_set.append(schema.OperatorsSet(OPSET_MERGE_OPS, const_configuration_options_inout16_per_tensor))
263
274
 
264
275
  # Define operator sets that use mixed_precision_configuration_options:
@@ -39,7 +39,8 @@ from model_compression_toolkit.target_platform_capabilities.tpc_models.imx500_tp
39
39
  from model_compression_toolkit.target_platform_capabilities.tpc_models.imx500_tpc.v4.tp_model import OPSET_NO_QUANTIZATION, \
40
40
  OPSET_QUANTIZATION_PRESERVING, OPSET_DIMENSION_MANIPULATION_OPS_WITH_WEIGHTS, OPSET_DIMENSION_MANIPULATION_OPS, \
41
41
  OPSET_MERGE_OPS, OPSET_CONV, OPSET_FULLY_CONNECTED, OPSET_ANY_RELU, OPSET_ADD, OPSET_SUB, OPSET_MUL, OPSET_DIV, \
42
- OPSET_PRELU, OPSET_SWISH, OPSET_SIGMOID, OPSET_TANH, OPSET_GELU, OPSET_BATCH_NORM, OPSET_MIN_MAX, OPSET_HARDSIGMOID
42
+ OPSET_PRELU, OPSET_SWISH, OPSET_SIGMOID, OPSET_TANH, OPSET_GELU, OPSET_BATCH_NORM, OPSET_MIN_MAX, OPSET_HARDSIGMOID, \
43
+ OPSET_SPLIT_OPS
43
44
 
44
45
  tp = mct.target_platform
45
46
 
@@ -78,11 +79,7 @@ def generate_keras_tpc(name: str, tp_model: schema.TargetPlatformModel):
78
79
  ZeroPadding2D,
79
80
  Dropout,
80
81
  MaxPooling2D,
81
- tf.split,
82
- tf.cast,
83
- tf.unstack,
84
- tf.__operators__.getitem,
85
- tf.strided_slice]
82
+ tf.cast]
86
83
  quantization_preserving_list_16bit_input = [Reshape,
87
84
  tf.reshape,
88
85
  Permute,
@@ -97,6 +94,7 @@ def generate_keras_tpc(name: str, tp_model: schema.TargetPlatformModel):
97
94
  tp.OperationsSetToLayers(OPSET_QUANTIZATION_PRESERVING, quantization_preserving)
98
95
  tp.OperationsSetToLayers(OPSET_DIMENSION_MANIPULATION_OPS, quantization_preserving_list_16bit_input)
99
96
  tp.OperationsSetToLayers(OPSET_DIMENSION_MANIPULATION_OPS_WITH_WEIGHTS, [tf.gather, tf.compat.v1.gather])
97
+ tp.OperationsSetToLayers(OPSET_SPLIT_OPS,[tf.unstack, tf.split, tf.strided_slice, tf.__operators__.getitem])
100
98
  tp.OperationsSetToLayers(OPSET_MERGE_OPS, [tf.stack, tf.concat, Concatenate])
101
99
  tp.OperationsSetToLayers(OPSET_CONV,
102
100
  [Conv2D,
@@ -36,7 +36,7 @@ from model_compression_toolkit.target_platform_capabilities.tpc_models.imx500_tp
36
36
  OPSET_QUANTIZATION_PRESERVING, OPSET_DIMENSION_MANIPULATION_OPS_WITH_WEIGHTS, OPSET_DIMENSION_MANIPULATION_OPS, \
37
37
  OPSET_MERGE_OPS, OPSET_CONV, OPSET_FULLY_CONNECTED, OPSET_ANY_RELU, OPSET_ADD, OPSET_SUB, OPSET_MUL, OPSET_DIV, \
38
38
  OPSET_PRELU, OPSET_SWISH, OPSET_SIGMOID, OPSET_TANH, OPSET_GELU, OPSET_BATCH_NORM, OPSET_MIN_MAX, OPSET_HARDSIGMOID, \
39
- OPSET_HARDSWISH
39
+ OPSET_HARDSWISH, OPSET_SPLIT_OPS
40
40
 
41
41
  tp = mct.target_platform
42
42
 
@@ -77,9 +77,6 @@ def generate_pytorch_tpc(name: str, tp_model: schema.TargetPlatformModel):
77
77
  topk])
78
78
  tp.OperationsSetToLayers(OPSET_QUANTIZATION_PRESERVING, [Dropout,
79
79
  dropout,
80
- split,
81
- chunk,
82
- unbind,
83
80
  MaxPool2d])
84
81
  tp.OperationsSetToLayers(OPSET_DIMENSION_MANIPULATION_OPS, [Flatten,
85
82
  flatten,
@@ -90,6 +87,7 @@ def generate_pytorch_tpc(name: str, tp_model: schema.TargetPlatformModel):
90
87
  permute,
91
88
  transpose])
92
89
  tp.OperationsSetToLayers(OPSET_DIMENSION_MANIPULATION_OPS_WITH_WEIGHTS, [gather, torch.Tensor.expand])
90
+ tp.OperationsSetToLayers(OPSET_SPLIT_OPS,[split, chunk, unbind])
93
91
  tp.OperationsSetToLayers(OPSET_MERGE_OPS,
94
92
  [torch.stack, torch.cat, torch.concat, torch.concatenate])
95
93