Commit graph

7399 commits

Author SHA1 Message Date
cloudhan
e9d91cac55
Fix hipify not running if the pwd is not the root of onnxruntime repo (#12941) 2022-09-21 14:27:01 +08:00
Changming Sun
b2b4f703a5
Move Linux GPU CI pipeline to T4 (#12996)
Move Linux GPU CI pipeline to T4
2022-09-20 20:21:32 -07:00
Rachel Guo
bee49dd112
Add limit input rank <= 4 in NNAPI EP Sigmoid op support checker (#13019)
**Description**: Describe your changes.

As title. 
Added unit test for the 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.

Fix issue #12979
2022-09-20 16:40:45 -07:00
Wei-Sheng Chin
40749124b1
Fix Deferred Release and Add New Test Framework for CUDA EP-specific Tests (#13016)
Since CUDA EP became a shared library, most of internal functions are
not accessible from `onnxruntime_test_all`, we need a new mechanism to
write CUDA EP-specific tests. To this end, this PR introduces a general
infra and an example test for deferred release in CUDA EP. When adding
this test, we also found the current deferred release will cause error
when pinned CPU buffer is not allocated by BFCArena, and this PR also
makes a small fix (see changes in rocm_execution_provider.cc and
cuda_execution_provider.cc).

This PR also fixes a deferred release bug found by new tests.
2022-09-20 16:16:13 -07:00
Weixing Zhang
4113df0e21
use constexpr (#12953) 2022-09-20 14:34:33 -07:00
Yufeng Li
dd39f0293d
fix static analysis: integer_gemm and attention_quantization (#13004) 2022-09-20 14:32:31 -07:00
Edward Chen
454f77cd94
Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791)
# Motivation
Currently, ORT minimal builds use kernel def hashes to map from nodes to
kernels to execute when loading the model. As the kernel def hashes must
be known ahead of time, this works for statically registered kernels.
This works well for the CPU EP.
For this approach to work, the kernel def hashes must also be known at
ORT format model conversion time, which means the EP with statically
registered kernels must also be enabled then. This is not an issue for
the always-available CPU EP. However, we do not want to require that any
EP which statically registers kernels is always available too.
Consequently, we explore another approach to match nodes to kernels that
does not rely on kernel def hashes. An added benefit of this is the
possibility of moving away from kernel def hashes completely, which
would eliminate the maintenance burden of keeping the hashes stable.

# Approach
In a full build, ORT uses some information from the ONNX op schema to
match a node to a kernel. We want to avoid including the ONNX op schema
in a minimal build to reduce binary size. Essentially, we take the
necessary information from the ONNX op schema and make it available in a
minimal build.
We decouple the ONNX op schema from the kernel matching logic. The
kernel matching logic instead relies on per-op information which can
either be obtained from the ONNX op schema or another source.
This per-op information must be available in a minimal build when there
are no ONNX op schemas. We put it in the ORT format model.
Existing uses of kernel def hashes to look up kernels are replaced
with the updated kernel matching logic. We no longer store
kernel def hashes in the ORT format model’s session state and runtime
optimization representations. We no longer keep the logic to
generate and ensure stability of kernel def hashes.
2022-09-20 14:24:59 -07:00
Edward Chen
32878a1e58
Fix log timestamps being off by one hour when DST is in effect. (#11385) 2022-09-20 11:45:35 -07:00
Justin Chu
1245c6397e
Remove usage of torch.onnx symbolic_registry (#13011)
**Description**: symbolic_registry is deprecated in torch.onnx. This PR
removes its usage.

Fixes #13008
2022-09-20 10:59:41 -07:00
PeixuanZuo
189aef2bea
[ADD] add skip layernorm to kernel explorer for ROCm EP (#12816)
**Description**: Describe your changes.
Related PR: https://github.com/microsoft/onnxruntime/pull/12803
https://github.com/microsoft/onnxruntime/pull/12817
https://github.com/microsoft/onnxruntime/pull/12821

Add skip layernorm to kernel explorer for profiling.

**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-20 17:17:01 +08:00
cloudhan
ffeba98a9d
Allow gemm profile by pass args from commandline (#12991)
This allow us quickly launch a microbench session by, for example:
```bash
python gemm_test.py T N float16 256 256 65536 
```
So that we can quickly see which one is the fastest.
2022-09-20 16:18:56 +08:00
Cheng
f26054deca
[XNNPACK] Support running in multi-thread with seperate pthreadpool (#11762)
**Description**: Describe your changes.
XNNPACK takes pthreadpool as its internal threadpool implemtation, it
couples calculation and parallelization. Thus it's impossible to
leverage ORT's threadpool (EIGEN/OPENMP based). So we enabled
pthreadpool in XNNPACK EP in this PR.

Case 1:  Pthreadpool coexist with ORT-threadpool simply
Expriments setup
hardware:RedMi8A with 8 cores, ARMv7
The two threadpool has the same pool size form 1 to 8.
Two models: mobilenet_v2 and mobilenet_egetppu.
we can see the picture below and draw a conclusion, latency are even
higher from 5 threads or more.


![image](https://user-images.githubusercontent.com/9417365/190550127-2304adfe-97ac-4aeb-91a0-4606b5305a82.png)

Case 2:
For the reason of performance regression with 5 more threads,
ORT-threads are spinning on CPU and diddn't realease it after
computation finished. It's equivalent of creating 5x2 threads for
parallelization while we have only 8 cpu cores.
So I mannuly disabled spinning after ort-threadpool finished and enabled
it when enter ort-threadpool.
The result is quite normal now.

![image](https://user-images.githubusercontent.com/9417365/190675230-0d85dd02-01f0-4255-967d-e3dbb2a1fe52.png)


Case 3:
Even we achieved a reasonable results with disabling spinning, Will
ORT-threadpool still impact performance of pthreadpool?
we have expriment setting up as: Setting ORT-threadpool size
(intra_thread_num) as 1, and only pthreadpool created.
Attention that, almost a third of ops are running by CPU EP. we are
surprisingly find that disabling ort-threadpool is even better in
performance than creating two threadpool.


![image](https://user-images.githubusercontent.com/9417365/190556480-d6507396-d777-44fc-94e1-938d2b9bb7d7.png)


Case 4:
Use a unified threadpool between CPU ep and XNNPACK ep.
It's the fastest among all. But if we take the similar workload
partition strategy as ORT-threadpool, it could be faster.


![image](https://user-images.githubusercontent.com/9417365/190674908-a68fd20f-bdf4-41f9-bf0a-76b304cda490.png)

**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.

Co-authored-by: Jicheng Wen <jicwen@microsoft.com>
2022-09-20 16:02:15 +08:00
Pranav Sharma
a8b0f57d1a
Fix eager mode pipeline to accommodate recent allocator change. (#13000) 2022-09-20 12:53:46 +08:00
cloudhan
0ddf4efbd9
Make PythonOp report dtype mismatch by name, instead of by using enum index (#13007) 2022-09-20 12:29:30 +08:00
Chen Fu
77b567df66
test qdq loss presence (#12928)
**Description**: Change qdq debugger test oracle

instead of testing a threshold, which occasionally fails, we just test
the loss value is present.
2022-09-19 15:58:27 -07:00
Prathik Rao
3cd2d4a7a1
Merge pull request #13013 from microsoft/prathikrao/setuptools-version-bug-fix
downgrade setuptools
2022-09-19 15:50:48 -07:00
Prathik Rao
8ea742b507 downgrade setuptools 2022-09-19 12:39:35 -07:00
Justin Chu
14eb3cf485
Ignore settings.json in git (#12988)
**Description**: Remove the `settings.json` line in gitignore.

**Motivation and Context**

Having `settings.json` tracked in git has created annoying diffs when it
is modified locally. This PR removes the entry in gitignore but
maintains the `settings.json` in the repo so that we have a good
default.
2022-09-19 12:05:43 -07:00
cloudhan
14365b67a0
Fix hipify due to CUDA EP tensorrt_fused_multihead_attention optimization (#12990)
Recent change in CUDA EP #12814 makes hipify extremely slow and breaks the building. This PR fixes it by c

The onnxruntime/contrib_ops/rocm/bert/attention.h is checkout-ed from the version before #12814 and manually hipify-ed.
Slightly extend amd_hipify.py to allow wildcard file match and exclude all `tensorrt_fused_multihead_attention/*` files from hipify
2022-09-19 15:29:23 +08:00
Changming Sun
e02bea2e3f
Fix some warnings (#12918) 2022-09-18 10:55:33 -07:00
Baiju Meswani
4ed5a5b2a8
Disable local versions based on environment variable (#12997) 2022-09-16 22:51:18 -07:00
Yufeng Li
b48f71fcfc
fix bug: quantization shape inference (#12983)
model path for onnx.shape_inference.infer_shapes_path and the external
data needs to be under the same directory as doc here:
f4dea9e68b/docs/PythonAPIOverview.md (shape-inference-a-large-onnx-model-2gb)
2022-09-16 10:17:22 -07:00
Wei-Sheng Chin
1a684152cc
Fix C6011: dereferencing NULL pointer with_data (and external_data) (#12982)
As title. For pattern like
```cpp
foo(*ptr)
```

we change them to
```cpp
if (ptr)
  foo(*ptr)
else
  throw
```
2022-09-16 09:49:36 -07:00
Wei-Sheng Chin
12aab3c01d
Fix TSA warnings (#12950)
Fix two warnings:
1. Warning: Avoid calling new and delete explicitly, use
std::make_unique<T> instead (r.11).
   Fix: new is replaced by creating unique_ptr and unique_ptr.release
delete is replaced by unique_ptr.reset and unique_ptr's destructor.
2. Warning: Buffer overrun while writing to 'cpu_buffers_info->buffers':
the writable size is 'buffers.public: unsigned __int64 __cdecl
std::vector<void \*,class std::allocator<void\*> >::size(void)const ()
\* 8' bytes, but '16' bytes might be written.
Fix: Replace void* with cudaStream_t and void** with
std::vector<cudaStream_t>.
2022-09-16 09:43:48 -07:00
Adam Louly
268bfe2a5d
python training api bindings (#12610)
**Description**: **Python API Bindings for on device training. **
**Motivation and Context**
- This PR contains api bindings so python users can perform a whole
training loop.

Co-authored-by: Adam Louly <adamlouly@microsoft.com@orttrainingdev7.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
Co-authored-by: Baiju Meswani <bmeswani@microsoft.com>
2022-09-16 09:38:24 -07:00
Alexey Gladyshev
2b5b11d373
[C#][TVM EP] Fix issues related to using TVM EP in C# front-end (#12958)
Changes in this PR:
* Update building of Nuget package for TVM EP
* Update of documentation  for using TVM EP in C#
2022-09-16 16:04:59 +02:00
Jake Mathern
85546255c4
make nhwc transformer only apply to CPU ep. (#11882)
QLinearConv does not work with DML EP because this optimizer intended for CPU EP is wrongfully applied to it.

Limit NHWC optimizer to nodes assigned to the CPU EP
2022-09-16 18:46:28 +10:00
sumitsays
ab45ac311f
Merge pull request #12980 from microsoft/WindowsAI
[DML EP] Merge ORT/WindowsAI to ORT/main
2022-09-15 22:24:14 -07:00
Pranav Sharma
b935524e22
Revert reverse setup of allocators + create/register allocator in CPU EP only when needed. (#12954)
* Revert reverse setup of allocators + create/register allocator in CPU EP only when needed.
2022-09-15 17:54:32 -07:00
Faith Xu
94d9e9ad6d
[Issue labeler] Separate out C# api as separate label (#12951)
Separate out C# api as separate label
2022-09-15 17:36:57 -07:00
sumitsays
709254949a
DML EP temporarily fall back to CPU for LayerNorm when Bias is not present (#12987)
* Temporarily fall back to CPU for LayerNorm

* Build fix

* Typo

* TYPO

Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
2022-09-15 16:13:18 -07:00
Ye Wang
3c427a8946
Fix an arithmetic overflow warning (#12961) 2022-09-15 15:53:57 -07:00
Tang, Cheng
739b5675c8
remove legacy compile api (#12932)
Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-09-15 13:18:40 -07:00
Changming Sun
203f63c224
Publish WinML Nuget package to ORT-Nightly ADO feed (#12904) 2022-09-15 12:10:27 -07:00
Sumit Agarwal
9f6646f11d Merge branch 'master' into WindowsAI 2022-09-15 10:55:08 -07:00
sumitsays
363c695dad
Update DML 1.9.0 to 1.9.1 (#12966)
Update DML to 1.9.1

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>
2022-09-15 10:54:22 -07:00
Yi Zhang
08af88e3e2
Assign generate document job to CPU pool. (#12973) 2022-09-15 10:42:12 -07:00
PeixuanZuo
647e09cc39
[FIX] skip layer norm for ROCm EP (#12803)
* [FIX] fix skiplayernorm
2022-09-15 09:07:37 -07:00
cloudhan
d2aa2109c0
Make TunableOp follow stream semantics (#12856) 2022-09-15 21:11:27 +08:00
Cheng
248f72e972
fix VC++ Static Code Analysis warnings (#12940)
* fix VC++ Static Code Analysis warnings

* fix warning
2022-09-15 16:33:13 +08:00
cloudhan
10f9a69707
Use CMake EXCLUDE_FROM_ALL for composable kernels to avoid building of conv related kernels (#12855) 2022-09-14 22:11:31 -07:00
Chun-Wei Chen
d819b56fba
Consume ONNX 1.12.1 to prevent vulnerability issue while loading external file (#12915)
* consume ONNX 1.12.1 to prevent vulnerability issue while loading external tensors

* update ONNX 1.12.1

* test updated PR

* use official rel-1.12.1 commit
2022-09-14 21:10:24 -07:00
PeixuanZuo
3f456a1847
[Update] update rocm5.2.3 (#12942)
* [Update] update rocm5.2.3

* [Update] use rocm docker image as base
2022-09-15 10:41:49 +08:00
Cassie Breviu
5099dda42f
Lint updates csharp docs (#12962)
* fix lint issues on docfx.vendor.js file

* fix ci

* remove submodule

* fix ci

* Update var name to AcceptedList

* remove test branch from ci
2022-09-14 17:56:41 -05:00
Dmitri Smirnov
bc2df1bf95
Remove previously deprecated API (#12935)
Remove previously deprecated API
Format JS code, address review comments
NPM Formatting
2022-09-14 10:58:03 -07:00
Yi Zhang
1ef1029163
Skip 2 tests in windows gpu workflow (#12956) 2022-09-14 09:43:38 -07:00
cloudhan
b8e34fbd91
Split topk implementation into per-type translation units to speed up compilation (#12861) 2022-09-14 19:36:54 +08:00
Vincent Wang
da07c83948
SoftmaxCrossEntropyLossInternalGrad and Sum Fusion (#12746)
* fuse scegrad and sum

* add yield output shapes to value_info

* resolve comments

* fix merge main
2022-09-14 14:45:51 +08:00
Dwayne Robinson
568950e28c
Warn on node EP silent fallback from preferred provider (#10831)
* Warn on node EP fallback from preferred provider
* Clarify with comment
* Update to ORT's weird coding style for ragged parameter wrap
* Android build error: unused parameter ‘providers’
* Update logic to be more robust
* Updates from Pranav's feedback about messaging to rerun with verbose and respecting explicit vs implicit EP addition. Also merge from main.
* brace style patch up
* Update with feedback from Pranav and Scott McKay
* Restore node_placement_set after realizing it only applies when is_verbose is true
* Fix build warning on Android
* Renamed to node_placement_provider_set per Pranav's suggestion
2022-09-13 15:53:17 -07:00
Yulong Wang
78bc53f91d
fix prefast:Warning C26814 in non_max_suppression.cc (#12934) 2022-09-13 15:22:55 -07:00