Skip to content

Use autograd_inlining for model export#16665

Merged
pengwa merged 3 commits intomainfrom
pengwa/disable_inline
Jul 12, 2023
Merged

Use autograd_inlining for model export#16665
pengwa merged 3 commits intomainfrom
pengwa/disable_inline

Conversation

@pengwa
Copy link
Copy Markdown
Contributor

@pengwa pengwa commented Jul 12, 2023

Use autograd_inlining for model export

From some versions of PyTorch, there is an issue related to custom autograd.Function inlining, even though we register custom export function for the autograd.Function (e.g. when custom autograd function is enabled).

As an options, PyTorch exporter adds a new flag during export, we can disable the inline. pytorch/pytorch#104067

Currently the PyTorch change is in nightly built, this PR dynamically check the torch.onnx.export's signature and decide to use the autograd_inlining when it exists.

Motivation and Context

@pengwa pengwa added the training issues related to ONNX Runtime training; typically submitted using template label Jul 12, 2023
@pengwa pengwa requested a review from wschin July 12, 2023 10:40
@pengwa pengwa merged commit 2449ded into main Jul 12, 2023
@pengwa pengwa deleted the pengwa/disable_inline branch July 12, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

training issues related to ONNX Runtime training; typically submitted using template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants