Skip to main content

TOSA Tools: serialization library, reference model, optional MLIR translator

Project description

TOSA Tools

A toolkit for working with the Tensor Operator Set Architecture (TOSA) Specification (https://git.mlplatform.org/tosa/specification.git/), 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.

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 x86_64 release
Linux aarch64 experimental
Windows (r) x86_64 experimental
macOS (r) aarch64 experimental

For build instructions see README.md for individual components.

System Requirements

Tool Version Note
Python 3.10 or later tested with 3.12.0
CMake 3.16 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.

Quick Build (POSIX)

Build all projects with default configuration:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build

Selective Build

Use TOSA_ENABLE_PROJECTS to build specific components:

Build only serialization library:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTOSA_ENABLE_PROJECTS=serialization
cmake --build build

Build serialization and reference model:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTOSA_ENABLE_PROJECTS="serialization;reference_model"
cmake --build build

Build MLIR translator:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTOSA_ENABLE_PROJECTS="mlir_translator" \
    -DMLIR_TOSA_OPT=ON \
    -DMLIR_DIR=${LLVM_BUILD}/lib/cmake/mlir \
    -DLLVM_DIR=${LLVM_BUILD}/lib/cmake/llvm
cmake --build build

Build all projects (including MLIR translator):

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DTOSA_ENABLE_PROJECTS=all \
    -DMLIR_TOSA_OPT=ON \
    -DMLIR_DIR=${LLVM_BUILD}/lib/cmake/mlir \
    -DLLVM_DIR=${LLVM_BUILD}/lib/cmake/llvm
cmake --build build

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.

Debug Build

For debug symbols:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DTOSA_ENABLE_PROJECTS=reference_model
cmake --build build

Build and install with pip

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 .).

Install default components (serialization + reference model)

This uses the default CMake definitions from pyproject.toml.

python -m venv .venv
source .venv/bin/activate

python -m pip install -U pip

# Build + install from the current checkout
python -m pip install . -v -Cbuild-dir=build/pip-install

Install with MLIR translator enabled

To build the MLIR translator you need a compatible LLVM/MLIR build. The tested LLVM commit is pinned in ci/vars/llvm-sha.yml.

Install tosa-tools with the required CMake config settings:

python -m pip install . -v -Cbuild-dir=build/pip-install \
    --config-settings=cmake.define.TOSA_ENABLE_PROJECTS="serialization;reference_model;mlir_translator" \
    --config-settings=cmake.define.MLIR_TOSA_OPT=ON \
    --config-settings=cmake.define.MLIR_DIR="${LLVM_BUILD}/lib/cmake/mlir" \
    --config-settings=cmake.define.LLVM_DIR="${LLVM_BUILD}/lib/cmake/llvm"

Build a wheel locally (optional)

python -m pip wheel . -w dist -v -Cbuild-dir=build/pip-wheel
python -m pip install --no-deps dist/*.whl

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tosa_tools-2026.2.1-cp313-cp313-win_amd64.whl (35.3 MB view details)

Uploaded CPython 3.13Windows x86-64

tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (28.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (25.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tosa_tools-2026.2.1-cp313-cp313-macosx_15_0_arm64.whl (22.4 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

tosa_tools-2026.2.1-cp312-cp312-win_amd64.whl (35.3 MB view details)

Uploaded CPython 3.12Windows x86-64

tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (28.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (25.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tosa_tools-2026.2.1-cp312-cp312-macosx_15_0_arm64.whl (22.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

tosa_tools-2026.2.1-cp311-cp311-win_amd64.whl (35.3 MB view details)

Uploaded CPython 3.11Windows x86-64

tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (28.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (25.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tosa_tools-2026.2.1-cp311-cp311-macosx_15_0_arm64.whl (22.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

tosa_tools-2026.2.1-cp310-cp310-win_amd64.whl (35.3 MB view details)

Uploaded CPython 3.10Windows x86-64

tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (28.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (25.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

tosa_tools-2026.2.1-cp310-cp310-macosx_15_0_arm64.whl (22.4 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file tosa_tools-2026.2.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 70fbb33918e4fa6bc8282052d064443da9ab34605952714baeb54696ab1150db
MD5 58b78e004071d84a4d669147fdb6c236
BLAKE2b-256 451fd2ce885f2060158af646f7a5ad303c511e78267a1a5b06c907a8bd9beb3a

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e37bedddc83f880426c970f8d0204e36f3dd0dcbe9b34ede10f860142ba5ef45
MD5 30244ee3aaa10fd85fc90db2fb604b53
BLAKE2b-256 41e17145ccce635a3c400d55dbe9ae7be0eed1242124505f3e9fc0a5721da916

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8c5e94113352d10d6211a7195a5426a340729e513995c1ecc4c0a8f97f7daec4
MD5 cee90fe386c4de0ca591b6d03a6091a2
BLAKE2b-256 efd5002528d306dcc748b20ab8f7c31c203cee80b854297aacbbd8cd195961c3

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8713b7621ea7397acde44d0b15e66d6b5f0d2013037752a5ba936e36afdfe4db
MD5 6b6bfdfc0591848d7775a256e3d467b0
BLAKE2b-256 b1d708a4d1036ad61c633cf1ebc60085430c016c062f8fb69a188b6398d5b15f

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 231d6630c4a25662f62876a40a0e4be5e9a838b7a2e5765ef242d0701c883393
MD5 3435275307d22f0e2055c6b8044d9bbc
BLAKE2b-256 42523cb3552a74d7746d604cf08f5cda44fd52046a1113f14e8e098dd5de3e1e

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac365517919dc4ca050abfbe465b0780773545b32309244393c8a8c5fcb17065
MD5 d16162cb2c36a41674efd3252d539da0
BLAKE2b-256 2ca140f72b2e67842ec713632d79782c66b6fadb9be99ee3f31d15c8983297da

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 093e2dbef4cc272fa5e92f4817988f29c42631d29690573e3a1b990bcff1a1dd
MD5 7787094a916291b548540548eaa706b0
BLAKE2b-256 2c273595ec5434c6ce35915137e0a5be307650facac02a62d54cc5b38f98dce0

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bb599850fa907faa130cacc4e68ca7697dabd5c7d48ab8a9e402450c4ab1e9b6
MD5 60c4319145ef6d246c9f0558bef518af
BLAKE2b-256 815edbe14f56e8ef3fa6d9537098b9d204d1941f8859e773c5dd7ba015db8b1f

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dac8217a7daee3502446ac7d505fa3298ba54130437a7ad84d5c4a0fff2156c2
MD5 2552f418fb42b4fbad60e01c31cf1817
BLAKE2b-256 c2174a3f55a522572d69a61466a6ada5db17260e6cb6102186a030ebb1d0bb81

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9b05a16393872a75ff0739c9271a874d08774e89d30f5751c2ad81cd6972100c
MD5 1c20220f92d2446e6a26ee45f43141d4
BLAKE2b-256 5eacded1fdd110c7ba9f6c8fa33549b8b4f2496cad69bc90dd68424c7ee47f4e

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 46bbe4aedfe00d5bb253fe379a165f239c88d91675facafc83a0bb970ccb64a5
MD5 0310e4b757f29635c38cc349799096bd
BLAKE2b-256 77f5314e33f577951f7e7f2b64df89317b73d3eb38663bf51c497071fbb38b26

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 3f4315e603821a79f955fbf9792a873773b8e628d58d2f4ec3b24db84a9d1c03
MD5 8d407a8c640041ba008311a6b77f3ce0
BLAKE2b-256 0f5153c36d0a8a0e614be26c23ec25c297dc2cdec4557328867b41844b6c763a

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a4df91733798b6eabca011b06f9ef55fad943b48e046f1c8303a8b7645bf92dd
MD5 8beb089d0550fe490e5e6509134ed183
BLAKE2b-256 f13a9bee0079591b5b1b1a3b2144bf572c0788ab26ba796005aeb11bdb6a4f46

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0e2a755d323ac9a77bfe54f5463e53c9c82ea27f0d5ad2c8fdd4f972739d331f
MD5 8069a2f1b31fb815010e75a617ec8aa1
BLAKE2b-256 8fe5fd55cbe4f64b4d89793162a28d2247ee2a9efc2a2ed0cb822f61434abf4f

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fd2f089787abb065aa32a575ca6eed0f210758af987781226b6c13bb0b28c426
MD5 ef34aaf61cfc82b31fbdc1fcb640ba39
BLAKE2b-256 83934297f891b9d82fddc0feab295cd96ace3cdc3183f408c7c077c55d191d0c

See more details on using hashes here.

File details

Details for the file tosa_tools-2026.2.1-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for tosa_tools-2026.2.1-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 0d8b82f072bc599a8fbf19da282dbce402fcc76ad165886cd55b67eac4faa23b
MD5 0782ee7dacede5e8c741c1f8ad76cc07
BLAKE2b-256 9aafa50a86945c03cbb2a6e9dc5a6a7d598a4d7f984288fa20196fbe80ffd5c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page