Skip to content

Commit 7ce9aba

Browse files
Merge pull request #2204 from madeline-underwood/review-visualizing-ethos-u-performance
Review visualizing ethos u performance_to be signed off
2 parents 32aeeb7 + 946cbfd commit 7ce9aba

File tree

12 files changed

+384
-255
lines changed

12 files changed

+384
-255
lines changed

content/learning-paths/embedded-and-microcontrollers/visualizing-ethos-u-performance/1-overview.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

content/learning-paths/embedded-and-microcontrollers/visualizing-ethos-u-performance/2-env-setup.md

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Overview
3+
weight: 2
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
## Simulate and evaluate TinyML performance on Arm virtual hardware
9+
10+
In this section, you’ll learn how TinyML, ExecuTorch, and Arm Fixed Virtual Platforms work together to simulate embedded AI workloads before hardware is available.
11+
12+
Choosing the right hardware for your machine learning (ML) model starts with having the right tools. In many cases, you need to test and iterate before your target hardware is even available, especially when working with cutting-edge accelerators like the Ethos-U NPU.
13+
14+
Arm [Fixed Virtual Platforms](https://developer.arm.com/Tools%20and%20Software/Fixed%20Virtual%20Platforms) (FVPs) let you visualize and test model performance before any physical hardware is available.
15+
16+
By simulating hardware behavior at the system level, FVPs allow you to:
17+
18+
- Benchmark inference speed and measure operator-level performance
19+
- Identify which operations are delegated to the NPU and which execute on the CPU
20+
- Validate end-to-end integration between components like ExecuTorch and Arm NN
21+
- Iterate faster by debugging and optimizing your workload without relying on hardware
22+
23+
This makes FVPs a crucial tool for embedded ML workflows where precision, portability, and early validation matter.
24+
25+
## What is TinyML?
26+
27+
TinyML is machine learning optimized to run on low-power, resource-constrained devices such as Arm Cortex-M microcontrollers and NPUs like the Ethos-U. These models must fit within tight memory and compute budgets, making them ideal for embedded systems.
28+
29+
This Learning Path focuses on using TinyML models with virtualized Arm hardware to simulate real-world AI workloads on microcontrollers and NPUs.
30+
31+
If you're looking to build and train your own TinyML models, follow the [Introduction to TinyML on Arm using PyTorch and ExecuTorch](/embedded-and-microcontrollers/introduction-to-tinyml-on-arm/).
32+
33+
## What is ExecuTorch?
34+
35+
ExecuTorch is a lightweight runtime for running PyTorch models on embedded and edge devices. It supports efficient model inference on a range of Arm processors, ranging from Cortex-M CPUs to Ethos-U NPUs, with support for hybrid CPU+accelerator execution.
36+
37+
ExecuTorch provides:
38+
39+
- Ahead-of-time (AOT) compilation for faster inference
40+
- Delegation of selected operators to accelerators like Ethos-U
41+
- Tight integration with Arm compute libraries
42+
43+
## Why use Arm Fixed Virtual Platforms?
44+
45+
Arm Fixed Virtual Platforms (FVPs) are virtual hardware models used to simulate Arm-based systems like the Corstone-320. They allow developers to validate and tune software before silicon is available, which is especially important when targeting newly-released accelerators like the [Ethos-U85](https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u85) NPU.
46+
47+
These virtual platforms also include a built-in graphical user interface (GUI) that helps you:
48+
49+
- Confirm your model is running on the intended virtual hardware
50+
- Visualize instruction counts
51+
- Review total execution time
52+
- Capture clear outputs for demos and prototypes
53+
54+
## What is Corstone-320?
55+
56+
The Corstone-320 FVP is a virtual model of an Arm-based microcontroller system optimized for AI and TinyML workloads. It supports Cortex-M CPUs and the Ethos-U NPU, making it ideal for early testing, performance tuning, and validation of embedded AI applications, all before physical hardware is available.
57+
58+
The Corstone-320 reference system is free to use, but you'll need to accept the license agreement during installation. For more information, see the [Corstone-320 documentation](https://developer.arm.com/documentation/109761/0000?lang=en).
59+
60+
## What's next?
61+
In the next section, you'll explore how ExecuTorch compiles and deploys models to run efficiently on simulated hardware.

content/learning-paths/embedded-and-microcontrollers/visualizing-ethos-u-performance/3-env-setup-fvp.md

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
# User change
3+
title: "Understand the ExecuTorch workflow"
4+
5+
weight: 3
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
## Overview
11+
12+
Before setting up your environment, it helps to understand how ExecuTorch processes a model and runs it on Arm-based hardware. ExecuTorch uses ahead-of-time (AOT) compilation to transform PyTorch models into optimized operator graphs that run efficiently on resource-constrained systems. The workflow supports hybrid execution across CPU and NPU cores, allowing you to profile, debug, and deploy TinyML workloads with low runtime overhead and high portability across Arm microcontrollers.
13+
14+
## ExecuTorch in three steps
15+
16+
ExecuTorch works in three main steps:
17+
18+
**Step 1: Export the model**
19+
20+
- Convert a trained PyTorch model into an operator graph
21+
- Identify operators that can be offloaded to the Ethos-U NPU (for example, ReLU, conv, and quantize)
22+
23+
**Step 2: Compile with the AOT compiler**
24+
25+
- Translate the operator graph into an optimized, quantized format
26+
- Use `--delegate` to move eligible operations to the Ethos-U accelerator
27+
- Save the compiled output as a `.pte` file
28+
29+
**Step 3: Deploy and run**
30+
31+
- Execute the compiled model on an FVP or physical target
32+
- The Ethos-U NPU runs delegated operators - all others run on the Cortex-M CPU
33+
34+
For more detail, see the [ExecuTorch documentation](https://docs.pytorch.org/executorch/stable/intro-how-it-works.html).
35+
36+
37+
## A visual overview
38+
39+
The diagram below summarizes the ExecuTorch workflow from model export to deployment. It shows how a trained PyTorch model is transformed into an optimized, quantized format and deployed to a target system such as an Arm Fixed Virtual Platform (FVP).
40+
41+
- On the left, the model is exported into a graph of operators, with eligible layers flagged for NPU acceleration.
42+
- In the center, the AOT compiler optimizes and delegates operations, producing a `.pte` file ready for deployment.
43+
- On the right, the model is executed on embedded Arm hardware, where delegated operators run on the Ethos-U NPU, and the rest are handled by the Cortex-M CPU.
44+
45+
This three-step workflow ensures your TinyML models are performance-tuned and hardware-aware before deployment—even without access to physical silicon.
46+
47+
![Diagram showing the three-step ExecuTorch workflow from model export to deployment#center](./how-executorch-works-high-level.png "The three-step ExecuTorch workflow from model export to deployment")
48+
49+
## What's next?
50+
51+
Now that you understand how ExecuTorch works, you're ready to set up your environment and install the tools.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# User change
3+
title: "Set up your ExecuTorch environment"
4+
5+
weight: 4
6+
7+
# Do not modify these elements
8+
layout: "learningpathall"
9+
---
10+
## Set up overview
11+
12+
Before you can deploy and test models with ExecuTorch, you need to set up your local development environment. This section walks you through installing system dependencies, creating a virtual environment, and cloning the ExecuTorch repository on Ubuntu or WSL. Once complete, you'll be ready to run TinyML models on a virtual Arm platform.
13+
14+
## Install system dependencies
15+
16+
{{< notice Note >}}
17+
Make sure Python 3 is installed. It comes pre-installed on most versions of Ubuntu.
18+
{{< /notice >}}
19+
20+
These instructions have been tested on:
21+
22+
- Ubuntu 22.04 and 24.04
23+
- Windows Subsystem for Linux (WSL)
24+
25+
Run the following commands to install the dependencies:
26+
27+
```bash
28+
sudo apt update
29+
sudo apt install python-is-python3 python3-dev python3-venv gcc g++ make -y
30+
```
31+
32+
## Create a virtual environment
33+
34+
Create and activate a Python virtual environment:
35+
36+
```console
37+
python3 -m venv $HOME/executorch-venv
38+
source $HOME/executorch-venv/bin/activate
39+
```
40+
Your shell prompt should now start with `(executorch)` to indicate the environment is active.
41+
42+
## Install ExecuTorch
43+
44+
Clone the ExecuTorch repository and install dependencies:
45+
46+
``` bash
47+
cd $HOME
48+
git clone https://github.com/pytorch/executorch.git
49+
cd executorch
50+
```
51+
52+
Set up internal submodules:
53+
54+
```bash
55+
git submodule sync
56+
git submodule update --init --recursive
57+
./install_executorch.sh
58+
```
59+
60+
{{% notice Tip %}}
61+
If you encounter a stale `buck` environment, reset it using:
62+
63+
```bash
64+
ps aux | grep buck
65+
pkill -f buck
66+
```
67+
{{% /notice %}}
68+
69+
## Verify the installation:
70+
71+
Check that ExecuTorch is correctly installed:
72+
73+
```bash
74+
pip list | grep executorch
75+
```
76+
Expected output:
77+
78+
```output
79+
executorch 0.8.0a0+92fb0cc
80+
```
81+
82+
## What's next?
83+
84+
Now that ExecuTorch is installed, you're ready to simulate your TinyML model on an Arm Fixed Virtual Platform (FVP). In the next section, you'll configure and launch a Fixed Virtual Platform.

0 commit comments

Comments
 (0)