Commit graph

5242 commits

Author SHA1 Message Date
Viswanath Boga
6dee9b9d2d
attention fusion kernel refactoring (#8432)
* attention fusion kernel refactored

* consider the case of none in add_qk

* variabled added to check for pre-pack weights

* added a comment to PrePack()

* Optimized prepack and try to free the weights

* making comment sound better

* fixing a bug with optimizer.py

* commented out changes to be done

* removed comments

* make the private fn() private

* fix build

* making clean up fn static

* backed out optimizer tool change, needs more looking into
2021-07-23 17:46:39 -07:00
Ryan Hill
a396c9e572
Add more safety checks to the C API (#8474) 2021-07-23 15:41:27 -07:00
Ye Wang
6a07172a93
Restore cpu affinity after loading tensorflow model from transformers (#8448)
* Update onnx_exporter.py

* update

* review comments
2021-07-23 15:20:44 -07:00
Yulong Wang
e66846da4a revise terms according to guideline 2021-07-23 13:26:15 -07:00
ytaous
ab5289f109
Performance: enable faster training with skip checks config (#8411)
* freeze/fastpath support

* more comments on _fast_path

* per comments

* minor fix

* IntFlag improve

* address comments

Co-authored-by: Ethan Tao <ettao@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2021-07-23 10:23:13 -07:00
Vincent Wang
c8d210de29
Decouple Forward and Backward of ATenOp (#8301)
* atenop for inference

* assert if dtype mismatch

* atenop config in frontend

* fix orttrainer test

* gradient def not only for ATenOp

* bugfix

* fix gradient input shape and type issue

* fix after merge master
2021-07-23 16:53:26 +08:00
Vincent Wang
619a8782a5
Improve AddValueInfo (#8451)
* change AddValueInfo

* fix after merge master
2021-07-23 16:39:55 +08:00
Tracy Sharpe
b2b9de939f
cleanup onnxruntime_mlas.cmake of old gcc workarounds (#8469) 2021-07-22 22:01:05 -07:00
Frank Liu
002e427c5b
Add UINT8 datatype support to Java (#8401)
Add UINT8 datatype support
Add inference test for UINT8 model
2021-07-22 17:11:49 -07:00
Dmitri Smirnov
950fe5e28b
Implement SparseTensor and infrastructure suppport and advance ONNX commit (#8038)
SparseTensor support
  Implement Builder pattern
  Fix support for 1-D and 2-D COO indices
  Implement and test CSR support.
  Handle shape inference for SparseTensors
  Implement conversion for COO, CSR and tests.
  Address the case where constant sparse initializer is the output.
  Implement test infra for SparseTensors
  Implement SparseDenseMatMul for Csr and COO and tested it.
  Add hash for SparseToDenseMatMul
  Finish shared provider refactor
  Refactor GetOrCreate to Create
  Working on py interface
  Expose OrtDevice and use it in allocate_numpy
	Adjust Sparse interfaces, add support for string SparseTensor. Add tests.
	Add and test to_cuda()
	Add accessors to format specific indices
	Test values and indices views, read-only flag, after GC access
	Add sparse related methods to OrtValue
	Re-work SparseTensor wrapper, add OrtValue methods
	Rework numpy_array_to_cuda/to_cpu
	Add run_with_ort_values
	Add models and test sparse_mat_mul with run_with_ort_values
	Refactor sparse tensor to use a single buffer
        Ifdef x86 Eigen CSR sparse matmul implementation
        Exclude broken test, check for string type when copying cross device
       Split pybind schema, regenerate docs, add exclusion
       Conditionally exclude schema module
       Update docs fix cuda build
       Add test to a filter and renerate JS docs
      Add conversion and test string support for sparse tensors
      Exclude conversion utils from minimal build
      Add CUDA Memcpy and adjust provider interfaces
2021-07-22 15:24:36 -07:00
raviskolli
f641c0f4e8 Update requirements.txt
Updated requests version to address component governance failure
2021-07-22 14:18:21 -07:00
Thiago Crepaldi
9073c094d4 Update torch litghning and re-enable test 2021-07-22 14:18:07 -07:00
Ye Wang
e8ee31bcc3
Update onnx_model_bert_tf.py (#8457)
Fix a bug: when layernorm and skiplayernorm are not fused, the program will crash
2021-07-22 13:50:55 -07:00
Adam Pocock
9a6fa057c8
[Java] Allow extraction of multidimensional String tensors (#8452)
Fixing a bug where String tensors would always be single dimensional in Java.
2021-07-22 13:19:49 -07:00
Edward Chen
287a2a778f
Update CODEOWNERS with mobile team ownership of expected kernel def hash data files. (#8454) 2021-07-22 11:19:06 -07:00
Hariharan Seshadri
3360024a0b
Support plugging in custom user-defined allocators for sharing between sessions (#8059) 2021-07-22 10:17:35 -07:00
Edward Chen
989491c333
[NNAPI EP] Make partitioning stop ops configurable. (#8444)
Enable NNAPI EP partitioning stop ops to be overridden by a session configuration option.
2021-07-22 09:21:42 -07:00
pengwa
892ac9f55a
code structure update (rename only) (#8410) 2021-07-22 23:50:19 +08:00
DeyuHuang
4275055868
Add Gridsampler contrib op (#8372)
* add Gridsampler contrib op

* fix gridsampler_paddingmode_border test

* disable the tests until the kernel added

* fix CI failure

* change GridSampler to GridSample
2021-07-22 15:39:28 +08:00
Ryan Hill
53d5814d12
Move the wrapped types out of provider_interfaces (#8455) 2021-07-21 21:43:40 -07:00
Faith Xu
14b045ad52
Add link to sample repos (#8417)
* Update readme and add link to sample repos

* Minor updates based on PR feedback

* Add links to sample repos in former samples folder
2021-07-21 16:18:59 -07:00
Edward Chen
695536a7ac
Make some common macros safer to use. (#8445) 2021-07-21 12:14:36 -07:00
Oliver Rausch
972aee8308
Fix GCC build error in quantization tests (#8449) 2021-07-21 18:15:13 +02:00
Ryan Hill
7e2ecb2eeb
Remove unnecessary line as no headers exist now (#8446) 2021-07-21 01:03:05 -07:00
Adam Pocock
55b26b6951
[Java] Adds support for DNNL, OpenVINO, TensorRT shared providers and refactors the CUDA shared provider loader (#8013) 2021-07-20 22:33:15 -07:00
Changming Sun
1cd9b47d8d
Remove all C/C++ samples from our C# dir (#8441) 2021-07-20 21:46:46 -07:00
Rajalakshmi Srinivasaraghavan
894fc82858 POWER10: Additional check in cmake
When compiling with newer gcc and older glibc, there is a chance
for new POWER10 macros to be not available in hwcap.h. This patch
checks whether hwcap macros are available before using that in
platform.cpp.
2021-07-20 13:04:18 -07:00
Sherlock
28527b4867
Handle duplicated names for output_grads (#8431) 2021-07-20 10:17:31 -07:00
Ryan Hill
cc9f793b48
Move one function from cuda_provider_factory.h (#8407) 2021-07-19 17:55:59 -07:00
Guoyu Wang
3e7fcd8c92
Fix iOS packaging pipeline failure (#8433) 2021-07-19 17:42:58 -07:00
Rachel Guo
bf54fe481e
[CoreML EP] Support 1D Conv for coreml ep (#8398)
* initial conv 1d

* wip

* clean up and add comments

* refine

* elimnate some of the redundant copies of code

* update UT tests

* update with the new creatennlayer

* minor refine

* address cr comments

* refine

* refine

* address comments

* address comments

* fix

* fix

Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
2021-07-19 17:26:22 -07:00
Tianlei Wu
862bc8c7a0
shape infer for present output of Attention op (#8430) 2021-07-19 17:24:10 -07:00
harshithapv
0f989c6162
bumping onnxruntime version to 1.8.1 (#8429) 2021-07-19 16:48:56 -07:00
Ryan Hill
e04e1d5ce0
Move shared providers CPU providers into separate file (#8293) 2021-07-19 15:19:32 -07:00
Tianlei Wu
dfe42e185c
update bert notebook to use onnxruntime 1.8.1 (#8379) 2021-07-19 14:16:59 -07:00
Viswanath Boga
afce0e2543
Attention kernel update to handle different Q,K,V hidden sizes (#8039)
* changes working to convert akv nodes

* changes to replace nodes

* changes to accomodate qkv hidden sizes as attributes

* kernel to accept qkv_hidden_size attributes

* Working till compute for varied dimension, todo applyattention()

* changes to make all regression tests work

* inference running successfully without prepack

* success inference with pre-pack weights

* add test for diff sizes

* bias shape need not be a mul of 3

* get the output_hidden_size from input

* infer output shape from input

* merge with master

* cleaning up files that got merged wrong

* accurancy at accepted level

* added unit test case for different dimensions

* all unit tests passing

* packed weights working for attention

* prepacked weights working

* added test case for newly added extra qk input

* updated unit test to test only extra add qk

* fixing build error

* removing few debugs

* reverting test changes

* all python test passing

* cleaning up

* new unit test added, major clean up of code

* removed extra code

* minor

* minor fix to tests

* prepack weights code cleaned up

* compacted compute() in attention.cc

* reformat compute()

* making a parameter T

* adding 3 q,k,v buffers in all cases

* fixing build

* running tests only on cpu

* Updating docs

* trigger ci builds

* Addressing comments in PR

* addressing some more comments

* get add_qk_str from add_qk node directly

* updating docs, added extra check to verify attn inputs

* Optimized the extra add by parallelizing

* added attention_shape to symbolic_shape_infer.py

* minor refactoring to address comments
2021-07-19 12:21:33 -07:00
Sheil Kumar
c3129306e5
Enable string attributes for experimental model building (#8428)
* string attributes

* Update error message

Co-authored-by: Sheil Kumar <sheilk@microsoft.com>
2021-07-19 11:48:41 -07:00
Maajid khan
1686e8ff57
[OpenVINO-EP] 2021.4 Release (#8369)
* Changes to ensure the openvino-ep-2021.4 branch is created
* Fix failing cpp and python unit tests
* Fixed Myriad Tests for Ov_2021.4
* Disabled failing python tests for myriad
* Fixes models which were breaking w.r.t 2021.4
* Added fixes to Fix tinyyolov3 working on Myriad
and MaskRcnn, FasterRcnn using GPU_FP32
* Added FP16 output data type support for ngraph
* Implemented ReadNetwork() method

->Using Core::ReadNetwork() method for reading and creating a CNNNework

->Since OpenVINO™ 2020.4 version, Inference Engine enables reading ONNX models
  via the Inference Engine Core API and there is no need to use directly the low-level
  ONNX* Importer API anymore. To read ONNX* models, it's recommended to use the
  Core::ReadNetwork() method that provide a uniform way to read models from ONNX format.

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

* Fixed ngraph f16 supported output type

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

* Added comments in data_ops.cc

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

* Fixed broken windows build

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

* Disable failing CPP tests on CPU

Some of the convtranspose tests are failing on
OpenVINO-EP CPU due to accuracy mismatch w.r.t
default CPU. so currently we are disbaling
these tests.

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

* Updated for ov version 2021.4

* Changes to include qdq ops in code

* Disabled failing python tests on GPU

Disabled two maxpool python tests on
GPU as they were passing but throwing
segfault

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

* Fix the backward compatibility issue

ReadNetwork() API has a bug and will only work
starting from OpenVINO 2021.4 version.

The previous versions will still have to use
onnx importer route

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

* Fix CMakeLists.txt for OpenVINO EP

If a directory with OpenVINO is sourced,
the latest OpenVINO settings have to
be imported.

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

Co-authored-by: sfatimar <sahar.fatima@intel/com>
Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com>
Co-authored-by: Aravind Gunda <aravindx.gunda@intel.com>
2021-07-19 10:40:56 -07:00
Dwayne Robinson
8544c222ce
Fix build error about if being constant in Eigen and Protobuf (#8291)
* Fix build error about if being constant in Eigen and Protobuf
* Update with Changming's proposal
2021-07-18 00:35:24 -07:00
Edward Chen
4a614637a7
[NNAPI EP] Update NnapiExecutionProvider::GetCapability() to use partitioning utils (#8387) 2021-07-16 17:42:10 -07:00
Hariharan Seshadri
2f408f757e
Improve performance of Pad CUDA kernel (#8408) 2021-07-16 09:44:16 -07:00
sumitsays
127b1f0d01
SDL Native Warning errors in DML ep (#8396)
* Updated d3dx12.h with latest change. Fixed SDL native warning errors

* Removed usage of IID_ID3D12Device variable, instead used __uuidof as in previous commit

* Removed usage of NULL, used nullptr instead.

Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
2021-07-15 23:17:47 -07:00
Guoyu Wang
bcd50afafb
[CoreML EP] Fix failure for layer without name (#8399)
* Fix CoreML failure for layer without name

* Update clip op builder to new naming function
2021-07-15 11:52:01 -07:00
Nick Kreeger
963d883de8
Create a common directory for quantization code and functionality. (#8320) 2021-07-14 22:56:58 -05:00
Edward Chen
ef930b3ca9
[Objective-C API] Fix ORTIsCoreMLExecutionProviderAvailable link error when used from Swift. (#8350) 2021-07-14 18:38:58 -07:00
Guoyu Wang
c5038063ed
Add iOS/macOS static framework (#8357)
* Add ability to generate ios static framework

* Fix typos

* Add pod cache clean, update some comments of previous commit

* Fix CI failure with newly added cpuinfo library

* Update test model (CoreML requires node has a name)

* Addressed CR comments
2021-07-14 16:39:17 -07:00
Tianlei Wu
41f1280fc9
Fix transformer optimizer (#8392)
* fix a few issues
2021-07-14 16:00:17 -07:00
Edward Chen
88d1ffe9b8
Fix invalid access in log call. (#8389)
Fix bug that shows up when running tests (in particular, GraphTransformationTests.ConcatSliceEliminationTest) with more verbose logging level.

There is a log statement that doesn't get evaluated at the default test logging level (warning). It was accessing the first element of an empty vector. This change moves that log statement before the point where that vector is cleared.
2021-07-14 15:09:45 -07:00
Yulong Wang
0a1c00e8db
[js/node] remove unused dependency node-pre-gyp-github (#8388) 2021-07-14 14:30:44 -07:00
Tianlei Wu
5cd254aa79
update gpt2 attention fusion for past pattern (#8375) 2021-07-14 12:04:53 -07:00