Metadata-Version: 2.5
Name: mlia-ethos-u
Version: 0.1.0
Summary: ML Inference Advisor Ethos Plugin
Project-URL: Homepage, https://github.com/arm/mlia-ethos-u.git
Author-email: Arm Ltd <mlia@arm.com>
License-Expression: Apache-2.0
License-File: LICENSES/Apache-2.0.txt
License-File: LICENSES/BSD-3-Clause.txt
License-File: LICENSES/CC-PDDC.txt
Keywords: arm,ethos,ml,tflite
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: mlia==0.12.2
Description-Content-Type: text/markdown

<!---
SPDX-FileCopyrightText: Copyright 2026, Arm Limited and/or its affiliates.
SPDX-License-Identifier: Apache-2.0
--->

# MLIA Ethos-U Plugin

This package contains the MLIA target plugin for Arm Ethos-U platforms and
packages the Ethos-U backend integrations used by MLIA.

The package is distributed as `mlia-ethos-u` and contributes:

- The `ethos_u` target plugin.
- The `vela` backend plugin.
- The Corstone backend plugin, which registers target-specific Corstone backends.
- Bundled Ethos-U target profiles and Vela configuration assets.

## Table of Contents

- [Overview](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#overview)
- [Supported targets](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#supported-targets)
- [Backends in this package](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#backends-in-this-package)
- [Installation](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#installation)
- [Reporting bugs](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#reporting-bugs)
- [Development setup](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#development-setup)
- [Common commands](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#common-commands)
- [Project layout](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#project-layout)
- [Documentation](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#documentation)
- [Releases](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#releases)
- [License](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#license)
- [Trademarks and copyrights](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/README.md#trademarks-and-copyrights)

## Overview

`mlia-ethos-u` is the main MLIA plugin package for Ethos-U inference analysis.
It extends the core MLIA framework with Arm Ethos-U target knowledge, operator
analysis, bundled target profiles, and the backend integrations required for
Vela compilation and Corstone-based performance flows.

This is the package to install when you want MLIA to analyse LiteRT /
TensorFlow Lite `.tflite` models for Ethos-U55, Ethos-U65, or Ethos-U85 targets,
or when you want to run
the Corstone-based ExecuTorch AOT path for supported PyTorch inputs.

## Supported targets

Bundled target profiles include:

- `ethos-u55-128`
- `ethos-u55-256`
- `ethos-u65-256`
- `ethos-u65-512`
- `ethos-u85-128`
- `ethos-u85-256`
- `ethos-u85-512`
- `ethos-u85-1024`
- `ethos-u85-2048`

These profiles are shipped under `src/mlia/resources/target_profiles/`.

## Backends in this package

### Vela

The Vela backend is used for compiler-oriented analysis, compatibility checks,
and Ethos-U standardized performance results based on the Vela toolchain.

### Corstone

The Corstone backend supports simulation-oriented performance flows for
Corstone platforms used in Ethos-U analysis and validation. It is also the
backend path used for supported ExecuTorch `.pte` workloads.

## Installation

Install into an environment that already contains `mlia`:

```bash
pip install mlia-ethos-u
```

If you want MLIA to accept PyTorch `.pt2` inputs directly for the ExecuTorch
flow, install the matching
[converter plugin](https://github.com/arm/mlia-converters-pytorch) as well:

```bash
pip install mlia-converters-pytorch
```

A typical MLIA workflow then references one of the bundled profiles, for
example:

```bash
mlia check my_model.tflite --target-profile ethos-u55-256
```

For supported ExecuTorch AOT flows, a PyTorch-originating run can look like:

```bash
mlia check my_model.pt2 --target-profile ethos-u55-256 --performance --backend corstone-300
```

Direct `.pt2` support depends on `mlia-converters-pytorch`. Corstone performance
for ExecuTorch `.pte` models, including converted `.pt2` inputs, currently
supports only these combinations:

| Target | ExecuTorch performance backend |
| --- | --- |
| Ethos-U55 | `corstone-300` |
| Ethos-U85 | `corstone-320` |
| Ethos-U65 | Unsupported |

For Ethos-U65, `--performance` on a PyTorch `.pt2` input is supported only
through Vela:

```bash
mlia check my_model.pt2 --target-profile ethos-u65-256 --performance --backend vela
```

Vela provides compiler-based performance estimates. It does not run ExecuTorch
`.pte` models; use the original `.pt2` input for this route. Ethos-U65 `.pte`
performance is currently unsupported. These restrictions do not affect the
TFLite Corstone performance path. See the
[backend guide](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/docs/source/backends.md#executorch-performance-support) for details.

The package depends on MLIA and is intended to be used as part of an MLIA
installation rather than as a standalone CLI. See `pyproject.toml` for the
current dependency constraint.

## Reporting bugs

Report bugs by creating GitHub issues. Use the
[`arm/mlia` issue tracker](https://github.com/arm/mlia/issues) by default.

Only open an issue in
[`arm/mlia-ethos-u`](https://github.com/arm/mlia-ethos-u/issues) when the bug
is clearly and specifically in this plugin.

## Development setup

Create a local environment with the project and all development dependencies:

```bash
uv sync --group dev
```

If you only need the test dependencies:

```bash
uv sync --group test
```

This repository currently does not use a committed lock file (`uv.lock`).

## Common commands

Run the quick test suite used in CI:

```bash
uv run pytest -m "not slow" tests/
```

Run the full test suite with coverage:

```bash
uv sync --group test
uv run pytest tests/
```

Run the local quality checks:

```bash
uv run pre-commit run --all-files
```

Build the package:

```bash
uv build
```

## Project layout

- `src/mlia/target/ethos_u/`: target integration, advisor logic, result-owned
  advice, and standardized-output collection for Ethos-U.
- `src/mlia/backend/vela/`: Vela backend integration.
- `src/mlia/backend/corstone/`: Corstone backend integration.
- `src/mlia/resources/target_profiles/`: bundled Ethos-U target profiles.
- `src/mlia/resources/vela/`: bundled Vela configuration.
- `tests/`: unit, integration, and CLI coverage for targets and backends.

## Documentation

Additional package documentation lives in [docs/README.md](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/docs/README.md).

## Releases

Latest changes and release history can be found in
[MLIA Ethos-U releases](https://github.com/arm/mlia-ethos-u/releases).

## License

This project is licensed under the Apache License 2.0. See the
[license files](https://github.com/arm/mlia-ethos-u/blob/b1eb6a4a6c340f8d4f66da061955369f6c9ec0a2/LICENSES/) for details.

## Trademarks and copyrights

- Arm, Arm Ethos-U, Arm Cortex-M, and Arm Corstone are registered trademarks or trademarks of Arm Limited (or its subsidiaries) in the U.S. and/or elsewhere.
- TensorFlow is a trademark of Google LLC.
- PyTorch and ExecuTorch are trademarks of The Linux Foundation.
- Linux is the registered trademark of Linus Torvalds in the U.S. and elsewhere.
- Python is a registered trademark of the PSF.
