ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
Find a file
Jake Mathern f96f222526
Change CPU EP behavior with auto_pad when ConvTranspose output shape is specified. (#13311)
### Description
Based on the ORT spec for ConvTranspose:

```
output_shape can also be explicitly specified in which case pads values are auto generated using these equations:

total_padding[i] = stride[i] * (input_size[i] - 1) + output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - output_shape[i]
If (auto_pads == SAME_UPPER): pads[start_i] = total_padding[i]/2; pads[end_i] = total_padding[i] - (total_padding[i]/2)
Else: pads[start_i] = total_padding[i] - (total_padding[i]/2); pads[end_i] = (total_padding[i]/2).
```
However the CPU EP logic differs. Basically, unless SAME_UPPER is
specified, the default behavior (for VALID,NOTSET,SAME_LOWER) should be
SAME_LOWER.

I think this is the pragmatic fix, however it's perhaps still not
totally up to standard.
In the case tested, the operator is actually only valid if padding is
inserted. Perhaps it "should" throw some error then, if auto_pad is not
SAME_UPPER or SAME_LOWER, as the spec also mentions:

"VALID mean no padding." (For convtranspose-1 but this was removed in
convtranspose-11, making it less clear.)
"NOTSET, which means explicit padding is used" (should technically
require explicit padding then, and not generate it)

HOWEVER, changing it to throw errors could do more harm than good. For
now, probably just best to make it consistent.

### Motivation and Context
We noticed that there was a discrepancy in one of the DML tests between
CPU and DML.
auto_pad is not specified, and DML is doing SAME_LOWER behavior by
default, where CPU EP is doing SAME_UPPER behavior.

```json
    {
      "graph_name": "ConvTranspose output_shape with even strides odd kernel autopad NOTSET",
      "op_type": "ConvTranspose",
      "dilations": [1,1],
      "group": 1,
      "strides": [2,2],
      "kernel_shape": [3,3],
      "output_shape": [1,1,4,4],
      "X": {"dims": [1,1,2,2], "function": "iota"},
      "W": {"dims": [1,1,3,3], "value": [1,2,3,4,5,6,7,8,9]},
      "B": [1],
      "Y": {"dims": [1,1,4,4], "value": [1,5,6,7,5,17,15,19,11,25,16,19,17,40,25,28]},
      "T": "float32"
    }
```
2022-10-18 12:57:47 -07:00
.config Update TSA path to new ADO project (#12902) 2022-10-03 22:54:42 -07:00
.devcontainer Remove two lines in the Dockerfile for Github Codespace (#12278) 2022-07-21 20:52:17 -07:00
.gdn
.github Update Win_GPU_CI trigger (#13290) 2022-10-12 15:22:42 +08:00
.pipelines Publish WinML Nuget package to ORT-Nightly ADO feed (#12904) 2022-09-15 12:10:27 -07:00
.vscode cpplint & Eager mode: refactor and add comments to empty_* functions, general lint cleanup in ort_aten (#12238) 2022-07-20 11:47:57 -04:00
cgmanifests Upgrade protobuf version (#13100) 2022-09-26 21:30:28 -07:00
cmake MIGraphX Execution Provider: Stream Synchronization (#12899) 2022-10-14 10:23:51 -07:00
csharp uset SearchOption for dotframework (#13321) 2022-10-14 10:22:05 -07:00
dockerfiles Openvino GPU Unit/Python Tests fix failure (#13122) 2022-09-28 16:00:06 -07:00
docs skip windows GPU check if changes only in doc (#13248) 2022-10-11 13:51:44 +08:00
include/onnxruntime/core Improve thread pool creation failure handling. (#13313) 2022-10-15 17:57:19 -07:00
java [Java] Fix OnnxSequence semantics (#13012) 2022-09-28 15:53:30 -07:00
js Deprecate CustomApi and refactor public API for better safety and consistency (#13215) 2022-10-06 14:57:37 -07:00
objectivec Deprecate CustomApi and refactor public API for better safety and consistency (#13215) 2022-10-06 14:57:37 -07:00
onnxruntime Change CPU EP behavior with auto_pad when ConvTranspose output shape is specified. (#13311) 2022-10-18 12:57:47 -07:00
orttraining update the nightly build to use the latest ptca image. (#13309) 2022-10-17 14:12:03 -07:00
package/rpm Bump ort version number (#11948) 2022-07-22 12:55:53 -07:00
samples Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
tools update the nightly build to use the latest ptca image. (#13309) 2022-10-17 14:12:03 -07:00
winml Fix SDL Unmatched Annotation Errors (#13162) 2022-09-30 15:36:30 -07:00
.clang-format
.clang-tidy Create clang-tidy CI (#12653) 2022-09-30 08:05:38 -07:00
.dockerignore
.flake8 Remove miscellaneous nuphar configs (#13070) 2022-09-26 13:41:28 -07:00
.gitattributes
.gitignore Ignore settings.json in git (#12988) 2022-09-19 12:05:43 -07:00
.gitmodules upgrade emsdk to 3.1.19 (#12690) 2022-08-30 13:42:45 -07:00
build.amd64.1411.bat
build.bat
build.sh
CITATION.cff
CODEOWNERS Add cgmanifest file in codeowner list (#13042) 2022-09-22 18:58:01 -07:00
CONTRIBUTING.md
lgtm.yml Add LGTM config for c++ and c# (#11365) 2022-04-27 10:51:40 -07:00
LICENSE
NuGet.config
ort.wprp
ORT_icon_for_light_bg.png
packages.config Update DML 1.9.0 to 1.9.1 (#12966) 2022-09-15 10:54:22 -07:00
pyproject.toml Reduce CI noise from Python lint (#12270) 2022-07-27 13:42:29 -07:00
README.md Remove miscellaneous nuphar configs (#13070) 2022-09-26 13:41:28 -07:00
requirements-dev.txt Introduce parameterized as a dev dependency (#11364) 2022-04-26 17:24:39 -07:00
requirements-doc.txt
requirements-training.txt pin protobuf version to be compatible with onnx (#12132) 2022-07-08 15:01:27 -07:00
requirements.txt.in Add additional python requirements (#11522) 2022-05-20 16:16:18 -07:00
SECURITY.md Microsoft mandatory file (#11619) 2022-05-25 13:56:10 -07:00
setup.py Add Utils for federated learning scenarios (#13014) 2022-10-17 12:39:43 -07:00
ThirdPartyNotices.txt
VERSION_NUMBER Bump ort version number (#11948) 2022-07-22 12:55:53 -07:00

ONNX Runtime is a cross-platform inference and training machine-learning accelerator.

ONNX Runtime inference can enable faster customer experiences and lower costs, supporting models from deep learning frameworks such as PyTorch and TensorFlow/Keras as well as classical machine learning libraries such as scikit-learn, LightGBM, XGBoost, etc. ONNX Runtime is compatible with different hardware, drivers, and operating systems, and provides optimal performance by leveraging hardware accelerators where applicable alongside graph optimizations and transforms. Learn more →

ONNX Runtime training can accelerate the model training time on multi-node NVIDIA GPUs for transformer models with a one-line addition for existing PyTorch training scripts. Learn more →

Get Started

General Information: onnxruntime.ai

Usage documention and tutorials: onnxruntime.ai/docs

Companion sample repositories:

Build Pipeline Status

System CPU GPU EPs
Windows Build Status Build Status Build Status
Linux Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Mac Build Status
Build Status
Android Build Status
iOS Build Status
WebAssembly Build Status

Data/Telemetry

Windows distributions of 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.

Contributions and Feedback

We welcome contributions! Please see the contribution guidelines.

For feature requests or bug reports, please file a GitHub Issue.

For general discussion or questions, please use GitHub Discussions.

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

This project is licensed under the MIT License.