This directory contains documentation and scripts to help you setup and run a PyTorch model on the Arm backend via ExecuTorch.
For Ethos-U examples, install the current checkout and the dependencies needed for ahead-of-time (AOT) export in a clean Python environment:
python3.12 -m venv .venv
source .venv/bin/activate
./install_executorch.sh --optional-dependency ethos_uAfter the base dependencies are installed, the equivalent editable package
command is pip install -e '.[ethos_u]' --no-build-isolation. The ethos_u
extra provides host-side export dependencies; it does not install the Arm
toolchain, FVPs, or target runtime. Run setup.sh below to install the cross
compiler, FVPs, and backend tools used by these examples.
setup.sh downloads the Arm cross-compilation toolchain and Corstone FVP
simulators, installs the backend dependencies, and generates setup_path.sh
scripts for adding those tools to your environment. Optional flags also install
VGF/MLSDK and Vulkan dependencies.
Example to install the default Arm backend dependencies and add them to your current shell:
./examples/arm/setup.sh --i-agree-to-the-contained-eula
source examples/arm/arm-scratch/setup_path.shrun.sh is an end-to-end helper for building and executing an Arm backend
example. It sources the setup_path.sh script generated by setup.sh, runs
aot_arm_compiler.py to convert the selected model to a .pte or .bpte,
builds the matching runner with CMake, and starts the simulator or runtime for
the selected target when --build_only is not set.
Build and test artifacts are written to arm_test by default. Use
--et_build_root=<FOLDER> to choose another build root.
For example, after running setup.sh and sourcing the generated
setup_path.sh, build and run a model on an Ethos-U85 target with:
./examples/arm/run.sh --model_name=examples/arm/example_modules/add.py --target=ethos-u85-128For bundled input/output and ETDump testing:
./examples/arm/run.sh --model_name=lstm --target=ethos-u85-128 --bundleio --etdumpFor Cortex-M testing, use a Cortex-M target and bundled I/O:
./examples/arm/run.sh --model_name=mv2 --target=cortex-m55 --bundleio- ethos_u_minimal_example.ipynb - Minimal Ethos-U AOT, runtime build, and FVP execution flow.
- vgf_minimal_example.ipynb - Minimal VGF lowering and host execution flow.
- cortex_m_mv2_example.ipynb - Cortex-M MobileNetV2 export, quantization, runtime build, and FVP execution flow.
- pruning_minimal_example.ipynb - Model conditioning and pruning flow for Ethos-U85.
- quantizer_tutorial.ipynb - Quantizer tutorial for TOSA, Ethos-U, and VGF quantizers.
- minimal_classic_ml - Minimal single-shot runtime integration, intended for models such as MobileNetV2 and YOLO.
- image_classification_example_ethos_u
- End-to-end DEiT-Tiny image classification flow for Ethos-U, including model fine-tuning, export, bare-metal runtime build, and Corstone-320 FVP execution.
- mobilesam_prompt_segmentation_example_ethos_u
- End-to-end MobileSAM prompt segmentation flow for Ethos-U, including export, quantization, debug mask generation, bare-metal runtime build, and Corstone-320 FVP execution.
- image_classification_example_vgf - DEiT-Tiny image classification flow for VGF host execution.
- super_resolution_example_vgf - Swin2SR image super-resolution.
- example_modules/add.py - Small external model file
usable with
run.sh --model_name=examples/arm/example_modules/add.py.
- executor_runner - Advanced test and diagnostic runner for BundleIO, ETDump, profiling, semihosted files, and backend regression tests.
- ethos-u-porting-guide.md - Notes for adapting the example Ethos-U runtime integration to another target.
- export_standalone_tosa_graph.py - Example of exporting a standalone TOSA graph with multiple outputs.
- visualize.py - Helper used by
run.sh --model_explorerto visualize TOSA or PTE graphs.
These project templates provide alternative starting points with different toolchains and build systems:
-
CMSIS-Executorch Project Template — Docker-based build environment with Keil Studio/VS Code integration, automated CI/CD, and AVH simulation support.
-
ExecuTorch on Zephyr RTOS with CMSIS — ExecuTorch on Arm Cortex-M with Ethos-U NPU using Zephyr RTOS and CMSIS Toolbox.