Skip to content
heliaAOT
Examples
HELIA HUB

Ethos-U

From the repository root with Git LFS files available, run the public CLI or Python example with the preparation extra:

Terminal window
uv sync --frozen --extra ethos
uv run --frozen --extra ethos helia-aot convert --path examples/ethos-u/prepare.yaml
uv run --frozen --extra ethos python examples/ethos-u/prepare.py out/ethos-python

prepare.yaml selects the modeled U55-128 and its compiler SoC. The CLI prints the retained record and compiled hash. prepare.py compiles the original and then replays the same artifact through the public Python API. Move the whole run directory to relocate its record, sources and compiler evidence.

Convert a supplied Vela-compiled model for the Ethos-U NPU on atomiq110. This path accepts its compiled input with the base package.

Field Value
Model a compatible Vela-compiled LiteRT model you supply
Target atomiq110
Shows The Ethos-U operator, the driver dependency, and the platform gate
CI Manual for the supplied model. The automated Corstone-320 test uses the public CNN.

The model is whatever VELA_MODEL points at. Neither Vela nor a Vela artifact is supplied by this example. This is a converter-stage recipe, not an end-to-end Vela or board bring-up tutorial. Record your Vela version, accelerator configuration, input/output hashes and matching driver/platform versions before using it.

Use a repository checkout with Bash and the environment from Running examples: uv sync --frozen --group ci, then activate .venv. Supply a compatible Vela-compiled model and run the commands below from this example directory. This step converts on the host; building and running the module also requires the matching Ethos-U driver and target environment.

Terminal window
VELA_MODEL=/path/to/vela_model.tflite ./run.sh

A second run stops with Output path ... already exists, because the first run’s module is still in out/. Add --force to replace it.

config.yaml selects atomiq110 as the target. Vela has already partitioned the model and produced the accelerator command stream; selecting a target in heliaAOT does not offload an ordinary graph to the NPU.

Successful conversion writes the configured module under out/; inspect its ETHOS_U source and build dependencies. Compilation and actual accelerator execution are separate checks. The supplied model still has to satisfy the converter’s supported tensor/shape/operator contracts.

Every Ethos-U-supported subgraph arrives as a single ETHOS_U operator whose first input is the command stream. The generated module wraps the driver’s invoke call and wires up the command stream and the base addresses for inputs, outputs and Vela’s auxiliary buffers. Operators Vela did not take stay ordinary kernels.

Buffer alignment is handled for you. Where Vela emitted its own offline memory allocation, heliaAOT honours those offsets rather than re-planning the region, so the addresses the command stream was compiled against stay valid.

A module containing ETHOS_U operators will not compile without the driver header on the include path; the generated translation unit stops with an #error. This is deliberate. A missing header used to compile a stub that returned success without touching the accelerator, so an integrator could ship a passing build whose accelerator never ran.

A non-functional stub is still available for host-side codegen tests and for bring-up without a driver tree, and it has to be asked for explicitly with -DHELIA_ETHOSU_ALLOW_STUB=1. Never use it in a build expected to run the model.

Converting a Vela model against a platform that declares no accelerator is rejected at conversion time. Simulation is the legitimate exception, most often an Arm fixed virtual platform that provides the accelerator itself. Opt out per operator, in the configuration file:

operators:
- type: ETHOS_U
attributes:
require_platform_npu: "false"

or on the command line, where --operators takes the same rule as JSON:

Terminal window
--operators '{"type": "ETHOS_U", "attributes": {"require_platform_npu": "false"}}'

On Linux x86-64 with Git LFS files available, run from the repository root:

Terminal window
uv sync --frozen --group ci --extra ethos
uv run --frozen --no-sync python tests/e2e/tools/deps.py setup --skip corstone
uv run --frozen --no-sync pytest -sv tests/e2e/qualification_corstone320.py

This test prepares the original quantized CNN using the public Python API and the catalog’s atomiq110/npu_0 configuration (Ethos-U85-256). It builds the generated C with the real driver and runs on the Corstone-320 Cortex-M85. The UART log records a completed NPU job, the driver’s compiled and observed MAC counts, and the comparison with the original LiteRT output at tolerance 10. The test installs Arm FVP 11.27.25 from its pinned archive. Set HELIA_AOT_CORSTONE320_HOME to use an existing installation of that version.

The Corstone-300 test continues to exercise the U55-128 configuration. Both tests qualify functional inference on the simulator. Physical Atomiq110 memory reach, power behavior and performance require measurements on that platform.

AOT supports ETHOS_U_STREAM_SPLIT v1 in Vela-compiled models. See the operator contracts for tensor requirements, memory behavior and the sequential execution contract.