Commit graph

3083 commits

Author SHA1 Message Date
Chun-Wei Chen
744809ceae
Detect whether the node has been inserted cast nodes twice (#4811)
* check whether the node has been casted before

* check casted node logically

* better naming convention

* nit: extra space

* change to skip for Cast Node

* remove hasNodeBeenCast

* Add a Unit test

* Add test onnx file

* nit: naming convention and comments

* check CI: try to remove test

* move test to existing test file
2020-08-24 07:25:41 -07:00
Scott McKay
47c4144bd1
Add gcc/clang flags to make binary smaller (https://interrupt.memfault.com/blog/best-and-worst-gcc-clang-compiler-flags#-ffunction-sections--fdata-sections----gc-sections) (#4895)
Add gcc/clang flags to make binary smaller. ~10% reduction for Android baseline build (minimal build with no ops, no exceptions, no rtti).
2020-08-24 19:24:13 +10:00
Rayan-Krishnan
eb05db5a2a
Fix OptimizerConfig params groups (#4877)
* Copy samples to build folder and load models from there. Fix CI
* This PR also includes a fix to path validation for save_as_onnx API
* Add torchtext to CI for GPU training
* Remove new frontend tests from CI

Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2020-08-22 22:04:17 -07:00
Scott McKay
728e886bba
Add kernel def hash logic for minimal build (#4891)
* Add hash based lookup of kernels
2020-08-23 14:39:07 +10:00
Scott McKay
db7669b225
Reduce ONNX dependency in minimal build (#4890)
* Next round of changes.

Remove inclusion of ONNX schema header
Exclude custom registry related things
Move IsConstantInitializer from graph_utils to Graph as it's needed in a minimal build and graph_utils is excluded.
2020-08-23 07:02:13 +10:00
Pranav Sharma
29dcfb24ab
Allow multiple sessions to share an allocator, optimize constant folding memory usage, expose arena configs. (#4813)
* Add support for sharing allocators

* Incremental update

* Address some PR comments, add unit tests, add documentation.

* Address PR comments, add tests and some documentation.

* Fix build and test issues

* Remove RegisterAllocator API restoring the OrtAllocator interface changes. Changed docs to reflect this.
Also fixed the orttraining segfault. The segfault was because in the case of training session,
the CPU exec prov is not available at the time the transformers are applied. Changed it to create
a new one.
2020-08-22 10:03:17 -07:00
jingyanwangms
fa68bbc82e
Relu grad kernel (#4864)
* create branch for debug

* move unit test

* more changes

* move relu to activations_grad*

* Fix ReluGrad Domain and opset version

* added unit test, CudaKernelTest.Relu_basic doesn't work yet

* remove CudaKernelTest.Relu_basic

* PR comment

* add unit test ReluGradTest_Basic

Co-authored-by: Jingyan Wang <jingywa@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2020-08-22 01:03:44 -07:00
Thiago Crepaldi
dce2ce7a4f
Fix checkpoint API and copy samples into build dir (#4887)
* Fix state_dict APIs
* Copy samples to build folder and fix CI
2020-08-22 00:09:48 -07:00
liqunfu
6260d073b3
Glue parallel training (#4550)
add mpi size, rank python API

add single node parallel training example
2020-08-21 21:24:27 -07:00
RRRachelllll555
9a6db9b9f4
Fix next node access bug in calibration tool (#4863)
* fix bug in calibration tool

* fix next node access bugs

* rm file in wrong folder

* refine

* optimize

* refine

* refine format

* refine

Co-authored-by: t-yguo <t-yguo@microsoft.com>
2020-08-21 20:48:54 -07:00
RandySheriffH
3fa73a5b6a
ReduceBinarySize (#4747)
* cancel night build on pyop

* add rewriter to rewrite cpu provider

* skip BuildKernelCreateInfo<void>

* refactor variable name and comment

* include ops from csv file

* process multiple eps

* add default function to cuda provider

* rename function and add license header

* fix import

* add doc

* fix typo

* deal with empty kernel entry in cuda

* rename the rewriter file

* add comment into provider file

* add comment and rename function

* log warnings

* refactor extracting logic

* add entry for script to run solo

* add better example

* avoid onnx importing

* fix flake8 alerts

* minor fixes to better comments and doc

* add entries for all domains

* add void entry into contrib providers

* format cuda_contrib_kernels.cc

* format cpu_contrib_kernels.cc

* add all providers

* add default entry to all providers

* include op_kernel header

* cancelling change in providers beyond cpu/cuda

* rename file and switch file format to domain;opset;op1,op2...

* update doc

* restore non-regular ending grammar in cuda_contrib_kernels.cc

* add ort_root as input argument of script

* enable test in ci

* update doc

* update doc

* revert change on linux gnu ci

* switch to set to host ops

* simplify trimming logic

* add domain map to track current model

* allow ort_root to take relative path
2020-08-21 19:50:13 -07:00
gwang-msft
82bc21e35e
Namespace change on ort flatbuffers schema (#4886)
* correct some errors in the flatbuffers schema, move flatbuffers submodule to cmake/external

* update the ort flatbuffers schema to use less namespace

* minor update

Co-authored-by: gwang0000 <62914304+gwang0000@users.noreply.github.com>
2020-08-21 17:43:11 -07:00
Vincent Wang
fdd0926d00
int64_t support for GatherND cuda (#4881)
Co-authored-by: Vincent Wang <weicwang@microsoft.com>
2020-08-22 08:00:31 +08:00
Thiago Crepaldi
acbf6d15c6
Improve LRScheduler tests (#4885)
* LRScheduler tests added to the Transformer model
	* Refactored LRScheduler tests for the BERT Toy onnx example
	* Removed dead code
2020-08-21 16:18:30 -07:00
Scott McKay
e00ad83f2b
Initial changes to disable code in a minimal build (#4872)
* Initial set of changes to start disabling code in the minimal build. Breaking changes into multiple PRs so they're more easily reviewed. Focus on InferenceSession, Model and Graph here. SessionState will be next.
Needs to be integrated with de/serialization code before being testable so changes are all off by default.

Changes are limited to
  - #ifdef'ing out code
  - moving some things around so there are fewer #ifdef statements
  - moving definition of some one-line methods into the header so we don't need to #ifdef out in a .cc as well
  - exclude some things in the cmake setup

* Update session state and a few other places.

The core code builds if ORT_MINIMAL_BUILD is specified.
2020-08-22 07:14:53 +10:00
Yufeng Li
fb43aa0de0
implement per-channel for quantizelinear and dequantizelinear (#4759)
* update onnx to latest master

* implement per-channel for quantizelinear and dequantizelinear

* refine the unit test

* exclude sequence_insert tests

* refine onnx cmake

* add failure tests to broken_tests

* move qdq common code to a seperate function

* refine code
2020-08-21 12:08:50 -07:00
Thiago Crepaldi
5427a7e9af
Update LRScheduler to use scheduling similar to HuggingFace (#4880) 2020-08-21 10:24:04 -07:00
Scott McKay
ef19916d07
Add Node::SinceVersion() (#4874)
* Add Node::SinceVersion() so that the value is known when loading a graph from the ORT format (OpSchema is not available).

* Fix build warning from returning 'const int'
2020-08-21 16:48:52 +10:00
gwang-msft
d4d52056be
Flatbuffers schema for serialization of the onnxruntime::model/graph (#4870)
* add flatbuffers submodule

* test version of flat buffer schema

* test version of flat buffer schema

* minor updates

* add serialization of the value info, group defs in different namespace

* update comments

* update cgmanifest.json

* update namespace, changed typeinfovalue to use union, added root_type and file_identifier

* add new container type, add max_node_index to graph

* add serializing session state

* addressed review comments

* minor updates

Co-authored-by: gwang0000 <62914304+gwang0000@users.noreply.github.com>
2020-08-20 18:45:43 -07:00
Sherlock
a0271f619a
Range CUDA inputs should be in CPU (#4871)
Co-authored-by: Sherlock Huang <bahuang@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2020-08-20 15:52:02 -07:00
paradigm
c5342b5417
fixed compilation issue for Jetson Xavier (#4873)
The string concatenation of the cuda flags makes compiling impossible due to the missing space (Error: " nvcc fatal: redefinition of keyword 'code' ") .
2020-08-21 06:27:38 +08:00
Yulong Wang
c6119a548c enable telemetry in node.js binding 2020-08-20 09:47:57 -07:00
suryasidd
3a00b50cf8
[OpenVINO-EP] Updating OpenVINO EP to 2020.4 (#4836)
* Removed building ngraph from source

* Disabled some tests temporarily

* Enabled softmax for all dims

* Added onnx importer to link libraries

* int64 changes

* fixed

* temp

* slice update start and end need to be initializer

* Disabled GatherND, ScatterND, ReverseSequence operators

* Added supported ops instead of unsupported ops

* Set precision only for CPU

* Removed some unecessary conditions

* Fixed segfault in slice

* Softmax restriction removed

* changes

* Setting precision for all plugins

* Changes added to include precision
and supported ops for gpu and vpu

* branch op support

* checking for disabled python test failure

* mapped input names and tensors directly rather than copying which was leading to mismatch

* last index is not supported
mkldnn does not support pow between integers

* included the code changes

* Rename inner-scoped variable to avoid MSVC warning

* applied changed to vadm as well and removed the utility function
getinputtensors() completely

* OpenVINO multi version support: CMake changes

* OpenVINO multi version support: C++ support

* removed commented code

* Remove redundant code lines

* Revert "Rename inner-scoped variable to avoid MSVC warning"

This reverts commit 2f650493162675bc6fb70730de9656ec400be332.
Merged separately in master.

* vadm changes disabled reduction op test

* putting test_gather_negative_indices in unsupported list for now

* Update MCR Dockerfile with 2020.4

Installs OpenVINO 2020.4 from deb packages via APT tool.

* Update build docs with 2020.4 info

* Update dockerfile with OV 2020.4 info

Instructions for building OpenVINO based docker image no longer require
downloading installer package as it is installed by the dockerfile
using OpenVINO 2020.4 APT package for Ubuntu 18.04

* Added constant folding bypass logic

* Added cout statements for ci

* Added NDEBUG flag for debug symbols

* Update Ops info in docs

* fixes multiple unit tests

* mathoptest.ceil disabled for gpu and myriad

* activation test temp disabled

* Fix models for CPU

* Fixed a syntax error

* local cmmit

* fixing unit tests for myriad

* Fixed Variadic Split, Topk issues

* fix_model commit

* Fix models in myriad

* Added ifdefs for OpenVINO 2020.4

* temp

* made some changes to not operator

* Added unused parameter

* relu enabled

* Fixed bug in Conv output

* Consolidated GPU failing tests into one category

* Made it compatible to InternalCI 2020.4

* Made changes for ngraph

* Disabled test for mask,fastercnn,tinyyolov3

* Removed proxy for ci

* run_dockerbuild.sh restored to same version

* run_dockerbuild.sh restored to same version

* run_dockerbuild.sh restored to same version

* Updated documentation for 2020.4

* Removed FP32 to FP16 transformation for GPU

* Disabled Coreml-FNS-Candy model test

* Added FP16 transformations

Co-authored-by: sfatimar <sahar.fatima@intel.com>
Co-authored-by: Manohar Karlapalem <manohar.karlapalem@intel.com>
Co-authored-by: sfatimar <sahar.fatima@intel/com>
Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com>
Co-authored-by: intel <you@example.com>
Co-authored-by: gundaarx <aravindx.gunda@intel.com>
2020-08-19 23:18:08 -07:00
KeDengMS
d00a70a432 Fix broken Nuphar docker file by removing stale build options 2020-08-19 21:46:48 -07:00
Rayan-Krishnan
7589445e6e
Add ONNX BERT Frozen Weights and Save as ONNX Tests (#4859)
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2020-08-19 21:31:38 -07:00
liqunfu
25cc6158a8
update golden numbers (#4865)
Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2020-08-19 20:52:10 -07:00
Yang Chen
101cd80bd7
fixed a warning on an unreferenced local variable (#4861)
The warning prevented me from building the code with VS 2019,
because it was treated as an error.
2020-08-19 19:20:55 -07:00
Scott McKay
dc50aa42d5
Refactor session state finalization and kernel lookup usage (#4763)
* Refactor SessionState to support coming de/serialization changes
  - move more parts into SessionState to simplify usage
  - do the kernel lookup once instead of multiple times from different places
  - rename finalize_session_state.* to session_state_utils.* as the finalization logic is now inside SessionState

* Fix some build issues

* Move subgraph session state creation into SessionState. It's not needed by GraphPartitioner any more so we can delay the creation until later. Fixes issue where EP may have removed the subgraph during partitioning when taking a control flow node, and SessionState thought the subgraph was still valid.

* Address PR comments

* Clarify a comment
2020-08-20 12:19:38 +10:00
liqunfu
d7233c7c97
Fix training for models with dict input (#4842)
This PR also includes:
	* Remove defaults from named tuples to support python 3.6
	* Allows model which takes dicts as input
	* Adapts BERT finetuning example to run on the new frontend
        * Match numbers for BERT fine tuning model

Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2020-08-19 18:36:36 -07:00
Thiago Crepaldi
7cc88ef7ed
Port legacy checkpoint API into new front-end (#4855)
* Port legacy checkpoint API into new front-end

This PR also fixes:
	* Warnings on ORTTrainer for improper tensor copies
	* Inaccurate LRScheduler tests using wrong LR
	* Stale DeepSpeed documentation
	* Minor code refactoring for Toy BERT tests
        * Move experimental state_dict() and load_state_dict() into checkpoint ns
2020-08-19 14:27:28 -07:00
Alexandros Koumparoulis
75ad7be336
add caching support for dynamic input models (#4702) 2020-08-19 11:41:40 -07:00
gwang-msft
fff0b41fcb
Nuget build break fix (#4854)
* rename new header file to fix build break

* update code to use the new header file name
2020-08-19 13:51:33 +10:00
Vincent Wang
5eaac31faa
support opset13 on transformers. (#4837)
Co-authored-by: Vincent Wang <weicwang@microsoft.com>
2020-08-19 11:13:37 +08:00
Scott McKay
61a5502af0
Fix some incorrect operator registrations. (#4838) 2020-08-19 09:23:33 +10:00
Changming Sun
1ba07ccfaf Codesign validator fixes 2020-08-18 16:20:15 -07:00
Yufeng Li
0575881949
Update quantization notebook to pytorch 1.6 (#4834) 2020-08-18 14:20:46 -07:00
gwang-msft
dee7596724
Add a generic collection of session configurations to the SessionOptions (#4718)
* adding generic configurations for session options

* fix a build break on linux

* fix training ci build break

* fix training ci build break

* addressed CR comments

* fix traning ci build break

* move config_key from enum to string

* add c# api

* add python api

* fix build break

* move prepacking from 2 new api entries to session options configs

* fix traning ci build break

* add python test, update some comments, move const key definition to avoid build break

* addressed comments

* move definitions of keys to common.h

* move api to version 5

* remove accidental change in build.py

* remove pragma to avoid build break

* addressed CR comments

* fix the python build break, and move location of config keys definition

* small typo changes
2020-08-18 13:40:40 -07:00
Nat Kershaw (MSFT)
81ff168833
Update stale.yml with current labels and mark stale items as "stale" (#4831) 2020-08-18 13:25:57 -07:00
ytaous
2605af9a0b
Fix for mainz model (#4744)
* fix for mainz model

* fix build

* on comments

* revert the extra check

* on comments

Co-authored-by: Ethan Tao <ettao@microsoft.com>
2020-08-18 11:47:19 -07:00
Thiago Crepaldi
f3b0c93a45
Fix issue preventing loss scaler to run due (#4833)
`LossScaler.update()` was not being properly called due to the incorrect TrainStepInfo.all_finite assignment.

Additionally to this fix, _ORTTrainerModelDesc.is_finite was renamed to _ORTTrainerModelDesc.all_finite to make it more uniform with TrainStepInfo
2020-08-18 10:03:02 -07:00
Hariharan Seshadri
a3c95374c3
Support asymmetric paddings in CUDA Conv kernel (#4627) 2020-08-18 02:09:30 -07:00
Hariharan Seshadri
c878ecbbe0
Sahar/csharp support openvino (refined) (#4835)
* Sahar/csharp support openvino (#4703)

* Temp changes and include openvino to ensure nuget package is created with linux till we configure azure ci pipeline

* string id change

* native nuget indentation changes

* documentation changes

* Update Openvino_execution_provider.md

Documentation includes openvino execution provider

* Update OpenVino-ExecutionProvider.md

update details to build csharp api for openvino execution provider .

* vadm backend revert

* Update Openvino-Execution-Provider.md

updated for review comments

* Update OpenVino-Execution-Provider.md

* Update OpenVINO-ExecutionProvider.md

* nuget package custome support for openvino
change in native nuget spec python script for including linux runtime

* change to make path to boolean flag

* removed the tab

* Update OpenVINO-ExecutionProvider.md

updated for review comments

* chnages to include pep8 warnings
modification to documentation

Co-authored-by: saharfraza <sfatima.3001@gmail.com>
Co-authored-by: sfatimar <sahar.fatima@intel/com>

* Changes to include csharp support for openvino

* Fix flake error

* Fix

Co-authored-by: sfatimar <64512376+sfatimar@users.noreply.github.com>
Co-authored-by: saharfraza <sfatima.3001@gmail.com>
Co-authored-by: sfatimar <sahar.fatima@intel/com>
2020-08-17 21:52:17 -07:00
Rayan-Krishnan
24d9f4e0c3
Add More Extensive ONNX BERT Tests (#4827)
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2020-08-17 19:54:22 -07:00
Changming Sun
e98697ec28
Fix nuget cpu package pipeline (#4832) 2020-08-17 17:08:48 -07:00
jingyanwangms
d3af669980
Auto upgrade base image dependencies (#4797)
* use unattended-upgrade

* PR comment

* add comment

Co-authored-by: Jingyan Wang <jingywa@OrtTrainingDev3.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
2020-08-17 17:05:01 -07:00
Thiago Crepaldi
f933910ea3
Update LambConfig defaults to match backend (#4826) 2020-08-17 16:58:14 -07:00
RandySheriffH
6a360bad6b
ReplaceStrncpy (#4823)
* replace strncpy with strlcpy

* keep strncpy to linux

* cancel reseting of string ending for strlcpy

Co-authored-by: Randy <Randy@randysmac.attlocal.net>
Co-authored-by: RandySheriffH <rashuai@microsoft.com>
2020-08-17 16:44:44 -07:00
edgchen1
32a5f3d5b6
Check status of element-wise op prepare functions. (#4830)
* Check status of BinaryElementwise::Prepare().

* Add additional status checks for BinaryElementwise::Prepare() and UnaryElementwise::Prepare().

* Add status checks for BinaryElementwisePreparation::BinaryElementwiseBroadcastPrepareHelper().
2020-08-17 16:11:30 -07:00
Thiago Crepaldi
ef20efe015
Register cerberus license into ThirdPartyNotices.txt (#4828)
Governance Compliance component shows cerberus is ok:
https://dev.azure.com/onnxruntime/onnxruntime/_componentGovernance/112016/53457366

As this is installed by pip, I am assuming we don't need to update
cgmanifest.json file too.
2020-08-17 15:03:54 -07:00
Ksenija Stanojevic
ea37a4d89b
Add Trilu custom op (#4537)
Co-authored-by: neginraoof <neginmr@utexas.edu>
2020-08-17 14:42:26 -07:00