Metadata-Version: 2.5
Name: mlia-neural-technology
Version: 0.2.1
Summary: ML Inference Advisor NX Plugin
Project-URL: Homepage, https://github.com/arm/mlia-neural-technology.git
Author-email: Arm Ltd <mlia@arm.com>
License-Expression: Apache-2.0
License-File: LICENSES/Apache-2.0.txt
License-File: LICENSES/LicenseRef-LICENSE.txt
Keywords: arm,ml,neural-technology,nx
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <3.13,>=3.12
Requires-Dist: ai-ml-sdk-model-converter==0.10.0
Requires-Dist: mlia<0.13,>=0.12.3
Requires-Dist: tosa-tools==2026.2.1
Description-Content-Type: text/markdown

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

# MLIA Neural Technology Plugin

This package contains the MLIA target plugin for Arm Neural Technology flows
and packages the backend integrations used to estimate performance and work with
TOSA-related assets in that environment.

The package is distributed as `mlia-neural-technology` and contributes:

- The `neural-technology` target plugin.
- The `nx-performance-estimator` model-analysis backend.
- The `neural-technology-profiling-data` measured-analysis backend.
- The internal `ml-sdk-model-converter` conversion integration.
- The internal `tosa-flatbuffers` serialization integration.
- Bundled Neural Technology target profiles and backend configuration assets.

## Table of Contents

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

## Overview

`mlia-neural-technology` extends MLIA with Neural Technology target knowledge,
profile assets, and backend plugins used by NX-oriented performance and model
conversion workflows.

This package is responsible for the target-side integration and backend
wiring for Neural Technology analysis. It is typically installed alongside the
core `mlia` package and, depending on the workflow, other MLIA converter
plugins.

For upstream model formats, the compatible converter plugins are:

- `mlia-converters-litert` for LiteRT / TensorFlow Lite `.tflite` inputs.
- `mlia-converters-pytorch` for `.pt2` and `.pte` inputs.

## Supported targets

Bundled target profiles include:

- `neural-technology`
- `NX-peak-12SC-8NX-600MHz`
- `NX-sustained-12SC-8NX-350MHz`

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

## Backends in this package

### NX Performance Estimator

Provides the performance-estimation flow for Neural Technology targets and uses
bundled system and graph-compiler configuration assets.

For TOSA compatibility reports, omit constants, shape constants, and reshapes
with the optional boolean flag (no value is required):

```bash
uv run mlia check -t neural-technology --compatibility \
  --nx-performance-estimator.skip-trivial-ops -- model.tosamlir
```

Without the flag, these operations remain in the report. This controls MLIA's
compatibility reporting, not the estimator's compilation or performance analysis.

### Measured profiling data

The built-in `neural-technology-profiling-data` backend analyzes structured
captures from `VK_LAYER_LGL_neural_statistics`. It is selected automatically
when `--profiling-data` is supplied and supports performance analysis only.

### Conversion support

`ml-sdk-model-converter` prepares models for downstream Neural Technology tools,
and `tosa-flatbuffers` supplies low-level TOSA serialization support. Both are
internal, non-selectable dependency integrations rather than analysis backends.

## Installation

The wheel requires CPython 3.12 (`>=3.12,<3.13`). On x86-64 Linux, it requires
Ubuntu 24.04 or newer, or another distribution with glibc 2.39 or newer.
Linux wheels use a `manylinux_2_39` platform tag so installers reject older
glibc versions. Builds on newer glibc versions retain that higher minimum.
The bundled native `vgfpy` extension also requires a matching CPython ABI.

Install into an environment that already contains `mlia`:

```bash
pip install mlia-neural-technology
```

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

```bash
mlia check my_model.tosa --target-profile neural-technology
```

Measured profiling data can be analyzed without a source model when one dispatch
is selected:

```bash
mlia check --target-profile neural-technology --performance \
  --profiling-data ./capture/pipeline_000000/session_000000/dispatch_000000
```

Use `.tosa` as the clearest default model example for this package on its own.
Direct LiteRT / TensorFlow Lite `.tflite`, `.pt2`, and `.pte` flows depend on the
matching converter plugins being installed.

The supported Python range and required core MLIA dependency are maintained in
[`pyproject.toml`](https://github.com/arm/mlia-neural-technology/blob/2f8abb87eb9b22ed2288024823bf50d977730c5c/pyproject.toml), which is the authoritative source for current
installation requirements. This package is intended to be used as part of a
wider MLIA installation rather than as a standalone CLI.

## Releases

Latest changes and release history can be found in
[MLIA Neural Technology releases](https://github.com/arm/mlia-neural-technology/releases).

## 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-neural-technology`](https://github.com/arm/mlia-neural-technology/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/neural_technology/`: Neural Technology target integration and advisor logic.
- `src/mlia/backend/nx_performance_estimator/`: NX performance estimator backend.
- `src/mlia/backend/neural_technology_profiling_data/`: measured capture parsing
  and analysis.
- `src/mlia/backend/ml_sdk_model_converter/`: internal model-conversion support.
- `src/mlia/backend/tosa_flatbuffers/`: internal TOSA FlatBuffers support.
- `src/mlia/resources/`: bundled target profiles and backend assets.
- `tests/`: unit tests covering plugins, CLI integration, and target/backend behaviour.

## Documentation

Additional package documentation lives in [docs/README.md](https://github.com/arm/mlia-neural-technology/blob/2f8abb87eb9b22ed2288024823bf50d977730c5c/docs/README.md). The
[Python API walkthrough](https://github.com/arm/mlia-neural-technology/blob/2f8abb87eb9b22ed2288024823bf50d977730c5c/docs/source/neural_technology_api_walkthrough.ipynb)
covers `torch.nn.Module` inputs and structured Python results.

## License

The source code and configuration in this repository are licensed under the
Apache License 2.0 unless a file states otherwise. See
[`LICENSES/Apache-2.0.txt`](https://github.com/arm/mlia-neural-technology/blob/2f8abb87eb9b22ed2288024823bf50d977730c5c/LICENSES/Apache-2.0.txt) for the full license text.

All contents of these directories are proprietary and are provided under
[`END USER LICENSE AGREEMENT FOR ARM ECOSYSTEM SOFTWARE`](https://github.com/arm/mlia-neural-technology/blob/2f8abb87eb9b22ed2288024823bf50d977730c5c/LICENSES/LicenseRef-LICENSE.txt):

- `src/mlia/_vendor/artifacts/nx-performance-estimator/`
- `src/mlia/resources/nx-performance-estimator/`

### Applicable proprietary license terms

By accessing or using the software, documentation, or any other material made available
to you by Arm on this GitHub repository (“Arm Deliverables”), you agree to be bound by the
terms of the Arm End User License Agreement or Open-Source License (as applicable) (“License”)
included in the component-level license_terms folder for each Arm Deliverable.

Use, modification and distribution of any Arm Deliverable is permitted only
to the extent expressly stated in the relevant License. Notwithstanding any
wording to the contrary in the relevant License, the Arm Deliverables are provided
by Arm solely for use with the relevant Arm SoC product.

For all Arm development tools licensed under the terms of the End User License
Agreement for Software Development Tools (“Arm Tools”), your attention is drawn
to the terms and conditions applicable to free-of-charge Arm Tools. Your use of
any Arm Tools shall be limited as set out therein.

## Trademarks and copyrights

- Arm is a registered trademark or trademark 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.
