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
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ who_is_this_for: This is an introductory topic for embedded/edge software develo
9
9
10
10
learning_objectives:
11
11
- Explain how Topo deploys an application that spans Cortex-A, Cortex-M, and Ethos-U
12
-
- 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
13
-
- Describe how the Template is bootstrapped from Compose services, Remoteproc Runtime metadata, and Topo arguments and follow this process yourself
14
-
- Understand how to take similar projects and create Topo Templates, including using Agent Skills
12
+
- Deploy the topo-imx93-npu-deployment Topo Project, which operates across Cortex-A, Cortex-M, and Ethos-U, to perform image classification using an ExecuTorch MobileNetV2 model
13
+
- Describe how the project is bootstrapped from Compose services, Remoteproc Runtime metadata, and Topo parameters and follow this process yourself
14
+
- Understand how to take similar projects and create Topo Projects, including using Agent Skills
15
15
16
16
prerequisites:
17
17
- A host machine (x86 or Arm) with Linux, macOS, or Windows
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/build-the-project.md
+36-33Lines changed: 36 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
---
2
-
title: Build the Topo Template from scratch
3
-
description: Create a Topo Template from the web application and Cortex-M33 firmware sources by adding Compose services, build artifacts, remoteproc-runtime metadata, and Topo arguments.
2
+
title: Build the Topo Project from scratch
3
+
description: Create a Topo Project from the web application and Cortex-M33 firmware sources by adding Compose services, build artifacts, remoteproc-runtime metadata, and Topo parameters.
In this section, you'll build the `topo-imx93-npu-deployment` Topo Template starting from two non-Topo, non-Compose projects:
14
+
In this section, you'll build the `topo-imx93-npu-deployment` Topo Project starting from two non-Topo, non-Compose projects:
13
15
14
16
- a Cortex-A web application that prepares images, writes model and tensor data into shared memory, and sends inference commands over `RPMsg`
15
17
- a Cortex-M33 ExecuTorch runner firmware project for the FRDM i.MX 93
@@ -18,12 +20,12 @@ You'll combine those sources into one repository, then make the repository a nor
18
20
19
21
## Create the repository from the base projects
20
22
21
-
Start by copying the original base projects from the Topo Template.
23
+
Start by copying the original base projects from the Topo Project.
22
24
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:
25
+
Clone the Topo repository for the Topo Project specification and validation schema, clone the original Topo Project for the source files, and start a new empty repository:
You have two sets of source code combined into one repository. It's not a Compose project and it's not a Topo Template.
63
+
You have two sets of source code combined into one repository. It's not a Compose project and it's not a Topo Project.
62
64
63
-
You'll now create a Compose project and Topo Template around the source code.
65
+
You'll now create a Compose project and Topo Project around the source code.
64
66
65
-
The Compose project provides the container build and runtime structure. A Dockerfile describes how to build one image. A Compose file describes the services that use those images, their build contexts, ports, volumes, dependencies, and runtime settings. In this Template:
67
+
The Compose project provides the container build and runtime structure. A Dockerfile describes how to build one image. A Compose file describes the services that use those images, their build contexts, ports, volumes, dependencies, and runtime settings. In this Topo Project:
66
68
67
69
-`webapp/Dockerfile` builds the Flask image.
68
70
-`webapp/compose.yaml` keeps the web app's build context and Linux runtime settings close to the web app source.
69
71
-`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 Topo Template entry point. It combines the web app, artifact build services, the Remoteproc Runtime service, and the root-level `x-topo` metadata.
72
+
- the root `compose.yaml` is the Topo Project entry point. It combines the web app, artifact build services, the Remoteproc Runtime service, and the root-level `x-topo` metadata.
71
73
72
74
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
75
@@ -304,7 +306,7 @@ x-topo:
304
306
description: "Runs a Cortex-A web application that sends image inference commands to a resident CM33 ExecuTorch runner over RPMsg."
305
307
features:
306
308
- "remoteproc-runtime"
307
-
args:
309
+
parameters:
308
310
EXECUTORCH_BASE_CACHE_IMAGE:
309
311
description: Optional GHCR image used as a BuildKit cache source for the ExecuTorch PTE build.
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.
320
+
The `features` value tells Topo that this project requires `remoteproc-runtime` support on the target. This is useful when checking for project compatibility with the `topo projects --target <target>` command.
319
321
320
-
The `args` entries describe configurable build inputs. Compose consumes those values through the `cache_from` interpolation that you added earlier:
322
+
The `parameters` entries describe configurable build inputs. Compose consumes those values through the `cache_from` interpolation that you added earlier:
321
323
322
324
```output
323
325
cache_from:
@@ -326,44 +328,45 @@ cache_from:
326
328
327
329
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
330
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.
331
+
Keep runtime settings such as `WEBAPP_PORT` as normal Compose interpolation unless you intentionally want Topo to collect them as Topo Project setup arguments.
330
332
331
333
## (Optional) Use an Agent Skill to add the Topo metadata
332
334
333
-
The [Topo Template Format](https://github.com/arm/topo-template-format) repository includes public authoring skills for agents that support skill installation:
335
+
[Topo](https://github.com/arm/topo) currently provides the following skills:
334
336
335
-
- `topo-template-context`: provides Topo and Topo Template reference context for `x-topo` metadata, schema, docs, and CLI template behavior.
336
-
- `topo-template-bootstrap`: converts a Compose repository into a Topo Template by adding or improving `compose.yaml` and `x-topo` metadata.
337
-
- `topo-template-lint`: reviews a Topo Template for schema correctness, metadata consistency, deployment success messages, and build argument wiring.
337
+
- `topo-project-context`: provides Topo and Topo Project reference context for questions about x-topo metadata, schema, docs, and CLI project behavior.
338
+
- `topo-project-bootstrap`: converts a repository into a Topo Project by adding or improving `compose.yaml` and `x-topo` metadata.
339
+
- `topo-project-lint`: reviews an existing Topo Project for correctness, consistency, and authoring best practices.
340
+
- `topo-project-optimize-deployment`: optimizes feedback loop by measuring and applying the highest-leverage Docker build improvement.
338
341
339
342
Install the skills with `npx skills`:
340
343
341
344
```bash
342
-
npx skills add arm/topo-template-format
345
+
npx skills add arm/topo
343
346
```
344
347
345
-
If your agent doesn't use `npx skills`, manually copy or symlink the directories under `../topo-template-format/skills/` into your agent's skills directory.
348
+
If your agent doesn't use `npx skills`, manually copy or symlink the skill directories from Topo into your agent's skills directory.
346
349
347
350
Restart your agent after installing or updating the skills.
348
351
349
-
From the root of the Compose project, ask your agent to use `topo-template-bootstrap`:
352
+
From the root of the Compose project, ask your agent to use `topo-project-bootstrap`:
350
353
351
354
```
352
-
Use topo-template-bootstrap on this repository.
353
-
Treat the root compose.yaml as the Template root.
355
+
Use topo-project-bootstrap on this repository.
356
+
Treat the root compose.yaml as the project root.
354
357
Preserve plain docker compose behavior.
355
358
Add x-topo metadata only where it reflects the actual services, hardware requirements, and build arguments.
356
359
```
357
360
358
-
After bootstrap, ask the agent to use `topo-template-lint`:
361
+
After bootstrap, ask the agent to use `topo-project-lint`:
359
362
360
363
```
361
-
Use topo-template-lint on this repository.
362
-
Validate compose.yaml against the Topo Template Format schema.
363
-
Check README alignment, Remoteproc Runtime metadata, and x-topo.args wiring.
364
+
Use topo-project-lint on this repository.
365
+
Validate compose.yaml against the Topo Project specification schema.
366
+
Check README alignment, Remoteproc Runtime metadata, and x-topo.parameters wiring.
364
367
```
365
368
366
-
## Validate the final Topo Template
369
+
## Validate the final Topo Project
367
370
368
371
Check the Compose model and check that the Topo metadata is present:
- `webapp`imports the `.pte` file through `additional_contexts`.
413
-
- every `x-topo.args` entry is consumed by Compose interpolation.
416
+
- every `x-topo.parameters` entry is consumed by Compose interpolation.
414
417
415
418
## What you've accomplished and what's next
416
419
417
-
You started with two non-Topo, non-Compose projects, made them a standard Compose project, and then converted that Compose project into a Topo Template. You created the web app image, added artifact builds for the ExecuTorch `.pte` model and Cortex-M33 ELF, packaged the firmware as a Remoteproc Runtime service, and exposed the build cache inputs as Topo arguments.
420
+
You started with two non-Topo, non-Compose projects, made them a standard Compose project, and then converted that Compose project into a Topo Project. You created the web app image, added artifact builds for the ExecuTorch `.pte` model and Cortex-M33 ELF, packaged the firmware as a Remoteproc Runtime service, and exposed the build cache inputs as Topo parameters.
418
421
419
-
Next, you'll prepare the FRDM i.MX 93 target, deploy the template with Topo, and run the image classification application.
422
+
Next, you'll prepare the FRDM i.MX 93 target, deploy the project with Topo, and run the image classification application.
Copy file name to clipboardExpand all lines: content/learning-paths/embedded-and-microcontrollers/deploy-ml-model-to-npu-with-topo/deploy.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,6 +1,6 @@
1
1
---
2
2
title: Clone and deploy the application with Topo
3
-
description: Prepare the NXP FRDM i.MX 93 target, deploy the image classification Topo Template, and validate MobileNetV2 inference through the browser application.
3
+
description: Prepare the NXP FRDM i.MX 93 target, deploy the image classification Topo Project, and validate MobileNetV2 inference through the browser application.
4
4
weight: 5
5
5
6
6
### FIXED, DO NOT MODIFY
@@ -9,7 +9,7 @@ layout: learningpathall
9
9
10
10
## Prepare the target
11
11
12
-
Before deploying the Topo Template, confirm that the FRDM i.MX 93 board is reachable from your host and that it's ready for deployment:
12
+
Before deploying the Topo Project, confirm that the FRDM i.MX 93 board is reachable from your host and that it's ready for deployment:
13
13
14
14
```bash
15
15
topo health --target <user>@<target-ip>
@@ -135,7 +135,7 @@ topo health --target <user>@<target-ip>
135
135
136
136
## Deploy to the board
137
137
138
-
You can choose to deploy from the original Topo Template, or from the template you built from scratch. If you haven't already cloned the original template, clone it now:
138
+
You can choose to deploy from the original Topo Project, or from the project you built from scratch. If you haven't already cloned the original project, clone it now:
@@ -225,6 +225,6 @@ Try this out with an image from an ImageNet-supported class.
225
225
226
226
## What you've accomplished
227
227
228
-
You've prepared an FRDM i.MX 93 board for shared-memory NPU inference, deployed the `topo-imx93-npu-deployment`template with Topo, and started Cortex-M33 firmware through `remoteproc-runtime`. You used a browser-based application to stage the ExecuTorch `.pte` program and input tensor for MobileNetV2 classification with Ethos-U65 acceleration.
228
+
You've prepared an FRDM i.MX 93 board for shared-memory NPU inference, deployed the `topo-imx93-npu-deployment`Topo Project with Topo, and started Cortex-M33 firmware through `remoteproc-runtime`. You used a browser-based application to stage the ExecuTorch `.pte` program and input tensor for MobileNetV2 classification with Ethos-U65 acceleration.
229
229
230
230
You can now use the deployed application as a reference for your own heterogeneous Arm applications, or adapt the model, firmware runner, web interface, or Topo metadata for another target.
0 commit comments