robertknight/rten

ONNX neural network inference engine

What it solves

RTen is a machine learning runtime designed to let developers run models trained in Python (using frameworks like PyTorch) directly within Rust applications. It removes the need for a Python environment at runtime, providing a small, efficient, and end-to-end Rust implementation for model inference.

How it works

RTen loads models in the standard ONNX format or a custom .rten format for faster loading and support for very large models. It performs CPU-based inference, utilizing SIMD (AVX2, AVX-512, Arm Neon, and WebAssembly SIMD) and multi-threading to optimize performance. It also provides supporting libraries to handle the pre-processing and post-processing of data before and after it passes through the model.

Who it’s for

It is built for developers who want to deploy ML models in Rust environments or target WebAssembly (Wasm) for use in JavaScript applications, particularly those seeking a lightweight runtime without heavy external dependencies.

Highlights

  • End-to-end Rust: The entire project and its dependencies are written in Rust, simplifying build and deployment.
  • ONNX Support: Compatible with most standard ONNX operators and supports both float32 and quantized (int8/uint8) weights.
  • Cross-Platform: Runs on various platforms, including WebAssembly with SIMD support for browser-based inference.
  • Integrated Toolkit: Includes libraries for common pre- and post-processing tasks across different domains.

Related

  • Project
  • Project
  • Project
  • Project
  • Project