Skip to content

ethosu_operator

Classes

EthosUOperator

EthosUOperator(op: AirOperator, model: AirModel, platform: SocPlatform, prefix: str = 'aot', attributes: dict[str, str] = {})

AIR Ethos-U custom operator.

The generated kernel drives the Arm Ethos-U NPU through the Ethos-U core driver (ethosu_driver.h / ethosu_invoke_v3), which is a hard dependency. The emitted source is fail-closed: if the driver header is not on the include path the translation unit stops with a #error rather than silently compiling a no-op stub. A non-functional stub remains available for host-side / bring-up builds by defining HELIA_ETHOSU_ALLOW_STUB=1 (the NPU is not executed in that mode). The generated CMake module advertises and wires the driver dependency; see aot/templates/cmake/CMakeLists.txt.j2.

Tensor alignment: :meth:on_resolve stamps alignment_hint = 16 on the command stream, Vela-added auxiliary tensors, and this operator's inputs and outputs, so the memory planner places every NPU-visible buffer on the 16-byte boundary the Ethos-U requires.

Platform gating: :meth:validate rejects conversion when the target platform does not declare :attr:SocCapability.NPU, so scheduling this operator onto an accelerator-less platform fails at convert time with an actionable message instead of later in the integrator's build (#265). Simulator targets whose NPU is provided externally (e.g. Corstone FVP) can opt out via the require_platform_npu: "false" operator attribute, which is reachable only through the operators: attribute ruleset in a config YAML -- the --operators CLI flag rejects inline values because :class:~helia_aot.attributes.defines.AttributeRuleset is a nested model.

Functions