Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

C/C++17 SDK that compiles graph-built or handwritten MIL programs and runs inference on the Apple Neural Engine.

202
16
C++
1 day old
+91 stars in 24h

What it is

ane-native is a C and C++17 SDK for running inference on the Apple Neural Engine (ANE). It targets Mac developers who want to call ANE directly from native code instead of going through Core ML or converting models to Core ML formats.

You can describe the computation in two ways:

  • Graph builder: assemble operations such as matrix multiplication, addition and ReLU in C or C++ and let the SDK generate the MIL (Model Intermediate Language) and pack weights. See the graph examples.
  • Handwritten MIL: supply your own MIL text plus weights when the graph builder does not expose an operation, such as max pooling. See the MIL examples.

Both paths use Apple's compiler and produce the same kind of session: write inputs, evaluate, read outputs. Sessions can be reused with new inputs without recompiling, which is the key performance property for repeated inference.

Quick start

Prerequisites: an Apple silicon Mac, Apple Command Line Tools, and CMake 3.21 or newer. From the repository root:

CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -S . -B build/sdk -DCMAKE_BUILD_TYPE=Release
cmake --build build/sdk
./build/sdk/ane_matmul_cpp

The matmul example reuses one session, writing A once and changing only the right-hand matrix on the second evaluation. Expected output:

A x B = [19 22; 43 50]
A x I = [1 2; 3 4]

To compare both authoring paths for the same vector addition:

./build/sdk/ane_add_c
./build/sdk/ane_add_cpp

Both print A + B = [5, 0, 3, 5]. ./build/sdk/ane_relu_cpp --mil prints the generated MIL for a relu(XW + bias) graph without running it. More operators are indexed in the example list.

Adding it to a project

Pick a release from the Releases page and copy its FetchContent snippet into your CMakeLists.txt after defining your application target, replacing my_app with your target; CMake checks the archive's SHA-256 and builds the SDK with your app. Alternatively, install the built SDK locally:

cmake --install build/sdk --prefix "$PWD/build/sdk-prefix"

Then point CMAKE_PREFIX_PATH at that prefix and link in CMake:

find_package(ane-native 0.1 CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE ane::ane_native)

For a consumer project walkthrough see Getting started; for custom models, tensor layout, linked procedures and error handling see the API guide. A complete trained classifier is demonstrated in the MobileNetV2 benchmarks, which can also be run locally.

Constraints

  • Apple silicon Mac only; the verified configuration is M4, macOS 26.7.1 (25G241) and Apple clang 21.0.0.
  • The runtime uses macOS's private AppleNeuralEngine.framework, so it depends on an undocumented system component and may break across OS updates.
  • No license is declared in the repository, which matters if you plan to redistribute the SDK or ship it in a product.
  • The graph builder covers a limited set of operations; anything else needs handwritten MIL.

HotRepo's take

This is a narrowly scoped systems project rather than a general framework: the value is in exposing ANE sessions to plain C/C++, with a documented build, reusable sessions and a MobileNetV2 benchmark to calibrate expectations. Its dependence on a private framework and a single verified macOS version are the main things to weigh before adopting it. The repository first appeared on HotRepo's new-project list for C++ on 2026-12-02, where it recorded 100 stars and 8 forks, all accumulated within roughly 18 hours of the project's creation. That is a single early snapshot, not evidence of sustained traction.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. Tencent/ncnnA dependency-free C++ inference framework that runs converted neural network models on mobile, embedded, and desktop hardware via CPU and Vulkan GPU.C++24,044
  2. chenglou/handwiredCompiles ordinary JavaScript control flow into differentiable matmul-and-ReLU graphs so programs run GPU-parallel without training.TypeScript1,984
  3. alibaba/MNNA lightweight deep learning inference engine for deploying models and LLMs on phones, PCs, and embedded devices.C++16,419
  4. google-ai-edge/LiteRT-LMRun large language models locally on phones, browsers, desktops and IoT devices, with GPU/NPU acceleration and a C++, Python, Kotlin, Swift or web API.C++6,791
  5. openvinotoolkit/openvinoAn inference toolkit for converting and running trained deep learning models on Intel CPUs, GPUs and NPUs.C++11,062