Skip to content

Latest commit

 

History

174 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anira-backends

Prebuilt inference-engine binaries for anira. Each backend is built from source (or repackaged from an upstream prebuilt) and published as GitHub release archives that anira's CMake downloads at configure time.

Backends

Backend C API Upstream lib name License
TFLite TfLite* tensorflow/lite tensorflowlite_c Apache-2.0
LiteRT LiteRt* google-ai-edge/LiteRT LiteRt Apache-2.0
ONNXRuntime — microsoft/onnxruntime onnxruntime MIT
LibTorch — pytorch/pytorch torch BSD-3
ExecuTorch — pytorch/executorch executorch BSD-3

TFLite and LiteRT are two C APIs for the same runtime (LiteRT is the rebranded TensorFlow Lite): TfLite* is the mature legacy API; LiteRt* is LiteRT's newer native API. Pick one.

LibTorch and ExecuTorch are two PyTorch C++ runtimes: LibTorch is the full desktop runtime; ExecuTorch is the on-device runtime that runs ahead-of-time-exported .pte models. We ship a generic ExecuTorch (full CPU op set + XNNPACK, not a per-model selective build), so one package loads any .pte. Both are consumed via find_package (Torch / executorch).

This repo is licensed Apache-2.0; the published binaries follow their upstream licenses (above).

Support matrix

What ships per target — shared and/or static:

Target TFLite LiteRT ONNXRuntime LibTorch ExecuTorch
macOS x86_64 shared · static shared · static shared · static shared static
macOS arm64 shared · static shared · static shared · static shared static
macOS universal shared · static shared · static shared · static shared static
Linux x86_64 shared · static shared · static shared · static shared static
Linux aarch64 shared · static shared · static shared · static shared static
Windows x86_64 shared · static ¹ shared · static ¹ shared · static ¹ shared static
Windows arm64 shared · static ¹ shared · static ¹ shared · static ¹ shared static
Android (arm64-v8a + x86_64) shared · static shared · static shared · static — —
iOS (xcframework) static static static — —
WASM (Emscripten) — — static ² — —

macOS shared dylibs are Developer ID code-signed (Hardened Runtime, timestamped); the consuming app re-signs/notarizes on embed.

¹ Windows static also ships a Debug variant.

² Emscripten static archive — build flags and consumer requirements in engines/onnxruntime.

ExecuTorch is static-only, built from source on every leg (no upstream prebuilt desktop runtime), CPU-only by default (XNNPACK + optimized kernels everywhere). GPU delegates live in the separate -gpu variants (below).

— = not provided.

Per-backend build details (e.g. LiteRT's LiteRt* vs TfLite* API split, Windows-arm64 from-source toolchain, Android static) live in each engine's README under engines/<backend>/.

GPU variants

GPU acceleration ships as separate -gpu / -cuda variant archives — the default packages above stay CPU-only (and their smoke asserts the accelerator is absent). -gpu bundles the cross-vendor WebGPU path plus the platform-native one where the engine has it; -cuda is NVIDIA-only (CUDA 13 + cuDNN 9, user-provided). Full detail, smoke policy and consumer notes in docs/gpu-support.md.

Target ONNXRuntime -gpu LibTorch ExecuTorch -gpu LiteRT -gpu TFLite -gpu
macOS x86_64/arm64 CoreML + WebGPU (Metal) · shared/static ³ MPS (arm64) · shared CoreML + MPS (+ MLX arm64 ⁴) Metal (arm64) · shared Metal delegate · shared/static
Windows x86_64 DirectML + WebGPU (D3D12) · shared -cuda · shared — WebGPU (D3D12) · shared —
Windows arm64 DirectML + WebGPU (D3D12) · shared — — — —
Linux x86_64 WebGPU (Vulkan) · shared/static -cuda · shared Vulkan delegate WebGPU (Vulkan) · shared —
Linux aarch64 WebGPU (Vulkan) · shared/static — — WebGPU (Vulkan) · shared —
Android (bundle) WebGPU (Vulkan) · shared — Vulkan delegate OpenCL/GL + WebGPU · shared OpenCL delegate · shared/static
iOS (xcframework) CoreML — CoreML + MPS Metal accelerator ⁵ Metal + CoreML delegates

ONNXRuntime and LibTorch also ship -cuda (Linux/Windows x86_64, shared): the upstream CUDA prebuilt repackaged. The ORT -gpu archives carry their own Dawn (external-Dawn build; the consumer passes the proc table — what anira v3 does), so each archive is one ORT + Dawn pair.

³ ORT -gpu on macOS requires macOS 13.3+ (the WebGPU EP's floor); CPU packages stay at 11.0.

⁴ The ExecuTorch macOS arm64 -gpu package requires macOS 14+ (MLX); every other package 12.0.

⁵ LiteRT iOS -gpu is dynamic (upstream's prebuilt libLiteRt.dylib + the Metal accelerator plugin, two xcframeworks); the CPU iOS package stays static.

Releases

Backends are versioned and released independently, one tag per backend:

<engine>-v<upstream version>[-<n>]      e.g. onnxruntime-v1.30.0-2, libtorch-v2.12.0, litert-v2.2.0-2

A tag builds that one engine at its pinned engines/<engine>/VERSION (CI refuses a tag whose version differs from the file) and publishes every archive of that engine to the GitHub release named after the tag. -<n> (onnxruntime-v1.30.0-2) re-cuts the same upstream version after a packaging change. Nothing else is rebuilt, so a re-cut of one backend never touches the others. anira pins a tag per engine in its cmake/backends.cmake.

Convergence rounds: run a workflow manually (workflow_dispatch) with preset_filter, a regex over preset names (onnx-linux-x86_64-shared, macos-.*-gpu, …), to build only the matching legs; aggregation jobs (macOS universal, Android bundle) are skipped under a filter, and the iOS job runs only if the regex also matches ios.

Releases up to v2.4.0 predate this scheme and hold every backend under one anira-version tag.

Sponsor

Funded by the German Federal Ministry of Research, Technology and Space (BMFTR)

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages