Skip to content

Commit 26b4e96

Browse files
authored
NXP backend: Update to Neutron Converter SDK_25.06 (#13128)
### Summary Bumps Neutron Converter SDK version and decreases min-num-ops-per-graph to revert the original Neutron Converter functionality. ### Test plan You can test this change by running NXP backend tests since almost all of them rely on Neutron Converter. cc @digantdesai @JakeStevens @robert-kalmar
1 parent 208e7a3 commit 26b4e96

File tree

9 files changed

+10
-8
lines changed

9 files changed

+10
-8
lines changed

backends/nxp/backend/neutron_converter_manager.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def convert(
5050

5151
cctx = neutron_converter.CompilationContext()
5252
cctx.targetOpts = neutron_converter.getNeutronTarget(target)
53+
# New switch since Neutron Converter SDK_25.06
54+
cctx.compilationOpts.minNumOpsPerGraph = 1
5355
model_converted = neutron_converter.convertModel(list(tflite_model), cctx)
5456

5557
return bytes(model_converted)

backends/nxp/nxp_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def neutron_compile_spec(
6464
Args:
6565
config: Neutron accelerator configuration, e.g. "imxrt700"
6666
neutron_converter_flavor: Flavor of the neutron-converter module to use. Neutron-converter module named "
67-
"'neutron_converter_SDK_25_03' has flavor 'SDK_25_03'.
67+
"'neutron_converter_SDK_25_06' has flavor 'SDK_25_06'.
6868
extra_flags: Extra flags for the Neutron compiler
6969
operators_not_to_delegate: List of operators that should not be delegated
7070
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
--index-url https://eiq.nxp.com/repository
2-
neutron_converter_SDK_25_03
2+
neutron_converter_SDK_25_06

backends/nxp/tests/executorch_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def to_quantized_edge_program(
8888
[tuple[ModelInputSpec, ...]], list[tuple[torch.Tensor, ...]]
8989
] = get_random_calibration_inputs,
9090
target="imxrt700",
91-
neutron_converter_flavor="SDK_25_03",
91+
neutron_converter_flavor="SDK_25_06",
9292
remove_quant_io_ops=False,
9393
custom_delegation_options=CustomDelegationOptions(), # noqa B008
9494
) -> EdgeProgramManager:

backends/nxp/tests/test_neutron_converter_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_conv2d_neutron_conversion__default_flavor():
3030

3131
neutron_converter_manager = NeutronConverterManager()
3232
neutron_model = neutron_converter_manager.convert(
33-
tflite_model, "imxrt700", "SDK_25_03"
33+
tflite_model, "imxrt700", "SDK_25_06"
3434
)
3535

3636
assert len(

examples/nxp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ examples/nxp/setup.sh
1313
2. Now run the `aot_neutron_compile.py` example with the `cifar10` model
1414
```commandline
1515
$ python -m examples.nxp.aot_neutron_compile --quantize \
16-
--delegate --neutron_converter_flavor SDK_25_03 -m cifar10
16+
--delegate --neutron_converter_flavor SDK_25_06 -m cifar10
1717
```
1818

1919
3. It will generate you `cifar10_nxp_delegate.pte` file which can be used with the MXUXpresso SDK `cifarnet_example` project, presented [here](https://mcuxpresso.nxp.com/mcuxsdk/latest/html/middleware/eiq/executorch/docs/nxp/topics/example_applications.html#how-to-build-and-run-executorch-cifarnet-example).

examples/nxp/aot_neutron_compile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _get_batch_size(data):
164164
"-c",
165165
"--neutron_converter_flavor",
166166
required=False,
167-
default="SDK_25_03",
167+
default="SDK_25_06",
168168
help="Flavor of installed neutron-converter module. Neutron-converter module named "
169169
"'neutron_converter_SDK_24_12' has flavor 'SDK_24_12'.",
170170
)

examples/nxp/run_aot_example.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ cd $EXECUTORCH_DIR
1313

1414
# Run the AoT example
1515
python -m examples.nxp.aot_neutron_compile --quantize \
16-
--delegate --neutron_converter_flavor SDK_25_03 -m ${MODEL}
16+
--delegate --neutron_converter_flavor SDK_25_06 -m ${MODEL}
1717
# verify file exists
1818
test -f ${MODEL}_nxp_delegate.pte

examples/nxp/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
set -u
88

99
# Install neutron-converter
10-
pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_03
10+
pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_06

0 commit comments

Comments
 (0)