[dynamo] skip_guard_eval_unsafe stance for power users#140251
[dynamo] skip_guard_eval_unsafe stance for power users#140251anijain2305 wants to merge 14 commits intogh/anijain2305/587/basefrom
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140251
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit eb55040 with merge base f4ce9ac ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
williamwen42
left a comment
There was a problem hiding this comment.
Do we expect the string stance to be "default" when skip_guard_eval_unsafe=True?
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
It can be other stances as well. But I expect |
torch/_dynamo/decorators.py
Outdated
|
|
||
| def __init__(self, stance: str, force_backend=None) -> None: | ||
| def __init__( | ||
| self, stance: str, skip_guard_eval_unsafe: bool = False, force_backend=None |
There was a problem hiding this comment.
Let's force these to be kwargs:
| self, stance: str, skip_guard_eval_unsafe: bool = False, force_backend=None | |
| self, stance: str, *, skip_guard_eval_unsafe: bool = False, force_backend=None |
torch/compiler/__init__.py
Outdated
|
|
||
|
|
||
| def set_stance(stance: str, force_backend=None): | ||
| def set_stance(stance: str, skip_guard_eval_unsafe=False, force_backend=None): |
There was a problem hiding this comment.
| def set_stance(stance: str, skip_guard_eval_unsafe=False, force_backend=None): | |
| def set_stance(stance: str, *, skip_guard_eval_unsafe=False, force_backend=None): |
torch/csrc/dynamo/extra_state.cpp
Outdated
| void* diff_guard_root_mgr = | ||
| torch::dynamo::convert_to_root_guard_manager( | ||
| cache_entry.guard_manager.attr("diff_guard_root")); |
There was a problem hiding this comment.
How expensive is this? Could we do this without doing a Python getattr (with refcountin, etc)?
There was a problem hiding this comment.
Removed this. And added a new member to the cache_entry, which we update in lockstep with the python diff_guard_root update.
|
Maybe we should also give |
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng chauhang amjames [ghstack-poisoned]
|
@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 |
Pull Request resolved: pytorch#140251 Approved by: https://github.com/jansel ghstack dependencies: pytorch#140223, pytorch#140250
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames