A compact, high-performance C++ inference engine for neural networks.
- Small, embeddable runtime for executing ONNX-style graphs
- Memory-efficient allocators (arena/bump allocator) and flexible
Allocatorinterface - Support for quantized INT8 and floating-point workloads
- Minimal dependencies; built with CMake and GoogleTest for unit tests
- Linux, macOS, or Windows
- CMake 3.18+ (older versions may work)
- A C++17-capable compiler (GCC, Clang, MSVC)
- Optional: ONNX model support requires an ONNX parser at build time
From the repository root:
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -- -j$(nproc)This produces binaries in build/bin/ such as infer_example and onnx_inference.
- Simple inference example (uses a built-in or sample model):
./build/bin/infer_example- Run ONNX model (
onnx_inferenceto be built and ONNX support to be enabled):
./build/bin/onnx_inference path/to/model.onnxFrom the build directory you can run the unit tests (GoogleTest):
ctest --output-on-failure -j4
# or
./build/bin/test_tensorGitHub Actions workflows are configured for continuous integration and release artifacts:
-
CI workflow:
.github/workflows/ci.yml- Runs on pushes to
mainand pull requests. - Executes a matrix of Ubuntu jobs:
- Baseline build/test with safe flags:
ENABLE_SIMD=OFF,ENABLE_MT=OFF(Release) - SIMD validation:
ENABLE_SIMD=ON,ENABLE_MT=OFF(Release) - OpenMP validation:
ENABLE_SIMD=OFF,ENABLE_MT=ON(Release) - Debug sanity build/test:
ENABLE_SIMD=OFF,ENABLE_MT=OFF(Debug)
- Baseline build/test with safe flags:
- Uploads
ctestlogs as workflow artifacts for each matrix entry.
- Runs on pushes to
-
Release workflow:
.github/workflows/release.yml- Triggers on tags matching
v*(for examplev0.1.0). - Verifies tag builds by running unit tests before publishing artifacts.
- Builds and publishes binary assets for:
infer_exampleonnx_inferencebenchmarkonnx_inspect
- Publishes a versioned Linux tarball and
sha256checksums.
- Triggers on tags matching
Badges:
include/— Public headers (core, graph, memory)src/— Implementation filesexamples/— Small example programs (simple_inference.cpp,onnx_inference.cpp)tests/— Unit teststools/— Developer tools (e.g.,onnx_inspect)
- Fork the repository and create a feature branch.
- Run tests and ensure new code has unit tests.
- Open a PR with a clear description and changelog entry.
This project is provided under the MIT license. See the LICENSE file for details.