Commit graph

6129 commits

Author SHA1 Message Date
Chih-Hsuan Yen
4e73cc83d6
Fix building DNNL EP with clang (#10014)
Before this change, building DNNL EP from onnxruntime 1.10.0 with clang fails with:

In file included from /build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/dnnl/subgraph/dnnl_squeeze.cc:4:
In file included from /build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/dnnl/subgraph/dnnl_squeeze.h:5:
In file included from /build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/dnnl/subgraph/dnnl_subgraph.h:10:
In file included from /build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/shared_library/provider_api.h:19:
In file included from /build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/common.h:36:
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:33:6: error: call to function 'operator<<' that is neither visible in the template definition nor found by argument-dependent lookup
  ss << t;
     ^
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<std::vector<long>>' requested here
  MakeStringImpl(ss, args...);
  ^
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<const char *, std::vector<long>>' requested here
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<long, const char *, std::vector<long>>' requested here
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<const char *, long, const char *, std::vector<long>>' requested here
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:39:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<unsigned long, const char *, long, const char *, std::vector<long>>' requested here
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:46:3: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<const char *, unsigned long, const char *, long, const char *, std::vector<long>>' requested here
  MakeStringImpl(ss, args...);
  ^
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/make_string.h:93:18: note: in instantiation of function template specialization 'onnxruntime::detail::MakeStringImpl<const char *, unsigned long, const char *, long, const char *, std::vector<long>>' requested here
  return detail::MakeStringImpl(detail::if_char_array_make_ptr_t<Args const&>(args)...);
                 ^
/build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/dnnl/subgraph/dnnl_squeeze.cc:46:7: note: in instantiation of function template specialization 'onnxruntime::MakeString<char [20], unsigned long, char [23], long, char [9], std::vector<long>>' requested here
      ORT_ENFORCE(data_dims[i] == 1, "Dimension of input ", i, " must be 1 instead of ", data_dims[i],
      ^
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/common/common.h:184:64: note: expanded from macro 'ORT_ENFORCE'
                                                ::onnxruntime::MakeString(__VA_ARGS__)); \
                                                               ^
/build/python-onnxruntime/src/onnxruntime/include/onnxruntime/core/framework/tensor_shape.h:147:15: note: 'operator<<' should be declared prior to the call site
std::ostream& operator<<(std::ostream& out, const TensorShape& shape);
              ^
1 error generated.
make[2]: *** [CMakeFiles/onnxruntime_providers_dnnl.dir/build.make:384: CMakeFiles/onnxruntime_providers_dnnl.dir/build/python-onnxruntime/src/onnxruntime/onnxruntime/core/providers/dnnl/subgraph/dnnl_squeeze.cc.o] Error 1

Two-phase lookups fail as:

1. visible in the template definition - fails as `std::ostream& operator<<(std::ostream& out, const TensorShape& shape)` (from include/onnxruntime/core/framework/tensor_shape.h) is defined after `template <typename... Args> std::string MakeString(const Args&... args)` (from include/onnxruntime/core/common/make_string.h) as per `clang++ -E`
2. argument-dependent lookup - fails as the argument data_dims has type `std::vector<long>` (via typedef in dnnl.hpp), while `std::ostream& operator<<(std::ostream& out, const TensorShape& shape)` is in namespace onnxruntime instead of std

There are several possible fixes:

* Make operator<< appear before MakeString by adjust the order of header files - I consider it fragile
* Also define operator<< in namespace std - may results in namespace pollution
* Use an argument of a class in onnxruntime namespace - this commit
2021-12-15 17:08:57 -08:00
Valery Chernov
b327e89efa
Standalone TVM Executor Provider (#10019)
* squashed commit for standalone tvm execution provider

* critical fix for correct python build with stvm ep

* get tuning log file from ep options. It has priority over AUTOTVM_TUNING_LOG

* updates and fixes

* update parsing of stvm provider options

* add support of external data for onnx model

* add conditional dump of subgraphs

* remove unused code

* get input tensor shapes through provider options. get output shapes for fixed input ones by TVM API

* support AUTO_TVM tuning log file inside ORT. Selector for Ansor and Auto_TVM is provider option (tuning_type)

* add fp16

* add functionality of conversion of model layout to NHWC if need. Necessary parameter was added to STVM provider options

* fix license text in header. fix log format

* small fixes

* fix issues from flake8

* remove model proto construction from GetCapability

* reserve memory for vector of DLTensors

* add simple tutorial for STVM EP

* STVM docs

* jroesch/tvm -> apache/tvm

* remove dead code, unneccessary logs and comments

* fix in readme

* improve tutorial notebook

* tvm update

* update STVM_EP.md

* fix default value

* update STVM_EP.md

* some TODOs for the future development

* shorten long lines

* add hyperlink to STVM_EP.md

* fix Linux CI error

* fix error in csharp test

Co-authored-by: Jared Roesch <jroesch@octoml.ai>
Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
Co-authored-by: KJlaccHoeUM9l <wotpricol@mail.ru>
2021-12-15 16:59:20 -08:00
George Wu
16274beb6f
update TensorRT EP to use TensorRT 8.2 (#9981)
* update base image from 11.4.0 to 11.4.2

* update Linux TRT GPU pipeline to TRT 8.2

* update onnx-tensorrt to 8.2-GA

* disable failing TensorRT 8.2 tests.

* update pad test.

* fix

* update win trt ci pipeline to trt 8.2

* test run with cuda 11.4 and cudnn 8.2

* increase timeout

* revert

* revert

* update packaging pipelines to use trt 8.2

* fix typo

* update trt gpu perf pipeline to trt 8.2

* increase timeout

* delete deprecated ci-perf-pipeline.yml

* bump timeout

* adjust timeout packaging
2021-12-15 15:59:31 -08:00
Yufeng Li
ee975de77b
reorganize quantization files (#10023)
* reorganize quantization files
2021-12-15 15:45:04 -08:00
Edward Chen
6cdab06255
Enable argument files in build.py. (#10040) 2021-12-15 08:22:15 -08:00
Changming Sun
20f8a06f1f
Remove OpenMP code (#10032) 2021-12-15 00:58:42 -08:00
jingyanwangms
8043a9facc
Bump master version to 1.11 (#9957)
* Bump master version to 1.11

* Update Windows AI version

* update version in onnxruntime_c_api.cc
2021-12-14 23:32:06 -08:00
Changming Sun
91096781c3
A small fix to allocators (#10042) 2021-12-14 21:21:07 -08:00
Changming Sun
9d9ebd3b85
Fix some static analysis warnings in the core framework (#10033) 2021-12-14 14:41:42 -08:00
Changming Sun
e0a0f385bb
Fix some warnings in mlas (#10034) 2021-12-14 14:41:11 -08:00
ashari4
af71da0ac6
Yield op supports bf16 (#10035) 2021-12-14 13:12:37 -08:00
Ye Wang
703becd796
Fix a bug in fusion_embedlayer.py (#10022) 2021-12-14 12:50:35 -08:00
Ginés Hidalgo
5be0fa13c0 [DML] Fixed huge bug in ORT_NO_EXCEPTIONS for DML back end, the check is reversed 2021-12-14 10:17:06 -08:00
ashari4
9e04b7e59b
Remove memcpy in in-place ATen ops (#9913)
* Make ops in-place

* Add comment
2021-12-14 08:28:12 -08:00
Vincent Wang
a7c2d1cb09
bf16 for dlpack (#10016) 2021-12-14 13:34:14 +08:00
Chen Fu
cd0af7ad44
Symmetric quantized convolution kernel ARM64 (#9772)
Adding a symmetric quantized convolution kernel for ARM64

Note:
Indirect conv performs worse for shallow convs (input channels are small). This is much more so for low end pre-dot CPUs, where only 128 or deeper conv is faster with indirect conv. With DOT-CPUs, 32 deep conv is already faster

Co-authored-by: Chen Fu <fuchen@microsoft.com>
2021-12-13 21:14:45 -08:00
Suffian Khan
7e55a942cd
Add torch 1.10 requirements for rocm (#10028) 2021-12-13 20:39:58 -08:00
Sunghoon
6de2a878cb
[js/react_native] Fix a broken manual build (#10012)
* Fix a broken manual build

* Keep the same file structures
2021-12-13 19:02:10 -08:00
Changming Sun
7b63d1102b
Fix some warnings in orttraining code (#10009) 2021-12-13 15:28:21 -08:00
Gani Nazirov
c82160bbd0
Add AtenOp at:bitwise_or (#9662)
* Add AtenOp at:bitwise_or

* Specify overload name for bitwise_or

* undo unnecessary import

* set output element type to BOOL

* Add broadcasting support

* Fix test

Co-authored-by: Gani Nazirov <ganaziro@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Gani Nazirov <ganaziro@microsoft.com>
2021-12-13 14:36:15 -08:00
Rajalakshmi Srinivasaraghavan
ad99dff298 POWER10: Update builtins for DGEMM
This patch changes builtin names in DGEMM based on endianness order.
Also changing some casting style in SGEMM and DGEMM code for POWER10.
2021-12-13 21:43:01 +00:00
Edward Chen
5d821b5bd9
Address null dereference warning in div_grad_impl.cu. (#10010) 2021-12-13 13:26:56 -08:00
Abhishek Jindal
777a80fbc1
Abjindal/eager onnx operators fix (#9968)
* adding view operator changes

* adding the slice operator definition

* moving to opgen script for slice op and removing redundant steps in view op and reshape_copy

* adding for at definition

* adding for at::infer_size definition

* changing template style for reshape_copy to ensure int64_t type
2021-12-13 13:23:46 -08:00
George Nash
d0b08af37a
Implementation of QAttention for the DNNL execution provider (#10004)
* Add QAttention to DNNL EP

Add QAttention to DNNL EP (limited support and disable for gpu)

update ONEDNN version to 2.4.4

bug fix in getcapability

add memory debug print

Signed-off-by: Wang <zhaoyang.wang@intel.com>

* Address Code Review + MatMulInteger Fix

clean up code and add comments

fix matmulinteger and add fusion rule to enable initialized vector weight zero
points of 0s

update DNNL_TAG to v2.5

Signed-off-by: Wang <zhaoyang.wang@intel.com>

* Linux Compile Fix + rollback ONEDNN to 2.4.4

Signed-off-by: Zhaoyang Wang <zhaoyang.wang@intel.com>

* Fix QAttention Debug build

Signed-off-by: Wang <zhaoyang.wang@intel.com>

* Fix QAttention build if USE_DNNL not specified

Signed-off-by: George Nash <george.nash@intel.com>

Co-authored-by: Wang <zhaoyang.wang@intel.com>
Co-authored-by: MTC <63478620+jeyblu@users.noreply.github.com>
2021-12-10 21:50:13 -08:00
Zhang Lei
787755328b
Add s8s8 for depthwise qconv 3x3 5x5 (#10008)
* Add depthwise conv s8s8 routine for 3x3 5x5 on arm64. And its testcase.

* fix some comments.
2021-12-10 17:52:51 -08:00
Nat Kershaw (MSFT)
b4434c7694
Automate generation of C/C++ API docs (#9997) 2021-12-10 17:45:50 -08:00
Zhang Lei
b000ec91cc
Add quantization tool and its unittest with s8s8 support (#10007)
* Add quantization tool with s8s8 support
  * Add unittest for existing s8s8 support operators
  * Comment ready unittest for upcomming s8s8 operator (ConvInteger, and Resize)
  * Minor change on quantization tools

* Use different s8 min value upon weight or activation.

* use same qmin for reduce ranged s8.
2021-12-10 16:40:01 -08:00
Changming Sun
7a70d22150
Change some const to constexpr in unit tests code(#10002) 2021-12-10 12:26:59 -08:00
Yufeng Li
ffdafb2012
add fallback of s8s8 support on x64 (#9995)
* add fallback of s8s8 support on x64
2021-12-10 11:33:19 -08:00
Yi-Hong Lyu
3c79f3055f
Weaken x86.get_pc_thunk for NDK <= r22 (#9994)
Otherwise there is multiple definition of '__x86.get_pc_thunk.bx'
2021-12-10 01:30:26 -08:00
Ryan Hill
343a76945b
Fix some documentation errors plus ones generating doxygen warnings (#9993) 2021-12-09 17:42:34 -08:00
Chi Lo
4669048b47
Handle compiler warnings for TRT EP (#9956)
* fix error C4996

* remove wd4996 and fix error C4966

* fix typo

* remove wd4996 for onnx-tensorrt

* remove more /wd for onnx-tensorrt

* gix bug for strncpy_s of (Buffer is too small && 0)

* fix code to remove warning 4244

* fix code to remove warning 4267

* remove /wd4267 /wd4244

* fix bug

* change int to size_t

* using size_t instead of int

* use float instead of double

* Use size_t instead of int

* use size_t instead of int

* use size_t instead of int. Also fix typo
2021-12-09 15:33:52 -08:00
Ryan Hill
e0960d7d79
Change assert on a null value to an ort_enforce (#9982) 2021-12-09 14:44:58 -08:00
Yulong Wang
b9909f985e
[js/web] rename build-def.ts to build-def.d.ts (#9954) 2021-12-09 14:17:42 -08:00
Sunghoon
c7e8365e1f
Resolve security issue reported by dependabot (#9983) 2021-12-09 13:45:56 -08:00
Yufeng Li
2fdcaffbb7
add missing test files (#9989) 2021-12-09 13:25:15 -08:00
Edward Chen
41fd745996
Fix build error when using '--build_minimal extended' and '--build_wheel' build.py options. (#9979) 2021-12-09 10:01:35 -08:00
Dmitri Smirnov
a7abd541c7
Correct message type (#9973) 2021-12-09 10:00:44 -08:00
Xavier Dupré
42c176b60c
Update default opset to 14 in ORTModule (#9743)
* update to torch 1.10
* update torchvision version
* update torchtext version
* remove deprecated option enable_onnx_checker
* add unit test to test gradient of GatherElements
* add ORTMODULE_ONNX_OPSET_VERSION in a docker file
2021-12-09 12:45:35 +01:00
Yufeng Li
bc0f2d173a
enable s8s8 QDQ fusion on ARM (#9961)
* enable s8s8 QDQ fusion on ARM devices
2021-12-08 18:13:13 -08:00
Martin Hořeňovský
cd552e1bda Add build.py option for disabling memleak checker
The memleak checker used by default in Debug configuration does not
play nice with embedding static lib of ONNXRuntime into binaries,
because other code will not be using the same debug heap, leading
to trouble.

This makes it easier for outside builders to disable it for their
build.
2021-12-09 01:39:09 +00:00
Nick Kreeger
051d005926
Fix build warnings with VS 2022 (#9967) 2021-12-08 16:43:46 -06:00
Yufeng Li
0c72f1cd5a
add copyright (#9943) (#9970) 2021-12-08 14:34:53 -08:00
Sunghoon
35cf8b8725
[js/react_native] npm audit fix (#9876)
* add p50 in test

* Audit fix for react native

Co-authored-by: Yulong Wang <yulongw@microsoft.com>
2021-12-08 13:27:31 -08:00
Tang, Cheng
0adeb86bfd
Fix ortmodule for the pytorch model with ort device (#9927)
* add ortmodule and eager mode test

* add ortmodule dependency

* convert between aten ort tensor and ortvalue

* register the EP to ortmodule using ort device information

* remove duplicated test

* remove useless dependency

* handle half precision type for ortmodule outputs

* adjust the tensor conversion python code

Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2021-12-08 13:04:29 -08:00
Patrik Vavercak
fb30e9fdae
Remove /safeseh link option from non-msvc builds (#9744) (#9935) 2021-12-08 11:44:00 -08:00
Ye Wang
9e7d52a801
Update parity_check_helper.py (#9884) 2021-12-08 10:51:46 -08:00
Yi-Hong Lyu
f60a287a64
Add __x86.get_pc_thunk.bx to avoid dependency (#9955) 2021-12-08 04:50:41 -08:00
Dmitri Smirnov
a7f649db7c
Enable proper override using MIMalloc (#9944)
Redirect memory allocations to MiMalloc and advance its version to v2.0.3
Refactor for a universal ifdef
2021-12-07 17:56:58 -08:00
Guoyu Wang
b34b991aea
Improve reduced ops and types build (#9908)
* Improve reduceops and types build

* minor update

* fix test error

* fix minimal build break

* minor update and add comments

* Address CR comments
2021-12-07 13:02:05 -08:00