* add windowsai.yml for new Microsoft.AI.MachineLearning nuget * temporarily add windowsai.yml to gpu.yml * pass in build arch * remove install onnx task * no dml for arm or arm64 * refactor nuget pipeline defs * update package creation * pass in build and sources path * missing hyphens * copy license file * fix parameter variable * disable arm builds for now * remove commented script block * download pipeline atifcat name update * set working dir * Add bundling nuget script * path combine * null path * combine needs parentheses * binplace microsoft.* dlls in new nuget package * update artifact name * move merged nuget to artifacts directory * move to merged subfolder in artifacts staging dir * forward slash to back * enable arm * vcvarsall needs x64 vars setup * Run Tests * fix tests * move global variables * update yml to not have global variable in template * removed parameters * fixes * Add build arch as an env variable * ne not neq * %Var% for batch script * dont pass argument for x64 * disable arm tests * skip csharp/cxx tests for microsoft nuget package * remove test-win as it tests only c# cxx and capi * test build for store apps * dont build for store * tools/nuget/generate_nuspec_for_native_nuget.py * remove args. * add new props and targets for microsoft.ai * make windowsai props/targets static * add dependency * dont ship dot net props * Remove c# fom windowsai nuget * copy license file * native packages must have win10 as the platform, not win * cuda header in wrong if branch * no dml for arm builds * only build dml for x64/ x86 * User/sheilk/props update (#3616) * prelim store work * props * Fix desktop nuget props/targets * clean up targets and make store apps work Co-authored-by: Sheil Kumar <sheilk@microsoft.com> * update windowsai.yml with latest * remove extra dloadhelpers * Add abi headers to abi dir, and reference native includes * update windowsai.yml * minor update * remove parameters * add doesrp param * hard code esrp to true * add directml for x86/x64 * revert gpu yml changes * add store builds * add store builds * add checks again in old way * dup job names for store and desktop builds * move all of the runtime binaries to win10 folder * only set safeseh on x86 * disable the store builds for now... missing msvcprt.lib * copy paste deletion... * switch back to win- (#3646) Co-authored-by: Sheil Kumar <sheilk@microsoft.com> * use stahlworks * & not supported in ado * add cuda to cpu nuget(???) and EnableDelayedExpansion to enable x86 dml package * revert nocontribops * add underscore... * extra win/win10 change * merged nuget... still not being bundled... * files in merged directory * missing parens causing dml to be included in cpu package * more diagnostic info * switch dir to get-childitem * wait for compression to complete * add winml_adapter to mkml and gpu packages * enable_wcos * add mklml binaries * props and targets missing from mklml Co-authored-by: Sheil Kumar <sheilk@microsoft.com> |
||
|---|---|---|
| .github | ||
| cmake | ||
| csharp | ||
| dockerfiles | ||
| docs | ||
| include/onnxruntime/core | ||
| java | ||
| onnxruntime | ||
| package/rpm | ||
| samples | ||
| server | ||
| tools | ||
| winml | ||
| .clang-format | ||
| .clang-tidy | ||
| .dockerignore | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| build.amd64.1411.bat | ||
| build.bat | ||
| BUILD.md | ||
| build.sh | ||
| cgmanifest.json | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| NuGet.config | ||
| ort.wprp | ||
| packages.config | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements-doc.txt | ||
| requirements.txt | ||
| setup.py | ||
| ThirdPartyNotices.txt | ||
| VERSION_NUMBER | ||

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.
CPU
- Default CPU - MLAS (Microsoft Linear Algebra Subprograms) + Eigen
- Intel DNNL
- Intel nGraph
- Intel MKL-ML
GPU
- NVIDIA CUDA
- NVIDIA TensorRT
- DirectML
IoT/Edge/Mobile
- Intel OpenVINO
- ARM Compute Library (preview)
- Android Neural Networks API (preview)
Other
Extensibility Options
- Add a custom operator/kernel
- Add a new graph transform
- Add a new rewrite rule
- Add an execution provider
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 published for the default CPU Provider (Eigen + MLAS), as well as GPU with CUDA. 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 see BUILD.md. 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 localeis 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-8update-locale LANG=en_US.UTF-8 - Follow similar procedure to configure other locales on other platforms.
- Run the following commands:
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
Please see Samples and Tutorials for examples.
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.