ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Find a file
Andrews548 475ea382f9
Fix ACL EP convolution-activation fusion optimization (#3896)
Co-authored-by: Andrei-Alexandru <andrei-alexandru.avram@nxp.com>
2020-05-12 14:06:48 -07:00
.github Minor update to the issue template. Add a line to attach model where applicable. (#3339) 2020-03-26 14:28:27 -07:00
cmake Merge DML Execution Provider updates (#3885) 2020-05-11 17:57:01 -07:00
csharp Fix C# log APIs. Also fixes github issue #3409. (#3840) 2020-05-08 14:31:06 -07:00
dockerfiles [OpenVINO-EP] Optimize MCR Docker image size (#3732) 2020-04-29 00:08:15 +08:00
docs bump up ORT version and extend time limit for windows cpu packaging pipelines (#3852) 2020-05-07 14:22:20 -07:00
include/onnxruntime/core Fold Shape Node During Constant Folding (#3748) 2020-05-09 20:15:03 +08:00
java [Java] Adding missing methods on Session, SessionOptions and RunOptions (v2) (#3832) 2020-05-06 01:19:46 -07:00
nodejs [Node.js API] optimize prebuild (#3844) 2020-05-06 15:48:13 -07:00
onnxruntime Fix ACL EP convolution-activation fusion optimization (#3896) 2020-05-12 14:06:48 -07:00
orttraining Ensure pt model is set to cpu in ort_trainer (#3867) 2020-05-12 13:32:27 -07:00
package/rpm bump up ORT version and extend time limit for windows cpu packaging pipelines (#3852) 2020-05-07 14:22:20 -07:00
samples Introduce training changes. 2020-03-11 14:39:03 -07:00
server OpenVINO EP v2.0 (#3585) 2020-04-24 04:06:02 -07:00
tools Add a few more things to the helper python scripts. (#3842) 2020-05-12 09:59:40 +10:00
winml add test to api tests to ensure correct hresult is returned for corrupt model file (#3796) 2020-05-11 13:22:22 -07:00
.clang-format Initial bootstrap commit. 2018-11-19 16:48:22 -08:00
.clang-tidy Add remaining build options and make minor changes in documentation (#39) 2018-11-27 19:59:40 -08:00
.dockerignore Allow building Docker container based on a different git repo. (#1222) 2019-06-20 09:55:42 -07:00
.gitattributes Initial bootstrap commit. 2018-11-19 16:48:22 -08:00
.gitignore dashboard integration - output training perf metrics as json (#3809) 2020-05-10 10:29:38 -07:00
.gitmodules Merge remote-tracking branch 'origin/master' into edgchen1/merge_from_master 2020-04-23 20:50:33 +00:00
build.amd64.1411.bat Initial bootstrap commit. 2018-11-19 16:48:22 -08:00
build.bat Initial bootstrap commit. 2018-11-19 16:48:22 -08:00
BUILD.md Initial PR for RKNPU execution provider (#3609) 2020-05-05 20:36:47 -07:00
build.sh update 2019-01-09 15:49:27 -08:00
cgmanifest.json Update ONNX submodule to ONNX 1.7 release branch. (#3888) 2020-05-10 15:44:44 -07:00
CODEOWNERS Fix codeowners file 2018-11-27 23:42:17 -08:00
CONTRIBUTING.md Add guidelines for writing a good PR. (#3830) 2020-05-05 16:28:21 -07:00
LICENSE Initial bootstrap commit. 2018-11-19 16:48:22 -08:00
NuGet.config Add DirectML Execution Provider (#2057) 2019-10-15 06:13:07 -07:00
ort.wprp Add Tracelogging for profiling (#1639) 2019-11-11 21:34:10 -08:00
packages.config Merge DML Execution Provider updates (#3885) 2020-05-11 17:57:01 -07:00
README.md Add FAQ page (#3324) 2020-05-06 15:43:32 -07:00
requirements-dev.txt Removing unused six package 2020-04-13 18:59:44 -07:00
requirements-doc.txt Update readme.rst for pypi, change documentation style (#1663) 2019-10-19 18:26:34 -07:00
requirements.txt Downgrade numpy requirement to 1.16.6 (#3635) 2020-04-22 16:11:33 -07:00
setup.py Added aarch64 build pipeline (#3841) 2020-05-11 22:56:16 +05:30
ThirdPartyNotices.txt Some documentation updates. (#3060) 2020-02-21 20:07:39 +10:00
VERSION_NUMBER bump up ORT version and extend time limit for windows cpu packaging pipelines (#3852) 2020-05-07 14:22:20 -07:00

Build Status Build Status Build Status Build Status Build Status

ONNX Runtime is a performance-focused inference engine for ONNX (Open Neural Network Exchange) models.

Models in the Tensorflow, Keras, PyTorch, scikit-learn, CoreML, and other popular supported formats can be converted to the standard ONNX format, providing framework interoperability and helping to maximize the reach of hardware optimization investments. This provides a solution for systems to integrate a single inference engine to support models trained from a variety of frameworks, while taking advantage of specific hardware accelerators where available.

ONNX Runtime was designed with a focus on performance and scalability in order to support heavy workloads in high-scale production scenarios. It also has extensibility options for compatibility with emerging hardware developments.

ONNX Runtime stays up to date with the ONNX standard and supports all operators from the ONNX v1.2+ spec and is backwards compatible with older versions. Please refer to this page for ONNX opset compatibility details.


Table of Contents


Functional Overview

Key Features

  • Cross Platform: The runtime provides a cross platform API compatible with Windows, Linux, and Mac and a variety of architectures. Both CPU and GPUs are supported, and language bindings are available for a variety of languages and architectures See more details (below). If you have specific scenarios that are not supported, please share your suggestions and scenario details via Github Issues.
  • Run any ONNX model: ONNX Runtime provides comprehensive support of the ONNX spec and can be used to run all models based on ONNX v1.2.1 and higher. Both ONNX (DNN) and ONNX-ML (traditional ML) operator sets are supported. The full set of operators and types supported is listed here. Some operators not supported in the current ONNX version may be available as a Contrib Operator.
  • Backwards Compatible: Newer versions of ONNX Runtime support all models that worked with prior versions, so updates should not break integrations. See version compatibility details here.

Performance Focused Design

High level architectural design

Using various graph optimizations and accelerators, ONNX Runtime can provide lower latency compared to other runtimes for faster end-to-end customer experiences and minimized machine utilization costs. See Performance Tuning guidance.

Supported Accelerators

The list of currently supported accelerators (termed Execution Providers) is below. Please see BUILD.md for build instructions. If you are interested in contributing a new execution provider, please see this page.

Please refer to Roadmap for a list of upcoming accelerators.

CPU

GPU

IoT/Edge/Mobile

Other

Extensibility Options


Installation

Quick Start: The ONNX-Ecosystem Docker container image is available on Dockerhub and includes ONNX Runtime (CPU, Python), dependencies, tools to convert from various frameworks, and Jupyter notebooks to help get started. Additional dockerfiles can be found here.

API Documentation

Language Supported Versions Samples
Python 3.5, 3.6, 3.7
Python Dev Notes
Samples
C# Samples
C++ Samples
C Samples
WinRT Windows.AI.MachineLearning Samples
Java 8-13 Samples
Ruby (external project) 2.4-2.7 Samples

Builds and Packages

Official builds are available for:

  • Default CPU Provider (Eigen + MLAS)
  • GPU Provider - NVIDIA CUDA
    • note: If your deployment target is Windows, the DirectML execution provider is recommended for optimal performance and compatibility with a broad set of GPUs. This will be an official package soon. In the meantime, see the build instructions at BUILD.md.

Python packages can be found on PyPi, and C#/C/C++ packages on Nuget. Please view the table on aka.ms/onnxruntime for instructions for different build combinations.

For additional build flavors and/or dockerfiles, please carefully read through BUILD.md. If you encounter problems, please provide as much information as possible when filing an issue.

For production scenarios, it's strongly recommended to build only from an official release branch.

PyPi (Python):

If using pip to download the Python binaries, run pip install --upgrade pip prior to downloading.

Nuget (C#/C/C++):

Other package repositories:

Contributed non-official packages (including Homebrew, Linuxbrew, and nixpkgs) are listed here. These are not maintained by the core ONNX Runtime team and will have limited support; use at your discretion.

System Requirements

These system requirements must be met for using the compiled binaries.

System language

  • Installation of the English language package and configuring en_US.UTF-8 locale is required, as certain operators makes use of system locales.
  • For Ubuntu, install language-pack-en package
    • Run the following commands: locale-gen en_US.UTF-8 update-locale LANG=en_US.UTF-8
    • Follow similar procedure to configure other locales on other platforms.

Default CPU

  • ONNX Runtime binaries in the CPU packages use OpenMP and depend on the library being available at runtime in the system.
    • For Windows, OpenMP support comes as part of VC runtime. It is also available as redist packages: vc_redist.x64.exe and vc_redist.x86.exe
    • For Linux, the system must have libgomp.so.1 which can be installed using apt-get install libgomp1.

Default GPU (CUDA)

  • The default GPU build requires CUDA runtime libraries being installed on the system:
    • Version: CUDA 10.1 and cuDNN 7.6.5
  • Version dependencies from older ONNX Runtime releases can be found in prior release notes.

Other Execution Providers

  • For requirements and dependencies of other build options, see detailed build instructions on the BUILD.md page.

Usage

Samples and Tutorials

Frequently Asked Questions

Getting ONNX Models

To get an ONNX model, please view these ONNX Tutorials. ONNX Runtime supports all versions of ONNX 1.2+. Full versioning compatibility information can be found under Versioning.

Deploying ONNX Runtime

Cloud

ONNX Runtime can be deployed to the cloud for model inferencing using Azure Machine Learning Services. See detailed instructions and sample notebooks.

ONNX Runtime Server (beta) is a hosted application for serving ONNX models using ONNX Runtime, providing a REST API for prediction. Usage details can be found here, and image installation instructions are here.

IoT and edge devices

The expanding focus and selection of IoT devices with sensors and consistent signal streams introduces new opportunities to move AI workloads to the edge.

This is particularly important when there are massive volumes of incoming data/signals that may not be efficient or useful to push to the cloud due to storage or latency considerations. Consider: surveillance tapes where 99% of footage is uneventful, or real-time person detection scenarios where immediate action is required. In these scenarios, directly executing model inferencing on the target device is crucial for optimal assistance.

To deploy AI workloads to these edge devices and take advantage of hardware acceleration capabilities on the target device, see these reference implementations.

Client applications

Install or build the package you need to use in your application. Check this page for installation/package guidance. See sample implementations using the C++ API.

On newer Windows 10 devices (1809+), ONNX Runtime is available by default as part of the OS and is accessible via the Windows Machine Learning APIs. Find tutorials here for building a Windows Desktop or UWP application using WinML.

Data/Telemetry

This project may collect usage data and send it to Microsoft to help improve our products and services. See the privacy statement for more details.


Contribute

We welcome contributions! Please see the contribution guidelines.

Feedback

For any feedback or to report a bug, please file a GitHub Issue.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.


License

MIT License