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
[dynamo][eval_frame] Set destroy_extra_state deleter as part of co_extra #107117
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/107117
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a26c3a1 with merge base aa04b05 (): This comment was automatically generated by Dr. CI and updates every 15 minutes. |
letting @jansel on this one |
torch/csrc/dynamo/eval_frame.c
Outdated
@@ -420,7 +425,6 @@ inline static void set_extra_state(PyCodeObject* code, ExtraState* extra_state) | |||
// set_extra_state responsibility to clean it up. It will be deleled during | |||
// the reset_code/skip, when the set_extra_state is called with | |||
// NULL/SKIP_CODE. | |||
destroy_extra_state(code); | |||
_PyCode_SetExtra((PyObject*)code, extra_index, extra_state); |
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 am assuming _PyCode_SetExtra
calls destroy_extra_state
if the value is already set?
(I have not confirmed this.)
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.
…rt of co_extra" Using the `freefunc` facility to free the ExtraState objects - https://peps.python.org/pep-0523/ cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx ipiszy chenyang78 aakhundov [ghstack-poisoned]
…rt of co_extra" Using the `freefunc` facility to free the ExtraState objects - https://peps.python.org/pep-0523/ cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx ipiszy chenyang78 aakhundov [ghstack-poisoned]
…rt of co_extra" Using the `freefunc` facility to free the ExtraState objects - https://peps.python.org/pep-0523/ cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx ipiszy chenyang78 aakhundov [ghstack-poisoned]
ghstack-source-id: e6a38392b88e31d320ef4ff1a7163f7218715d91 Pull Request resolved: #107117
…rt of co_extra" Using the `freefunc` facility to free the ExtraState objects - https://peps.python.org/pep-0523/ cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx ipiszy chenyang78 aakhundov [ghstack-poisoned]
…rt of co_extra" Using the `freefunc` facility to free the ExtraState objects - https://peps.python.org/pep-0523/ cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx ipiszy chenyang78 aakhundov [ghstack-poisoned]
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
@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 |
This PR makes CacheEntry a PyObject. This is prep PR for cache size changes. As CacheEntry is a py object, we can now traverse the linked list in Python and write cache size policies. It was possible to do in C, but Python is just easier to iterate upon. We call convert_frame only when we (re)compile, so a small bump in latency going from C to Python is acceptable here. Pull Request resolved: #107405 Approved by: https://github.com/ezyang ghstack dependencies: #106917, #107117
Stack from ghstack (oldest at bottom):
Using the
freefunc
facility to free the ExtraState objects - https://peps.python.org/pep-0523/cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @aakhundov