-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[inductor] Optimize cache_on_self #135445
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/135445
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 32c9b80 with merge base 8c738c9 ( 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. |
| ctx = {"fn": fn} | ||
| exec( | ||
| f"""\ | ||
| def {name}_cache_on_self(self): |
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.
Ugh, there has to be a better way to dynamically generate the functions. setattr can handle most of the assignments, just need something for dynamically naming the function which should be doable
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.
setattr is a lot slower...
Before:  After:  Pull Request resolved: #135446 Approved by: https://github.com/oulgen ghstack dependencies: #135445
Pull Request resolved: #135776 Approved by: https://github.com/oulgen ghstack dependencies: #135445, #135446
This is a small compile time win, but also makes profiles more readable. Pull Request resolved: pytorch#135445 Approved by: https://github.com/oulgen
Before:  After:  Pull Request resolved: pytorch#135446 Approved by: https://github.com/oulgen ghstack dependencies: pytorch#135445
Pull Request resolved: pytorch#135776 Approved by: https://github.com/oulgen ghstack dependencies: pytorch#135445, pytorch#135446
ghstack-source-id: 1edf35e Pull Request resolved: pytorch/pytorch#135445
Stack from ghstack (oldest at bottom):
This is a small compile time win, but also makes profiles more readable.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang