-
Couldn't load subscription status.
- Fork 702
[ET-VK] Move save_cache from Runtime dtor to model destroy
#6974
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
[ET-VK] Move save_cache from Runtime dtor to model destroy
#6974
Conversation
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6974
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 5af5944 with merge base 711f1c2 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) ghstack-source-id: 254419629 Pull Request resolved: #6974
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254427379 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254427928 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254451659 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254586045 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254592628 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254601628 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`.\ ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) [ghstack-poisoned]
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254701488 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/)
|
This pull request was exported from Phabricator. Differential Revision: D66179917 |
d9d5055
into
gh/jorgep31415/126/base
Pull Request resolved: #6974 ## Issue `Runtime` is a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed. This means the cache is not saved due to the following chain never being invoked. `~Runtime()` > `~Adapter()` > `~ComputePipelineCache()` > `save_cache()`. ## Solution Move cache saving to `VulkanBackend.cpp`'s model destroy. This makes sense since the cache is tied to the model and not the runtime. ## Resources https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195 ghstack-source-id: 254701488 @exported-using-ghexport Differential Revision: [D66179917](https://our.internmc.facebook.com/intern/diff/D66179917/) --------- Co-authored-by: jorgep31415 <[email protected]>
Stack from ghstack (oldest at bottom):
save_cachefrom Runtime dtor to model destroy #6974Runtimemove #6964Issue
Runtimeis a local static variable. Hence we'd expect the Runtime dtor to be called on program exit. But on Android devices it's not being invoked. This behavior is different than that seen 6 months ago (D57085281). It's unclear what changed.This means the cache is not saved due to the following chain never being invoked.
~Runtime()>~Adapter()>~ComputePipelineCache()>save_cache().\Solution
Move cache saving to
VulkanBackend.cpp's model destroy. This makes sense since the cache is tied to the model and not the runtime.Resources
https://medium.com/@martin00001313/mastering-static-objects-in-c-initialization-destruction-and-best-practices-760b17734195
Differential Revision: D66179917