Commit graph

30 commits

Author SHA1 Message Date
Hariharan Seshadri
b5f7bb7d10
Update ONNX (#9462) 2021-10-29 10:33:40 -07:00
Abhishek Jindal
868c8af9ac
Abjindal/eager mode pipeline (#8870)
* Adding pipeline file for eager mode

* adding the build eager mode flag

* adding torch wheel files for installation

* Changing pytorch version for change in wheel files

* updating requirements file path

* Removing Java and NodeJS from the build

* removing import torch for testing build of eager mode

* changing the build command

* import torch

* building eager mode separately

* removing Java tests

* python path issues

* changing python path location

* changing the build path file loc

* installing torch before build

* setting environment for building eager mode

* Copying the build file and getting rid of flags

* changing python path

* adding missing packages

* moving build eager mode code

* changing python path to python3

* adding amd_hipify

* adding logger file

* install torch before build

* change requirements file location

* install torch before build eager

* modifying eager mode build

* modifying build location

* adding new docker image

* handling gradle move issue

* Typo fix

* changing deps file

* adding java and nodejs

* changing repo name for docker image

* removing pybind

* building only eager mode

* changing the image name

* removing install wheel package

* build complete onnxruntime with eager mode

* building wheel

* enabling pybind

* adding build eager mode flag in unit tests

* removing build java nodejs

* adding build command

* removing java tests

* moving Debug tests before Release

* building Debug only case

* changing debug test code

* running the build eager mode with tests

* adding build dir

* adding build dir path

* changing build dir path

* changing build command for eager mode

* building eager mode and running tests simultaneously

* adding more flags to the pipeline

* chaning flag

* adding Debug and Release

* changing torch to nightly build

* changing torch version for nightly build

* chaning torch version

* move to Ubuntu image

* adding pool

* adding dockerfile for eager mode

* adding python deps file for eager

* modifying python deps file for eager

* changing deps file

* changing deps file statements

* changing python path

* REMOVING ECHO line

* going to original docker file

* changing docker file

* changing to eager requirements file

* changing python deps file

* changing paths

* changing cmake path

* changing build script

* changing python installation

* running debug mode only

* changing pipeline file

* test name

* test name

* test name2

* changing requirements file

* final flags for eager mode

* previous pipeline

* moving to ubuntu image and including some deps

* adding cmake path

* returning to manylinux image

* removing unncecessary files for pipeline
2021-08-30 18:24:39 -07:00
Edward Chen
20f006c580
Remove flake8 check from CMake build. (#8662) 2021-08-09 14:10:36 -07:00
Ashwini Khade
96eb9810ba
Update onnx (#8458)
* updates for picking pnnx commit

* add tests filter to c# tests

* plus test fixes

* fix versioning for contrib ops

* fix tests

* test filter for optional ops

* more versioning related updates

* fix test

* fix layernorm spec

* more updates

* update docs

* add more test filters

* more filters

* update binary size threshold

* update docs

* plus more fixes

* updates per review

* update to release commit

* add filters for optional type tests

* plus updates
2021-08-05 09:21:44 -07:00
Thiago Crepaldi
83be3759bc
Add post-install command to build PyTorch CPP extensions from within onnxruntime package (#8027)
ORTModule requires two PyTorch CPP extensions that are currently JIT compiled. The runtime compilation can cause issues in some environments without all build requirements or in environments with multiple instances of ORTModule running in parallel

This PR creates a custom command to compile such extensions that must be manually executed before ORTModule is executed for the first time. When users try to use ORTModule before the extensions are compiled, an error with instructions are raised

PyTorch CPP Extensions for ORTModule can be compiled by running:
python -m onnxruntime.training.ortmodule.torch_cpp_extensions.install

Full build environment is needed for this
2021-06-28 18:11:58 -07:00
Negin Raoof
80b7b134bf
Adding optional ops in contrib ops (#7946)
* Added optional const spec
2021-06-24 13:16:31 -07:00
Changming Sun
6e2b064aec
Delete some unused code in run_dockerbuild.sh and Enable Nuget CUDA tests (#8089)
1. Remove some unused code and simplify tools/ci_build/github/linux/run_dockerbuild.sh.
2. Enable Nuget CUDA tests. The original design was we could leverage Directory.Build.props and let cmake generate the required properties(USE_CUDA/...) there. However, in nuget packaging pipeline we test the package on a different host that doesn't run cmake command and doesn't have the auto-generated Directory.Build.props file.
2021-06-22 18:43:33 -07:00
Suffian Khan
35ca3c99d1
Fix ROCm wheels pipeline after changes to manylinux scripts (#8026)
* update

* try fix rocm pipeline

* avoid already isntalled error

* ignore python3.10 since build fails

* fix

* try setting user

* try again

* try again

* try again

* fix script

* disable inference docs generation

* try print device id

* fix name qual

* try again

* try again

* try again

* provider_options

* add device verify

* rty again

* try again

* try aggain

* print video/render gid

* try again

* run as root

* try again with uid, gid

* cleanup

* run as root

* temp fix

* add /bin/bash

Co-authored-by: Changming Sun <chasun@microsoft.com>
2021-06-10 21:01:28 -07:00
pengwa
cb5f411da3
Fix Python Packaging Pipeline && Build Clean Up (#7993)
* remove link to python

* revert orttraining-linux-ci build env change introduced by pr
https://github.com/microsoft/onnxruntime/pull/7993.

* fix builds

* fix builds

* clean up

* fix builds

* Fix unused params

* fix some comments.
2021-06-09 17:35:17 +08:00
pengwa
9e4dc08483
training with custom autograd Functions (#7513)
* Register Torch Custom autograd.Function

* Add flag to supress pybind11 warning

* Avoid unnecessary include in cmake

* Add missing reference

* Add getter for registerred functions

* Format for making subsquent changes cleaner

* Fix interop feature build failure

* Forward pass, run PyOP on CPU EP

* clean up the code

* Fix build

* Define new ops

* refactor pyop - extract PyOpLibProxy class

* Hacks to run example

* implement the kernel compute func

* add back PyOP for comparision experiments

* debug info - thread id

* refine the kernels

* Polish code

(cherry picked from commit 4ed606f9a0)

* Fix a the Tensor address mismatch in C++ side

* PythonOpGrad compute

* add distributed test case

* refine test cases

* get dist.get_rank() in Autograd forward pass

* Add CUDA kernels

* Store float, int, and tuple of them as PythonOp's attributes

* Populate local changes

* Fix bugs

* PythonOp/PythonOpGrad CUDA kernels

* Support non-tensor inputs

* Single GPU FP16 Run Pass

(cherry picked from commit e539989e91e18ee997900292d3493b97d3eafa8a)

* Fix segement

* add basic test cases

* Save progress

* fix gradient builder for a Add op who have same inputs

* add test cases for auto grad fallback feature

* fix ref cnt issue. add thread id for debugging

* POC: remove interface class

* Remove interface classes

* Clean a bit

* Coarse-grained clean up after rebase master

* reset pyop and language_interop_ops to latest master

* Fix missing part during merge

* re-structure torch related language interop files

* Fix build

* Fix tests and build

* Fix build and basic unit tests

* Fix most of uts

* remove unnecessary import

* clean up and fix build when enabling language_interop_ops

* Fix single-GPU UTs

* Move runner register into ORT package

* Update dist UTs to new style

* Also fix distributed UTs and leaf gradient problem

* Static generation for constant args

* Move arg_positions_ to static field

* Rename some functions

* Move arg ceration into a function

* Clean output logic in PythonOp

* Move PythonOp's ctor

* Revise PythonOpGrad

* Fix "ORT only supports contiguous tensor for now" for inputs

* Fix evaulation mode error, add test & clean up

* clean up codes

* Fix issues introduced by recent master change (enabled symbolic shape infer)

* automatically register forward/backward function pointers && clean up

* Fix multi-output case

* Add a test back

* fix build and clean up

* RAII for function params PyObject

* Use new exporter

* Clean full name in new exporter

* Fix UTs

* Format a file

* Add "inplace" back

Remove a legacy comment

* Refine TorchProxy
1. Make TorchProxy a formal singleton class.
2. Remove unused Scope class.
3. Simplify the call to Forward and Backward. The two functions now
   automatically acquire and release GIL state, so user doesn't need
   any GIL-related calls.

* Format

* Add lock to avoid racing condition when registering Python objs

* Fix Python call param ref issues && Add RefcountTracker for debug build && Clean up

* clean up print

* Resolve part of comments && clean up

* Fix a potential bug

* track pyobject consistently

* move kernels to cpu provider as base class

* Refactor - 1. Extract PythonOpBase/PythonOpGradBase 2. Implement CPU kernels 3. Test coverage for CPU kernels

* Refine register code

* Add a missing macro

* Release python call result objects with PythonObjectPtr && Add UnRegisterContext && Track PyObject for Debugging && Clena up

* Fix random segfault issue - relasing a wrong ctx pointer for inplace cases

* put ref count in debug macro

* Move GIL out

* Refine tests

* Fix memory leak issue && forward output lifecycle issue:
1. Unregister the OrtValue PythonObject. Currently, the OrtValue shared same buffer with PythonOp/PythonOpGrad's output. So after those kernels outputs are released, the "leaked" OrtValue caused the shared buffer cannot be released.
2. According PyTorch forward+backward execution. The forward outputs (e.g. torch tensors) maintains the context/saved variables/dirty inputs, etc, which are used for backward execution, so its life should be after the backward runs. This change added such a depencencies between PythonOpGrad on PythonOp.

* Move dlpack->ortvalue into C++ to avoid temp object registration

* Fix the over released Py_False/Py_True && refine tests

* Clean up unused functions

* Always assume the first forward output is context so we don't need to test unused cases.

* Fix a memory leak

* move-copy unique_ptr & avoid C-style casting

* Use inplace attribute to determine if input tensors are copied

* Move DlpackCapsuleDestructor's to a common place

* Thread-safe TorchProxy

* Use OrtValue instead of OrtValue*

* Only keep checks for Debug build

* Wrap some long line per comment

* onnx_export_type --> kwargs

* Use requires_grads to create PythonOpGrad's inputs

* add missing files during master merge

* Fix build issue after merge

* Address two comments.
1. Internalize DlpackCapsuleDestructor
2. Change "(" to "]" for describing closed interval.

* Address some comments.
1. "override" -> "overwrite" to avoid using reserved keyword.
2. Call DLPack's helper to create OrtValue for avoiding repeated code.

* Address comments.
1. Pass std::mutex to registeration helpers so their callers don't
   have to lock the mutex expclicitly.
2. Rename "func_context_pool_mutex_" to "mutex_". This mutex is the global mutex for OrtTorchFunctionPool.

* Add bridging code to make cuda kernels work with merged master

* put debue macro check within RefCountTracker && use default logger for debug info && remove useless ortvalue_ptr interface && typos && revert unncessary blank line changes

* fix some comments

* Resolve more comments

* Capitalize a word

* use unique_ptr instead of ObjectPointer for PyObject management && add converntion

* Support symbolic shape

* Remove unused variable

* fix build

* Enable function registration for training only && rectify ToDlpack/FromDlpack merge with master.

* Don't add context for non-PythonOp opeartors (for example AtenOp)

* Fix build error

* Polish frontend part.
1. Avoid adding kwargs to ORTModule's ctor
2. Use onnx_export_type rather than kwargs for type safty
3. Fix some build bugs.

* Resolve simpler comments

* Resolve export related comments

* sync master && fix tests && fix non-training build error

* Fix build errors

* add target link lib

* windows build error

* Fix orttraining-linux-ci build

* disable autograd test && clean up

* fix linux orttraining ci build

* try fixing win build error

* Revise append calls in runner

* Enable custom function using a function

* Rename to avoid using reservied keyword

* Use list comprehension

* Set ORT random seed in tests

* Remove print code and fix ctx shape

* [] -> list()

* Move autograd.Function and nn.Module into corresponding functions

* Move test helpers

* Polish dist test a bit. Tried move helpers to helper file but it causes a deadlock.

* trying fix undefined reference

* Context is not managed by global pool

* Polish dist test

* Polish dist test

* Add enable_custom_autograd_function

* Remove enable_custom_autograd_function from ctors

* Add doc strings

* Shorter code

* Address comments

* Add one empty line

* revert a minor and not needed change

* Address comments

* Back to reference

* Fix windows builds

* Fix windows debug build fail to find "'python39_d.lib'"

* fix mac build error

* revert _to_contiguous change

* add debugging tag for orttraining-cpu-ci

* Fix the wrong PYTHON_LIBRARIES which is affected by PYTHON_LIBRARY given in build command

* add debugging info

* Fix the build in this case: PYTHON_LIBDIR: /opt/_internal/cpython-3.7.10/lib, PYTHON_EXECUTABLE: /opt/python/cp37-cp37m/bin/python3, PYTHON_MULTIARCH: x86_64-linux-gnu
PYTHON_LIBRARY_PATH python3.7m

* fix build error due to python lib not found

* Fixes
1. Release PyObject's
2. Not useing deepcopy because we assume autograd.Function's
   non-tensor inputs are static (constants) so there should
   be no side effect after calling any autograd.Function
   multiple times.

* Revert dtoc for decreasing refcnt

* add debugging log

* add debugging tag

* Fix a small leak

* Remove ONNX_FALLTHROUGH flag

* debug tag

* debug tag

* fix builds

* remove debug tag

* fix build

* fix builds

* fix build

* install python3 in centos, in case there is no libpython3.xm.so

* build python so for redhat

* add training cpu specific docker, build python so inside

* revert build-cpython change

* try fixing numpy include issue

* install_deps after re-installing cpython

* fix build && remove debug tag

* install openssl before cpython

* let's say: builds pass!

* add build flag for torch iterop, only enable it when training+Python is enabled

* skip ComputeBroadcastBackwardAxesDynamic for the shared inputs

* fix build

* add debug info for padgrad test

* Fix builds

* Split dlpack_converter into C++ and Python interfaces respecitively. Then different build use them as needed.

* clean up the changes

* fix addsubgradient builder

* Fix builds

* clean up

* clean up

* Address some comments.
1. Use pointer wraper to avoid calling Py_DECREF
2. Remove unregister_* functions
3. Allow repeated registration by skipping those with existing keys
4. Unregister context in PythonOpGrad

* Fix over-released Py_Boolean

Co-authored-by: Wei-Sheng Chin <wschin@outlook.com>
2021-06-07 13:01:21 -07:00
Thiago Crepaldi
c45ac166d3
Add graphviz into Dockerfile images for Python API documentation (#7819) 2021-06-02 16:12:54 -07:00
Changming Sun
38d90b0f15
Cleanup install_deps.sh (#7734) 2021-05-17 19:27:47 -07:00
ashbhandare
56e993a434
Bump to rel-1.9.1 (#7684) 2021-05-13 18:41:28 -07:00
Changming Sun
a284eede64
Fix Linux CPU pipeline (#7584) 2021-05-05 13:26:10 -07:00
Ashwini Khade
75e054cd33
pick onnx release candidate (#7177)
* pick onnx release candidate

* fix typo

* filter batchnorm tests

* add implementation for reshape 14

* add identity op kernel for opset 14

* fix typo

* update onnx commit

* update commit to latest master

* add hashes for new kernel registrations and update 1

* TEST commit

* update onnx back to right commit

* Update onnx to latest in rel-1.9.0

* temp fix

* remove nonzeroshapesetter transformer

* pick rel branch latest commit

* fix build failures

* fix build failures

* fix build failures

* update the commit to latest in release branch

* add test filters for not impemented op14 ops in c# tests

* plus review comments
2021-04-22 23:57:09 -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
Ashwini Khade
b22e60bd44
pull onnx latest commit (#7102)
* update onnx commit

* fix test scripts to remove deprecated call

* update filters

* add registration for relu and cumsum ver 14

* add promote trilu to onnx domain

* update onnx-tensorrt submodule

* update flag

* update flag

* update dependencies

* fix android ci failure
2021-03-29 11:00:38 -07:00
Thiago Crepaldi
867804bea1
Add auto doc gen for ORTModule API during CI build (#7046)
In addition to ORTModule auto documentation during packaging, this PR also update golden numbers to fix CI
2021-03-22 10:20:33 -07:00
Changming Sun
b5bd14fc9f
Update GPU packaging pipelines to cuda11 and fix the other build break issues (#6585)
Update gpu packaging pipelines to CUDA11

In the next release we will use CUDA 11. And our CUDA 11 build suddenly became broken because recently CentOS 7 posted an update of glibc. The version of glibc was changed from 2.17-317.el7 to 2.17-322.el7_9. But the newer one isn't compatible with CUDA 11. We have to downgrade it.
2021-02-05 16:58:37 -08:00
Chun-Wei Chen
f2ce3aae13
add set_model_dir and update ONNX (#6119) 2021-02-05 09:30:49 -08:00
Scott McKay
c84bb9df9f
Add ability to track per operator types in reduced build config. (#6428)
* Add ability to generate configuration that includes required types for individual operators, to allow build size reduction based on that.
  - Add python bindings for ORT format models
    - Add script to update bindings and help info
  - Add parsing of ORT format models
  - Add ability to enable type reduction to config generation
  - Update build.py to only allow operator/type reduction via config
    - simpler to require config to be generated first
    - can't mix a type aware (ORT format model only) and non-type aware config as that may result in insufficient types being enabled
  - Add script to create reduced build config
  - Update CIs
2021-01-29 07:59:51 +10:00
Hariharan Seshadri
d7bdd96425
Refine auto_pad based pad computation in ConvTranspose (#6305) 2021-01-19 19:01:49 -08:00
Ashwini Khade
0ed56d491a
fix opset imports for function body (#6287)
* fix function opsets

* add tests and update onnx

* changes per review comments

* add comments

* plus updates

* build fix
2021-01-12 13:44:36 -08:00
Chun-Wei Chen
84024bdfa9
Enable ONNX backend test of SequenceProto input/output (#6043)
* assert sequence tensor and remove skips

* update testdata json

* use ONNX 1.8 in cgmanifest.json

* use previous commit to workaround

* update ONNX commit ID in docker

* skip test_maxpool_2d_dilations test for now

* update function name
2021-01-11 11:30:33 -08:00
Changming Sun
2d9dcc4576
Add python 3.9 support (#5874)
1. Add python 3.9 support(except Linux ARM)
2. Add Windows GPU python 3.8 to our packaging pipeline.
2020-11-30 12:02:48 -08:00
Ashwini Khade
705d093167
Update onnx (#5720)
* update onnx

* update docker image for testing
2020-11-24 11:20:15 -08:00
Changming Sun
79350a642a
Update install_deps.sh: remove the unnecessary data generating step (#5758)
We install onnx python package from this script, so python tests can run the tests for the latest commit which we are importing.
2020-11-10 22:19:03 -08:00
Ashwini Khade
1cca903680
update onnx commit id (#5594)
* update onnx commit id

* update onnx commit for docker images

* update docker images
2020-11-02 09:46:36 -08:00
Ashwini Khade
df22611026
Update ONNX commit (#5487)
* update ONNX

* update onnx + register kernels for reduction ops

* bug fix kernel reg

* update cgmanifests

* revert unsqueeze op 13 registration

* filter ops which are not implemented yet

* filter some tests

* update onnx commit to include conv transpose bug fix

* update docker images

* undo not required test changes

* fix test failures
2020-10-21 07:22:20 -07:00
Changming Sun
17f1178c2e
Downgrade GCC (#5269)
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2020-09-24 21:14:54 -07:00