Refactor autograd engine (#4724)
* Accumulate partial grad to acc tensor promptly. * refactor(Tensor): add AutogradMeta and delete retain_grad in constructor * refactor(AutogradEngine): function node just cache autograd_meta and output tensor_infos * fix(*): fix bugs and add zeros op * Capture detached output tensors. * fix(*): fix merge bugs * style(*): refine code * fix(*): refine FunctionNode release * fix(Autograd): save input tensors which requires_grad is true * fix(*): fix bug * format code * chore(*): add head file in cmake Co-authored-by: hjchen2 <hjchen2> Co-authored-by:oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com> Co-authored-by:
Yurui Li <32978179+poohRui@users.noreply.github.com>
Showing
- cmake/oneflow.cmake 1 addition, 0 deletionscmake/oneflow.cmake
- oneflow/api/python/framework/tensor.cpp 9 additions, 7 deletionsoneflow/api/python/framework/tensor.cpp
- oneflow/core/autograd/autograd_engine.cpp 44 additions, 52 deletionsoneflow/core/autograd/autograd_engine.cpp
- oneflow/core/autograd/autograd_engine.h 6 additions, 7 deletionsoneflow/core/autograd/autograd_engine.h
- oneflow/core/autograd/autograd_meta.cpp 39 additions, 0 deletionsoneflow/core/autograd/autograd_meta.cpp
- oneflow/core/autograd/autograd_meta.h 86 additions, 0 deletionsoneflow/core/autograd/autograd_meta.h
- oneflow/core/autograd/autograd_mode.h 5 additions, 2 deletionsoneflow/core/autograd/autograd_mode.h
- oneflow/core/framework/op_expr_grad_function.h 3 additions, 1 deletiononeflow/core/framework/op_expr_grad_function.h
- oneflow/core/framework/op_expr_helper.cpp 7 additions, 7 deletionsoneflow/core/framework/op_expr_helper.cpp
- oneflow/core/framework/op_expr_helper.h 3 additions, 3 deletionsoneflow/core/framework/op_expr_helper.h
- oneflow/core/framework/op_interpreter.h 1 addition, 1 deletiononeflow/core/framework/op_interpreter.h
- oneflow/core/framework/op_interpreter/op_interpreter_util.cpp 3 additions, 5 deletions...low/core/framework/op_interpreter/op_interpreter_util.cpp
- oneflow/core/framework/tensor.cpp 12 additions, 15 deletionsoneflow/core/framework/tensor.cpp
- oneflow/core/framework/tensor.h 8 additions, 7 deletionsoneflow/core/framework/tensor.h
- oneflow/core/framework/tensor_impl.cpp 2 additions, 3 deletionsoneflow/core/framework/tensor_impl.cpp
- oneflow/core/framework/tensor_impl.h 33 additions, 37 deletionsoneflow/core/framework/tensor_impl.h
- oneflow/python/framework/tensor.py 0 additions, 11 deletionsoneflow/python/framework/tensor.py
Please register or sign in to comment