Skip to content

Conversation

@fduwjj
Copy link
Contributor

@fduwjj fduwjj commented Oct 16, 2024

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

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 16, 2024

🔗 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 Failures

As of commit c62c197 with merge base a77bb85 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels Oct 16, 2024
fduwjj added a commit that referenced this pull request Oct 16, 2024
ghstack-source-id: 6ffc3c7
Pull Request resolved: #138048
@fduwjj fduwjj requested review from kwen2501 and wconstab October 16, 2024 02:08
@fduwjj fduwjj changed the title Refactor CUDAEventCache Create [c10d] Refactor CUDAEventCache Create to use deque rather than stack Oct 16, 2024
@fduwjj fduwjj requested a review from shuqiangzhang October 16, 2024 02:09
Copy link
Collaborator

@kwen2501 kwen2501 left a 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.

@fduwjj
Copy link
Contributor Author

fduwjj commented Oct 16, 2024

@pytorchbot merge

@fduwjj
Copy link
Contributor Author

fduwjj commented Oct 16, 2024

@kwen2501 will add in a follow-up PR.

@pytorchmergebot
Copy link
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Oct 16, 2024
…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
pytorchmergebot pushed a commit that referenced this pull request Oct 16, 2024
@github-actions github-actions bot deleted the gh/fduwjj/146/head branch November 16, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants