Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/nxp/backend/edge_program_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class EdgeProgramToIRConverter:
"""

_default_conversion_config = ConversionConfig()
_default_target_spec = NeutronTargetSpec("imxrt700", "SDK_25_09")
_default_target_spec = NeutronTargetSpec("imxrt700", "SDK_25_12")
_default_delegation_options = CustomDelegationOptions()

def convert_program(
Expand Down
2 changes: 1 addition & 1 deletion backends/nxp/backend/neutron_converter_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NeutronConverterManager:

def __init__(
self,
neutron_converter_flavor: str = "SDK_25_09",
neutron_converter_flavor: str = "SDK_25_12",
):

neutron_converter_modules = [
Expand Down
2 changes: 1 addition & 1 deletion backends/nxp/nxp_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def neutron_compile_spec(
Args:
config: Neutron accelerator configuration, e.g. "imxrt700"
neutron_converter_flavor: Flavor of the neutron-converter module to use. Neutron-converter module named "
"'neutron_converter_SDK_25_09' has flavor 'SDK_25_09'.
"'neutron_converter_SDK_25_12' has flavor 'SDK_25_12'.
extra_flags: Extra flags for the Neutron compiler
operators_not_to_delegate: List of operators that should not be delegated
use_neutron_for_format_conversion: If True, the EdgeProgramToIRConverter will insert `Transpose` ops to
Expand Down
2 changes: 1 addition & 1 deletion backends/nxp/requirements-tests-eiq.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--index-url https://eiq.nxp.com/repository
neutron_converter_SDK_25_09
neutron_converter_SDK_25_12
2 changes: 1 addition & 1 deletion backends/nxp/tests/executorch_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from torch.export import export
from torchao.quantization.pt2e.quantizer import Quantizer

neutron_converter_flavor = "SDK_25_09"
neutron_converter_flavor = "SDK_25_12"
neutron_target_spec = NeutronTargetSpec(
target="imxrt700", neutron_converter_flavor=neutron_converter_flavor
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def test_cat__same_shapes_converter_padding_last_dimension(use_qat):
CatModule(2),
[input_shape, input_shape],
target=target,
neutron_converter_flavor="SDK_25_09",
neutron_converter_flavor="SDK_25_12",
custom_delegation_options=CustomDelegationOptions(),
use_qat=use_qat,
).exported_program()
Expand All @@ -385,7 +385,7 @@ def test_cat__same_shapes__channels_first__padding_channels(use_qat):
CatConvModule(1),
[input_shape, input_shape],
target=target,
neutron_converter_flavor="SDK_25_09",
neutron_converter_flavor="SDK_25_12",
custom_delegation_options=CustomDelegationOptions(),
use_qat=use_qat,
).exported_program()
Expand Down
2 changes: 1 addition & 1 deletion backends/nxp/tests/test_edge_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_remove_additional_quantize_dequantize_nodes_pass(self):

edge_program_manager = edge_program_manager.transform(NeutronEdgePassManager())

compile_spec = generate_neutron_compile_spec(target, "SDK_25_09")
compile_spec = generate_neutron_compile_spec(target, "SDK_25_12")
partitioner = NeutronPartitioner(
compile_spec, neutron_target_spec, custom_delegation_options
)
Expand Down
8 changes: 4 additions & 4 deletions backends/nxp/tests/test_neutron_backend_executor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 NXP
# Copyright 2024-2025 NXP
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -165,7 +165,7 @@ def test_delegating_format_related_transpose_operators__supported_case(mocker):
# Make sure the output channels (channels for the trailing Transpose), and the last input dimension (channels for
# the leading Transpose) are multiples of `num_macs``.

num_macs = NeutronTargetSpec("imxrt700", "SDK_25_09").get_num_macs()
num_macs = NeutronTargetSpec("imxrt700", "SDK_25_12").get_num_macs()
model = Conv2dModule(
in_channels=num_macs, out_channels=num_macs, padding=1, stride=1
)
Expand Down Expand Up @@ -222,7 +222,7 @@ def test_delegating_format_related_transpose_operators__supported_case(mocker):
def test_delegating_format_related_transpose_operators__supported_output__unsupported_input(
mocker,
):
num_macs = NeutronTargetSpec("imxrt700", "SDK_25_09").get_num_macs()
num_macs = NeutronTargetSpec("imxrt700", "SDK_25_12").get_num_macs()
model = Conv2dModule(
in_channels=num_macs,
out_channels=num_macs, # The output `Transpose` will be supported.
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_delegating_format_related_transpose_operators__supported_output__unsupp
def test_delegating_format_related_transpose_operators__supported_input__unsupported_output(
mocker,
):
num_macs = NeutronTargetSpec("imxrt700", "SDK_25_09").get_num_macs()
num_macs = NeutronTargetSpec("imxrt700", "SDK_25_12").get_num_macs()
model = Conv2dModule(
in_channels=num_macs,
out_channels=3, # The output `Transpose` will NOT be supported.
Expand Down
2 changes: 1 addition & 1 deletion backends/nxp/tests/test_split_group_convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _quantize_and_lower_module(
edge_compile_config=edge_compile_config,
)

compile_spec = generate_neutron_compile_spec(target, "SDK_25_09")
compile_spec = generate_neutron_compile_spec(target, "SDK_25_12")
partitioner = NeutronPartitioner(compile_spec, neutron_target_spec)
return edge_program_manager.to_backend(partitioner)

Expand Down
6 changes: 3 additions & 3 deletions docs/source/backends/nxp/nxp-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Among currently supported machine learning models are:
## Development Requirements

- [MCUXpresso IDE](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE) or [MCUXpresso Visual Studio Code extension](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-for-visual-studio-code:MCUXPRESSO-VSC)
- [MCUXpresso SDK 25.06](https://mcuxpresso.nxp.com/mcuxsdk/25.06.00/html/index.html)
- eIQ Neutron Converter for MCUXPresso SDK 25.06, what you can download from eIQ PyPI:
- [MCUXpresso SDK 25.12](https://mcuxpresso.nxp.com/mcuxsdk/25.12.00/html/index.html)
- eIQ Neutron Converter for MCUXPresso SDK 25.12, what you can download from eIQ PyPI:

```commandline
$ pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_06
$ pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_12
```

Instead of manually installing requirements, except MCUXpresso IDE and SDK, you can use the setup script:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/backends/nxp/nxp-partitioner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To generate the Compile Spec for Neutron backend, you can use the `generate_neut
Following fields can be set:

* `config` - NXP platform defining the Neutron NPU configuration, e.g. "imxrt700".
* `neutron_converter_flavor` - Flavor of the neutron-converter module to use. Neutron-converter module named neutron_converter_SDK_25_06' has flavor 'SDK_25_06'. You shall set the flavour to the MCUXpresso SDK version you will use.
* `neutron_converter_flavor` - Flavor of the neutron-converter module to use. Neutron-converter module named neutron_converter_SDK_25_12' has flavor 'SDK_25_12'. You shall set the flavour to the MCUXpresso SDK version you will use.
* `extra_flags` - Extra flags for the Neutron compiler.
* `operators_not_to_delegate` - List of operators that will not be delegated.

Expand Down
6 changes: 3 additions & 3 deletions docs/source/backends/nxp/nxp-quantization.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ from torchao.quantization.pt2e.quantize_pt2e import convert_pt2e, prepare_pt2e
model = models.mobilenetv2.mobilenet_v2(weights=MobileNet_V2_Weights.DEFAULT).eval()
sample_inputs = (torch.randn(1, 3, 224, 224), )

target_spec = NeutronTargetSpec(target="imxrt700", converter_flavor="SDK_25_09")
target_spec = NeutronTargetSpec(target="imxrt700", converter_flavor="SDK_25_12")
quantizer = NeutronQuantizer(neutron_target_spec) # (1)

training_ep = torch.export.export(model, sample_inputs).module() # (2)
Expand All @@ -78,7 +78,7 @@ quantized_model = convert_pt2e(prepared_model) # (5)
compile_spec = generate_neutron_compile_spec(
"imxrt700",
operators_not_to_delegate=None,
neutron_converter_flavor="SDK_25_06",
neutron_converter_flavor="SDK_25_12",
)

et_program = to_edge_transform_and_lower( # (6)
Expand All @@ -95,7 +95,7 @@ from executorch.backends.nxp.quantizer.utils import calibrate_and_quantize

...

target_spec = NeutronTargetSpec(target="imxrt700", converter_flavor="SDK_25_09")
target_spec = NeutronTargetSpec(target="imxrt700", converter_flavor="SDK_25_12")
quantized_graph_module = calibrate_and_quantize(
aten_model,
calibration_inputs,
Expand Down
4 changes: 2 additions & 2 deletions examples/nxp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ The steps are expected to be executed from the `executorch` root folder.
1. Run the `aot_neutron_compile.py` example with the `cifar10` model
```commandline
$ python -m examples.nxp.aot_neutron_compile --quantize \
--delegate --neutron_converter_flavor SDK_25_09 -m cifar10
--delegate --neutron_converter_flavor SDK_25_12 -m cifar10
```

2. It will generate you `cifar10_nxp_delegate.pte` file which can be used with the MCUXpresso 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).
This project will guide you through the process of deploying your PTE model to the device.
To get the MCUXpresso SDK follow this [guide](https://mcuxpresso.nxp.com/mcuxsdk/latest/html/middleware/eiq/executorch/docs/nxp/topics/getting_mcuxpresso.html),
use the MCUXpresso SDK v25.09.00.
use the MCUXpresso SDK v25.12.00.
4 changes: 2 additions & 2 deletions examples/nxp/aot_neutron_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def get_model_and_inputs_from_name(model_name: str):
"-c",
"--neutron_converter_flavor",
required=False,
default="SDK_25_09",
default="SDK_25_12",
help="Flavor of installed neutron-converter module. Neutron-converter module named "
"'neutron_converter_SDK_25_09' has flavor 'SDK_25_09'.",
"'neutron_converter_SDK_25_12' has flavor 'SDK_25_12'.",
)
parser.add_argument(
"-q",
Expand Down
2 changes: 1 addition & 1 deletion examples/nxp/run_aot_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ cd $EXECUTORCH_DIR

# Run the AoT example
python -m examples.nxp.aot_neutron_compile --quantize \
--delegate --neutron_converter_flavor SDK_25_09 -m ${MODEL}
--delegate --neutron_converter_flavor SDK_25_12 -m ${MODEL}
# verify file exists
test -f ${MODEL}_nxp_delegate.pte
2 changes: 1 addition & 1 deletion examples/nxp/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set -u

# Install neutron-converter
pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_09
pip install --index-url https://eiq.nxp.com/repository neutron_converter_SDK_25_12

# Get the directory of the current script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand Down
Loading