-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[compiled autograd] have context manager turn on dynamo config #138241
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138241
Note: Links to docs will display an error until the docs builds have been completed. ❌ 17 New Failures, 1 Unrelated FailureAs of commit 7250431 with merge base d531bd5 ( NEW FAILURES - The following jobs have failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torch/_dynamo/compiled_autograd.py
Outdated
| if not prior: | ||
| compiled_autograd_enabled = False | ||
| torch._dynamo.config.compiled_autograd = prior_config | ||
| torch._C._dynamo.compiled_autograd.set_autograd_compiler(prior) |
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.
maybe we can rebase on top of #138113 to avoid potential merge conflict?
…nfig" We need a way to unify CA checks across ctx manager or torch.compile APIs. Setting this config is actually a no-op, but unifies the state One edge case is user using torch.compile on regions that have .backward() but don't want CA to execute on them and another thread is within the context manager. The general solution to the problem would be to first make the state thread local, then have FSDP create threads that carryover the compiled autograd state cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec yf225 [ghstack-poisoned]
…nfig" We need a way to unify CA checks across ctx manager or torch.compile APIs. Setting this config is actually a no-op, but unifies the state One edge case is user using torch.compile on regions that have .backward() but don't want CA to execute on them and another thread is within the context manager. The general solution to the problem would be to first make the state thread local, then have FSDP create threads that carryover the compiled autograd state cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec yf225 [ghstack-poisoned]
…nfig" We need a way to unify CA checks across ctx manager or torch.compile APIs. Setting this config is actually a no-op, but unifies the state One edge case is user using torch.compile on regions that have .backward() but don't want CA to execute on them and another thread is within the context manager. The general solution to the problem would be to first make the state thread local, then have FSDP create threads that carryover the compiled autograd state cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames rec yf225 [ghstack-poisoned]
|
nvm this doesnt work for reentrants |
We need a way to unify CA checks across ctx manager or torch.compile APIs. Setting this config is actually a no-op, but unifies the state
One edge case is user using torch.compile on regions that have .backward() but don't want CA to execute on them and another thread is within the context manager. The general solution to the problem would be to first make the state thread local, then have FSDP create threads that carryover the compiled autograd state
Stack from ghstack (oldest at bottom):
_compiled_autograd_enabledglobal state variable #138187cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames @rec @yf225