Releases: microsoft/onnxruntime
ONNX Runtime v1.16.2
The patch release includes updates on:
- Performance optimizations for Llama2 on CUDA EP and DirectML EP
- Performance optimizations for Stable Diffusion XL model for CUDA EP
- Demos for text to image generation
- Mobile bug fixes for crash on some older 64-bit ARM devices and AOT inlining issue on iOS with C# bindings
- TensorRT EP bug fixes for user provided compute stream and stream synchronization
ONNX Runtime v1.16.1
Patch release for 1.16
- Fix type of weights and activations in the ONNX quantizer
- Fix quantization bug in historic quantizer #17619
- Enable session option access in nodejs API
- Update nodejs to v18
- Align ONNX Runtime extensions inclusion in source and build
- Limit per thread context to 1 in the TensorRT EP to avoid error caused by input shape changes
ONNX Runtime v1.16.0
General
- Support for serialization of models >=2GB
APIs
- New session option to disable default CPU EP fallback
session.disable_cpu_ep_fallback
- Java
- Support for fp16 and bf16 tensors as inputs and outputs, along with utilities to convert between these and fp32 data. On JDK 20 and newer the fp16 conversion methods use the JDK's Float.float16ToFloat and Float.floatToFloat16 methods which can be hardware accelerated and vectorized on some platforms.
- Support for external initializers so that large models that can be instantiated without filesystem access
- C#
- Expose OrtValue API as the new preferred API to run inference in C#. This reduces garbage and exposes direct native memory access via Slice like interfaces.
- Make Float16 and BFloat16 full featured fp16 interfaces that support conversion and expose floating properties (e.g. IsNaN, IsInfinity, etc)
- C++
- Make Float16_t and BFloat16_t full featured fp16 interfaces that support conversion and expose floating properties (e.g. IsNaN, IsInfinity, etc)
Performance
- Improve LLM quantization accuracy with smoothquant
- Support 4-bit quantization on CPU
- Optimize BeamScore to improve BeamSearch performance
- Add FlashAttention v2 support for Attention, MultiHeadAttention and PackedMultiHeadAttention ops
Execution Providers
- CUDA EP
- Initial fp8 support (QDQ, Cast, MatMul)
- Relax CUDA Graph constraints to allow more models to utilize
- Allow CUDA allocator to be registered with ONNX Runtime externally
- Fixed a build issue with CUDA 12.2 (#16713)
- TensorRT EP
- CUDA Graph support
- Support user provided cuda compute stream
- Misc bug fixes and improvements
- OpenVINO EP
- Support OpenVINO 2023.1
- QNN EP
- Enable context binary cache to reduce initialization time
- Support QNN 2.12
- Support for resize with asymmetric transformation mode on HTP backend
- Ops support: Equal, Less, LessOrEqual, Greater, GreaterOrEqual, LayerNorm, Asin, Sign, DepthToSpace, SpaceToDepth
- Support 1D Conv/ConvTranspose
- Misc bug fixes and improvements
Mobile
- Initial support for Azure EP
- Dynamic shape support for CoreML
- Improve React Native performance with JSI
- Mobile support for CLIPImageProcessor pre-processing and CLIP scenario
- Swift Package Manager support for ONNX Runtime inference and ONNX Runtime extensions via onnxruntime-swift-package-manager
Web
- webgpu ops coverage improvements (SAM, T5, Whisper)
- webnn ops coverage improvements (SAM, Stable Diffusion)
- Stability/usability improvements for webgpu
Large model training
- ORTModule + OpenAI Triton Integration now available. See details here
- Label Sparsity compute optimization support complete and enabled by default starting release 1.16
- New experimental embedding sparsity related optimizations available (disabled by default).
- Improves training performance of Roberta in Transformers by 20-30%
- Other compute optimizations like Gather/Slice/Reshape upstream support enabled.
- Optimizations for LLaMAv2 (~10% acceleration) and OpenAI Whisper
- Improvements to logging and metrics (initialization overhead, memory usage, statistics convergence tool, etc) system improvements.
- PythonOp enhancement: bool and tuple[bool] constants, materialize grads, empty inputs, save in context, customized shape inference, use full qualified name for export.
- SCELossInternal/SCELossGradInternal CUDA kernels can handle elements more than std::numeric_limits<int32_t>::max.
- Improvements to LayerNorm fusion
- Model cache for exported onnx model is introduced to avoid repeatedly exporting a model that is not changed across.
On-Device Training
- iOS support available starting this release
- Minimal build now available for On-Device Training. Basic binary size ~1.5 MB
- ORT-Extensions custom op support enabled through onnxblock for on-device training scenarios
ORT Extensions
This ORT release is accompanied by updates to onnxruntime-extensions. Features include:
- New Python API gen_processing_models to export ONNX data processing model from Huggingface Tokenizers such as LLaMA , CLIP, XLM-Roberta, Falcon, BERT, etc.
- New TrieTokenizer operator for RWKV-like LLM models, and other tokenizer operator enhancements.
- New operators for Azure EP compatibility: AzureAudioToText, AzureTextToText, AzureTritonInvoker for Python and NuGet packages.
- Processing operators have been migrated to the new Lite Custom Op API
Known Issues
- ORT CPU Python package requires execution provider to be explicitly provided. See #17631. Fix is in progress to be patched.
Contributions
Contributors to ONNX Runtime include members across teams at Microsoft, along with our community members:
fs-eire, edgchen1, snnn, pengwa, mszhanyi, PeixuanZuo, tianleiwu, adrianlizarraga, baijumeswani, cloudhan, satyajandhyala, yuslepukhin, RandyShuai, RandySheriffH, skottmckay, Honry, dependabot[bot], HectorSVC, jchen351, chilo-ms, YUNQIUGUO, justinchuby, PatriceVignola, guschmue, yf711, Craigacp, smk2007, RyanUnderhill, jslhcl, wschin, kunal-vaishnavi, mindest, xadupre, fdwr, hariharans29, AdamLouly, wejoncy, chenfucn, pranavsharma, yufenglee, zhijxu-MS, jeffdaily, natke, jeffbloo, liqunfu, wangyems, er3x3, nums11, yihonglyu, sumitsays, zhanghuanrong, askhade, wenbingl, jingyanwangms, ashari4, gramalingam, georgen117, sfatimar, BowenBao, hanbitmyths, stevenlix, jywu-msft
ONNX Runtime v1.15.1
This release fixed the following issues:
- A coding problem in test/shared_lib/test_inference.cc that it should use ASSERT_NEAR to test float values instead of ASSERT_EQ. Without this change, some DNNL/OpenVino tests would fail on some AMD CPUs.
- A misaligned error in cublasGemmBatchedHelper function. The error only occurs when CUDA version = 11.8 and the GPU's CUDA Compute capability >=80. (In other words: with TensorFloat-32 support) (#15981)
- A build issue that build with onnxruntime_ENABLE_MEMORY_PROFILE was broken in 1.15.0 release. (#16124)
- Native onnxruntime library not loading in Azure App Service. It is because in 1.15.0 we introduced a Windows API call to SetThreadDescription. Though the API is available in all Windows 10 versions, some sandbox environments block using the API. (#15375)
- An alignment problem for xnnpack EP on Intel/AMD CPUs on PC platforms.
- Some training header files were missing in the 1.15.0 training nuget package.
- Some fields in OrtCUDAProviderOptionsV2 struct are not initialized
- The *.dylib files in ONNX Runtime nuget package are not signed. (#16168)
Known issue
ONNX Runtime v1.15.0
Announcements
Starting from the next release(ONNX Runtime 1.16.0), at operating system level we will drop the support for
- iOS 11 and below. iOS 12 will be the minimum supported version.
- CentOS 7, Ubuntu 18.04, and any Linux distro without glibc version >=2.28.
At compiler level we will drop the support for
- GCC version <= 9
- Visual Studio 2019
Also, we will remove the onnxruntime_DISABLE_ABSEIL build option since we will upgrade protobuf and the new protobuf version will need abseil.
General
- Added support for ONNX Optional type in C# API
- Added collectives to support multi-GPU inferencing
- Updated macOS build machines to macOS-12, which comes with Xcode 14.2 and we should stop using Xcode 12.4
- Added Python 3.11 support (deprecate 3.7, support 3.8-3.11) in packages for Onnxruntime CPU, Onnxruntime-GPU, Onnxruntime-directml, and onnxruntime-training.
- Updated to CUDA 11.8. ONNX Runtime source code is still compatible with CUDA 11.4 and 12.x.
- Dropped the support for Windows 8.1 and below
- Eager mode code and onnxruntime_ENABLE_EAGER_MODE cmake option are deleted.
- Upgraded Mimalloc version from 2.0.3 to 2.1.1
- Upgraded protobuf version from 3.18.3 to 21.12
- New dependency: cutlass, which is only used in CUDA/TensorRT packages.
- Upgraded DNNL from 2.7.1 to 3.0
Build System
- On POSIX systems by default we disallow using "root" user to build the code. If needed, you can append "--allow_running_as_root" to your build command to bypass the check.
- Add the support for building the source natively on Windows ARM64 with Visual Studio 2022.
- Added a Gradle wrapper and updated Gradle version from 6.8.3 to 8.0.1. (Gradle is the tool for building ORT Java package)
- When doing cross-compiling, the build scripts will try to download a prebuit protoc from Github instead of building the binary from source. Because now protobuf has many dependencies. It is not easy to setup a build environment for protobuf.
Performance
- Improved string marshalling and reduce GC pressure
- Added a build option to allow using a lock-free queue in threadpool for improved CPU utilization
- Fix CPU memory leak due to external weights
- Added fused decoder multi-head attention kernel to improve GPT and decoder models(like T5, Whisper)
- Added packing mode to improve encoder models with inputs of large padding ratio
- Improved generation algorithm (BeamSearch, TopSampling, GreedySearch)
- Improved performance for StableDiffusion, ViT, GPT, whisper models
Execution Providers
Two new execution providers: JS EP and QNN EP.
TensorRT EP
- Official support for TensorRT 8.6
- Explicit shape profile overrides
- Support for TensorRT plugins via ORT custom op
- Improve support for TensorRT options (heuristics, sparsity, optimization level, auxiliary stream, tactic source selection etc.)
- Support for TensorRT timing cache
- Improvements to our test coverage, specifically for opset16-17 models and package pipeline unit test coverage.
- Other misc bugfixes and improvements.
OpenVINO EP
- Support for OpenVINO 2023.0
- Dynamic shapes support for iGPU
- Changes to OpenVINO backend to improve first inference latency
- Deprecation of HDDL-VADM and Myriad VPU support
- Misc bug fixes.
QNN EP
DirectML EP:
- Updated to DirectML 1.12
- Opset 16-17 support
AzureEP
- Added support for OpenAI whisper model
- Available in a Nuget pkg in addition to Python
Mobile
New packages
- Swift Package Manager for onnxruntime
- Nuget package for onnxruntime-extensions (supports Android/iOS for MAUI/Xamarin)
- React Native package for onnxruntime can optionally include onnxruntime-extensions
Pre/Post processing
-
Added support for built-in pre and post processing for NLP scenarios: classification, question-answering, text-prediction
-
Added support for built-in pre and post processing for Speech Recognition (Whisper)
-
Added support for built-in post processing for Object Detection (YOLO). Non-max suppression, draw bounding boxes
-
Additional CoreML and NNAPI kernels to support customer scenarios
- NNAPI: BatchNormalization, LRN
- CoreML: Div, Flatten, LeakyRelu, LRN, Mul, Pad, Pow, Sub
Web
- [preview] WebGPU support
- Support building the source code with "MinGW make" on Windows.
ORT Training
On-device training:
- Official package for On-Device Training now available. On-device training extends ORT Inference solutions to enable training on edge devices.
- APIs and Language bindings supported for C, C++, Python, C#, Java.
- Packages available for Desktop and Android.
- For custom builds refer build instructions.
Others
- Added graph optimizations which leverage the sparsity in the label data to improve performance. With these optimizations we see performance gains ranging from 4% to 15% for popular HF models over baseline ORT.
- Vision transformer models like ViT, BEIT and SwinV2 see upto 44% speedup with ORT Training+ DeepSpeed over PyTorch eager mode on AzureML.
- Added optimizations for SOTA models like Dolly and Whisper. ORT Training + DS now gives ~17% speedup for Whisper and ~4% speedup for Dolly over PyTorch eager mode. Dolly optimizations on main branch show a ~40% over eager mode.
Known Issues
- The onnxruntime-training 1.15.0 packages published to pypi.org were actually built in Debug mode instead of Release mode. You can get the right one from https://download.onnxruntime.ai/ . We will fix the issue in the next patch release.
- XNNPack EP does not work on x86 CPUs without AVX-512 instructions, because we used wrong alignment when allocating buffers for XNNPack to use.
- The CUDA EP source code has a build error when CUDA version <11.6. See #16000.
- The onnxruntime-training builds are missing the training header files.
Contributions
Contributors to ONNX Runtime include members across teams at Microsoft, along with our community members:
snnn, fs-eire, edgchen1, wejoncy, mszhanyi, PeixuanZuo, pengwa, jchen351, cloudhan, tianleiwu, PatriceVignola, wangyems, adrianlizarraga, chenfucn, HectorSVC, baijumeswani, justinchuby, skottmckay, yuslepukhin, RandyShuai, RandySheriffH, natke, YUNQIUGUO, smk2007, jslhcl, chilo-ms, yufenglee, RyanUnderhill, hariharans29, zhanghuanrong, askhade, wschin, jywu-msft, mindest, zhijxu-MS, dependabot[bot], xadupre, liqunfu, nums11, gramalingam, Craigacp, fdwr, shalvamist, jstoecker, yihonglyu, sumitsays, stevenlix, iK1D, pranavsharma, georgen117, sfatimar, MaajidKhan, satyajandhyala, faxu, jcwchen, hanbitmyths, jeffbloo, souptc, ytaous kunal-vaishnavi
ONNX Runtime v1.14.1
This patch addresses packaging issues and bug fixes on top of v1.14.0:
- Mac OS Python build for x86 arch (issue: #14663)
- DirectML EP fixes: sequence ops (#14442), package naming to remove -dev suffix
- CUDA12 build compatibility (#14659)
- Performance regression fixes: IOBinding input (#14719), Transformer models (#14732, #14517, #14699)
- ORT Training kernel fix (#14727)
Only select packages were published for this patch release; others can be found in the attachments below:
ONNX Runtime v1.14.0
Announcements
- Building ORT from source will require cmake version >=3.24 instead of >=3.18.
General
- ONNX 1.13 support (opset 18)
- Threading
- New custom operator APIs
- Multi-stream Execution Provider refactoring
- Improves GPU utilization by putting parallel inference requests on different GPU streams. Updated for CUDA, TensorRT, and ROCM execution providers
- Improves memory efficiency by enabling GPU memory reuse across different streams
- Enables Execution Provider developer to customize its stream implementation by providing "Stream" interface in ExecutionProvider API
- [Preview] Rust API for ORT - not part of release branch but available to build in main.
Performance
- Support of quantization with AMX on Sapphire Rapids processors
- CUDA EP performance improvements:
- Improve performance of transformer models and decoding methods: beam search, greedy search, and topp sampling.
- Stable Diffusion model optimizations
- Change cudnn_conv_use_max_workspace default value to be 1
- Performance improvements to GRU and Slice operators
Execution Providers
- TensorRT EP
- Adds support for TensorRT 8.5 GA versions
- Bug fixes
- OpenVINO EP
- Adds support for OpenVINO 2022.3
- DirectML EP:
- Updated to DML 1.10.1
- Additional operators: NonZero, Shape, Size, Attention, EmbedLayerNorm, SkipLayerNorm, BiasGelu
- Additional data types: Abs, Sign, Where
- Enable SetOptimizedFilePath export/reload
- Bug fixes/extensions: allow squeeze-13 axes, EinSum with MatMul NHCW
- ROCm EP: 5.4 support and GA ready
- [Preview] Azure EP - supports AzureML hosted models using Triton for hybrid inferencing on-device and on-cloud
Mobile
- Pre/Post processing
- Support updating mobilenet and super resolution models to move the pre and post processing into the model, including usage of custom ops for conversion to/from jpg/png
- onnxruntime-extensions python package includes the model update script to add pre/post processing to the model
- See example model update usage
- [Coming soon] onnxruntime-extensions packages for Android and iOS with DecodeImage and EncodeImage custom ops
- Updated the onnxruntime inference examples to demonstrate end-to-end usage with onnxruntime-extensions package
- Support updating mobilenet and super resolution models to move the pre and post processing into the model, including usage of custom ops for conversion to/from jpg/png
- XNNPACK
- Added support for additional commonly used operators
- Add iOS build support
- XNNPACK EP is now included in the onnxruntime-c iOS package
- Added support for using the ORT allocator in XNNPACK kernels to minimize memory usage
Web
- onnxruntime-extensions included in default ort-web build (NLP centric)
- XNNPACK Gemm
- Improved exception handling
- New utility functions (experimental) to help with exchanging data between images and tensors.
Training
- Performance optimizations and bug fixes for Hugging Face models (i.e. Xlnet and Bloom)
- Stable diffusion optimizations for training, including support for Resize and InstanceNorm gradients and addition of ORT-enabled examples to the diffusers library
- FP16 optimizer exposed in torch-ort (details)
- Bug fixes for Hugging Face models
Known Issues
- The Microsoft.ML.OnnxRuntime.DirectML package name includes -dev-* suffix. This is functionally equivalent to the release branch build, and a patch is in progress.
Contributions
Contributors to ONNX Runtime include members across teams at Microsoft, along with our community members:
snnn, skottmckay, edgchen1, hariharans29, tianleiwu, yufenglee, guoyu-wang, yuslepukhin, fs-eire, pranavsharma, iK1D, baijumeswani, tracysh, thiagocrepaldi, askhade, RyanUnderhill, wangyems, fdwr, RandySheriffH, jywu-msft, zhanghuanrong, smk2007, pengwa, liqunfu, shahasad, mszhanyi, SherlockNoMad, xadupre, jignparm, HectorSVC, ytaous, weixingzhang, stevenlix, tiagoshibata, faxu, wschin, souptc, ashbhandare, RandyShuai, chilo-ms, PeixuanZuo, cloudhan, dependabot[bot], jeffbloo, chenfucn, linkerzhang, duli2012, codemzs, oliviajain, natke, YUNQIUGUO, Craigacp, sumitsays, orilevari, BowenBao, yangchen-MS, hanbitmyths, satyajandhyala, MaajidKhan, smkarlap, sfatimar, jchen351, georgen117, wejoncy, PatriceVignola, adrianlizarraga, justinchuby, zhangxiang1993, gineshidalgo99, tlh20, xzhu1900, jeffdaily, suryasidd, yihonglyu, liuziyue, chentaMS, jcwchen, ybrnathan, ajindal1, zhijxu-MS, gramalingam, WilBrady, garymm, kkaranasos, ashari4, martinb35, AdamLouly, zhangyaobit, vvchernov, jingyanwangms, wenbingl, daquexian, sreekanth-yalachigere, NonStatic2014, [mayavijx](https://github.com/m...
ONNX Runtime v1.13.1
Announcements
- Security issues addressed by this release
- A protobuf security issue CVE-2022-1941 that impact users who load ONNX models from untrusted sources, for example, a deep learning inference service which allows users to upload their models then runs the inferences in a shared environment.
- An ONNX security vulnerability that allows reading of tensor_data outside the model directory, which allows attackers to read or write arbitrary files on an affected system that loads ONNX models from untrusted sources. (#12915)
- Deprecations
- CUDA 10.x support at source code level
- Windows 8.x support in Nuget/C API prebuilt binaries. Support for Windows 7+ Desktop versions (including Windows servers) will be retained by building ONNX Runtime from source.
- NUPHAR EP code is removed
- Dependency versioning updates
- C++ 17 compiler is now required to build ORT from source. On Linux, GCC version >=7.0 is required.
- Minimal numpy version bumped to 1.21.6 (from 1.21.0) for ONNX Runtime Python packages
- Official ONNX Runtime GPU packages now require CUDA version >=11.6 instead of 11.4.
General
- Expose all arena configs in Python API in an extensible way
- Fix ARM64 NuGet packaging
- Fix EP allocator setup issue affecting TVM EP
Performance
- Transformers CUDA improvements
- Quantization on GPU for BERT - notebook, documentation on QAT, transformer optimization toolchain and quantized kernels.
- Add fused attention CUDA kernels for BERT.
- Fuse
Add
(bias) andTranspose
of Q/K/V into one kernel for Attention and LongformerAttention. - Reduce GEMM computation in LongformerAttention with a new weight format.
- General quantization (tool and kernel)
- Quantization debugging tool - identify sensitive node/layer from accuracy drop discrepancies
- New quantize API based on QuantConfig
- New quantized operators: SoftMax, Split, Where
Execution Providers
- CUDA EP
- Official ONNX Runtime GPU packages are now built with CUDA version 11.6 instead of 11.4, but should still be backwards compatible with 11.4
- TensorRT EP
- Build option to link against pre-built onnx-tensorrt parser; this enables potential "no-code" TensorRT minor version upgrades and can be used to build against TensorRT 8.5 EA
- Improved nested control flow support
- Improve HashId generation used for uniquely identifying TRT engines. Addresses issues such as TRT Engine Cache Regeneration Issue
- TensorRT uint8 support
- OpenVINO EP
- OpenVINO version upgraded to 2022.2.0
- Support for INT8 QDQ models from NNCF
- Support for Intel 13th Gen Core Process (Raptor Lake)
- Preview support for Intel discrete graphics cards Intel Data Center GPU Flex Series and Intel Arc GPU
- Increased test coverage for GPU Plugin
- SNPE EP
- Add support for Windows Dev Kit 2023
- Nuget Package is now available
- DirectML EP
- Update to DML 1.9.1
- New ops: LayerNormalization, Gelu, MatMulScale, DFT, FusedMatMul (contrib)
- Bug fixes: DML EP Fix InstanceNormalization with 3D tensors (#12693), DML EP squeeze all axes when empty (#12649), DirectML GEMM broken in opset 11 and 13 when optional tensor C not provided (#12568)
- [new] CANN EP - Initial integration of CANN EP contributed by Huawei to support Ascend 310 (#11477)
Mobile
- EP infrastructure
- Implemented support for additional EPs that use static kernels
- Required for EPs like XNNPACK to be supported in minimal build
- Removes need for kernel hashes to reduce maintenance overhead for developers
- NOTE: ORT format models will need to be regenerated as the format change is NOT backwards compatible. We're replacing hashes for the CPU EP kernels with operator constraint information for operators used by the model so that we can match any static kernels available at runtime.
- Implemented support for additional EPs that use static kernels
- XNNPack
- Added more kernels including QDQ format model support
- AveragePool, Softmax,
- QLinearConv, QLinearAveragePool, QLinearSoftmax
- Added support for XNNPACK using threadpool
- See documentation for recommendations on how to configure the XNNPACK threadpool
- Added more kernels including QDQ format model support
- ORT format model peak memory usage
- Added ability to use ORT format model directly for initializers to reduce peak memory usage
- Enabled via SessionOptions config
- https://onnxruntime.ai/docs/reference/ort-format-models.html#load-ort-format-model-from-an-in-memory-byte-array
- Set "session.use_ort_model_bytes_directly" and "session.use_ort_model_bytes_for_initializers" to "1"
- Enabled via SessionOptions config
- Added ability to use ORT format model directly for initializers to reduce peak memory usage
Web
- Support for 4GB memory in webassembly
- Upgraded emscripten to 3.1.19
- Build from source support for onnxruntime-extensions and sentencepiece
- Initial support for XNNPACK for optimizations for Wasm
Training
- Training packages updated to CUDA version 11.6 and removed CUDA 10.2 and 11.3
- Performance improvements via op fusions like BiasSoftmax and Dropout fusion, Gather to Split fusion etc targeting SOTA models
- Added Aten support for GroupNorm, InstanceNormalization, Upsample nearest
- Bug fix for SimplifiedLayerNorm, seg fault for alltoall
Contributions
Contributors to ONNX Runtime include members across teams at Microsoft, along with our community members:
snnn, baijumeswani#2baijumeswani, edgchen1, iK1D, skottmckay, cloudhan, tianleiwu, fs-eire, mszhanyi, WilBrady, hariharans29, chenfucn, fdwr, yuslepukhin, wejoncy, PeixuanZuo, pengwa, yufenglee, jchen351, justinchuby, dependabot[bot], RandySheriffH, sumitsays, wschin, wangyems, YUNQIUGUO, ytaous, pranavsharma, vvchernov, natke, Craigacp, RandyShuai, smk2007, zhangyaobit, jcwchen, yihonglyu, georgen117, chilo-ms, ashbhandare, faxu, jstoecker, gramalingam, garymm, jeffbloo, xadupre, jywu-msft, askhade, RyanUnderhill, thiagocrepaldi, mindest, jingyanwangms, wenbingl, ashari4, sfatimar, MaajidKhan, souptc, HectorSVC, weixingzhang, zhanghuanrong
ONNX Runtime v1.12.1
This patch addresses packaging issues and bug fixes on top of v1.12.0.
- Java package: MacOS M1 support folder structure fix
- Android package: enable optimizations
- GPU (TensorRT provider): bug fixes
- DirectML: package fix
- WinML: bug fixes
See #12418 for full list of specific fixes included
ONNX Runtime v1.12.0
Announcements
- For Execution Provider maintainers/owners: the lightweight compile API is now the default compiler API for all Execution Providers (this was previously only available for the mobile build). If you have an EP using the legacy compiler API, please migrate to the lightweight compile API as soon as possible. The legacy API will be deprecated in next release (ORT 1.13).
- netstandard1.1 support is being deprecated in this release and will be removed in the next ORT 1.13 release
Key Updates
General
- ONNX spec support
- onnx opset 17
- onnx-ml opset 3 (TreeEnsemble update)
- BeamSearch operator for encoder-decoder transformers models
- Support for invoking individual ops without the need to create a separate graph
- For use with custom op development to reuse ORT code
- Support for feeding external initializers (for large models) as byte arrays for model inferencing
- Build switch to disable usage of abseil library to remove dependency
Packages
- Python 3.10 support
- Mac M1 support in Python and Java packages
- .NET 6/MAUI support in Nuget C# package
- Additional target frameworks: net6.0, net6.0-android, net6.0-ios, net6.0-macos
- NOTE: netstandard1.1 support is being deprecated in this release and will be removed in the 1.13 release
- onnxruntime-openvino package available on Pypi (from Intel)
Performance and Quantization
- Improved C++ APIs that now utilize RAII for better memory management
- Operator performance optimizations, including GatherElements
- Memory optimizations to support compute-intensive real-time inferencing scenarios (e.g. audio inferencing scenarios)
- CPU usage savings for infrequent inference requests by reducing thread spinning
- Memory usage reduction through use of containers from the abseil library, especially inlined vectors used to store tensor shapes and inlined hash maps
- New quantized kernels for weight symmetry to improve performance on ARM64 little core (GEMM and Conv)
- Specialized kernel to improve performance of quantized Resize by up to 2x speedup
- Improved the thread job partition for QLinearConv, demonstrating up to ~20% perf gain for certain models
- Quantization tool: improved ONNX shape inference for large models
Execution Providers
- TensorRT EP
- TensorRT 8.4 support
- Provide option to share execution context memory between TensorRT subgraphs
- Workaround long CI test time caused by frequent initialization/de-initialization of TensorRT builder
- Improve subgraph partitioning and consolidate TensorRT subgraphs when possible
- Refactor engine cache serialization/deserialization logic
- Miscellaneous bug fixes and performance improvements
- OpenVINO EP
- Pre-Built ONNXRuntime binaries with OpenVINO now available on pypi: onnxruntime-openvino
- Performance optimizations of existing supported models
- New runtime configuration option ‘enable_dynamic_shapes’ added to enable dynamic shapes for each iteration
- ORTModule included as part of OVEP Python Package to enable Torch ORT Inference
- DirectML EP
- Updated to DirectML 1.9
- Opset 13-15 support: #11827, #11814, #11782, #11772
- Bug fixes: Xbox command list reuse, descriptor heap reset, command allocator memory growth, negative pad counts, node suffix removal
- TVM EP - details
- Updated to add model .dll ingestion and execution on Windows
- Updated documentation and CI tests
- [New] SNPE EP - details
- [Preview] XNNPACK EP - initial infrastructure with limited operator support, for use with ORT Mobile and ORT Web
- Currently supports Conv and MaxPool, with work in progress to add more kernels
Mobile
- Binary size reductions in Android minimal build - 12% reduction in size of base build with no operator kernels
- Added new operator support to NNAPI and CoreML EPs to improve ability to run super resolution and BERT models using NPU
- NNAPI: DepthToSpace, PRelu, Gather, Unsqueeze, Pad
- CoreML: DepthToSpace, PRelu
- Added Docker file to simplify running a custom minimal build to create an ORT Android package
- Initial XNNPACK EP compatibility
Web
- Memory usage optimizations
- Initial XNNPACK EP compatibility
ORT Training
- [New] ORT Training acceleration is also natively available through HuggingFace Optimum
- [New] FusedAdam Optimizer now available through the torch-ort package for easier training integration
- FP16_Optimizer Support for more DeepSpeed Versions
- Bfloat16 support for AtenOp
- Added gradient ops for ReduceMax and ReduceMin
- Updates to Min and Max grad ops to use distributed logic
- Optimizations
- Optimized perf for Gelu and GeluGrad kernels for mixed precision models
- Enabled fusions for SimplifiedLayerNorm
- Added bitmask versions of Dropout, BiasDropout and DropoutGrad which brings ~8x space savings for the mast output.
Known issues
- The Microsoft.ML.OnnxRuntime.DirectML package on Nuget has an issue and will be fixed in a patch. Fix: #12368
- The Maven package has a packaging issue for Mac M1 builds and will be fixed in a patch. Fix: #12335 / Workaround discussion
- Windows builds are not compatible with Windows 8.x in this release. Please use v1.11 for now.
Contributions
Contributors to ONNX Runtime include members across teams at Microsoft, along with our community members:
snnn, edgchen1, fdwr, skottmckay, iK1D, fs-eire, mszhanyi, WilBrady, justinchuby, tianleiwu, PeixuanZuo, garymm, yufenglee, adrianlizarraga, yuslepukhin, dependabot[bot], chilo-ms, vvchernov, oliviajain, ytaous, hariharans29, sumitsays, wangyems, pengwa, baijumeswani, smk2007, RandySheriffH, gramalingam, xadupre, yihonglyu, zhangyaobit, YUNQIUGUO, jcwchen, chenfucn, souptc, chandru-r, jstoecker, hanbitmyths, RyanUnderhill, georgen117, jywu-msft, mindest, sfatimar, HectorSVC, Craigacp, jeffdaily, zhijxu-MS, natke, stevenlix, jeffbloo, guoyu-wang, daquexian, faxu, jingyanwangms, adtsai, wschin, weixingzhang, wenbingl, MaajidKhan, ashbhandare, ajindal1, zhanghuanrong, tiagoshibata, askhade, liqunfu