Commit graph

7501 commits

Author SHA1 Message Date
Ashwini Khade
4fc8f7139a
Bug Fix - C# API order incompatibile with C API (#13191)
### Description
Training C# bindings (ReleaseTrainingSession and ReleaseCheckpointState)
broke after an API order change in Training C API. This PR fixes this
issue.



### Motivation and Context
Bug Fix for Training C# bindings
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2022-10-04 09:29:20 -07:00
Justin Chu
595a0c8658
Disable clang-tidy CI (#13207)
Disable clang-tidy CI for now because it is creating a lot of false
positives like in https://github.com/microsoft/onnxruntime/pull/12998
2022-10-04 07:37:49 -07:00
Tianlei Wu
b6c04f48c1
Fix reshape fusion (#13150)
(1) Hot fixes reshape fusion, which causes stable diffusion unet model invalid.
(2) Update remove_cascaded_cast_nodes to make it faster
2022-10-04 00:26:29 -07:00
Faith Xu
2d50d4be24
Update TSA path to new ADO project (#12902)
Updates TSA item path to new ADO project area paths
2022-10-03 22:54:42 -07:00
Ashwini Khade
c780c4a2b9
Fix two prefast warnings (#13211) 2022-10-03 20:00:57 -07:00
Tony Xia
962fee5fe5
Fix typo enviroment => environment (#13195) 2022-10-03 17:02:26 -07:00
Justin Stoecker
9cf98dacb3
Enable command list reuse for Xbox (#13173)
Removes the workaround introduced in #12063, which disabled DML command
list reuse for Xbox builds.

The ID3D12CommandList created in FusedGraphKernel takes points to an
ID3D12CommandAllocator that is local to the `BuildReusableCommandList`
function. On PC it would seem the command list is keeping the command
allocator alive, but this is highly suspect logic that definitely
doesn't work on Xbox. I find no documentation indicating this logic
should work (a section on [reference
counting](https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles#reference-counting)
makes it clear command lists take no refs on D3D objects passed as args
to its APIs; however, it's unclear if this also applies to its
construction).

A second (small) change is constructing the command list straight into
`ID3D12GraphicsCommandList` and removing an unnecessary QI.
2022-10-03 16:03:29 -07:00
Ryan Hill
81a4efee6c
Prefast Fixes (#12952)
**Description**: Fixes these TSA issues (no actual bugs fixed, but just
changing code to make TSA happy)

To fix 1944982 and 1944973 I changed DeleteOnUnloadPtr to not use 'new'
and to just use placement new to go into a fixed buffer. This required
changing the rocm usage of it also (probably a separate TSA bug on that
one that I don't have)

1944982 Ryan Hill [prefast:Warning]: C26426 (in
onnxruntime/core/providers/cuda/tensor/cast_op.cc)
Global initializer calls a non-constexpr function 'operator new' (i.22).

1944973 Ryan Hill [prefast:Warning]: C26426 (in
onnxruntime/core/providers/cuda/cuda_execution_provider_info.cc)
Global initializer calls a non-constexpr function 'operator new' (i.22).

1944929 Ryan Hill [prefast:Warning]: C26436 (in
onnxruntime/core/providers/cuda/cuda_provider_factory.cc)
The type 'struct onnxruntime::ProviderInfo_CUDA_Impl' with a virtual
function needs either public virtual or protected non-virtual destructor
(c.35).
2022-10-03 15:50:44 -07:00
Yulong Wang
82786baed1
[js/web] add 'xnnpack' to EP list (#12723)
**Description**: This PR adds support for "XNNPACK EP" in ORTWeb and
changes the behavior of how ORTWeb deals with "backends", or "EPs" in
API.

**Background**: Term "backend" is introduced in ONNX.js to representing
a TypeScript type which implements a "backend" interface, which is a
similar but different concept to ORT's EP (execution provider). There
was 3 backends in ONNX.js: "cpu", "wasm" and "webgl".

When ORT Web is launched, the concept is derived to help users to
integrate smoothly. Technically, when "wasm" backend is used, users need
to also specify "EP" in the session options. Considering it may get
complicated and confused for users to figure out the difference between
"backend" and "EP", the JS API hide the "backend" concept and made a
mapping between names, backends and EPs:
"webgl" (Name) <==> "onnxjsBackend" (Backend)
"wasm" (Name) <==> "wasmBackend" (Backend) <==> "CPU" (EP)

**Details**:
The following changes are applied in this PR:
1. allow multi-registration for backends using the same name. This is
for use scenarios where both "onnxruntime-node" and "onnxruntime-web"
are consumed in a Node.js App ( so "cpu" will be registered twice in
this scenario. )
2. re-assign priority values to backends. I give 100 as base to "cpu"
for node and react_native, and 10 as base to "cpu" in web.
3. add "cpu", "xnnpack" as new names of backends.
4. update onnxruntime wasm exported functions to support EP
registration.
5. update implementations in ort web to handle execution providers in
session options.
6. add '--use_xnnpack' as default build flag for ort-web
2022-10-03 10:38:45 -07:00
Yufeng Li
1342baf1c7
refine QuantConfig (#13155)
Refine the QuantConfig: 1. Remove the default EP config. 2. pass
QuantConfig to quantize API direclty.
2022-10-03 08:34:49 -07:00
Baiju Meswani
0cf17b1921
Add linux debug training package to nightly pipeline (#13192) 2022-10-01 06:58:43 -07:00
Nat Kershaw (MSFT)
68218935b9
Fix syntax error in labeler.yml (#13193) 2022-09-30 23:10:21 -07:00
Edward Chen
a86b8329d9
Update unsupported ORT format version error message to link to doc on rel-1.13.0 branch. (#13187) 2022-09-30 17:13:52 -07:00
Yulong Wang
054464dce2
fix XNNPACK on WebAssembly SIMD (#13161)
### Description

fix XNNPACK on WebAssembly SIMD.

Flag "-msimd128" need to be applied to every source file when compiling
WASM SIMD. Currently only a part of the source files are compiled with
this flag so we get inconsistent result for
`sizeof(xnn_f32_minmax_params)` because the type definition include a
`#ifdef` for `__wasm_simd128__`. The inconsistency causes writing
garbage data to a stack variable and eventually cause the crash.

XNNPACK libraries are C libraries so need to apply the build flags not
only to `CMAKE_CXX_FLAGS` but also to `CMAKE_C_FLAGS`.
2022-09-30 16:34:15 -07:00
Nat Kershaw (MSFT)
0bf0991fa2
Update labeler.yml (#13186) 2022-09-30 15:43:33 -07:00
Numfor Tiapo
56387c3c31
Fix SDL Unmatched Annotation Errors (#13162)
Fixes 3 SDL unmatched annotation errors.

Co-authored-by: Numfor Mbiziwo-Tiapo <numform@microsoft.com>
2022-09-30 15:36:30 -07:00
Edward Chen
aae35f2759
Binary size reduction in KernelTypeStrResolver and GraphPartitioner (#13172)
Reduce binary size for minimal Android builds.
- reduce places where Status objects are created in KernelTypeStrResolver::LoadFromOrtFormat()
- remove some unused parameters (in a base minimal build) and code in graph_partitioner.cc
2022-09-30 13:50:39 -07:00
George Nash
b76a65c784
Upgrade the oneDNN ep to use oneDNNv2.7 (#13175)
### Description
This updates the oneDNN library used by oneDNN ep from version 2.6 to
version 2.7



### Motivation and Context
This brings in the many improvements incorporated into the oneDNN
library to the oneDNN execution provider.

Signed-off-by: George Nash <george.nash@intel.com>
2022-09-30 12:29:17 -07:00
Nat Kershaw (MSFT)
eef0a98cae
Update and fix labeling rules (#13129) 2022-09-30 10:19:23 -07:00
Brian Martin
c20abcab87
User/brianma/eo (#13152)
fixing SDL issues. One was a SAL mismatch, the other was handling an
optional null pointer.
2022-09-30 09:43:56 -07:00
Justin Chu
402e1995f0
Create clang-tidy CI (#12653)
Update clang-tidy config to prepare for creating a CI workflow to run
clang-tidy.
Added clangtidy check in CI

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2022-09-30 08:05:38 -07:00
Changming Sun
5f1bc8ff56
Add "--parallel" to the build flags of WASM pipeline (#13179) 2022-09-30 06:54:39 -07:00
Yi Zhang
a862b0cad1
increase ios_CI_coreml stage timeout limit (#13157)
### Description
As titile 

### Motivation and Context
Recently, it became more frequently that the workflow canceled due to
timeout.
2022-09-30 14:45:14 +08:00
Changming Sun
dd2aec170d
Update Coding_Conventions_and_Standards.md (#7705) 2022-09-29 23:32:37 -07:00
sumitsays
f3180f3ac8
[DML EP] Enable graph inside DML Graph (#13073)
### Description
Kernels like Attention, BatchNormalization15, etc, can be implemented by
using multiple DML APIs. This PR paves the path for graph-based kernel
implementation.
As part of this PR, every kernel in DML EP will now wrap their
DML_OPERATOR_DESC into a graph and send it to FusedGraphKernel.
FusedGraphKernel will stich this smaller graph into its main DML_GRAPH.

All onnxconformance test and Winml model tests passed.

Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>
2022-09-29 23:32:20 -07:00
cloudhan
c93cb8f949
Revert "Enable ROCm to use tunable GEMM" (#13160)
Reverts microsoft/onnxruntime#12853 due to CI pipeline problem.
2022-09-30 14:01:16 +08:00
Ye Wang
c8781b77f6
Decouple use_sequence_as_input_ids from has_hidden_states (#13130)
### Description
<!-- Describe your changes. -->

A fix for parity issue in huggingface bart model with beam search
https://github.com/microsoft/onnxruntime/pull/12779

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2022-09-29 22:45:52 -07:00
Scott McKay
32395e2e16
Add handling for variadic inputs/outputs in a function. (#13140)
### Description
<!-- Describe your changes. -->
Add handling for variadic inputs/outputs in a function.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

#13121
2022-09-30 14:51:17 +10:00
Scott McKay
4d8510611b
Update find_optimizer_opset_version_updates_required.py to use the ONNX headers to determine the latest opset. (#12484)
**Description**: 
Use the onnx headers to find the latest opset for each operator. This
allows the script to detect optimizers with
`graph_utils::IsSupportedOptypeVersionAndDomain` calls that need
updating when run during the update of the onnx commit id. Without this
change issues are not detected until a new kernel is registered.

**Motivation and Context**
Detect optimizers that need updates as part of the ONNX update process.
2022-09-29 16:55:22 +10:00
Vincent Wang
6c63c1c9ee
Multiple Gather to Split Fusion (#13095)
For below code in some transformers models:
```
fused_qkv = fused_qkv.view(batch_size, seq_length, self.num_heads, 3, self.head_dim)
return fused_qkv[..., 0, :], fused_qkv[..., 1, :], fused_qkv[..., 2, :]
```

The exported graph will contains 3 Gather nodes, currently ORT's
GatherGrad CUDA implementation is slow. This pattern can be fused to use
one Split, so that we can launch less kernels for the compute, the perf
of Split/Concat (for grad) is also better than Gather/GatherGrad.

In a real example, one GatherGrad will take 15ms and there are 3 for
each layer in the graph, after the fusion, one Concat takes only 35us.
The total time of a step is improved from 1.5s to 0.4s.
2022-09-29 11:09:57 +08:00
PeixuanZuo
3157cdb19a
[ROCm] Fix MIGraphX ciagent user Permissions issues (#13137)
### Description
<!-- Describe your changes. -->

fix migraphx ci pipeline failed problem.

Disabled MIGraphX pipeline now. It will  be Enabled when this PR merge.

### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
2022-09-29 10:25:02 +08:00
Baiju Meswani
5182d6610d
Upgrade pytorch to 1.12.1 for training pipelines (#13128) 2022-09-28 17:59:49 -07:00
sfatimar
c9a86fa27f
Openvino GPU Unit/Python Tests fix failure (#13122)
### Description
We fix iGPU Unit and Python tests with this PR
We add packaging pip pkg to build Many Linux DockerFile


### Motivation and Context
This change is required to make sure iGPU Unit Test/Python Tests with OV
are fixed
 - If it fixes an open issue, please link to the issue here. -->

Co-authored-by: shamaksx <shamax.kshirsagar@intel.com>
Co-authored-by: mayavijx <mayax.vijayan@intel.com>
Co-authored-by: pratiksha <pratikshax.bapusaheb.vanse@intel.com>
Co-authored-by: pratiksha <mohsinx.mohammad@intel.com>
Co-authored-by: Sahar Fatima <sfatima.3001@gmail.com>
Co-authored-by: Preetha Veeramalai <preetha.veeramalai@intel.com>
Co-authored-by: nmaajidk <n.maajid.khan@intel.com>
Co-authored-by: Mateusz Tabaka <mateusz.tabaka@intel.com>
2022-09-28 16:00:06 -07:00
Adam Pocock
388d3cf847
[Java] Fix OnnxSequence semantics (#13012)
Previously OnnxSequence would flatten out a list of tensors into a
single output array assuming they were all scalar values. This doesn't
accurately represent the semantics of an ONNX sequence, but was what the
semantics appeared to be years ago when I first wrote that class. This
PR changes it so that the `getValue` method on `OnnxSequence` unwraps
the sequence and returns `List<? extends OnnxValue>` allowing the user
to process the individual ONNX values separately. It's done this way
rather than returning a multidimensional array for a tensor and a Java
map for a map as multidimensional arrays are very inefficient in Java
and best practice when operating with a OnnxTensor in Java is to use a
`java.nio.ByteBuffer`. So allowing users to access each `OnnxTensor`s
individually allows them to control how the data is materialised on the
Java heap.
2022-09-28 15:53:30 -07:00
Edward Chen
55ae71c160
Reduce Objective-C static analysis build time. (#13149) 2022-09-28 15:49:48 -07:00
PeixuanZuo
c26bb1bb19
Allow fastgelu/skiplayernorm profile by pass args from commandline (#13025)
**Description**: Describe your changes.
This allow us quickly launch a microbench session by, for example:
`python skip_layer_norm_test.py 8 128 128 float32 `
2022-09-28 15:48:59 -07:00
cloudhan
32c2c4b480
Change ROCm to use tunable GEMM (#12853)
Change ROCm to use tunable GEMM. It is not enabled in this PR. This will drastically improve GEMM performance in some shapes and dtypes configuration. This will benefit the overall performance for BERT inference and hopefully, training, when enabled.
2022-09-28 16:21:54 +08:00
PeixuanZuo
5e4ebbd9d9
[ROCm] add MIGraphX ci pipeline (#11569)
**Description**: Describe your changes.
Add migraphx ci pipeline, test build and unit tests.
This PR is based on #11492 

Pipeline :
https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=765711&view=results
2022-09-28 10:59:30 +08:00
Yi Zhang
19774f9230
print test case's skip reason (#13118)
### Description
as title


### Motivation and Context
easy to debug
2022-09-28 09:33:31 +08:00
Baiju Meswani
f99d00fa38
Add rel* branches to upload training packages to final storage (#13124) 2022-09-27 17:20:17 -07:00
Rachel Guo
9a44a69653
Refactor NNAPI EP OpBuilder/OpSupportChecker structure (#13065)
### Description
<!-- Describe your changes. -->

As title

-Split long OpBuilder and OpSupportChecker files into individual
operator files.

-Add OpBuilder/SupportChecker registry factories.

-Combine the functionality of op_builder and op_support_checker into one
op_builder.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

The NNAPI OPBuilder was splitted into OPBuilder (For EP::Compile) and
OPSupportChecker (for EP::GetCapability)
At the time it was reasonable choice, but OPBuilder/OPSupportChecker
share some logic and has to use addition helper.

Clean up now to make NNAPI OPBuilder/OPSupportChecker into single
OPBuilder (similar to what CoreML EP has)
2022-09-27 17:12:09 -07:00
Edward Chen
457a53c92f
Fix static analysis warning by making derived classes final. (#13123)
Follow up to #13059, which only updated the base classes. This change ensures that the derived classes will not be base classes.
2022-09-27 15:45:45 -07:00
Scott McKay
e19163167e
Update React Native documentation to reflect change to use full ORT (#13091)
### Description
<!-- Describe your changes. -->
Update React Native documentation to reflect change to use full ORT. Fix
broken links.


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
ORT v1.13 uses the full ORT package. Instructions for performing a
custom build did not cover this.

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2022-09-28 08:11:58 +10:00
Edward Chen
5c89c37f7f
Consolidate enabled/default kernel def type constraints (#13034)
Consolidate enabled/default kernel def type constraint types into enabled.
2022-09-27 14:04:15 -07:00
Faith Xu
440f31668f
Labeler: Test /i regex for case sensitivity (#13115)
### Description
Test if regex change will make auto labeling case insensitive
2022-09-27 13:58:09 -07:00
PeixuanZuo
13d1a3c007
[ROCm] add SkipLayerNorm vectorize Regular case (#12821)
**Description**: Describe your changes.
add SkipLayerNorm vectorize regular case
1. when hidden size <= 1024, SkipLayerNormTunable op can use both small
case and regular case
2. when hidden size > 1024, SkipLayerNormTunable op can only use regular
case.

**Motivation and Context**
- Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here.
2022-09-27 12:52:10 -07:00
leqiao-1
43766ee36d
Fix OLive build pipeline (#13114) 2022-09-27 10:19:58 -07:00
Vincent Wang
94e34ace15
Bugfix for SimplifiedLayerNormalization (#12975)
This PR is to fix https://github.com/microsoft/onnxruntime/issues/12930
and https://github.com/microsoft/onnxruntime/issues/12579.

In detail:
- For CPU EP, since current impl of SimplifiedLayerNormalization doesn't
support input and scale having different data types, so if the sub-graph
contains Cast Op, the sub-graph will not fused, this guarantee that both
inputs and output data type will be same
- For CUDA EP, add (fp16, float) support to (T,V) type constraints all
combinations of fp16 and float can be supported in the impl

With the fix, the original model can be run with
SimplifiedLayerNormalization, which also helps to improve the perf.
2022-09-27 14:24:16 +08:00
RandySheriffH
237ccc01c7
Remove one last nuphar reference (#13111)
Remove one last nuphar reference.
2022-09-26 23:02:36 -07:00
Changming Sun
b25437ec41
Upgrade protobuf version (#13100)
Upgrade protobuf version from 3.18.1 to 3.18.3 to address CVE-2022-1941
2022-09-26 21:30:28 -07:00