Repository navigation
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/96154
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 160ad55: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Mar 7, 2023
Closed
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
This was referenced Mar 9, 2023
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire [ghstack-poisoned]
Contributor
|
@davidberard98 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire Differential Revision: [D43999890](https://our.internmc.facebook.com/intern/diff/D43999890) [ghstack-poisoned]
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire Differential Revision: [D43999890](https://our.internmc.facebook.com/intern/diff/D43999890) [ghstack-poisoned]
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead. I'm using `StorageWeakRef` from `reductions.py`. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case. cc soumith voznesenskym penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx peterbell10 desertfire Differential Revision: [D43999890](https://our.internmc.facebook.com/intern/diff/D43999890) [ghstack-poisoned]
Closed
Contributor
Author
|
Squashed into #89146 |
eellison
added a commit
that referenced
this pull request
Mar 16, 2023
ghstack-source-id: c2aa27e Pull Request resolved: #89146 Use Storages for Cudagraph liveness ghstack-source-id: c2aa27e Pull Request resolved: #96154 Do warmup in cudagraph pool ghstack-source-id: c2aa27e Pull Request resolved: #96433 Comments for cuda graph trees Signed-off-by: Edward Z. Yang <ezyangmeta.com> ghstack-source-id: c2aa27e Pull Request resolved: #96932
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
In the previous PR we used tensors for liveness. This isn't actually correct as we should be treating a cudagraph output as dead only when its storage is dead, not the tensor impl output. The previous handling also had a particularly bad interaction with aot autograd detaching, since it would treat all outputs as dead.
I'm using
StorageWeakReffromreductions.py. This is sufficient for checking if a storage has died, although it doesn't allow you to trigger an event immediately upon deallocation. That works fine for most of the handling of the storage weak ref. The one case it doesn't is if you deallocated a torch dynamo function and its cudagraph wrapper, but you still have a Tensor output of it that you need to wait on to deallocate the cudagraph memory pool. We would need to trigger an event in order to do proper deferred deletion of the cudagraph. I'm deferring that till #91395 has landed, but that shouldn't be a particularly common case.cc @soumith @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire
Differential Revision: D43999890