You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/_index.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
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
3
3
4
4
draft: true
5
5
cascade:
@@ -12,16 +12,16 @@ minutes_to_complete: 60
12
12
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.
13
13
14
14
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
16
16
- 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
18
18
- Understand how to take similar projects and create Topo Templates, including using Agent Skills
19
19
20
20
prerequisites:
21
21
- A host machine (x86 or Arm) with Linux, macOS, or Windows
22
22
- 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/).
23
23
- 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.
25
25
- The Device Tree Compiler (`dtc`) installed on the host.
26
26
- lscpu installed on the target (pre-installed on most Linux distributions)
27
27
- 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/).
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/build-the-template.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,11 @@ In this section, you'll build the `topo-imx93-npu-deployment` Topo Template star
14
14
- a Cortex-A web application that prepares images, writes model and tensor data into shared memory, and sends inference commands over `RPMsg`
15
15
- a Cortex-M33 ExecuTorch runner firmware project for the FRDM i.MX 93
16
16
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.
18
18
19
19
## Create the repository from the base projects
20
20
21
-
You'll copy the original base projects from the Topo Template.
21
+
Start by copying the original base projects from the Topo Template.
22
22
23
23
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:
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.
62
62
63
63
You'll now create a Compose project and Topo Template around the source code.
64
64
@@ -67,7 +67,7 @@ The Compose project provides the container build and runtime structure. A Docker
67
67
-`webapp/Dockerfile` builds the Flask image.
68
68
-`webapp/compose.yaml` keeps the web app's build context and Linux runtime settings close to the web app source.
69
69
-`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.
71
71
72
72
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.
73
73
@@ -151,7 +151,7 @@ services:
151
151
published: "3001"
152
152
```
153
153
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.
155
155
156
156
## Add the ExecuTorch artifact pipeline
157
157
@@ -317,7 +317,7 @@ x-topo:
317
317
318
318
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.
319
319
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:
321
321
322
322
```output
323
323
cache_from:
@@ -326,7 +326,7 @@ cache_from:
326
326
327
327
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`.
328
328
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.
330
330
331
331
## (Optional) Use an Agent Skill to add the Topo metadata
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/deploy.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,9 +55,9 @@ topo health --target <user>@<target-ip>
55
55
56
56
## Reserve memory in the device tree
57
57
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.
59
59
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.
61
61
62
62
{{% notice Warning %}}
63
63
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.
Topo prompts for optional build cache image arguments. Accept the defaults unless you have your own cache images.
147
147
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
+
148
152
Then `cd` into the correct directory:
149
153
150
154
```bash
@@ -157,10 +161,6 @@ Or:
157
161
cd new-topo-npu-template
158
162
```
159
163
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
-
164
164
Deploy the project to your target:
165
165
166
166
```bash
@@ -213,8 +213,6 @@ The application shows:
213
213
- classification results
214
214
- an expandable analysis section with runtime details
215
215
216
-
The following screenshot shows the expected application user interface:
217
-
218
216

219
217
220
218
When you choose an image in the browser and select **Classify**, the web application:
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/overview.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Understand the architecture of the ML image classification application
2
+
title: Understand the architecture of the machine learning application
3
3
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.
4
4
weight: 2
5
5
@@ -9,7 +9,7 @@ layout: learningpathall
9
9
10
10
## What you'll deploy
11
11
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.
13
13
14
14
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.
0 commit comments