Skip to main content

TiGrIS

License PyPI Docs

Tiled Graph Inference Scheduler. An ahead-of-time compiler that tiles ML models to fit embedded devices with hard memory budgets.

Give it a model and a memory budget: ONNX, TFLite, or a PyTorch program saved with torch.export (.pt2). It partitions the compute graph into stages, tiles spatial operations, and emits a flat binary plan that the tigris-runtime executes with zero dynamic allocation.

If you already deploy TFLite Micro or ExecuTorch, tigris export rewrites the int8 .tflite file or the Cortex-M .pte program in row bands instead, so the runtime you ship runs it in less RAM with the same outputs.

The problem

On an embedded device with a few hundred KB of SRAM, most interesting models simply don't fit. The usual answer is to shrink the model: quantize harder, prune, pick a smaller architecture, and hope the accuracy hit is acceptable.

TiGrIS takes the other approach. It keeps the model you trained and rearranges the computation so that only a small working set lives in SRAM at any moment. Weights can stay in flash, and intermediate results that do not fit spill to slower writable memory such as PSRAM. What comes out is a binary plan that the runtime executes as a flat sequence of kernel calls, with no interpreter: activations get their addresses from caller-provided fast and slow arenas by bounded bump allocation, and inference never calls a general-purpose allocator.

Installation

pip install tigris-ml selects a wheel for the host. Native wheels include the portable reference runtime for Linux x86-64 and ARM64 with glibc >= 2.28, macOS x86-64 and ARM64, and Windows x86-64. The Linux wheels use manylinux_2_28; older glibc, musllinux, Windows ARM, and 32-bit ARM Linux install the pure Python wheel instead. A source distribution is also available.

The pure wheel supports inspection, compilation, analysis, code generation, export of TFLite models and ExecuTorch programs, and zoo downloads. Running a plan uses the bundled native library; without it run reports "Bundled host runtime is unavailable". Running a TFLite model uses tflite-micro, and running an ExecuTorch program builds a host runner once from an ExecuTorch checkout, which fetches CMSIS-NN.

On platforms without a native wheel, build the host library from the matching tigris-runtime release: run cmake -S . -B build-host -DTIGRIS_BUILD_HOST=ON, then cmake --build build-host --target tigris_host, and set TIGRIS_HOST_LIBRARY to the resulting shared library file. tigris --version and tigris run --json report the runtime's version and origin; an invalid override fails without falling back.

Quick start

pip install tigris-ml

# Will this model fit in 256KB SRAM + 16MB flash?
tigris analyze mobilenetv2.onnx -m 256K -f 16M
warning: input axis 0 (batch_size) is unset; using 1 (--input-shape overrides)
mobilenetv2.onnx   float32, 65 operators
  input    input    1x3x224x224 float32
  output   output   1x1000 float32
fits 256.00 KiB fast memory, 58 stages, 53 tiled

memory
  unscheduled         5.74 MiB
  largest tensor      4.59 MiB   1x96x112x112
  this plan         250.00 KiB   6.00 KiB headroom
  slow memory         5.17 MiB
  slow traffic       20.25 MiB   per inference: 7.21 MiB written, 13.04 MiB read
  smallest budget    37.50 KiB   37.47 KiB does not fit

flash
  plan           13.31 MiB   weights 13.30 MiB, overhead 8.32 KiB
  as int8         3.33 MiB   estimate
  flash budget   16.00 MiB   fits

Unscheduled, the model peaks at 5.74 MiB. TiGrIS schedules it into 256 KiB through temporal partitioning and spatial tiling. analyze runs on your laptop; no hardware required.

That model is a stock export with a free batch dimension. TiGrIS binds a dimension the model leaves open to 1 and says so; pass --input-shape input:4x3x224x224 to compile for a different one.

From ONNX to embedded

Three steps take a model from ONNX to a C file you can drop into your firmware project:

# 1. Analyze feasibility against a memory budget
tigris analyze model.onnx -m 256K -f 16M

# 2. Compile to a binary plan (weights read-in-place from flash)
tigris compile model.onnx -m 256K -f 16M --xip -o model.tgrs

# 3. Generate a backend-specific C harness for your target
tigris codegen model.tgrs --backend esp-nn -o model.c

The .tgrs plan is target-agnostic: the same file runs on an ESP32, a Cortex-M, or a POSIX host. The kernel backend is chosen at codegen time and decides which kernel library the generated C calls into. The operator and backend matrix shows which operators are native, which fall back, and which are rejected.

What you get

tigris compile writes a single .tgrs file holding the operator schedule, tile parameters, quantization tables, and the weights. With a host runtime, bundled or named by TIGRIS_HOST_LIBRARY, it first loads the plan with the runtime's loader and writes no plan the loader refuses. The pure wheel without TIGRIS_HOST_LIBRARY writes the plan without that check.

tigris codegen produces a C harness that loads the plan and hands it to the runtime: buffer and arena declarations, a target entry point, and the glue for reaching the plan bytes. --format app emits a standalone program. --format core emits a source and header for firmware that already owns its entry point, arenas, and input source, so several generated cores can coexist in one binary. The codegen reference documents the flags.

Link the harness against tigris-runtime and your kernel library, and you have a working inference binary.

Precompiled models

The model zoo hosts precompiled plans with runtime requirements, input/output conventions, evaluation results, and per-model licenses. Public downloads need no account. List available builds before choosing a model:

tigris zoo list --category classification
tigris zoo list --runtime 0.9.1 --backend reference -m 256K
tigris zoo fetch MODEL -o downloaded-model
tigris inspect downloaded-model/model.tgrs
tigris codegen downloaded-model/model.tgrs --format core -o model.c

Filters are optional. The newest published matching build wins. Runtime ranges include both endpoints; a null maximum means no known upper compatibility bound. Tested releases are reported separately. Matching a range does not claim that every release in it has been tested. -m limits the fast arena, a second -m limits the slow arena, and -f limits plan bytes. These are not total application RAM or flash limits. Unspecified resources remain unconstrained. The runtime for deployment on a device is supplied separately.

Use fetch --artifact ID to pin a build. Withdrawn builds are excluded from automatic selection but remain explicitly retrievable with a warning. Downloads verify file hashes and never replace an existing destination. manifest.json preserves the original build metadata. download.json records the current runtime constraints, tested releases, and pinned catalog revision; use it for dependency integration. Catalog updates do not change artifact publication dates or rebuild models. tigris zoo --offline ... uses the HF cache; tigris zoo --catalog catalog.json ... reads a local zoo snapshot.

Inspect a model

tigris inspect model.onnx
tigris inspect model.tgrs -v
tigris inspect model.tgrs --json

inspect detects the format from file contents: ONNX, TFLite, an exported PyTorch program (.pt2), an ExecuTorch program (.pte), or a compiled plan. For a TFLite file it also states whether the model converts, and if not, what stops it; for an ExecuTorch program it shows the interface and the RAM the program records. It reads declared ONNX inputs, outputs, operators, and initializers, or compiled plan interfaces, stages, tiling, quantization, and memory records. -v adds details; --json emits complete metadata with an inspection_version field and exact byte counts, without weight values. Inspection is offline: it does not compile, execute, infer shapes, or load external ONNX tensor data. Recorded plan memory is not measured runtime peak or total application RAM. Plan schemas do not imply runtime version requirements. Inspection does not validate kernel numerics. run executes portable kernels on the host: TiGrIS's reference kernels for a plan, TFLite Micro's reference kernels for a TFLite model, CMSIS-NN's portable C kernels for an ExecuTorch program. ESP-NN, the DSP and MVE kernel paths and on-device latency run on the target.

Run a compiled model

Platform wheels include the reference C runtime. Run preprocessed tensors in the stored axis order and declared interface dtype reported by inspect:

tigris run downloaded-model/model.tgrs --input downloaded-model/example-input.bin --output prediction.bin

Compare prediction.bin with example-output.bin numerically; the artifact's readme.md names the reference (TFLite Micro or ONNX Runtime) and how close the outputs must be.

tigris run model.tgrs --input input.npy --output prediction.npy
tigris --version

For multiple inputs, repeat --input NAME=FILE. Use .npz for multiple named outputs. Raw .bin files contain contiguous little-endian elements; .npy inputs retain their declared shape and dtype. Output files must not exist. --json reports execution metadata and arena peaks. These peaks exclude the plan, executor workspace, and Python process memory. Host execution uses only the portable float32 reference and int8 reference kernels. It checks plan execution on that path, not ESP-NN or CMSIS-NN numerics or on-device latency. It does not preprocess photos or CSV files.

import numpy as np
from tigris.runtime import Session

with Session("model.tgrs") as session:
    outputs = session.run({"input": np.load("input.npy", allow_pickle=False)})
    print(session.runtime_version, session.memory)

Compiler and runtime releases share a version identifying the tested pair. Execution checks matching zoo dependency records when present and lets the C loader validate the plan. Schema versions, accepted schema ranges, and the host ABI retain their own compatibility meanings. Downloading and generating deployment code remain independent of the host runtime. See Contributing for native-library staging and wheel builds.

Further reading

Maintainer

TiGrIS is maintained by RAWS Labs. For applied embedded-ML engineering or collaboration, see raws.at.

Development

git clone https://github.com/raws-labs/tigris
cd tigris
pip install -e . --group dev
pytest

Metadata

Release files for tigris-ml 0.15.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tigris-ml 0.15.2
File Size Uploaded Provenance Actions
tigris_ml-0.15.2.tar.gz 2.7 MB With provenance Details for tigris_ml-0.15.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tigris-ml 0.15.2
File Actions
tigris_ml-0.15.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for tigris_ml-0.15.2-py3-none-win_amd64.whl
tigris_ml-0.15.2-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for tigris_ml-0.15.2-py3-none-manylinux_2_28_x86_64.whl
tigris_ml-0.15.2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for tigris_ml-0.15.2-py3-none-manylinux_2_28_aarch64.whl
tigris_ml-0.15.2-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for tigris_ml-0.15.2-py3-none-macosx_11_0_x86_64.whl
tigris_ml-0.15.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for tigris_ml-0.15.2-py3-none-macosx_11_0_arm64.whl
tigris_ml-0.15.2-py3-none-any.whl Python 3 none any Details for tigris_ml-0.15.2-py3-none-any.whl

Total release size: 6.2 MB

Release files / tigris_ml-0.15.2.tar.gz

Download URL tigris_ml-0.15.2.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
4a1d76f928d81b9e510d7f36813bfa85babae660e6de8e536165ab0926bec448
BLAKE2b-256 checksum
How to use checksums
fefce6e9ec7e2c57c383cb4e0f35851bc17d418ca640c1777bffada6d24606db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-win_amd64.whl

Download URL tigris_ml-0.15.2-py3-none-win_amd64.whl
Size 672.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
84bf9eb7caf18bf6f3e1d652e297cef6759016d17cb3494dd8ea74f9c8d03b94
BLAKE2b-256 checksum
How to use checksums
99a182df28eac344ef8dda88cab0d3a2b1ded027c5b5ab924ddd427959d0a109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-manylinux_2_28_x86_64.whl

Download URL tigris_ml-0.15.2-py3-none-manylinux_2_28_x86_64.whl
Size 612.1 kB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
94de09f3b2394cf530c034aa16281f4938423827801a63ffcc452764b0f45707
BLAKE2b-256 checksum
How to use checksums
6a3f86d8efad30037be9d9076b560b6fd0d778233fd602cc7003e9833eed385b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-manylinux_2_28_aarch64.whl

Download URL tigris_ml-0.15.2-py3-none-manylinux_2_28_aarch64.whl
Size 615.1 kB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
424685494d92fb87bc193c6938cc6161d2a16847a664a3e3116c9ec13e914865
BLAKE2b-256 checksum
How to use checksums
202de37a08ff838e7d480721bcdfe6d16c9a52565aac09c27e45b952f7869c31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-macosx_11_0_x86_64.whl

Download URL tigris_ml-0.15.2-py3-none-macosx_11_0_x86_64.whl
Size 624.2 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
539dec4a032e9195d27d6736a06842398cfcd59c942abaeb04147b2021576983
BLAKE2b-256 checksum
How to use checksums
d63f587a2761701439d7044539c3712ff289a3966fc8c68064b2558d56215f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-macosx_11_0_arm64.whl

Download URL tigris_ml-0.15.2-py3-none-macosx_11_0_arm64.whl
Size 603.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
bdd238994894ba79297b750a68d6026ddfdcb98da5e791c28c35e0cd8bb4cbb3
BLAKE2b-256 checksum
How to use checksums
c31d8e40507aa4be0db2fac56b15bdc203711530b041b992f5654f1cdc13299c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / tigris_ml-0.15.2-py3-none-any.whl

Download URL tigris_ml-0.15.2-py3-none-any.whl
Size 402.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3f43090da673f7f90d5f9c616a427a8aaaba4b6b26011c10dd1a2b9460b51e4
BLAKE2b-256 checksum
How to use checksums
7c7b5b512996d36038ac506c9b58dfa9235a534cd094a5822cf08993b553e307
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for tigris-ml 0.15.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for tigris_ml-0.15.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page