This directory contains examples demonstrating the use of ExecuTorch AoT flow to convert a PyTorch model to ExecuTorch format and delegate the model computation to eIQ Neutron NPU using the eIQ Neutron Backend.
experimental/- contains CifarNet model example.models- demo models instantiation used in examplesaot_neutron_compile.py- script with end-to-end ExecuTorch AoT Neutron Backend workflow.README.md- this file.run_aot_example.sh- utility script to launch aot_neutron_compile.py. Primarily for CI purpose.setup.sh- setup script to install NeutronBackend dependencies.
Please finish tutorial Setting up ExecuTorch.
Run the setup.sh script to install the neutron-converter:
$ ./examples/nxp/setup.sh
- CifarNet
- MobileNetV2
First we will start with an example script converting the model. This example show the CifarNet model preparation.
It is the same model which is part of the example_cifarnet in
MCUXpresso SDK.
The NXP MCUXpresso software and tools offer comprehensive development solutions designed to help accelerate embedded system development of applications based on MCUs from NXP. The MCUXpresso SDK includes a flexible set of peripheral drivers designed to speed up and simplify development of embedded applications.
The steps are expected to be executed from the executorch root folder.
-
Run the
aot_neutron_compile.pyexample with thecifar10model$ python -m examples.nxp.aot_neutron_compile --quantize \ --delegate --neutron_converter_flavor SDK_25_06 -m cifar10 -
It will generate you
cifar10_nxp_delegate.ptefile which can be used with the MCUXpresso SDKcifarnet_exampleproject, presented here. This project will guide you through the process of deploying your PTE model to the device. To get the MCUXpresso SDK follow this guide, use the MCUXpresso SDK v25.06.00.