A toolkit for working with the Tensor Operator Set Architecture (TOSA) Specification (https://github.com/arm/tosa-specification), providing serialization, reference implementation, and MLIR translation capabilities.
Introduction
TOSA Tools is a composite project that integrates three main components:
reference_model – a reference implementation of TOSA operators.
serialization – provides methods to read and write serialized TOSA graphs.
mlir_translator – implements translators between the TOSA MLIR dialect and serialized representations.
Each subfolder contains its own README with more detailed information.
Release Notes
For release-specific changes, see the release notes.
PyPI package
From v2026.02.0 onward, the tosa-tools Python package is published on PyPI.
For most users, the quickest start is:
python -m pip install tosa-tools
This installs the Python APIs and command-line entrypoints from all the components (serialization + reference model + MLIR translator). For a concise list of the Python modules, executables, console scripts and shared libraries installed by the package, see PYTHON_PACKAGE.md.
Prerequisites
Platform support
The following platforms are supported:
Platform
Architecture
Support level
Linux (r)
x86_64
release
Linux (r)
aarch64
experimental
Windows (r)
x86_64
experimental
macOS (r)
Apple silicon
experimental
All supported platforms have operational CI builds and tests.
Experimental platforms may not produce bit-exact reference model results compared to Linux/x86_64.
Note:
Windows (r) git clone needs long paths enabled, for example:
git config --global core.longpaths true
For build instructions see README.md for individual components.
Test environments
Platform
Architecture
OS version
Toolchain
Linux (r)
x86_64
Ubuntu 26.04
Clang 22.1.2
Linux (r)
aarch64
Ubuntu 26.04
Clang 22.1.2
Windows (r)
x86_64
Server 2022
MSVC compiler 19.44.35221.0 toolset 14.44.35207
macOS (r)
Apple silicon
15.7
XCode 26.1.1 AppleClang 17.0.0.17000404
Linux Docker configuration is available in this repository at ci/docker
System Requirements
Tool
Version
Note
Python
3.11 or later
tested with 3.12.0
CMake
3.18 or later
tested with 3.30
External Dependencies
LLVM/MLIR
The TOSA MLIR Translator must be linked against a build of LLVM with the MLIR project enabled. Currently, the TOSA MLIR Translator aims to be compatible with the main branch of LLVM. However, when breaking API changes are introduced in LLVM/MLIR, compatibility may not be guaranteed. We regularly update the tested SHA; see ci/vars/llvm-sha.yml for the current SHA.
OpenMP (r) runtime
The reference model can use the OpenMP API to evaluate independent operator
outputs in parallel. See the reference-model documentation
for build requirements and thread controls.
Use your preferred package manager to install the OpenMP runtime and development files for your compiler. See our Dockerfile and its setup script for an Ubuntu example using apt-get.
Note:
The MLIR translator requires MLIR to be available on your system. It is not enabled by default.
LLVM_BUILD must be absolute path to llvm-project build directory.
The Python package is built with scikit-build-core, which drives a CMake build under the hood.
This means pip install will compile native code and therefore requires a working C/C++ toolchain.
If you just want the prebuilt package, use python -m pip install tosa-tools as shown above.
The steps below are for building from source.
Note: Starting with release 2026.05.0, the tooling to build/install the individual component
Python packages from subdirectories will be removed. Use the unified tosa-tools package from the
repository root (python -m pip install .).
The unified distribution installs its Python implementations under the
tosa_tools namespace. For example, the canonical import for the test runner is:
from tosa_tools import runner
Legacy top-level imports remain available during the compatibility period:
import runner
The top-level runner package is a small compatibility shim rather than a second
copy of the implementation. When imported, it logs a deprecation warning and
re-exports the public API from tosa_tools.runner. Nested legacy modules are
mirrored by small compatibility packages which re-export the corresponding
tosa_tools.runner.* module. The compatibility and canonical modules are distinct
module objects, but the functions, classes, and other objects re-exported by the
compatibility modules come from the canonical implementation.
Python installers track distributions and their files, but do not generally detect
when two differently named distributions provide the same top-level import package.
Before the namespace was introduced, installing tosa-tools over another
distribution that provided runner could overwrite files with matching paths and
leave non-matching files in place. The result could be a mixture of files from both
distributions.
With the namespaced layout, the implementation is isolated under
tosa_tools/runner. However, the legacy shim still installs
runner/__init__.py, so a clash at that path remains possible. If tosa-tools
is installed second, its shim normally overwrites the other distribution's
__init__.py. Importing runner then loads the compatibility API. Matching
nested module names resolve to the corresponding compatibility package, while
non-matching files left by the other distribution may remain importable. This can
still produce a hybrid package. If the other distribution is installed second, it
can instead overwrite the shim; canonical tosa_tools.runner imports remain
isolated, although code using the legacy name may resolve to the other distribution.
Uninstallation does not restore overwritten files. If either distribution is
removed after such a clash, the remaining distribution may be incomplete and
should be reinstalled. Use an isolated virtual environment and canonical
tosa_tools.* imports to minimize this risk. The compatibility shims can only be
removed after users of the legacy imports have migrated.
Development Environment
For a consistent setup, use the provided Docker configuration for development. This mirrors the CI environment closely. Please refer to the CI README for more details.
Pre-Commit Checks
Before pushing a commit, pre-commit checks must be run to ensure conformity.
NOTE: All commits pushed to remote must adhere to the structured commit format, please refer to CONTRIBUTING.md for detailed guidelines.
pre-commit install
pre-commit run --all
Versioning
This project uses Calendar Versioning (CalVer) in the format: YYYY.0M.Micro[.Modifier]
YYYY – 4-digit release year (e.g., 2025)
0M – 2-digit Zero-padded release month (e.g., 07 for July)
Micro – The third and usually final number in the version. Sometimes referred to as the "patch" segment.
Modifier - Optional text tag used to signify extra information
about the build.
no tag (empty string) - builds produced for release will have no tag at all.
The main branch is used as the active development branch for the next
version.
Backward Compatibility
The TOSA Specification outlines its own
backward compatibility guarantees and rules.
This section focuses on the backward compatibility guarantees of this project, which
implements the specification.
"Software" refers to tools provided by this project or otherwise explicitly
approved external ones.
There are no guarantees when using hand-written files or ones generated by un-vetted tools.
Serialization
The Serialization library guarantees the ability to load .tosa flatbuffer
files produced by earlier versions of the software, within a major TOSA specification version.
TOSA Specification features marked as experimental are an exception to the above and
we may remove them and the ability to parse them after a notice period.
Reference Model & Conformance Tests
The Reference Model uses the Serialization library and is able to read flatbuffer files produced by older software.
Compatibility between versions is determined by what changed in the following three areas: reference model result, compliance rules (defining tolerance), and conformance test content.
For details on exact changes please refer to the RELEASE_NOTES.md supplied with each release.
These changes are applied on a per-operator basis.
Reference model result
A bug fix to an operator can make it incompatible with
conformance tests and numerical tolerances from previous software versions.
Compliance rules (Tolerance)
With regards to compatibility between reference model results and tolerances, we currently
make no guarantees that two versions would be compatible with each other.
TOSA Specification outlines that changes to the compliance rules are allowed in both
directions: tightening and restricting. And as this implementation follows the specification it is possible that a change in tolerance causes incompatibility between
two versions.
Conformance test content
Bug fixes in the CTS can alter generated tests and their values, making
new Reference Model implementations potentially incompatible with older Conformance Tests.
TOSA MLIR Translator
The MLIR Translator uses Serialization library and is able
to read flatbuffer files produced by older software.
MLIR Translator depends on the TOSA MLIR dialect which can
change in incompatible ways and there is no backward
compatibility guarantee when reading older TOSA MLIR dialect
files and/or generated with a version of LLVM that is earlier than the tested version. Refer LLVM/MLIR for more details.
License
The TOSA Tools components are licensed as follows:
TOSA Serialization Library: Apache-2.0
TOSA Reference Model: Apache-2.0
TOSA MLIR Translator: Apache-2.0 with LLVM Exceptions
See individual component directories for detailed license information and third-party project licenses.
Trademarks
Arm is a registered trademark of Arm Limited (or its subsidiaries or affiliates).
The OpenMP name and the OpenMP logo are registered trademarks of the
OpenMP Architecture Review Board.
Works well with
Use together with tosa-tools: extensions, drivers, servers and companion tools.
ethos-u-velaPythie’s Index: 79Neural network model compiler for Arm Ethos-U NPUs102.7K downloads/mo