Skip to content

Commit 58ffd62

Browse files
edits
1 parent 02620e1 commit 58ffd62

4 files changed

Lines changed: 21 additions & 23 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Build and deploy an ML application to the Ethos-U65 NPU on NXP FRDM i.MX 93 with Topo
2+
title: Deploy a machine learning application to the Arm Ethos-U65 NPU on NXP FRDM i.MX 93 with Topo
33

44
draft: true
55
cascade:
@@ -12,16 +12,16 @@ minutes_to_complete: 60
1212
who_is_this_for: This is an introductory topic for embedded/edge software developers who want to deploy machine learning workloads to heterogeneous Arm-based Linux targets using Topo, including leveraging Arm Ethos-U NPUs.
1313

1414
learning_objectives:
15-
- Understand how Topo deploys an application that spans Cortex-A, Cortex-M, and Ethos-U
15+
- Explain how Topo deploys an application that spans Cortex-A, Cortex-M, and Ethos-U
1616
- Deploy the topo-imx93-npu-deployment Template, which operates across Cortex-A, Cortex-M, and Ethos-U, to perform image classification using an ExecuTorch MobileNetV2 model
17-
- Understand how the Template is bootstrapped from Compose services, Remoteproc Runtime metadata, and Topo arguments and follow this process yourself
17+
- Describe how the Template is bootstrapped from Compose services, Remoteproc Runtime metadata, and Topo arguments and follow this process yourself
1818
- Understand how to take similar projects and create Topo Templates, including using Agent Skills
1919

2020
prerequisites:
2121
- A host machine (x86 or Arm) with Linux, macOS, or Windows
2222
- An NXP FRDM i.MX 93 target board with Linux setup, accessible over SSH with root access. To do this, see [Use Linux on the NXP FRDM i.MX 93 board](https://learn.arm.com/learning-paths/embedded-and-microcontrollers/linux-nxp-board/).
2323
- Docker installed on the host and target. For installation steps, see [Install Docker](https://learn.arm.com/install-guides/docker/).
24-
- At least 25 GB of free disk space on the host if you are building without cache images.
24+
- At least 25 GB of free disk space on the host if you're building without cache images.
2525
- The Device Tree Compiler (`dtc`) installed on the host.
2626
- lscpu installed on the target (pre-installed on most Linux distributions)
2727
- Topo installed on the host. For installation steps, see [Deploy containerized workloads to Arm-based Linux targets with Topo](https://learn.arm.com/learning-paths/cross-platform/deploy-containerized-workloads-with-topo/).

content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/build-the-template.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ In this section, you'll build the `topo-imx93-npu-deployment` Topo Template star
1414
- a Cortex-A web application that prepares images, writes model and tensor data into shared memory, and sends inference commands over `RPMsg`
1515
- a Cortex-M33 ExecuTorch runner firmware project for the FRDM i.MX 93
1616

17-
You will combine those sources into one repository, then make the repository a normal Compose project, and only then add the Topo metadata and Remoteproc Runtime services.
17+
You'll combine those sources into one repository, then make the repository a normal Compose project. Then, you'll add the Topo metadata and Remoteproc Runtime services.
1818

1919
## Create the repository from the base projects
2020

21-
You'll copy the original base projects from the Topo Template.
21+
Start by copying the original base projects from the Topo Template.
2222

2323
Clone the Topo Template Format repository for the validation schema, clone the original Topo Template for the source files, and start a new empty repository:
2424

@@ -58,7 +58,7 @@ cp -R ../topo-imx93-npu-deployment/licenses .
5858
cp ../topo-imx93-npu-deployment/.gitignore .
5959
```
6060

61-
You now have two sets of source code, combined into one repository. It's not a Compose project and it's not a Topo Template.
61+
You have two sets of source code combined into one repository. It's not a Compose project and it's not a Topo Template.
6262

6363
You'll now create a Compose project and Topo Template around the source code.
6464

@@ -67,7 +67,7 @@ The Compose project provides the container build and runtime structure. A Docker
6767
- `webapp/Dockerfile` builds the Flask image.
6868
- `webapp/compose.yaml` keeps the web app's build context and Linux runtime settings close to the web app source.
6969
- `executorch-runner/Dockerfile` builds the ExecuTorch `.pte` model and Cortex-M33 runner ELF through multi-stage Docker builds.
70-
- the root `compose.yaml` is the Template entry point. It combines the web app, artifact build services, the Remoteproc Runtime service, and the root-level `x-topo` metadata.
70+
- the root `compose.yaml` is the Topo Template entry point. It combines the web app, artifact build services, the Remoteproc Runtime service, and the root-level `x-topo` metadata.
7171

7272
For a general introduction to Compose projects, services, and the `compose.yaml` file, see Docker's [How Compose works](https://docs.docker.com/compose/intro/compose-application-model/) documentation.
7373

@@ -151,7 +151,7 @@ services:
151151
published: "3001"
152152
```
153153

154-
At this point, Compose can build and run the Cortex-A web application as a normal Linux container. The image runs `webapp/src/app.py`, packages the Jinja templates from `webapp/src/templates/`, the static assets from `webapp/src/static/`, and the ImageNet labels from `webapp/src/data/imagenet_classes.txt`. The container listens on port `3000`, and Compose publishes it on host port `3001` unless you set `WEBAPP_PORT` to another value.
154+
At this point, Compose can build and run the Cortex-A web application as a normal Linux container. The image runs `webapp/src/app.py`. It packages the Jinja templates from `webapp/src/templates/`, the static assets from `webapp/src/static/`, and the ImageNet labels from `webapp/src/data/imagenet_classes.txt`. The container listens on port `3000`, and Compose publishes it on host port `3001` unless you set `WEBAPP_PORT` to another value.
155155

156156
## Add the ExecuTorch artifact pipeline
157157

@@ -317,7 +317,7 @@ x-topo:
317317

318318
The `features` value tells Topo that this template requires `remoteproc-runtime` support on the target. This is useful when checking for project compatibility with the `topo templates --target <target>` command.
319319

320-
The `args` entries describe configurable build inputs. Compose consumes those values through the `cache_from` interpolation you added earlier:
320+
The `args` entries describe configurable build inputs. Compose consumes those values through the `cache_from` interpolation that you added earlier:
321321

322322
```output
323323
cache_from:
@@ -326,7 +326,7 @@ cache_from:
326326

327327
The root `webapp.build.args` block also makes the Topo-provided values visible in the Compose build model while preserving the `webapp/` build context inherited through `extends`.
328328

329-
Keep runtime settings such as `WEBAPP_PORT` as normal Compose interpolation unless you intentionally want Topo to collect them as Template setup arguments.
329+
Keep runtime settings such as `WEBAPP_PORT` as normal Compose interpolation unless you intentionally want Topo to collect them as Topo Template setup arguments.
330330

331331
## (Optional) Use an Agent Skill to add the Topo metadata
332332

content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/deploy.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ topo health --target <user>@<target-ip>
5555

5656
## Reserve memory in the device tree
5757

58-
The web application and Cortex-M33 firmware exchange data through reserved physical memory. The target device tree must reserve memory for the model/input buffer and for the Ethos-U65. This prevents Linux from allocating memory that the firmware and Ethos-U65 access by physical address.
58+
The web application and Cortex-M33 firmware exchange data through reserved physical memory. The target device tree must reserve memory for the model/input buffer and for the Ethos-U65. This prevents Linux from allocating memory that the firmware and Ethos-U65 need to access by physical address.
5959

60-
You're now going to modify the device tree and reboot the target so that these modifications take effect.
60+
You'll now modify the device tree and reboot the target so that these modifications take effect.
6161

6262
{{% notice Warning %}}
6363
Back up the board's original device tree before modifying it. The exact boot partition can differ between Linux images, so check the paths on your board before copying files.
@@ -73,7 +73,7 @@ dtc -I dtb -O dts -o devicetree/live.dts devicetree/live.dtb
7373

7474
2. Open `devicetree/live.dts` in a text editor of your choice.
7575

76-
3. Under `remoteproc-cm33`, add the CM33 power domain if it is not already present:
76+
3. Under `remoteproc-cm33`, add the CM33 power domain if it's not already present:
7777

7878
```dts
7979
power-domains = <0x61>;
@@ -88,7 +88,7 @@ model@c0000000 {
8888
};
8989
```
9090

91-
5. Update the Ethos-U reserved-memory node so it is reserved and not reusable:
91+
5. Update the Ethos-U reserved-memory node so it's reserved and not reusable:
9292

9393
```dts
9494
ethosu_region@A8000000 {
@@ -145,6 +145,10 @@ topo clone https://github.com/Arm-Examples/topo-imx93-npu-deployment.git
145145

146146
Topo prompts for optional build cache image arguments. Accept the defaults unless you have your own cache images.
147147

148+
{{% notice Note %}}
149+
If you build without cache images, the first build can take a long time and requires about 25 GB of free disk space. The first build involves downloading and building ExecuTorch, the Arm GNU toolchain, MCUX SDK components, RPMsg-Lite, and the Cortex-M33 runner sources. Later builds are faster when Docker can reuse local cache layers or import the configured GHCR cache layers.
150+
{{% /notice %}}
151+
148152
Then `cd` into the correct directory:
149153

150154
```bash
@@ -157,10 +161,6 @@ Or:
157161
cd new-topo-npu-template
158162
```
159163

160-
{{% notice Note %}}
161-
If Docker doesn't pull from the cache, the first build can take a long time and requires about 25 GB of free disk space. It downloads and builds ExecuTorch, the Arm GNU toolchain, MCUX SDK components, RPMsg-Lite, and the Cortex-M33 runner sources. Later builds are faster when Docker can reuse local cache layers or import the configured GHCR cache layers.
162-
{{% /notice %}}
163-
164164
Deploy the project to your target:
165165

166166
```bash
@@ -213,8 +213,6 @@ The application shows:
213213
- classification results
214214
- an expandable analysis section with runtime details
215215

216-
The following screenshot shows the expected application user interface:
217-
218216
![Screenshot of the web interface running on an Arm-based target, showing an image and the model response. This confirms successful deployment and provides a visual reference for the expected result.#center](topo_npu_classifier.png "Image classification web app showing correctly classified German Shepherd")
219217

220218
When you choose an image in the browser and select **Classify**, the web application:

content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Understand the architecture of the ML image classification application
2+
title: Understand the architecture of the machine learning application
33
description: Review how the Topo Template deploys a Cortex-A web application, Cortex-M33 firmware, and Ethos-U65 NPU acceleration for image classification on NXP FRDM i.MX 93.
44
weight: 2
55

@@ -9,7 +9,7 @@ layout: learningpathall
99

1010
## What you'll deploy
1111

12-
[Topo](https://github.com/arm/topo) is an open-source command-line tool developed by Arm that you can use to deploy projects to an Arm-based Linux target over SSH. Topo builds container images on the host, transfers them to the target, and starts the services on the target. Topo Templates are the standardized format by which projects are deployed with Topo.
12+
[Topo](https://github.com/arm/topo) is an open-source command-line tool developed by Arm that you can use to deploy projects to an Arm-based Linux target over SSH. Topo builds container images on the host, transfers them to the target, and starts the services on the target. Topo Templates are the standardized format for deploying projects with Topo.
1313

1414
In this Learning Path, you'll deploy the [topo-imx93-npu-deployment](https://github.com/Arm-Examples/topo-imx93-npu-deployment) Topo Template to an NXP FRDM i.MX 93 board, and understand how this Topo Template was created.
1515

0 commit comments

Comments
 (0)