Commit graph

4632 commits

Author SHA1 Message Date
Jesse Benson
be79575c6a Use built-in reduce_sum() for simple reduction cases, specifically reduce all to a scalar. 2021-04-14 08:55:35 -07:00
Brian Martin
3eb2d349a6
fix typo in scenariotestscppwinrt.cpp (#7334)
the word is spelled, "resetting".
2021-04-14 08:26:55 -07:00
Oliver Rausch
87bd836886
Fixes in symbolic shape inference (#7258)
* Add symbolic shape inference for Transpose

* Support steps in symbolic shape inference for Slice

* Add inference for BatchNormalization

* Address review changes

* Address review changes
2021-04-13 22:17:30 -07:00
liqunfu
75d8319286
Liqun/ort package name2 (#7337) 2021-04-13 20:36:24 -07:00
Zhang Lei
f62db1a09c
quantization tools support qlinear average pool (#7309) 2021-04-13 18:22:42 -07:00
liqunfu
4c862c73ed
for training to use new python package naming convention to explicitl… (#7204) 2021-04-13 16:19:42 -07:00
ashbhandare
6ceee5d131
IsInf ReduceSum transform (#7188)
* IsInf ReduceSum transform

* Revert unnecessary changes, add isinf_only and isnan_only attr

* add tests, review comments

* Disable test for non-cuda

* Move IsAllFinite from training to contrib op

* review comments

* Review comment, formatting

* Enable test for ROCm EP
2021-04-13 16:05:21 -07:00
G. Ramalingam
f8a36dd6b3
Add DropoutGrad function body (#7310)
* Add DropoutGrad function body

* Add DropoutGrad function body

* Fix documentation and add test cases

* Fix template specialization

* Check expansion for float16 and bfloat16
2021-04-13 14:31:53 -07:00
harshithapv
a5d3a52d1a
Add Tile grad (#7289)
* tile grad

* fixed bugs

* added tile grad test

* bug fix

* Added tests. Addressed comments

* added optimization recommended and addressed comments

* fixed comment
2021-04-13 12:54:45 -07:00
Edward Chen
ce9cd6ad9a
Update usage of generator expression $<COMPILE_LANGUAGE:L1,L2> which is not available in CMake 3.14. (#7318) 2021-04-13 11:18:34 -07:00
Hariharan Seshadri
2c96050336
Fix SDL warning (#7331) 2021-04-13 11:14:43 -07:00
Ahmad Zakaria
f34468a309
Fix TRT EP memory leak (#7195 revisited) (#7276)
* pass trt_profile by pointer pointer to avoid memory leak

* have 1 optimization profile per state instead of 1 per provider instance
2021-04-13 09:43:19 -07:00
Zhang Lei
f616ea632e
remove mlas unittest.cpp which is already refactored. (#7319) 2021-04-13 09:24:56 -07:00
Guoyu Wang
fce67e2b9b
Create Android Package pipeline (#7295)
* Create Android Package pipeline

* adress CR comments

* Switch to jdk11
2021-04-12 17:56:25 -07:00
Sheil Kumar
b7c89ce78a
User/sheilk/add api usage telemetry (#7320)
* winml telemetry

* change name to ApiUsage

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-04-12 17:51:25 -07:00
Hariharan Seshadri
4971310d6a
Fix split op in the way it deals with the optional input (#7302) 2021-04-12 10:26:08 -07:00
jeyblu
61ba9ac1bb
matmul in dnnl (#7311)
* update dnnl to v2.2

* dnnl matmul
2021-04-12 08:03:03 -07:00
sfatimar
21c282ed54
yolov3 accuracy (#7235)
Co-authored-by: sfatimar <sahar.fatima@intel/com>
2021-04-10 20:53:17 -07:00
Zhang Lei
6334c29240
Zhalei/mlas test (#7213)
* Refactor mlas unittest.

* Fix building issue on Linux (non msvc).

* Fix unused variable CI issue seems for old gnuc.

* Move to unittest foler one level down, and some other word change.

* Fix typo cause some test wrong.

* Correct some missing registered test_case count.
2021-04-09 17:02:38 -07:00
Weixing Zhang
75c0192e4f
enable more unit tests for ROCM EP (#7307) 2021-04-09 15:15:13 -07:00
Tracy Sharpe
f27f5afd8a
NCHWc: Support "sizes" argument for Resize transform (#7290) 2021-04-09 13:54:16 -07:00
jingyanwangms
2edf29552d
Add Optype to type mismatch message (#7305)
* Include optype in error message

Co-authored-by: Jingyan Wang <jingywa@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2021-04-09 13:40:47 -07:00
baijumeswani
b221a4fd86
Better error message when ORTModule used with torch.DataParallel (#7287)
* Better error message when ORTModule used with torch.DataParallel
2021-04-09 10:07:22 -07:00
Weixing Zhang
c22963c23d
Polish Lamb Kernel (#7299) 2021-04-09 09:55:57 -07:00
Hariharan Seshadri
711cc99f4d
Improve logged message for nodes that are forced to execute on CPU rather than some other EP (usually CUDA) (#7297) 2021-04-09 01:36:19 -07:00
Weixing Zhang
8ad5007f8f
Polish Adam kernel (#7294)
* Polish Adam kernel
2021-04-09 01:11:09 -07:00
Tianlei Wu
274e2fea0c
change half gemm to use compute_32f as default (#7253)
change half gemm to use compute_32f as default; add env variable for configuration
2021-04-08 20:54:37 -07:00
Zhang Lei
a4fdb4dbd9
Support transpose by merge Reshape etc into direct xint8 operators. (#7265)
* Suppose transpose by merge Reshape etc into direct xint8 operators.

* Add resize operator quantization support

* Add QDQ tests for resize, reshape, maxpool, transpose.
2021-04-08 18:00:35 -07:00
RandySheriffH
42051c912a
Narrow profiling scope (#7281)
* record endtime ealier

* rename func

* narrow down scope

* rename args

Co-authored-by: Randy Shuai <rashuai@microsoft.com>
2021-04-08 17:47:17 -07:00
Guoyu Wang
370f9b88c2
Enable CoreML EP for minimal extended mode (#7266)
* Enable CoreML EP for minimal extended mode

* minor code formatting

* Fix CI run failure

* Address CR comments

* remove redundant ifdef
2021-04-08 17:45:22 -07:00
Thiago Crepaldi
7b4362c21a
Add support to dynamic positional/keyword input for ORTModule (#7189) 2021-04-08 12:46:21 -07:00
Guoyu Wang
4969431eba
Fix codeql java warning (#7280) 2021-04-08 11:08:12 -07:00
KeDengMS
0d49e53985
[Symbolic shape infer] fix scalar shape in Expand (#7285) 2021-04-08 10:26:28 -07:00
Tracy Sharpe
bc6ef809bb
NCHWc: avoid buffer reordering around Add nodes (#7279)
Use Reshape to handle more NCHWc Add cases without ReorderInput/ReorderOutput.
2021-04-08 09:57:23 -07:00
ytaous
e14b291ce7
Enable symbolic shape inference in ORTModule (#7282)
Co-authored-by: Ethan Tao <ettao@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2021-04-08 09:47:09 -07:00
baijumeswani
d272c8434d
Suppress tracer warnings from onnx export in ORTModule (#7221)
* Suppress tracer warnings from onnx export in ORTModule
2021-04-08 03:41:38 -07:00
Maajid khan
27e778909d
[OpenVINO-EP] Enabling save/Load blob feature (#7054)
* Enabling save/Load blob feature for OpenVINO-EP

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Added changes to enhance save/load feature

->This feature applies only for MYRIAD device target
->cleaned up the code and added error checks

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Enabled the feature only for MyriadX and only for Linux

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixed compilation issues on windows

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Added changes to fix const subgraph issue

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixed issues on windows

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Added changes for the feature

-> Removed default location dir dump using cmake
-> Enabled saving blob dumps at the executable path
   by default

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Made save/load dump path configurable

-> The save/load blob dump path is now also made configurable
using a c/python Api's.

-> Introduced a flag named blob_dump_path

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Minor fixes added

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixed python API issues

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Using GetEnvironmentVar to get the path

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixed python runtime option issue

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>

* Fixes import network issue on windows

Signed-off-by: MaajidKhan <n.maajidkhan@gmail.com>
2021-04-07 20:59:16 -07:00
Chen Fu
def4cc09c7
Add QGEMM benchmark (#7268)
* Add QGEMM benchmark
2021-04-07 20:24:49 -07:00
Sherlock
aa2c465143
Restrict ConvGrad to __CUDA_ARCH__>=700 (#7278)
* Restrict ConvGrad to __CUDA_ARCH__>=700

Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2021-04-07 20:10:29 -07:00
Vincent Wang
beb299e17d
ConvGrad CUDA Kernel Bugfix (#7273)
* bugfix

* add ut
2021-04-08 08:22:18 +08:00
baijumeswani
844361bc67
Support eval mode and torch.no_grad context in ORTModule and restructure ortmodule.py (#7162) 2021-04-07 09:29:54 -07:00
George Wu
025abf996d
fix for using tensorrt:20.12 base image (#7264) 2021-04-07 08:48:43 -07:00
Sherlock
4bc17ca04e
CUDA ConvGrad Kernel (#7227)
* ConvGrad CUDA impl

* Set up the test case for Deberta Conv1D

* Add fp16 test

Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2021-04-06 22:09:06 -07:00
TomWildenhain-Microsoft
8219518aa8
Fix initializer counts when used as graph output (#7260)
Signed-off-by: Tom Wildenhain <tomwi@microsoft.com>
2021-04-06 22:52:22 -04:00
Jesse Benson
2ec452cdad Remove ROCM workaround for half-to-double cast. 2021-04-06 17:46:46 -07:00
Derek Murray
25e261f196
Avoid passing zero bias to Gemm in gradients (#7244)
* Avoid passing zero bias to Gemm in gradients

The bias argument to Gemm is optional and defaults to zero. Therefore we do not need to generate zero initializers and pass them to that argument.

* Remove unused declaration.
2021-04-06 16:49:34 -07:00
Yulong Wang
405ca49012
build ONNXRuntime into WebAssembly (#6478)
* Simplified version of WebAssembly support to keep most of existing data structures and add cmake using Ninja and emcmake

* Clean up CMakeLists.txt and add an example to create and compute a kernel

* Load a model from bytes and remove graph building steps

* Add all cpu and contrib ops with mlas library

* WebAssembly build with Onnxruntime C/CXX API

* Use protobuf cmakefile directory instead of adding every necessary source file

* Fix invalid output at example

* add missing files

* Change an example to use Teams model and support ort mobile format

* add API for javascript

* fix input releasing in _ort_run()

* update API

* Let onnxruntime cmake build WebAssembly with option '--wasm'

* allow one-step building for wasm

* Make build script working on Linux and MacOS

* Fix broken build from Windows command

* Enable unit test on building WebAssembly

* Resolve comments

* update build flags

* wasm conv improvement from: 1) GemmV; 2) Depthwise direct convolution 3x3; 3) Direct convolution 3x3

* Cleaned mlas unittest.

* use glob

* update comments

* Update baseline due to loss scale fix (#6948)

* fix stream sync issue (#6954)

* Enable type reduction in EyeLike, Mod, random.cc CPU kernels. (#6960)

* Update EyeLike CPU kernel.

* Update Mod CPU kernel.

* Update Multinomial CPU kernel.

* Slight improvement to Pad CPU kernel binary size.

* Update RandomNormal[Like], RandomUniform[Like] CPU kernels.

* Fix warning from setting multiple MSVC warning level options. (#6917)

Fix warning from setting multiple MSVC warning level options. Replace an existing /Wn flag instead of always appending a new one.

* MLAS: quantized GEMM update (#6916)

Various updates to the int8_t GEMMs:

1) Add ARM64 udot kernel to take advantage of dot product instructions available in newer cores. Some models run 4x faster than the stock implementation we used before.
2) Refactor the x64 kernels to share common code for AVX2(u8u8/u8s8/avxvnni) vs AVX512(u8u8/u8s8/avx512vnni) to reduce binary size.
3) Extend kernels to support per-column zero points for matrix B. This is not currently wired to an operator.

* Implement QLinearAveragePool with unit tests. (#6896)

Implement QLinearAveragePool with unit tests.

* Attention fusion detect num_heads and hidden_size automatically (#6920)

* fixed type to experimental session constructor (#6950)

* fixed type to experimental session constructor

Co-authored-by: David Medine <david.medine@brainproducts.com>

* Update onnxruntime_perf_test.exe to accept free dimension overrides (#6962)

Co-authored-by: Ori Levari <orlevari@microsoft.com>

* Fix possible fd leak in NNAPI (#6966)

* Release buffers for prepacked tensors (#6820)

Unsolved problems:

1. One test failure was caused by a bug in Cudnn rnn kernels, when they can allocate a buffer and partially initialize it, the garbage data near tail of the buffer caused problem in some of the hardware. To attack this problem in a broader sense, should we add code in our allocators, and during a memory fuzzing test, fill an allocated buffer with garbage before returning to the caller?


2. Prepacking is used more widely than we know. For instance, Cudnn rnn kernels also cache their weights. They mix several weight tensors together into a single buffer, and never touch the original weight tensor anymore. This is the same idea with pre-pack, but they didn't override the virtual function, and they never tried to release those weight tensors, leading to memory waste. It also seems to me that there are some other kernels have similar behavior. Wonder how much memory we can save if we try to cleanup those too.

3. Turning off memory pattern planning does increase memory fragmentation, leading to out of memory error in some training test cases. Perhaps we can revisit the idea of pushing kernels-creation stage earlier, and then during initializer deserialization, we only avoid tracing those that will be prepacked.

* Enable type reduction for Range, ReverseSequence, ScatterND, Split, and Unique CPU kernels. (#6963)

* add CI

* fix test in ci

* fix flags for nsync in wasm build

* add copyright banner

* fix wasm source glob

* add missing exports

* resolve comments

* Perf gain by make packb wide to 4 from 16 on GEMM for WASM.
Remove no need direct conv in previous perf tuning.

* fix buildbreak introduced from latest master merge

* fix buildbreak in mlasi.h

* resolve all comments except MLAS

* rewrite packb related 3 functions for WASM_SCALAR seperately rather than using #ifdef in each.
and other changes according to PR feedback in mlas.

* More complete scalar path in sgemm from Tracy.

* Fix edge case handling in depthwise conv2d kernel 3x3. where:
  *) support input W==1 and H==1
  *) recalc in accurate pad_right and pad_bottom
  *) support hidden pad_right == 2 or pad_bottom == 2 when W == 1 or H==1 and no pad left/top

* Add more test coverage for conv depthwise from Tracy.
Fix one typo according to PR.

* resolve comments

* replace typedef by using

* do not use throw in OrtRun()

* output error message

Co-authored-by: Sunghoon <35605090+hanbitmyths@users.noreply.github.com>
Co-authored-by: Lei Zhang <zhang.huanning@hotmail.com>
Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>
Co-authored-by: Tianlei Wu <tlwu@microsoft.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
Co-authored-by: Tracy Sharpe <42477615+tracysh@users.noreply.github.com>
Co-authored-by: David Medine <david.eric.medine@gmail.com>
Co-authored-by: David Medine <david.medine@brainproducts.com>
Co-authored-by: Ori Levari <ori.levari@microsoft.com>
Co-authored-by: Ori Levari <orlevari@microsoft.com>
Co-authored-by: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com>
Co-authored-by: Chen Fu <chenfucs@gmail.com>
2021-04-06 16:18:10 -07:00
ashbhandare
2aa89989c4
Not-where fusion (#7182)
* Not-where fusion

* Change to rewrite rule

* Add to inference transforms

* Support numtiple where consumers

* review comments
2021-04-06 16:12:26 -07:00
Yufeng Li
790fc11e60
QDQ: type conversion and more ops support (#7243)
* QDQ: add int8_t to uint8_t conversion and Relu/AveragePool support
2021-04-06 15:30:31 -07:00
raviskolli
5d759e182b
Allocate external Rocm allocator via PyBind (#7148)
* Enabled rocm support for graph transformations

* Support for external Hip allocator

* Added const_cast to reinterpret_cast to fix compiler issue

* Another crack at fixing the compile error

* More compilation fixes

* Added compilation flags to load_inline extension

* Added ROCM, ROCM_PINNED constants

* Changes to address PR comments

* Changed gpu identifier from ROCM to CUDA

* Added HIP compilation flag for torch inline functions

* Fixed a typo in header allocator string formatting

* Fix for runtime error with external_cuda_allocator

* Removed cuda/rocm specific code paths for allocators

* More name changes to generic gpu from rocm/cuda

* Removed duplicate allocator creation

* Rename cuda_external_ config options as gpu_external_

* Rename hip_mem_limit to gpu_mem_limit

* Rename cuda_mem_limit to gpu_mem_limit
2021-04-06 15:23:51 -07:00