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
[inductor] Defer memory operation lowering to wrapper #111402
Conversation
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/111402
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 3c9fd63 with merge base 185e762 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. ghstack-source-id: 70aca600d57a98e99da85eef157fc37d4859008f Pull Request resolved: #111402
|
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. ghstack-source-id: 2f238a47e43bc1ace75dde9863848b37108df34a Pull Request resolved: #111402
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.
Tests are failing
torch/_inductor/codegen/wrapper.py
Outdated
name = buffer.get_name() | ||
if name in self.freed: |
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.
Don't we need to do this on the last free, not the first one?
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.
sorry, not sure I understand this comment. What is the first/last free you're referring to here?
torch/_inductor/codegen/wrapper.py
Outdated
name = buffer.get_name() | ||
if name in self.freed: |
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.
Don't we need to do this on the last free, not the first one?
torch/_inductor/codegen/wrapper.py
Outdated
name = buffer.get_name() | ||
if name in self.freed: | ||
return "" | ||
self.freed.add(name) |
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.
can we avoid duplicate code with above?
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've removed these entirely. I'm not sure why this change was introduced in your initial diff... but things seem to work regardless
This wasn't meant for review yet, that's why I marked it as a draft... should I be taking off the reviewers as well? This isn't the first time I've had a draft reviewed :/ |
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 aakhundov ColinPeppler [ghstack-poisoned]
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. ghstack-source-id: a7980e474d6d24e9e8aac84b6fa7b9250396d95a Pull Request resolved: #111402
@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 |
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. Pull Request resolved: pytorch#111402 Approved by: https://github.com/jansel
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. Pull Request resolved: pytorch#111402 Approved by: https://github.com/jansel
Right now, memory ops are being lowered to strings partly in scheduler.codegen() and partly in wrapper.codegen(). But that makes static memory planning (which is done entirely in `wrapper.codegen()`) difficult to implement as information is "lost" by that point. Pull Request resolved: pytorch#111402 Approved by: https://github.com/jansel
Stack from ghstack (oldest at bottom):
Right now, memory ops are being lowered to strings partly in
scheduler.codegen() and partly in wrapper.codegen(). But that makes
static memory planning (which is done entirely in
wrapper.codegen()
)difficult to implement as information is "lost" by that point.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler