Commit graph

878 commits

Author SHA1 Message Date
ashbhandare
cf13b9dd5e
Symbolic export for numpy_T (#10390)
* Export numpy_T as onnx transpose

* further fixes, test

Co-authored-by: Aishwarya Bhandare <aibhanda@microsoft.com@orttrainingdev8.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-01-26 14:14:42 -08:00
Tang, Cheng
9aa51379c9
[eager mode]: add configuration for ort virtual device count (#10346)
* add configuration for ort virtual device count

* fix build break

* fix ci build break

Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-01-25 16:15:54 -08:00
pallavides
790c3be7e9
Fix Reshape issue when shape size is -1 (#10356)
* Fix Reshape issue (in_place) when shape size is -1
2022-01-24 19:30:52 -08:00
Dmitri Smirnov
7e092a7e3f
Reduce number of memory allocations based on a customer profiling case (#10193)
Add abseil and inlined containers typedefs
Introduce TensorShapeVector for shape building.
Use gsl::span<const T> to make interfaces accept different types of vector like args.
Introduce InineShapeVectorT for shape capacity typed instantiations
Refactor cuda slice along with provider shared interfaces
Refactor Concat, Conv, Pad
Build with Conv Einsum and ConvTranspose refactored.
Remove TesnorShape::GetDimsAsVector()
Refactor SliceIterator and SliceIteratorBase
Refactor broadcast
Refactor Pads for twice as long
Remove memory planner intermediate shapes vector
Refactor orttraining
Fix passing TenshroShapeVector to tests
Remove abseil copy and submodule, use FetchContent_Declare/Fetch
Path with separate command
Make RocmAsyncBuffer accept anything convertible to span. Adjust Linux GPU pipeline.
2022-01-24 10:40:46 -08:00
Baiju Meswani
141606534c
Add support for FusedAdam to be mathematically equivalent to pytorch/AdamW (#10106) 2022-01-21 13:37:59 -08:00
Cheng Tang
13e277525c fix whitelist 2022-01-21 13:30:53 -08:00
Tang, Cheng
2dcb69685e
support type promotion in binary poerators in eager mode (#10285)
Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-01-20 10:06:09 -08:00
Baiju Meswani
c67594694c
Add ability to set onnx opset version from json config (#10223) 2022-01-20 09:10:19 -08:00
Abhishek Jindal
4aa7cee0d8
Abjindal/clean eager backend (#10055)
* clearing map for eager mode backends

* clearing map for eager mode backends manager

* making OrtBackendsManager an extern variable and trying to delete it

* cleaning backends manager when the python interpret exits

* adding ifdef for eager mode code

* disabling warning for pybind state file

* disabling warning for python module file

* running clang auto format and reducing redundancy

* remove new line

* moving declaration to a new header file

* adding the header file for eager mode for python module

* removing source files for eager mode

* add source file for python module in eager mode

* Update orttraining/orttraining/python/orttraining_python_module_eager.h

Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>

Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
2022-01-19 14:20:09 -08:00
jingyanwangms
a656c55a75
Add _force_exportable_set and pass debug_options (#10282)
* Add _force_exportable_set and pass debug_options

* Update orttraining/orttraining/python/training/ortmodule/experimental/hierarchical_ortmodule/_hierarchical_ortmodule.py

Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>

* nit fix

* Update orttraining/orttraining/python/training/ortmodule/experimental/hierarchical_ortmodule/_hierarchical_ortmodule.py

Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>

Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>
2022-01-19 10:26:27 -08:00
David Fan
7b14c70cfe
[ortmodule] Ensure contiguous tensor into forward pass (#10315) 2022-01-18 22:06:37 -08:00
pengwa
e365ad7f3a
fix deadlock in model.train mode forward run only (#9960)
* fix deadlock in model.train model forward run only

* fix tests

* clear the grad_fns before every forward run

* add clean up on exit

* fix

* refine code comments
2022-01-14 13:53:29 -08:00
Vincent Wang
44e2db9397
CUDA BFloat16 Refactor (#10085) 2022-01-14 19:38:56 +08:00
Vincent Wang
3ea7fb0f9f
fix mem leak (#10272) 2022-01-14 14:54:19 +08:00
ashari4
aff96ce081
remove hardcoded type (#10251) 2022-01-12 10:00:34 -08:00
PeixuanZuo
7d93498e0e
[FIX] register softmaxgrad_13/logsoftmaxgrad_13 for rocm (#10177)
* [FIX] register  softmaxgrad_13/logsoftmaxgrad_13 for rocm
* [FIX] update softmaxgrad_13/logsoftmaxgrad_13 implementation for rocm
2022-01-10 11:33:46 +08:00
Abhishek Jindal
4ac3277743
adding definition of concat operator for mapping it to onnx (#10062)
* adding definition of concat operator for mapping it to onnx

* adding the opgen generator file to include tensorlist type for eager mode
2022-01-06 14:56:35 -08:00
ashari4
4ab891999a
fix hardcoded type (#10205) 2022-01-06 09:28:22 -08:00
ashari4
7b5464ed7b
aten add_ op supports bf16 (#10084)
* hand implemented add_
2022-01-05 09:33:28 -08:00
Tang, Cheng
97659495d9
fix aten view op (#10050)
* fix aten view op

* add test case

* fix signature

* fix the build

Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2022-01-04 08:29:30 -08:00
Edward Chen
3bc91c2151
Move reduced ops files into build directory (#10030)
In a reduced ops build, some source files get updated. This change moves the updated files into the build directory. This way, it is easier to simultaneously manage different build directories (with possibly different reduced ops configurations) based on a single source directory.
2021-12-28 19:04:20 -08:00
Vincent Wang
f780f06240
ConcatGrad for OpSet13 (#10109) 2021-12-24 10:02:52 +08:00
satyajandhyala
bd4fb4c5da
Coding style fix. (#10080) 2021-12-18 12:05:48 -08:00
ashari4
cdbd678192
Check kMSDomain already exists before registering it (#10078)
* Check domain before registration
2021-12-17 17:55:15 -08:00
Bowen Bao
102f9b05e1
Support new symbolic function api from PyTorch with PythonOp (#9880)
* Support new symbolic function api from PyTorch with PythonOp

* Specify exact exception

* add comments

* move comments and arg
2021-12-16 11:08:06 -05:00
George Nash
93636cbd20
Reduce ops for DNNL ep (#10056)
* Add Reduce Ops to DNNL ep

Combine the Reduction ops into one class

Add ReduceL1, ReduceL2, ReduceSum, ReduceMax, ReduceMin, and ReduceProd,
ReduceSumSquare, ReduceLogSum, and ReduceLogSumExp

Reduce code now also handles the keepdims attribute

Also updated code to use HandleNegativeAxis function from
the providers/common.h code instead of manually calculating.

In code documentation exists to help explain complex reduction op code

Add elementwise ops to Reduction op capability code removed keepdims check
from the Reduction op capability code.

Updated the error_tolerance for LogGrad(DNNL EP only) after finding a few
instances that the tests were a little out of tolerance.

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

* Documentation cleanup in dnnl_qattention

Cleaned up the Comments documenting the QAttention operator
For some reason a bunch of new lines were introduced to the
comment making it harder to read.

Signed-off-by: George Nash <george.nash@intel.com>
2021-12-16 07:31:16 -08:00
Tang, Cheng
6357c12977
use inplace reshape (#9991)
Co-authored-by: Cheng Tang <chenta@microsoft.com@orttrainingdev9.d32nl1ml4oruzj4qz3bqlggovf.px.internal.cloudapp.net>
2021-12-15 21:17:29 -08:00
ashari4
af71da0ac6
Yield op supports bf16 (#10035) 2021-12-14 13:12:37 -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
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
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
Ryan Hill
e0960d7d79
Change assert on a null value to an ort_enforce (#9982) 2021-12-09 14:44:58 -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
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
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
Weixing Zhang
840212e115
Enable OneHot kernel for ROCm EP and add Dockerfile for ROCm 4.3.1 (#9656)
* enable OneHot for ROCm EP

* add dockerfile for ROCm 4.3.1

Co-authored-by: Weixing Zhang <wezhan@microsoft.com>
2021-12-07 12:47:00 -08:00
Weixing Zhang
67a30ef716
Address some code scan issues (#9873)
Potential comparison of a constant with another constant.
at D:\a\_work\1\s\orttraining\orttraining\training_ops\cuda\reduction\\reduction_all.cu@97,42

Co-authored-by: Weixing Zhang <wezhan@microsoft.com>
2021-12-06 13:50:52 -08:00
Tang, Cheng
8db49e3d0f
add ortmodule and eager mode test (#9888)
* add ortmodule and eager mode test

* add ortmodule dependency

* fix eager pipeline

* skip tthe ortmodule test for windows due to win ci issue

* remove useless win ci change

* add torch

Co-authored-by: Abhishek Jindal <abjindal@microsoft.com>
2021-12-02 19:49:18 -08:00
Sherlock
175acf08f4
ScatterND supports negative indices (#9739)
* ScatterND supports negative indices
2021-11-30 21:17:32 -08:00
Sherlock
6de79d82c8
Fix Training Packaging pipeline (#9885)
* Fix Training Packaging pipeline
2021-11-30 15:26:10 -08:00
Tang, Cheng
37bf46eb19
support print in ort eager mode (#9825)
* fix reshape implementation in eager mode

* test code

* update opgen script to support fallback to cpu

* enhance the eager backend to support torch cpu fallback

* add more testes

* disable the printensor test for now, as we need to erge a PR to pytorch first
2021-11-29 08:03:57 -08:00
Vincent Wang
24f3d72b77
relax atol and rtol for einsum ut (#9842) 2021-11-23 14:39:14 +08:00
Ryan Hill
1b953c6423
Fix some code defects (#9810) 2021-11-19 15:48:15 -08:00
Sergii Dymchenko
ba339e667b
Add training performance investigation script (ONNX graph analyzer) (#9791)
* Add first version of performance investigation script.

* Simplify and update performance investigation script.
2021-11-19 13:27:00 -08:00
Tang, Cheng
fcc167dd47
fix reshape implementation in eager mode (#9741) 2021-11-18 19:26:49 -08:00
satyajandhyala
3af14fc554
Updated SoftmaxGrad and LogSoftmaxGrad to support version 13. (#9733)
* Updated SoftmaxGrad_13/LogSoftmaxGrad_13 to support version 13.
2021-11-18 17:39:16 -08:00
Vincent Wang
3654a5d60e
Register Custom Symbolic of torch.einsum for ORTModule (#9590)
* register custom symbolic for einsum

* bugfix for case needs permute at the end

* refactor

* refactor equation parser

* support new case, use ReduceProd

* optimize perf and graph

* remove some Gather node

* add more ut, fix gemm trans fusion
2021-11-18 10:13:58 +08:00
satyajandhyala
421e4c03ce
Update default cast propagation strategy from None to FloodFill (#9713)
* Changed the default cast propagation strategy from None to FloodFill.
2021-11-16 13:15:57 -08:00