onnxruntime
b6a3562f - [ORTModule] Add Env Variable to Control Disabling Custom AutoGrad Function Support (#13430)

Commit
3 years ago
[ORTModule] Add Env Variable to Control Disabling Custom AutoGrad Function Support (#13430) Add env variable to control disabling custom autogard function support. When using ORTModule, if the torch model has torch.nn.Function, if user confirms that it can be exported to ONNX (for example, by inline PythonOp) and the backward implementation is matched to the forward impl, user can export "ORTMODULE_DISABLE_CUSTOM_AUTOGRAD_SUPPORT=1" to disable the custom autograd support so that it won't use ORT's PythonOp to fallback to PyTorch. Exporting to ONNX sometimes can leverage some graph optimizations in ORT so that perf is better.
Author
Parents
Loading