-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[c10d] Refactor CUDAEventCache Create to use deque rather than stack #138048
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138048
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c62c197 with merge base a77bb85 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
kwen2501
left a comment
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.
LGTM.
nit: not related to this PR, but would be nice if Create can have more in-line comments.
|
@pytorchbot merge |
|
@kwen2501 will add in a follow-up PR. |
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 |
…138059) We created a simple test to validate the cache is indeed working and when the cache is indeed used up. I revert the fix in (#138040) and the test indeed failed. Pull Request resolved: #138059 Approved by: https://github.com/kwen2501 ghstack dependencies: #138040, #138048
Stack from ghstack (oldest at bottom):
We used a LIFO stack to store the CudaEvent in the cache. ,Somehow we like FIFO deque better so aside from improving the readability of the code, we use a deque instead. As @wconstab pointed out, both methods are equally correct because the moment we put the event into stack/deque, the event is already ready for reuse, this change mostly is a preference change not trying to fix anything.
cc @XilunWu @H-Huang @awgu @kwen2501 @wanchaol @fegin @wz337 @wconstab @d4l3k @c-p-i-o