-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[AOTInductor] Enforce no_grad for Run entries #111613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111613
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit fae89ab with merge base 6a99291 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Oleg made a good point regarding recovering from Exceptions. LGTM otherwise. Thanks!
| // enforce no_grad context for run APIs. | ||
| #define WITH_NO_GRAD(...) \ | ||
| do { \ | ||
| bool prev_mode = aoti_torch_grad_mode_is_enabled(); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider print a warning msg if prev_mode is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be invoked in critical path of run(), so I shouldn't print log at every run() call.
I can print warning at ContainerCreate(), but there is a chance that create() is called under no_grad, but run() is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging now.
I can add logs latter if required.
Summary: Always enter no_grad mode in AOTInductor run entries. ``` // AOTInductor uses at::addmm_out, which doesn't supports // arguments that requires gradient. For this reason, we // enforce no_grad context for run APIs. ``` Test Plan: buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor and OSS CI Reviewed By: chenyang78 Differential Revision: D50432042
cd061d9 to
f08b46d
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
f08b46d to
dd2d917
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
dd2d917 to
ad7f569
Compare
Summary: Always enter no_grad mode in AOTInductor run entries. ``` // AOTInductor uses at::addmm_out, which doesn't supports // arguments that requires gradient. For this reason, we // enforce no_grad context for run APIs. ``` Test Plan: buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor and OSS CI Reviewed By: khabinov, chenyang78 Differential Revision: D50432042
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
ad7f569 to
b5fd0e3
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
Summary: Always enter no_grad mode in AOTInductor run entries. ``` // AOTInductor uses at::addmm_out, which doesn't supports // arguments that requires gradient. For this reason, we // enforce no_grad context for run APIs. ``` Test Plan: buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor and OSS CI Reviewed By: khabinov, chenyang78 Differential Revision: D50432042
b5fd0e3 to
fae89ab
Compare
|
This pull request was exported from Phabricator. Differential Revision: D50432042 |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: Always enter no_grad mode in AOTInductor run entries. ``` // AOTInductor uses at::addmm_out, which doesn't supports // arguments that requires gradient. For this reason, we // enforce no_grad context for run APIs. ``` Test Plan: buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor and OSS CI Differential Revision: D50432042 Pull Request resolved: pytorch#111613 Approved by: https://github.com/chenyang78, https://github.com/khabinov
Summary: Always enter no_grad mode in AOTInductor run entries. ``` // AOTInductor uses at::addmm_out, which doesn't supports // arguments that requires gradient. For this reason, we // enforce no_grad context for run APIs. ``` Test Plan: buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor and OSS CI Differential Revision: D50432042 Pull Request resolved: pytorch#111613 Approved by: https://github.com/chenyang78, https://github.com/khabinov
Summary:
Always enter no_grad mode in AOTInductor run entries.
Test Plan:
buck2 test mode/dev-nosan caffe2/test/inductor:test_aot_inductor
and OSS CI
Differential Revision: D50432042
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler