Commit graph

6719 commits

Author SHA1 Message Date
Sheil Kumar
85fa168dc1
Add optional dft_length input to the DFT and IDFT operators. (#11427)
* Add optional dft_length input.

* CR Feedback

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2022-05-03 16:17:43 -07:00
Tang, Cheng
ae043e3963
Support ort device tensor in ortmodule's inference (#11112)
* support ort device tensor in ort module inference

* fallback aten equal to cpu; add ortmodule inference test case

* fix python format

Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-05-03 14:28:30 -07:00
RandySheriffH
8d69b9398b
APIs for custom op to invoke ort operator directly (#10713)
* draft kernel creation

* setup eager context

* call into kernel in eager mode

* redefine test case

* refact eager context

* add comment

* remove header

* rename argument

* redefine API definition with types

* list outputs as argument

* switch to int to represent length

* fix compile err

* create attribute API

* add test case for topk

* remove bool from c api

* add gru test case

* remove var

* fix compile warnings

* rename status

* fix compile err

* exclude sparse tensor

* fix comments

* fix comments

* fix build err

* rename file and move location

* format code

* move file to session folder

* fix comments

Co-authored-by: Randy <Randy@randysmac.attlocal.net>
2022-05-03 14:16:30 -07:00
Yulong Wang
a3e38d7c90
[js] upgrade async@3.2.3 /js/web/ (#11426) 2022-05-03 14:04:22 -07:00
Changming Sun
253c8b41ed
Move some of the transpose kernel code to onnxruntime_framework.lib (#11380)
* Move some of the tranpose kernel code to onnxruntime_framework.lib

* Fix C4244 warnings in the tranpose code

* Rename IsMovingSingleAxis to IsTransposeMovingSingleAxis
2022-05-03 14:03:50 -07:00
Yulong Wang
308b605047
[wasm] increase timeout for Web Assembly static lib CI (#11306)
* [wasm] increase timeout for Web Assembly static lib CI

* update config format
2022-05-03 11:29:40 -07:00
Yulong Wang
d306e00351
[js/rn] set minSdkVersion to 21 for ORT-RN Android (#11403) 2022-05-02 19:36:41 -07:00
Changming Sun
5023f6750b
Revert "Call pluggable EP's shutdown function in Environment::~Environment() (#11120)" (#11393)
This reverts commit 4983d6e5d6. We can't destroy OrtEnv through python's atexit function, because at that time there might be many other ORT python objects alive.
2022-05-02 14:38:31 -07:00
Tianlei Wu
92cc1b4542
Update GPT2 notebook (#11371) 2022-05-02 12:27:48 -07:00
G. Ramalingam
024747bff4
Allow int32 as shape type (#11345)
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
2022-05-02 10:10:30 -07:00
Olivia Jain
49d7050b88
Create Checkout Submodules Script (#11344)
* move all logic for ubuntu dockerfiles

* pass in trt version

* update trt 8.0 file

* downgrade protobuf

* uncomment

* and

* change to 8.0

* update dockerfiles

* checkout protobuf based on version

* adding last dockerfile:
:

* checkout 3.10 protobuf

* fix checkout version

* update to 8.2

* keep only one submodule sync

* cleanup

* Delete Dockerfile.custom-trt-perf

* create checkout submodules script

* properly compare decimals in bin/sh

* combine build ort paths

* deprecate TRT 7.2

* only checkout protobuf if we checkout older onnx-tensorrt

* only pull nvidia container if true, update image

* downgrade protobuf only if we checkout onnx-trt

* Update linux-gpu-tensorrt-daily-perf-pipeline.yml for Azure Pipelines

* Update linux-gpu-tensorrt-daily-perf-pipeline.yml for Azure Pipelines

* Add quotes to avoid path splitting

* address shellcheck

* use shellcheck suggestions
2022-04-29 13:04:26 -07:00
Olivia Jain
80a950cde1
Create OV EP Signing Pipeline (#11391)
* Create new pipeline to sign ov ep binaries

* make codesign available

* make codesign available

* Update sign_ov_ep_binaries.yml for Azure Pipelines

* Update sign_ov_ep_binaries.yml for Azure Pipelines

* add codesign task

* Update sign_ov_ep_binaries.yml for Azure Pipelines

* Update sign_ov_ep_binaries.yml for Azure Pipelines

* windows

* reduce timeout to 15 minutes
2022-04-29 10:54:37 -07:00
Tang, Cheng
4b875e3543
Re-implment the function support in onnxruntime (#11167)
* initial fix

* refactor the function handle

* update the implementation

* fix linux build break

* fix training build

* fix minmal build

* fix gradient checker

* deprecate the local function members in graph. host it in model

* fix changming's comments

* fix comments about inlined containers

* fix a missed inlined container

* fix training build

* avoid const for std string_view

Co-authored-by: Cheng Tang <chenta@microsoft.com>
2022-04-29 10:15:58 -07:00
Edward Chen
e194a01787
Update SafeInt version. (#11379) 2022-04-28 10:51:59 -07:00
Adrian Lizarraga
11e681f46a
[ep-perf] Fix the order of onnx and onnxruntime imports. (#11383)
Fix the order of onnx and onnxruntime imports. Importing onnx before onnxruntime causes a dependency issue in the tensorrt containers that prevents onnxruntime_pybind11_state.so from finding the system libstdc++. This is a workaround to get the EP Perf pipeline working until we can investigate the issue more closely.

Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
2022-04-28 10:32:39 -07:00
Edward Chen
c6a3c149de
Fix formatting. (#11386) 2022-04-28 08:55:35 -07:00
mindest
c8270c2940
Add ATen export and gradient for torch.max/min (#11275)
* add aten export for max, max.dim

* rewrite grad of max (no dim); add cases for min

* update UT cases

* mod sym shape infer

* resolve comments: shape infer, add comments, etc.

* add test for torch.max of two tensors

* resolve peng's comments: keepdim; test case

* correct python format

* fix recently introduced lint error
2022-04-28 17:30:33 +08:00
Vincent Wang
1c64351e09
Create Tensor with Strides (#11294)
* create tensor with strides

* resolve comments

* refactor

Co-authored-by: Vincent Wang <weicwang@microsoft.com>
2022-04-28 16:49:37 +08:00
PeixuanZuo
6f218105ed
[FIX] amd ci pipeline timeout (#11387) 2022-04-28 14:32:36 +08:00
Scott McKay
833ded4b0e
Update setup.py to include config files used by model analysis in wheel. (#11381)
* Update setup.py to include config files used by model analysis in wheel.
2022-04-28 16:13:26 +10:00
Mina Asham
6cd1931a93
Specify list/map capacity when initializing where possible (#11110)
* Specify list/map capacity when initializing where possible

- This really depends on the use case, but in some cases the array/map resizing can be slightly costly, there is effectively no downside setting the initial capacity for a collection if we know for sure its final size

* Supply list/map capacity when initializing where possible

- This really depends on the use case, but in some cases the array/map resizing can be slightly costly, there is effectively no downside setting the initial capacity for a collection if we know for sure its final size
- Introduce an extra utility to help creating maps with expected capacity

* Move utility function to OrtUtil and drop MapUtil, also add Java doc to method

* Move test to the right class
2022-04-27 20:59:18 -07:00
Edward Chen
87a628a602
[NNAPI EP] Add support for PRelu op (#11303)
* Add OpBuilder/OpSupportChecker handling of PRelu.

* Register OpBuilder/OpSupportChecker for PRelu.
2022-04-28 12:31:17 +10:00
Ryan Hill
9e7753c109
Speed up GatherElements CPU Op (#11349)
* Specialize element copy by element size
2022-04-27 17:57:56 -07:00
Justin Chu
d64769c38e
Set black's target version (#11370)
Description: Set black's target version to be py37 - py310

Motivation and Context

Black by default targets its format for py3.10. Since our project supports python 3.7, we need to target version to all the python versions supported.

Re-ran black. 13 files reformatted.
2022-04-27 14:52:19 -07:00
Justin Chu
f6526af23d
Add LGTM config for c++ and c# (#11365)
Add LGTM config for c++, cs and java so that it can successfully built by lgtm.
2022-04-27 10:51:40 -07:00
Edward Chen
20ee399be4
Include layout transformation ops in extended minimal build and above. (#11355) 2022-04-27 10:31:02 -07:00
Olivia Jain
88ff48910d
Perf Bug Fix: Keep First Run for Random Input (#11366) 2022-04-27 09:17:49 -07:00
Dmitri Smirnov
a7d0158c24
Introduce a way to disable Abseil library (#11353)
Introduce a way to disable Abseil library.
Use cmake extra args, no new build switch.
2022-04-27 08:57:52 -07:00
Scott McKay
63d4f45186
Add stub implementation of the NNAPI interface (#11288)
* Add stub implementation of the NNAPI interface so that model builder code can be unit tested on all platforms.

Needed to fix a lot of type mismatch warnings. As these don't occur on Android builds used static_cast for simplicity.
2022-04-27 15:39:09 +10:00
Magnus1cheng
a937920e24
Update sequence_op.h (#11361)
Fix incorrect cudaMemcpyAsync kind in ConcatFromSequence Op.
2022-04-26 18:33:32 -07:00
Justin Chu
cbc7bd1d2a
Introduce parameterized as a dev dependency (#11364)
Introduce parameterized as a dev dependency to allow for parameterized test cases.

E.g.
fae8e8cabf/test/datasets/test_sst2.py (L71-L86)
2022-04-26 17:24:39 -07:00
Rachel Guo
14a2b2518e
[NNAPI QDQ] add qdq gemm/matmul op support (#11089)
* wip 1

* wip

* wip

* wip

* wip supported

* wip

* wip

* fix bias shape

* wip

* wip

* add gemm to binary op support checker

* op builder change

* add gemm bias handling

* update

* modify and add additional checks

* support matmul

* modify qdq matmul test case to make inputs an initializer

* support matmul test case pass

* modify several helper methods

* minor variable modify

* TestQDQGemm UT pass

* fix UT test pass

* uncomment minor fix

* fix build

* remove unnecessary line

* update to QDQMatMul tests

* add check to addinitializerstoskip

* address comments

* minor update

* update bool -> const bool

* update

* add tests and other minor update

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
2022-04-26 14:29:26 -07:00
Justin Chu
4ec5fe5c8a
Github action: Inline lint python / js / cpp (#11328)
Uses the reviewdog action which supports inline reporting.
2022-04-26 14:17:28 -07:00
Chi Lo
0292356bd7
TensorRT EP engine cache serialization/deserialization refactor (#11045)
* Code refactor

* fix bug

* modify comment

* modify test for the new ORT TRT cache behavior

* update comment

* rename variable

* fix bug for not having trt context

* Custom parameters (#10964)

* get inputs independently for trtexec

* track one process only

* remove engine and profile files

* change time to commit time

* add runtime option for io binding

* move to commit date

* fixes

* add option for graph optimization

* cleanup docker script

* note second time creation

* allow for parameters to be configured from pipeline at runtime

* uncomment

* include optional arguments at runtime

* post second session creation

* update cmake version

* Revert "update cmake version"

This reverts commit 09a1364eae68610724c8e90eeea777b7ee03f74b.

* Move data format import

* Perf FasterRCNN + MaskRCNN (#11102)

* add faster mask

* fix paths

* add a test scenario that - if engine cache is present, trt ep should load the engine cache and run inference

* Revert "Merge branch 'trt_cache_refactor' of https://github.com/microsoft/onnxruntime into trt_cache_refactor"

This reverts commit 8edc574de1ea6055534f33a57b9365c721c2eb29, reversing
changes made to 0c92e5b2b1d453527001fe731ed4ccfc79e6adad.

Co-authored-by: Olivia Jain <oljain@microsoft.com>
2022-04-26 11:07:48 -07:00
Hariharan Seshadri
81d78706fe
Add location planning logic for implicit inputs which are graph inputs (#11320) 2022-04-26 10:39:48 -07:00
Justin Chu
fdce4fa6af
Format all python files under onnxruntime with black and isort (#11324)
Description: Format all python files under onnxruntime with black and isort.

After checking in, we can use .git-blame-ignore-revs to ignore the formatting PR in git blame.

#11315, #11316
2022-04-26 09:35:16 -07:00
Yi Zhang
13f86e7d56
print mac agent info (#11338) 2022-04-26 09:27:55 +08:00
Changming Sun
aaa583e776
Refactor the model tests code in onnxruntime_test_all.exe (#11300)
Update the code to use OrtApis instead of the old onnxruntime::InferenceSession class. Mainly because the old one doesn't support custom op. We are trying to convert some EPs to custom ops. Hopefully they can continue to leverage this test set.
2022-04-25 11:52:51 -07:00
Justin Chu
6fb29f5b9a
Add python docstring linting in vscode settings (#11316)
Add python docstring linting in vscode settings
Use black and isort for python code formatting in VScode. Import sorting enabled on save. Code formatting available in VSCode with manual trigger.
Adopted from pytorch https://github.com/pytorch/pytorch/blob/master/.vscode/settings_recommended.json
2022-04-23 06:23:04 -07:00
Yi Zhang
532e2536cc
increase timeout in PR build (#11319)
* increase timeout

* show mac agent info

* Revert "show mac agent info"

This reverts commit a646ebefff8940a3044f1984107856db33319eb8.

* increase timeout in PR test
2022-04-23 16:01:21 +08:00
Adrian Lizarraga
f069951835
[trt-perf-test] Pass TensorRT/CUDA EP options via dictionary argument (#11231)
* Enable users to pass a dictionary of TensorRT and CUDA EP options to the EP perf benchmark.py script.
* Post specified EP options to database.
2022-04-22 11:22:25 -07:00
Yi Zhang
ba1e9a218e
increase timeout (#11310) 2022-04-22 13:55:04 +08:00
Ye Wang
daf87fd0dd
specify the path for gpt2_helper in onnx_exporter.py (#11301) 2022-04-21 21:01:40 -07:00
Hariharan Seshadri
23b01258b5
Fix how the output tensor is created in CUDA SpaceDepth ops (#11302) 2022-04-21 19:58:57 -07:00
Olivia Jain
86cdabbcfd
Add OpenVINO Pipeline Status to README (#11299)
* update ov pipeline definition ID

* Update ov build status
2022-04-21 15:59:50 -07:00
Edward Chen
4d0214f851
Move Contains() helper function to a higher common.h. (#11289) 2022-04-21 09:31:48 -07:00
Gary Miguel
7aa4af238a
Add strict_shape_type_inference config option (#11081)
Prior to this, certain shape and type errors were surfaced only when
the model was using the latest known op set version.

Providing users an explicit option allows for better testing of code
that produces models, which includes unit tests within this repo and
other repos such as the TF-ONNX and PT-ONNX converters.

Remove the previous behavior which seems quite counter-intuitive:
an otherwise identical model with a later op set version should be treated
identically in this regard.

The option defaults to false to avoid causing errors for users that
rely on the previous permissive behavior.

Turned on the strict enforcement by default in OpTester, which revealed a few
disagreements between ORT and ONNX on what the correct output shape should
be.

Fix shape inference bug in ReduceSumTraining with noop_with_empty_axes=1
which was revealed.

Fix TensorOpTest.Unsqueeze_scalar, which was testing negative axes on an
op set version where the op did not actually support negative axes.

Fixes #9506.
2022-04-21 08:32:40 -07:00
Scott McKay
c5de493a8a
Exclude EPs that aren't available on mobile to try and fix Xamarin build error on M1. (#11267) 2022-04-21 07:01:46 +10:00
Edward Chen
4854a09340
Consolidate utils::ToTensorProtoElementType, TypeToDataType, and data_types_internal::ToTensorDataType. (#9824) 2022-04-20 12:45:53 -07:00
Changming Sun
2cacd18d51 Fix an SAL annotation error 2022-04-20 12:02:30 -07:00