onnxruntime/orttraining/orttraining/python/training/utils
pengwa 0e2782438a
Support inplace update for PythonOp/Grad (#17687)
### Support inplace update for PythonOp/Grad

This PR is based on another PR
https://github.com/microsoft/onnxruntime/pull/17685's branch, to make it
easier to review.

With PR: PR https://github.com/microsoft/onnxruntime/pull/17685, By
default all PythonOp inputs/outputs are assumed to not be inplaced, if
during run, we found some inplace update happens (by checking output
data address with all inputs data address), we add clone before set it
as PythonOp/Grad's outputs. In this case, results are correct, but
implicit copies overheads are introduced.

This PR allow users to define output input reuse map, to let ORT know
how to do the reuse map, avoid such unnecessary copies.
2023-10-10 21:36:45 -07:00
..
data
hooks Support inplace update for PythonOp/Grad (#17687) 2023-10-10 21:36:45 -07:00
__init__.py Model post process for zero stage3 training (#17187) 2023-09-22 08:54:25 +08:00
torch_io_helper.py Refactor schema extraction and output unflattening (#16894) 2023-08-04 13:58:21 +08:00
torch_type_map.py Model post process for zero stage3 training (#17187) 2023-09-22 08:54:25 +08:00