mct-nightly 2.2.0.20241230.534__py3-none-any.whl → 2.2.0.20250102.111338__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.
- {mct_nightly-2.2.0.20241230.534.dist-info → mct_nightly-2.2.0.20250102.111338.dist-info}/METADATA +8 -11
- {mct_nightly-2.2.0.20241230.534.dist-info → mct_nightly-2.2.0.20250102.111338.dist-info}/RECORD +19 -19
- {mct_nightly-2.2.0.20241230.534.dist-info → mct_nightly-2.2.0.20250102.111338.dist-info}/WHEEL +1 -1
- model_compression_toolkit/__init__.py +1 -1
- model_compression_toolkit/target_platform_capabilities/schema/v1.py +308 -173
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1/tp_model.py +22 -22
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py +22 -22
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tp_model.py +22 -22
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2/tp_model.py +21 -21
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tp_model.py +22 -22
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3/tp_model.py +25 -25
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3_lut/tp_model.py +23 -23
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tp_model.py +55 -40
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_keras.py +4 -6
- model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v4/tpc_pytorch.py +2 -4
- model_compression_toolkit/target_platform_capabilities/tpc_models/qnnpack_tpc/v1/tp_model.py +10 -10
- model_compression_toolkit/target_platform_capabilities/tpc_models/tflite_tpc/v1/tp_model.py +49 -46
- {mct_nightly-2.2.0.20241230.534.dist-info → mct_nightly-2.2.0.20250102.111338.dist-info}/LICENSE.md +0 -0
- {mct_nightly-2.2.0.20241230.534.dist-info → mct_nightly-2.2.0.20250102.111338.dist-info}/top_level.txt +0 -0
@@ -153,10 +153,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
153
153
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
154
154
|
# If the QuantizationConfigOptions contains only one configuration,
|
155
155
|
# this configuration will be used for the operation quantization:
|
156
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
156
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
157
157
|
|
158
158
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
159
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
159
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
160
160
|
base_config=base_config)
|
161
161
|
|
162
162
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -167,46 +167,46 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
167
167
|
operator_set = []
|
168
168
|
fusing_patterns = []
|
169
169
|
|
170
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
171
|
-
default_configuration_options.clone_and_edit(enable_activation_quantization=False)
|
170
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
171
|
+
qc_options=default_configuration_options.clone_and_edit(enable_activation_quantization=False)
|
172
172
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
173
173
|
|
174
174
|
# Define operator sets that use mixed_precision_configuration_options:
|
175
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
176
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
175
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
176
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
177
177
|
|
178
178
|
# Define operations sets without quantization configuration
|
179
179
|
# options (useful for creating fusing patterns, for example):
|
180
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
181
|
-
add = schema.OperatorsSet("Add")
|
182
|
-
sub = schema.OperatorsSet("Sub")
|
183
|
-
mul = schema.OperatorsSet("Mul")
|
184
|
-
div = schema.OperatorsSet("Div")
|
185
|
-
prelu = schema.OperatorsSet("PReLU")
|
186
|
-
swish = schema.OperatorsSet("Swish")
|
187
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
188
|
-
tanh = schema.OperatorsSet("Tanh")
|
180
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
181
|
+
add = schema.OperatorsSet(name="Add")
|
182
|
+
sub = schema.OperatorsSet(name="Sub")
|
183
|
+
mul = schema.OperatorsSet(name="Mul")
|
184
|
+
div = schema.OperatorsSet(name="Div")
|
185
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
186
|
+
swish = schema.OperatorsSet(name="Swish")
|
187
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
188
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
189
189
|
|
190
190
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
191
191
|
# Combine multiple operators into a single operator to avoid quantization between
|
192
192
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
193
193
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
194
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
195
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
196
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
194
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
195
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
196
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
197
197
|
|
198
198
|
# ------------------- #
|
199
199
|
# Fusions
|
200
200
|
# ------------------- #
|
201
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
202
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
203
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
201
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
202
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
203
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
204
204
|
|
205
205
|
# Create a TargetPlatformModel and set its default quantization config.
|
206
206
|
# This default configuration will be used for all operations
|
207
207
|
# unless specified otherwise (see OperatorsSet, for example):
|
208
208
|
generated_tpc = schema.TargetPlatformModel(
|
209
|
-
default_configuration_options,
|
209
|
+
default_qco=default_configuration_options,
|
210
210
|
tpc_minor_version=1,
|
211
211
|
tpc_patch_version=0,
|
212
212
|
tpc_platform_type=IMX500_TP_MODEL,
|
model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_lut/tp_model.py
CHANGED
@@ -151,10 +151,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
151
151
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
152
152
|
# If the QuantizationConfigOptions contains only one configuration,
|
153
153
|
# this configuration will be used for the operation quantization:
|
154
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
154
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
155
155
|
|
156
156
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
157
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
157
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
158
158
|
base_config=base_config)
|
159
159
|
|
160
160
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -166,47 +166,47 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
166
166
|
fusing_patterns = []
|
167
167
|
|
168
168
|
# May suit for operations like: Dropout, Reshape, etc.
|
169
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
170
|
-
default_configuration_options.clone_and_edit(
|
169
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
170
|
+
qc_options=default_configuration_options.clone_and_edit(
|
171
171
|
enable_activation_quantization=False)
|
172
172
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
173
173
|
|
174
174
|
# Define operator sets that use mixed_precision_configuration_options:
|
175
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
176
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
175
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
176
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
177
177
|
|
178
178
|
# Define operations sets without quantization configuration
|
179
179
|
# options (useful for creating fusing patterns, for example):
|
180
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
181
|
-
add = schema.OperatorsSet("Add")
|
182
|
-
sub = schema.OperatorsSet("Sub")
|
183
|
-
mul = schema.OperatorsSet("Mul")
|
184
|
-
div = schema.OperatorsSet("Div")
|
185
|
-
prelu = schema.OperatorsSet("PReLU")
|
186
|
-
swish = schema.OperatorsSet("Swish")
|
187
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
188
|
-
tanh = schema.OperatorsSet("Tanh")
|
180
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
181
|
+
add = schema.OperatorsSet(name="Add")
|
182
|
+
sub = schema.OperatorsSet(name="Sub")
|
183
|
+
mul = schema.OperatorsSet(name="Mul")
|
184
|
+
div = schema.OperatorsSet(name="Div")
|
185
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
186
|
+
swish = schema.OperatorsSet(name="Swish")
|
187
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
188
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
189
189
|
|
190
190
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
191
191
|
# Combine multiple operators into a single operator to avoid quantization between
|
192
192
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
193
193
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
194
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
195
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
196
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
194
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
195
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
196
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
197
197
|
|
198
198
|
# ------------------- #
|
199
199
|
# Fusions
|
200
200
|
# ------------------- #
|
201
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
202
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
203
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
201
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
202
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
203
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
204
204
|
|
205
205
|
# Create a TargetPlatformModel and set its default quantization config.
|
206
206
|
# This default configuration will be used for all operations
|
207
207
|
# unless specified otherwise (see OperatorsSet, for example):
|
208
208
|
generated_tpc = schema.TargetPlatformModel(
|
209
|
-
default_configuration_options,
|
209
|
+
default_qco=default_configuration_options,
|
210
210
|
tpc_minor_version=1,
|
211
211
|
tpc_patch_version=0,
|
212
212
|
tpc_platform_type=IMX500_TP_MODEL,
|
model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v1_pot/tp_model.py
CHANGED
@@ -147,10 +147,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
147
147
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
148
148
|
# If the QuantizationConfigOptions contains only one configuration,
|
149
149
|
# this configuration will be used for the operation quantization:
|
150
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
150
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
151
151
|
|
152
152
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
153
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
153
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
154
154
|
base_config=base_config)
|
155
155
|
|
156
156
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -162,48 +162,48 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
162
162
|
fusing_patterns = []
|
163
163
|
|
164
164
|
# May suit for operations like: Dropout, Reshape, etc.
|
165
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
166
|
-
default_configuration_options.clone_and_edit(
|
165
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
166
|
+
qc_options=default_configuration_options.clone_and_edit(
|
167
167
|
enable_activation_quantization=False)
|
168
168
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
169
169
|
|
170
170
|
# Define operator sets that use mixed_precision_configuration_options:
|
171
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
172
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
171
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
172
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
173
173
|
|
174
174
|
# Define operations sets without quantization configuration
|
175
175
|
# options (useful for creating fusing patterns, for example):
|
176
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
177
|
-
add = schema.OperatorsSet("Add")
|
178
|
-
sub = schema.OperatorsSet("Sub")
|
179
|
-
mul = schema.OperatorsSet("Mul")
|
180
|
-
div = schema.OperatorsSet("Div")
|
181
|
-
prelu = schema.OperatorsSet("PReLU")
|
182
|
-
swish = schema.OperatorsSet("Swish")
|
183
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
184
|
-
tanh = schema.OperatorsSet("Tanh")
|
176
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
177
|
+
add = schema.OperatorsSet(name="Add")
|
178
|
+
sub = schema.OperatorsSet(name="Sub")
|
179
|
+
mul = schema.OperatorsSet(name="Mul")
|
180
|
+
div = schema.OperatorsSet(name="Div")
|
181
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
182
|
+
swish = schema.OperatorsSet(name="Swish")
|
183
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
184
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
185
185
|
|
186
186
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
187
187
|
|
188
188
|
# Combine multiple operators into a single operator to avoid quantization between
|
189
189
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
190
190
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
191
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
192
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
193
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
191
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
192
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
193
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
194
194
|
|
195
195
|
# ------------------- #
|
196
196
|
# Fusions
|
197
197
|
# ------------------- #
|
198
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
199
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
200
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
198
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
199
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
200
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
201
201
|
|
202
202
|
# Create a TargetPlatformModel and set its default quantization config.
|
203
203
|
# This default configuration will be used for all operations
|
204
204
|
# unless specified otherwise (see OperatorsSet, for example):
|
205
205
|
generated_tpc = schema.TargetPlatformModel(
|
206
|
-
default_configuration_options,
|
206
|
+
default_qco=default_configuration_options,
|
207
207
|
tpc_minor_version=1,
|
208
208
|
tpc_patch_version=0,
|
209
209
|
tpc_platform_type=IMX500_TP_MODEL,
|
@@ -156,10 +156,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
156
156
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
157
157
|
# If the QuantizationConfigOptions contains only one configuration,
|
158
158
|
# this configuration will be used for the operation quantization:
|
159
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
159
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
160
160
|
|
161
161
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
162
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
162
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
163
163
|
base_config=base_config)
|
164
164
|
|
165
165
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -170,46 +170,46 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
170
170
|
operator_set = []
|
171
171
|
fusing_patterns = []
|
172
172
|
# May suit for operations like: Dropout, Reshape, etc.
|
173
|
-
operator_set.append(schema.OperatorsSet("NoQuantization", default_configuration_options.clone_and_edit(
|
173
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization", qc_options=default_configuration_options.clone_and_edit(
|
174
174
|
enable_activation_quantization=False).clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
175
175
|
|
176
176
|
# Define operator sets that use mixed_precision_configuration_options:
|
177
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
178
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
177
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
178
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
179
179
|
|
180
180
|
# Define operations sets without quantization configuration
|
181
181
|
# options (useful for creating fusing patterns, for example):
|
182
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
183
|
-
add = schema.OperatorsSet("Add")
|
184
|
-
sub = schema.OperatorsSet("Sub")
|
185
|
-
mul = schema.OperatorsSet("Mul")
|
186
|
-
div = schema.OperatorsSet("Div")
|
187
|
-
prelu = schema.OperatorsSet("PReLU")
|
188
|
-
swish = schema.OperatorsSet("Swish")
|
189
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
190
|
-
tanh = schema.OperatorsSet("Tanh")
|
182
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
183
|
+
add = schema.OperatorsSet(name="Add")
|
184
|
+
sub = schema.OperatorsSet(name="Sub")
|
185
|
+
mul = schema.OperatorsSet(name="Mul")
|
186
|
+
div = schema.OperatorsSet(name="Div")
|
187
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
188
|
+
swish = schema.OperatorsSet(name="Swish")
|
189
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
190
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
191
191
|
|
192
192
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
193
193
|
|
194
194
|
# Combine multiple operators into a single operator to avoid quantization between
|
195
195
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
196
196
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
197
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
198
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
199
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
197
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
198
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
199
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
200
200
|
|
201
201
|
# ------------------- #
|
202
202
|
# Fusions
|
203
203
|
# ------------------- #
|
204
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
205
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
206
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
204
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
205
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
206
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
207
207
|
|
208
208
|
# Create a TargetPlatformModel and set its default quantization config.
|
209
209
|
# This default configuration will be used for all operations
|
210
210
|
# unless specified otherwise (see OperatorsSet, for example):
|
211
211
|
generated_tpm = schema.TargetPlatformModel(
|
212
|
-
default_configuration_options,
|
212
|
+
default_qco=default_configuration_options,
|
213
213
|
tpc_minor_version=2,
|
214
214
|
tpc_patch_version=0,
|
215
215
|
tpc_platform_type=IMX500_TP_MODEL,
|
model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v2_lut/tp_model.py
CHANGED
@@ -153,10 +153,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
153
153
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
154
154
|
# If the QuantizationConfigOptions contains only one configuration,
|
155
155
|
# this configuration will be used for the operation quantization:
|
156
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
156
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
157
157
|
|
158
158
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
159
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
159
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
160
160
|
base_config=base_config)
|
161
161
|
|
162
162
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -167,47 +167,47 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
167
167
|
operator_set = []
|
168
168
|
fusing_patterns = []
|
169
169
|
# May suit for operations like: Dropout, Reshape, etc.
|
170
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
171
|
-
default_configuration_options.clone_and_edit(
|
170
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
171
|
+
qc_options=default_configuration_options.clone_and_edit(
|
172
172
|
enable_activation_quantization=False)
|
173
173
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
174
174
|
|
175
175
|
# Define operator sets that use mixed_precision_configuration_options:
|
176
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
177
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
176
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
177
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
178
178
|
|
179
179
|
# Define operations sets without quantization configuration
|
180
180
|
# options (useful for creating fusing patterns, for example):
|
181
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
182
|
-
add = schema.OperatorsSet("Add")
|
183
|
-
sub = schema.OperatorsSet("Sub")
|
184
|
-
mul = schema.OperatorsSet("Mul")
|
185
|
-
div = schema.OperatorsSet("Div")
|
186
|
-
prelu = schema.OperatorsSet("PReLU")
|
187
|
-
swish = schema.OperatorsSet("Swish")
|
188
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
189
|
-
tanh = schema.OperatorsSet("Tanh")
|
181
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
182
|
+
add = schema.OperatorsSet(name="Add")
|
183
|
+
sub = schema.OperatorsSet(name="Sub")
|
184
|
+
mul = schema.OperatorsSet(name="Mul")
|
185
|
+
div = schema.OperatorsSet(name="Div")
|
186
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
187
|
+
swish = schema.OperatorsSet(name="Swish")
|
188
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
189
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
190
190
|
|
191
191
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
192
192
|
# Combine multiple operators into a single operator to avoid quantization between
|
193
193
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
194
194
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
195
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
196
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
197
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
195
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
196
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
197
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
198
198
|
|
199
199
|
# ------------------- #
|
200
200
|
# Fusions
|
201
201
|
# ------------------- #
|
202
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
203
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
204
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
202
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
203
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
204
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
205
205
|
|
206
206
|
# Create a TargetPlatformModel and set its default quantization config.
|
207
207
|
# This default configuration will be used for all operations
|
208
208
|
# unless specified otherwise (see OperatorsSet, for example):
|
209
209
|
generated_tpm = schema.TargetPlatformModel(
|
210
|
-
default_configuration_options,
|
210
|
+
default_qco=default_configuration_options,
|
211
211
|
tpc_minor_version=2,
|
212
212
|
tpc_patch_version=0,
|
213
213
|
tpc_platform_type=IMX500_TP_MODEL,
|
@@ -156,7 +156,7 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
156
156
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
157
157
|
# If the QuantizationConfigOptions contains only one configuration,
|
158
158
|
# this configuration will be used for the operation quantization:
|
159
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
159
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
160
160
|
|
161
161
|
# Create a QuantizationConfigOptions for quantizing constants in functional ops.
|
162
162
|
# Constant configuration is similar to the default eight bit configuration except for PoT
|
@@ -167,7 +167,7 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
167
167
|
default_weight_attr_config=default_config.default_weight_attr_config.clone_and_edit(
|
168
168
|
enable_weights_quantization=True, weights_per_channel_threshold=True,
|
169
169
|
weights_quantization_method=tp.QuantizationMethod.POWER_OF_TWO))
|
170
|
-
const_configuration_options = schema.QuantizationConfigOptions(tuple([const_config]))
|
170
|
+
const_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([const_config]))
|
171
171
|
|
172
172
|
# 16 bits inputs and outputs. Currently, only defined for consts since they are used in operators that
|
173
173
|
# support 16 bit as input and output.
|
@@ -175,12 +175,12 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
175
175
|
supported_input_activation_n_bits=(8, 16))
|
176
176
|
const_config_input16_output16 = const_config_input16.clone_and_edit(
|
177
177
|
activation_n_bits=16, signedness=Signedness.SIGNED)
|
178
|
-
const_configuration_options_inout16 = schema.QuantizationConfigOptions(tuple([const_config_input16_output16,
|
178
|
+
const_configuration_options_inout16 = schema.QuantizationConfigOptions(quantization_configurations=tuple([const_config_input16_output16,
|
179
179
|
const_config_input16]),
|
180
180
|
base_config=const_config_input16)
|
181
181
|
|
182
182
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
183
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
183
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
184
184
|
base_config=base_config)
|
185
185
|
|
186
186
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -191,49 +191,49 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
191
191
|
operator_set = []
|
192
192
|
fusing_patterns = []
|
193
193
|
# May suit for operations like: Dropout, Reshape, etc.
|
194
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
195
|
-
default_configuration_options.clone_and_edit(
|
194
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
195
|
+
qc_options=default_configuration_options.clone_and_edit(
|
196
196
|
enable_activation_quantization=False,
|
197
197
|
supported_input_activation_n_bits=(8, 16))
|
198
198
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
199
|
-
operator_set.append(schema.OperatorsSet("Default16BitInout", const_configuration_options_inout16))
|
199
|
+
operator_set.append(schema.OperatorsSet(name="Default16BitInout", qc_options=const_configuration_options_inout16))
|
200
200
|
|
201
201
|
# Define operator sets that use mixed_precision_configuration_options:
|
202
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
203
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
202
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
203
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
204
204
|
|
205
205
|
# Define operations sets without quantization configuration
|
206
206
|
# options (useful for creating fusing patterns, for example):
|
207
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
208
|
-
add = schema.OperatorsSet("Add", const_configuration_options_inout16)
|
209
|
-
sub = schema.OperatorsSet("Sub", const_configuration_options_inout16)
|
210
|
-
mul = schema.OperatorsSet("Mul", const_configuration_options_inout16)
|
211
|
-
div = schema.OperatorsSet("Div", const_configuration_options)
|
212
|
-
prelu = schema.OperatorsSet("PReLU")
|
213
|
-
swish = schema.OperatorsSet("Swish")
|
214
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
215
|
-
tanh = schema.OperatorsSet("Tanh")
|
207
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
208
|
+
add = schema.OperatorsSet(name="Add", qc_options=const_configuration_options_inout16)
|
209
|
+
sub = schema.OperatorsSet(name="Sub", qc_options=const_configuration_options_inout16)
|
210
|
+
mul = schema.OperatorsSet(name="Mul", qc_options=const_configuration_options_inout16)
|
211
|
+
div = schema.OperatorsSet(name="Div", qc_options=const_configuration_options)
|
212
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
213
|
+
swish = schema.OperatorsSet(name="Swish")
|
214
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
215
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
216
216
|
|
217
217
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
218
218
|
# Combine multiple operators into a single operator to avoid quantization between
|
219
219
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
220
220
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
221
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
222
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
223
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
221
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
222
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
223
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
224
224
|
|
225
225
|
# ------------------- #
|
226
226
|
# Fusions
|
227
227
|
# ------------------- #
|
228
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
229
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
230
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
228
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
229
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
230
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
231
231
|
|
232
232
|
# Create a TargetPlatformModel and set its default quantization config.
|
233
233
|
# This default configuration will be used for all operations
|
234
234
|
# unless specified otherwise (see OperatorsSet, for example):
|
235
235
|
generated_tpm = schema.TargetPlatformModel(
|
236
|
-
default_configuration_options,
|
236
|
+
default_qco=default_configuration_options,
|
237
237
|
tpc_minor_version=3,
|
238
238
|
tpc_patch_version=0,
|
239
239
|
tpc_platform_type=IMX500_TP_MODEL,
|
model_compression_toolkit/target_platform_capabilities/tpc_models/imx500_tpc/v3_lut/tp_model.py
CHANGED
@@ -153,7 +153,7 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
153
153
|
# of possible configurations to consider when quantizing a set of operations (in mixed-precision, for example).
|
154
154
|
# If the QuantizationConfigOptions contains only one configuration,
|
155
155
|
# this configuration will be used for the operation quantization:
|
156
|
-
default_configuration_options = schema.QuantizationConfigOptions(tuple([default_config]))
|
156
|
+
default_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([default_config]))
|
157
157
|
|
158
158
|
# Create a QuantizationConfigOptions for quantizing constants in functional ops.
|
159
159
|
# Constant configuration is similar to the default eight bit configuration except for PoT
|
@@ -164,10 +164,10 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
164
164
|
default_weight_attr_config=default_config.default_weight_attr_config.clone_and_edit(
|
165
165
|
enable_weights_quantization=True, weights_per_channel_threshold=True,
|
166
166
|
weights_quantization_method=tp.QuantizationMethod.POWER_OF_TWO))
|
167
|
-
const_configuration_options = schema.QuantizationConfigOptions(tuple([const_config]))
|
167
|
+
const_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple([const_config]))
|
168
168
|
|
169
169
|
# Create Mixed-Precision quantization configuration options from the given list of OpQuantizationConfig objects
|
170
|
-
mixed_precision_configuration_options = schema.QuantizationConfigOptions(tuple(mixed_precision_cfg_list),
|
170
|
+
mixed_precision_configuration_options = schema.QuantizationConfigOptions(quantization_configurations=tuple(mixed_precision_cfg_list),
|
171
171
|
base_config=base_config)
|
172
172
|
|
173
173
|
# Create an OperatorsSet to represent a set of operations.
|
@@ -178,47 +178,47 @@ def generate_tp_model(default_config: OpQuantizationConfig,
|
|
178
178
|
operator_set = []
|
179
179
|
fusing_patterns = []
|
180
180
|
# May suit for operations like: Dropout, Reshape, etc.
|
181
|
-
operator_set.append(schema.OperatorsSet("NoQuantization",
|
182
|
-
default_configuration_options.clone_and_edit(
|
181
|
+
operator_set.append(schema.OperatorsSet(name="NoQuantization",
|
182
|
+
qc_options=default_configuration_options.clone_and_edit(
|
183
183
|
enable_activation_quantization=False)
|
184
184
|
.clone_and_edit_weight_attribute(enable_weights_quantization=False)))
|
185
185
|
|
186
186
|
# Define operator sets that use mixed_precision_configuration_options:
|
187
|
-
conv = schema.OperatorsSet("Conv", mixed_precision_configuration_options)
|
188
|
-
fc = schema.OperatorsSet("FullyConnected", mixed_precision_configuration_options)
|
187
|
+
conv = schema.OperatorsSet(name="Conv", qc_options=mixed_precision_configuration_options)
|
188
|
+
fc = schema.OperatorsSet(name="FullyConnected", qc_options=mixed_precision_configuration_options)
|
189
189
|
|
190
190
|
# Define operations sets without quantization configuration
|
191
191
|
# options (useful for creating fusing patterns, for example):
|
192
|
-
any_relu = schema.OperatorsSet("AnyReLU")
|
193
|
-
add = schema.OperatorsSet("Add", const_configuration_options)
|
194
|
-
sub = schema.OperatorsSet("Sub", const_configuration_options)
|
195
|
-
mul = schema.OperatorsSet("Mul", const_configuration_options)
|
196
|
-
div = schema.OperatorsSet("Div", const_configuration_options)
|
197
|
-
prelu = schema.OperatorsSet("PReLU")
|
198
|
-
swish = schema.OperatorsSet("Swish")
|
199
|
-
sigmoid = schema.OperatorsSet("Sigmoid")
|
200
|
-
tanh = schema.OperatorsSet("Tanh")
|
192
|
+
any_relu = schema.OperatorsSet(name="AnyReLU")
|
193
|
+
add = schema.OperatorsSet(name="Add", qc_options=const_configuration_options)
|
194
|
+
sub = schema.OperatorsSet(name="Sub", qc_options=const_configuration_options)
|
195
|
+
mul = schema.OperatorsSet(name="Mul", qc_options=const_configuration_options)
|
196
|
+
div = schema.OperatorsSet(name="Div", qc_options=const_configuration_options)
|
197
|
+
prelu = schema.OperatorsSet(name="PReLU")
|
198
|
+
swish = schema.OperatorsSet(name="Swish")
|
199
|
+
sigmoid = schema.OperatorsSet(name="Sigmoid")
|
200
|
+
tanh = schema.OperatorsSet(name="Tanh")
|
201
201
|
|
202
202
|
operator_set.extend([conv, fc, any_relu, add, sub, mul, div, prelu, swish, sigmoid, tanh])
|
203
203
|
# Combine multiple operators into a single operator to avoid quantization between
|
204
204
|
# them. To do this we define fusing patterns using the OperatorsSets that were created.
|
205
205
|
# To group multiple sets with regard to fusing, an OperatorSetConcat can be created
|
206
|
-
activations_after_conv_to_fuse = schema.OperatorSetConcat([any_relu, swish, prelu, sigmoid, tanh])
|
207
|
-
activations_after_fc_to_fuse = schema.OperatorSetConcat([any_relu, swish, sigmoid])
|
208
|
-
any_binary = schema.OperatorSetConcat([add, sub, mul, div])
|
206
|
+
activations_after_conv_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, prelu, sigmoid, tanh])
|
207
|
+
activations_after_fc_to_fuse = schema.OperatorSetConcat(operators_set=[any_relu, swish, sigmoid])
|
208
|
+
any_binary = schema.OperatorSetConcat(operators_set=[add, sub, mul, div])
|
209
209
|
|
210
210
|
# ------------------- #
|
211
211
|
# Fusions
|
212
212
|
# ------------------- #
|
213
|
-
fusing_patterns.append(schema.Fusing((conv, activations_after_conv_to_fuse)))
|
214
|
-
fusing_patterns.append(schema.Fusing((fc, activations_after_fc_to_fuse)))
|
215
|
-
fusing_patterns.append(schema.Fusing((any_binary, any_relu)))
|
213
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(conv, activations_after_conv_to_fuse)))
|
214
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(fc, activations_after_fc_to_fuse)))
|
215
|
+
fusing_patterns.append(schema.Fusing(operator_groups=(any_binary, any_relu)))
|
216
216
|
|
217
217
|
# Create a TargetPlatformModel and set its default quantization config.
|
218
218
|
# This default configuration will be used for all operations
|
219
219
|
# unless specified otherwise (see OperatorsSet, for example):
|
220
220
|
generated_tpm = schema.TargetPlatformModel(
|
221
|
-
default_configuration_options,
|
221
|
+
default_qco=default_configuration_options,
|
222
222
|
tpc_minor_version=3,
|
223
223
|
tpc_patch_version=0,
|
224
224
|
tpc_platform_type=IMX500_TP_MODEL,
|