diff --git a/assets/contributors.csv b/assets/contributors.csv index 5d5ba43991..57f46c78b5 100644 --- a/assets/contributors.csv +++ b/assets/contributors.csv @@ -136,6 +136,7 @@ John O'Hara,Arm,JohnOhara-Arm,johnaohara,JohnnyDoItAll, Usamah Zaheer,Arm,usamahz,,, Roy Jamil,Ac6,RoyAc6,royjamil,,https://www.ac6.fr/en/ Elad Gross,Arm,eladgr,,, +Ash Naik,Arm,,,, Manu Nicholas Jacob,Independent Researcher,manunicholasjacob,manu-nicholas-jacob,,https://manunicholasjacob.com Ajeet Singh Raina,,,,, Alexandre Romana,,,,, diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_index.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_index.md new file mode 100644 index 0000000000..3aa636cad2 --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_index.md @@ -0,0 +1,138 @@ +--- +title: Generate human faces with a diffusion model on an Alif Ensemble E8 + +draft: true +cascade: + draft: true + +description: Export the pico-faces diffusion model with ExecuTorch, run it on the Alif Ensemble E8 Ethos-U85 NPU, and display generated faces on the DevKit LCD. + +minutes_to_complete: 120 + +who_is_this_for: This topic is for embedded and machine learning developers who want to deploy a Generative AI model on a microcontroller with Arm Ethos-U85 acceleration. + +learning_objectives: + - Explain how ExecuTorch divides pico-faces generation between the Cortex-M55 and Ethos-U85 NPU + - Export and fully delegate the pico-faces diffusion transformer and decoder to the Ethos-U85 NPU + - Configure the Alif Ensemble E8 DevKit for loading and debugging the generated application + - Generate human faces on the DevKit and validate NPU execution through the LCD and UART output + +prerequisites: + - Familiarity with Python, machine learning models, and embedded development + - An [Alif Ensemble E8 DevKit](https://alifsemi.com/support/kits/ensemble-e8devkit/) with its display and a USB-C data cable + - A development computer running Linux, macOS, or Windows, with internet access and several GB of free storage + - An Arm account for the Keil MDK Community license and an Alif account for downloading SETOOLS + +# START generated_summary_faq +generated_summary_faq: + template_version: summary-faq-v3 + generated_at: '2026-10-08T13:45:37Z' + generator: ai + ai_assisted: true + ai_review_required: true + model: gpt-5 + prompt_template: summary-faq-v3 + source_hash: c8f269fe31381f71921333cb60d33cf0f9406de630dfac4f424b045428870094 + summary_generated_at: '2026-10-08T13:45:37Z' + summary_source_hash: c8f269fe31381f71921333cb60d33cf0f9406de630dfac4f424b045428870094 + faq_generated_at: '2026-10-08T13:45:37Z' + faq_source_hash: c8f269fe31381f71921333cb60d33cf0f9406de630dfac4f424b045428870094 + summary: >- + You'll export the pico-faces diffusion model with ExecuTorch and deploy it to the Alif Ensemble + E8 DevKit. First, you'll configure Keil Studio and the CMSIS toolchain, then delegate the diffusion + transformer and decoder to the Arm Ethos-U85 NPU. Next, you'll provision the Cortex-M55 boot and + debug flow, build the application, and generate human faces. Finally, you'll verify NPU execution + through the DevKit LCD, UART output, and performance counters. + faqs: + - question: What should I check on the DevKit before connecting it to my computer? + answer: >- + Before you connect the DevKit, unplug all USB cables before changing any jumpers. Verify + that the jumpers match the factory defaults documented in the DK-E8 User Guide. This helps + you avoid power or boot issues during setup. + - question: Which USB port do I use for programming, and how do I confirm the board is powered? + answer: >- + Connect a USB-C cable to the PRG USB port on the bottom edge of the DevKit. You can confirm + that the board has power when a green LED illuminates near the E1 device. + - question: Which repository branch do I need for this example? + answer: >- + Clone the CMSIS-ExecuTorch repository using the `hackathon-pico-faces` branch. Use the + `--branch hackathon-pico-faces --single-branch` options, then open the workspace in VS Code. + - question: Which serial settings and switch position should I use to view application output? + answer: >- + Set **SW4** to **UART4** and open **Serial Monitor** on the **PRG USB** port at `115200` baud, + eight data bits, no parity, and one stop bit. If the port was open before changing **SW4**, + close and reopen it. + - question: What result should I expect when I start a debug session and run the firmware? + answer: >- + From the **CMSIS** view, select **Build**, then **Debug**. Keil Studio starts the J-Link GDB + server over SWD and loads the application into MRAM, stopping at `main`. Press **F5** to + continue. The DevKit displays a 128 x 128 RGB face, and UART output confirms Arm Ethos-U85 + execution. +# END generated_summary_faq + +author: Ash Naik + +# New Learning Paths are opted in for the next manual generated summary/FAQ run. +# The generator resets this to false after a successful write. +generate_summary_faq: false + +# Optional one-shot controls: set either field to true to regenerate just that +# generated section the next time the summary/FAQ tool runs. The tool resets +# them to false after a successful write. +rerun_summary: false +rerun_faqs: false + +### Tags +skilllevels: Advanced +subjects: ML +armips: + - Cortex-M55 + - Ethos-U85 +tools_software_languages: + - Alif SETOOLS + - CMSIS-Toolbox + - ExecuTorch + - Generative AI + - Keil Studio + - Python + - PyTorch + - SEGGER JLink +operatingsystems: + - Baremetal + - Linux + - macOS + - Windows + +further_reading: + - resource: + title: CMSIS-ExecuTorch pico-faces example + link: https://github.com/Arm-Examples/CMSIS-Executorch/tree/hackathon-pico-faces + type: website + - resource: + title: pico-faces project + link: https://github.com/cpldcpu/pico-faces + type: website + - resource: + title: ExecuTorch Arm Ethos-U backend + link: https://docs.pytorch.org/executorch/main/backends-arm-ethos-u.html + type: documentation + - resource: + title: PyTorch ExecuTorch CMSIS Pack + link: https://www.keil.arm.com/packs/executorch-pytorch/ + type: documentation + - resource: + title: CMSIS-Toolbox MLOps information + link: https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview/#mlops-information + type: documentation + - resource: + title: Alif Ensemble E8 DevKit support + link: https://alifsemi.com/support/kits/ensemble-e8devkit/ + type: website + +### FIXED, DO NOT MODIFY +# ================================================================================ +weight: 1 # _index.md always has weight of 1 to order correctly +layout: "learningpathall" # All files under learning paths have this same wrapper +learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. +--- + diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_next-steps.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_next-steps.md new file mode 100644 index 0000000000..727b395ddd --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/_next-steps.md @@ -0,0 +1,8 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # The weight controls the order of the pages. _index.md always has weight 1. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/export-the-model.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/export-the-model.md new file mode 100644 index 0000000000..088f07bd4f --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/export-the-model.md @@ -0,0 +1,67 @@ +--- +title: Export the model for Ethos-U85 +description: Clone the pico-faces example, select the Alif Ensemble E8 target, and generate an Ethos-U85-delegated ExecuTorch AI layer. +weight: 4 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Clone the example branch + +Clone the branch that contains the pico-faces application: + +```bash +git clone --branch hackathon-pico-faces --single-branch https://github.com/Arm-Examples/CMSIS-Executorch.git +cd CMSIS-Executorch +code . +``` + +When VS Code opens the workspace: + +1. Accept the Arm Tools Environment Manager prompt to activate the tools pinned in `vcpkg-configuration.json`. +2. Accept the prompt to install the required CMSIS packs. +3. Open the **CMSIS** view and select **Manage Solution**. +4. Select the `DevKit-E8` target type, then select **Apply**. + +The managed environment supplies CMSIS-Toolbox, Arm Compiler for Embedded, GCC, CMake, and Ninja. The CMSIS packs provide the Alif device support and the ExecuTorch runtime components. + +## Set up the Python environment + +Open the VS Code Command Palette and select **Tasks: Run Task > Setup Python virtual environment**. + +The task creates `.venv`, installs the pinned export packages, and downloads about 60 MB of pico-faces checkpoints into `model/pico_faces/`. The Python packages include several GB of PyTorch dependencies, so the first setup can take some time. + +The exporter supports Python 3.10 through 3.13. If your system Python isn't in that range, select the **Setup Python virtual environment (uv)** task. The `uv` variant can download a compatible Python interpreter. + +## Create the AI layer + +Select **Tasks: Run Task > Create AI layer**. + +If the task reports that `cmsis-executorch.cbuild-mlops.yml` is missing, select **Build** once in the **CMSIS** view. The extension generates the target description, and you can then run **Create AI layer** again. + +The export performs these operations: + +- Calibrates `dit_step` with 16-bit activations and 8-bit weights +- Calibrates `decode` with 8-bit activations and weights +- Delegates each method as one Ethos-U85 segment +- Generates the CMSIS component selection and embedded model data + +The task takes a few minutes. When it completes, confirm that `ai_layer/` contains these generated artifacts: + +| File | Purpose | +| --- | --- | +| `model.pte` | ExecuTorch program containing both methods | +| `model_pte.c` | Program embedded as a C array for the firmware build | +| `model_params.h` | Sampling schedule, image shapes, and conditioning data | +| `ai_layer.clayer.yml` | CMSIS components selected for the exported program | + +Review the task log. It should report one Ethos-U delegate for each model method. Only the quantize and dequantize boundaries remain on the CPU; the diffusion transformer and decoder run on the NPU. + +{{% notice Note %}} +Run **Create AI layer** again after changing `model/model.py` or selecting a target with a different NPU configuration. The generated model data isn't committed to the repository. +{{% /notice %}} + +## What you've accomplished and what's next + +You've exported the diffusion transformer and decoder as one ExecuTorch program for the DevKit's Ethos-U85. Next, you'll install the boot configuration and debug stub needed to load that program on the high-performance Cortex-M55 core. diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/generated-face-on-devkit.jpg b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/generated-face-on-devkit.jpg new file mode 100644 index 0000000000..94a7e88b06 Binary files /dev/null and b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/generated-face-on-devkit.jpg differ diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/image1.png b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/image1.png new file mode 100644 index 0000000000..0f5705253a Binary files /dev/null and b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/image1.png differ diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/prepare-the-board.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/prepare-the-board.md new file mode 100644 index 0000000000..79cd2857c2 --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/prepare-the-board.md @@ -0,0 +1,45 @@ +--- +title: Prepare the DevKit for debugging +description: Use Alif SETOOLS to install the table of contents and Cortex-M55 high-performance core debug stub needed by the example. +weight: 5 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Understand the one-time provisioning step + +The Alif Secure Enclave boots processor images from a table of contents in magnetoresistive random-access memory (MRAM). Before the first debug session, install the configuration that points the high-performance Cortex-M55 core to the project's debug stub. + +You normally perform this step once. Repeat it if another project replaces the table of contents. + +## Install the debug stub + +Confirm that the board is connected through **PRG USB** and that **SW4** is set to **SEUART**. Close any serial monitor that has the DevKit port open. + +In VS Code, select: + +**Terminal > Run Task > Alif: Install M55_HP debug stubs (DevKit-E8, single core configuration)** + +Choose automatic COM port discovery with `-d` the first time. SETOOLS remembers the selected port for later runs. + +The task performs these operations: + +1. Selects the DevKit-E8 part `AE822FA0E5597LS0` with revision `A0`. +2. Copies the supplied device configuration and debug stub into the SETOOLS workspace. +3. Generates the application table of contents. +4. Writes the table and debug stub to MRAM. + +If `app-write-mram` reports a different board revision and asks whether to continue, answer `y`. The part number determines whether the table can boot. + +## Switch the UART to the application + +After the task completes, set **SW4** to **UART4**. This routes the DevKit's application console to the USB-to-UART bridge. + +{{% notice Important %}} +Keep the debug interface set to SWD. A JTAG configuration can leave the generated load task waiting for a J-Link chain response while the device remains in SWD mode. +{{% /notice %}} + +## What you've accomplished and what's next + +You've installed the boot table and debug stub for the Cortex-M55 high-performance core, then routed the console to UART4. Next, you'll build the application, generate a face, and validate that both ExecuTorch methods ran on the Ethos-U85 NPU. diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/run-and-validate.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/run-and-validate.md new file mode 100644 index 0000000000..cb11f4b163 --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/run-and-validate.md @@ -0,0 +1,94 @@ +--- +title: Generate and validate faces on the DevKit +description: Build and debug the application, display generated faces on the LCD, and confirm Ethos-U85 execution from the UART performance output. +weight: 6 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Open the application console + +Keep **SW4** set to **UART4**. In VS Code, open **Serial Monitor** on the serial port exposed through **PRG USB** and use these settings: + +- Baud rate: `115200` +- Data bits: `8` +- Parity: `None` +- Stop bits: `1` + +If the port was open before you changed **SW4**, close and reopen it. + +## Build and debug the application + +In the **CMSIS** view, confirm that `DevKit-E8` is active. Select **Build**, then select **Debug**. Keil Studio starts the J-Link GDB server over SWD and loads the application into MRAM. + +The debugger stops at `main`. Press **F5** to continue. + +The firmware initializes the display and NPU, loads the two ExecuTorch methods, and generates a repeatable boot image. The output is similar to: + +```output +Ethos-U version info: + Arch: v2.0.0 + MACs/cc: 256 +ExecuTorch pico-faces (m3_long_cfg, a16w8/a8w8) +Methods: + dit_step 2 input(s), 1 output(s) + decode 1 input(s), 1 output(s) +Generating: seed 3, 4 steps, class 1, w 4.0 +Image: 128x128x3, CRC32 +Test_result: PASS +``` + +The LCD displays the 128 x 128 result scaled to 384 x 384 pixels in the center of the screen. The CRC depends on the host-side export, so use `Test_result: PASS` and the displayed image as the functional checks. + +## Confirm NPU execution + +Inspect the two performance lines printed after generation. They report NPU cycles, NPU active time, multiply-accumulate array activity, and AXI reads for `dit_step` and `decode`. These counters come from the Ethos-U performance monitoring unit and confirm that both methods executed on the NPU. + +The source project's reference DevKit run uses these conditions: + +| Setting | Reference value | +| --- | --- | +| Processor | Cortex-M55 high-performance core at 400 MHz | +| NPU | Ethos-U85 with 256 MACs per cycle | +| Model | `m3_long_cfg`, `a16w8` DiT and `a8w8` decoder | +| Sample | Seed 3, four steps, class 1, guidance 4.0 | +| Execution model | Bare-metal, single core; thread count and CPU affinity don't apply | +| Observed time | About 78 ms total: about 68 ms for eight `dit_step` calls and 3 ms for `decode` | + +Treat the timing as a reference measurement rather than a pass threshold. Tool versions, the exported program, and board conditions can change the result. + +## Generate more faces + +Use the **SW2** joystick after the boot image appears: + +- Press toward the left to generate one face with the next seed. +- Press toward the right to start continuous generation. Press in the same direction again to stop. + +Each completed generation updates the LCD and prints its seed, class, guidance, timing, and CRC to the console. + +## View an example result + +The following image shows a generated face displayed on the DevKit LCD: + +![Photograph of the Alif Ensemble E8 DevKit with its attached LCD displaying a generated smiling face. The display confirms that the pico-faces application completed inference and rendered the 128 x 128 result on the board.#center](generated-face-on-devkit.jpg "Generated face displayed on the Alif Ensemble E8 DevKit") + +## Troubleshoot common problems + +Use these checks if the application doesn't reach the pass marker: + +| Symptom | Check | +| --- | --- | +| J-Link connects but execution doesn't stop at `main` | Set **SW4** to **SEUART** and repeat the debug-stub task from the previous section. | +| Debug remains at **Connecting** | Confirm that the target uses SWD, not JTAG, then power-cycle the board. | +| UART has no application output | Set **SW4** to **UART4**, then close and reopen Serial Monitor. | +| `app-write-mram` receives no response | Set **SW4** to **SEUART**, close programs using the port, and press reset while the tool waits. | +| The build can't find `ai_layer/model_pte.c` | Run **Setup Python virtual environment**, followed by **Create AI layer**. | + +## Optional: use the Corstone-320 FVP + +The same CMSIS solution also includes the `SSE-320-U85` target for the Corstone-320 Fixed Virtual Platform (FVP). Select that target in **Manage Solution**, recreate the AI layer, and select **Run** or **Debug**. The FVP produces the same seed-based image and writes its raw result to `out/fvp_image.bin`, but the physical DevKit workflow is the primary target for this Learning Path. + +## What you've accomplished + +You've exported a generative model through ExecuTorch, loaded it on the Alif Ensemble E8 DevKit, and generated faces with both neural-network methods delegated to Ethos-U85. You also validated the run through the LCD, pass marker, and hardware performance counters. diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/set-up-the-devkit.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/set-up-the-devkit.md new file mode 100644 index 0000000000..0ed4f981a7 --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/set-up-the-devkit.md @@ -0,0 +1,90 @@ +--- +title: Set up the development tools and DevKit +description: Install the supported VS Code extensions, Alif SETOOLS, and SEGGER J-Link, then connect the Alif Ensemble E8 DevKit. +weight: 3 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Install the host tools + +Install [Visual Studio Code](https://code.visualstudio.com/) and add these extensions from the Extensions view: + +- [Keil Studio Pack](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack), extension ID `Arm.keil-studio-pack` +- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python), extension ID `ms-python.python` + +The project tasks need CMSIS Solution extension 1.70.0 or later, which is included with Keil Studio Pack. Sign in with your Arm account when Keil Studio requests a license. The free Keil MDK Community license supports this example. + +Install two tools for the physical DevKit: + +1. Download Alif SETOOLS version 1.110.00 or later from the [Alif software and tools page](https://alifsemi.com/support/software-tools/ensemble/). Extract the package and follow its README to install any Python dependencies. On Linux and macOS, make the SETOOLS programs executable. +2. Install SEGGER [J-Link Software](https://www.segger.com/downloads/jlink/) version 8.42 or later. The DevKit includes an on-board J-Link probe. + +## Configure the SETOOLS path + +In VS Code, press **Ctrl+Shift+P** on Linux or Windows, or **Cmd+Shift+P** on macOS, to open the Command Palette. Search for and select **Preferences: Open User Settings (JSON)**. Add `alif.setools.root` inside the existing JSON object and replace the example value with the directory that contains `app-gen-toc` and `app-write-mram`: + +```json +"alif.setools.root": "/absolute/path/to/setools" +``` + +Keep the comma required by your existing JSON properties. The project uses this setting when it installs the Cortex-M55 debug stubs. + +## Connect the DevKit + +Prepare the board before applying power: + +1. Disconnect all USB cables before checking or moving a jumper. +2. Keep **JP5** on pins **1-2** and **JP7** on pins **3-4**. +3. Set **SW4** to **SEUART**, its default position. +4. Connect a USB-C data cable to **PRG USB**, the connector near the corner of the board. +5. Leave **MCU USB** disconnected. + +{{% notice Warning %}} +Don't move jumpers while the board is powered. Disconnect **PRG USB** before changing a jumper. +{{% /notice %}} + +The **PRG USB** connection supplies power and exposes both the on-board J-Link probe and the USB-to-UART bridge. **SW4** selects which UART signal reaches that bridge: + +| SW4 position | Connection | Use | +| --- | --- | --- | +| **SEUART** | Secure Enclave UART | SETOOLS and initial board provisioning | +| **UART4** | Application UART4 at 115200 8N1 | Application logs and image requests | + +## Update the board support firmware + +Open a terminal in the extracted SETOOLS directory. On Linux or macOS, run: + +```bash +./updateSystemPackage -d +``` + +On Windows, run the corresponding executable: + +```powershell +.\updateSystemPackage.exe -d +``` + +Select the DevKit serial port when prompted. The output is similar to: + +```output +[INFO] /dev/ttyACM0 open Serial port success +Bootloader stage: SERAM +[INFO] Detected Device: +Part# AE822FA0E5597LS0 - Rev: A0 +Connected target is not the default Revision +Do you want to set this part as default? (y/n): y +Maintenance Mode = Enabled +... +Verify Image +Done +``` + +The serial port, package names, progress details, and elapsed time can differ. The default revision message is expected during initial setup; answer `y` to make the detected E8 revision the default. + +Run J-Link Commander once to update the on-board probe firmware and install its serial drivers. Use `JLinkExe` on Linux or macOS, or `JLink.exe` on Windows. + +## What you've accomplished and what's next + +You've installed the required host tools, configured the SETOOLS path, and connected the DevKit through **PRG USB**. Next, you'll clone the example and export the diffusion model for Ethos-U85. diff --git a/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/understand-the-workflow.md b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/understand-the-workflow.md new file mode 100644 index 0000000000..94d9a3d388 --- /dev/null +++ b/content/learning-paths/embedded-and-microcontrollers/generate-faces-alif-e8/understand-the-workflow.md @@ -0,0 +1,50 @@ +--- +title: Understand the pico-faces workflow +description: Learn how the pico-faces diffusion transformer, ExecuTorch, Cortex-M55, and Ethos-U85 NPU work together to generate an image. +weight: 2 + +### FIXED, DO NOT MODIFY +layout: learningpathall +--- + +## Understand the model + +[pico-faces](https://github.com/cpldcpu/pico-faces) is a compact generative model that produces 128 x 128 RGB face images. It combines a 2.5-million-parameter latent rectified-flow diffusion transformer (DiT) with a small convolutional decoder. + +The model provides four conditioned face classes and one unconditional class. The conditioned classes combine the model's female or male label with a neutral or smiling expression. + +![Diagram showing the pico-faces generation workflow: random latent noise passes through repeated diffusion transformer denoising steps and a decoder to produce a 128 x 128 RGB face on the Alif E8 Cortex-M55 and Ethos-U85. A row of example generated faces illustrates the model output.#center](image1.png "pico-faces diffusion workflow on the Alif Ensemble E8") + +The [CMSIS-ExecuTorch example](https://github.com/Arm-Examples/CMSIS-Executorch/tree/hackathon-pico-faces) re-expresses the model as two ExecuTorch methods: + +| Method | Purpose | Execution target | +| --- | --- | --- | +| `dit_step(z, c)` | Predict the velocity used to update the latent image | Ethos-U85 | +| `decode(z)` | Convert the final latent image into an RGB face | Ethos-U85 | +| Sampling loop | Generate noise, apply guidance, and update the latent image | Cortex-M55 | + +The `dit_step` method uses 16-bit activations and 8-bit weights. The extra activation precision preserves the transformer's residual stream. The decoder uses 8-bit activations and weights, which reduces its execution time without the same visible quality loss. + +## Follow the deployment flow + +The example uses a CMSIS solution to keep the hardware definition separate from the Python exporter. The workflow has three stages: + +1. CMSIS-Toolbox resolves the `DevKit-E8` target and records its Cortex-M55, Ethos-U85, and Vela settings in `cmsis-executorch.cbuild-mlops.yml`. +2. `create_ai_layer.py` quantizes and exports both methods, delegates them to Ethos-U85, and writes the AI layer. +3. CMSIS-Toolbox builds the application and embeds the ExecuTorch program in the firmware image. + +The generated application uses the high-performance Cortex-M55 core at 400 MHz to control sampling. The Ethos-U85 configuration provides 256 multiply-accumulate operations per cycle. The firmware displays each generated face on the DevKit LCD and reports timings through UART4. + +## Know what success looks like + +A successful run proves the complete workflow in three ways: + +- The DevKit LCD displays the generated face. +- UART output ends with `Test_result: PASS`. +- The Ethos-U performance monitoring unit reports cycles and activity for both model methods. + +The first image uses a fixed seed and configuration. This makes the boot test repeatable even though the exact CRC can change when the model is exported on a different host. + +## What you've learned and what's next + +You've learned how the Cortex-M55 sampling loop calls two ExecuTorch methods that run on the Ethos-U85 NPU. Next, you'll install the host tools and connect the DevKit.