KEMBAR78
[c10d][logging] Add wait counter for time spent in object to tensor and tensor to object by fduwjj · Pull Request #140414 · pytorch/pytorch · GitHub
Skip to content

Conversation

@fduwjj
Copy link
Contributor

@fduwjj fduwjj commented Nov 12, 2024

Stack from ghstack (oldest at bottom):

Originally we want to leverage the timer logger to measure the time spent in object to tensor and tensor to object (#139757) But it gets reverted (internally) because of a performance regression. We now use wait counter instead which is more lightweight.

cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @wz337 @wconstab @d4l3k @c-p-i-o

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 12, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140414

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

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

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

fduwjj added a commit that referenced this pull request Nov 12, 2024
…nd tensor to object

ghstack-source-id: a5d3aca
Pull Request resolved: #140414
@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 Nov 12, 2024
@fduwjj fduwjj added ciflow/trunk Trigger trunk jobs on your pull request topic: devs Developer feature labels Nov 12, 2024
Copy link
Contributor

@wconstab wconstab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you plan to roll this out or just land it? how sure are we that the _WaitCounter is faster enough to not get reverted again?

@fduwjj
Copy link
Contributor Author

fduwjj commented Nov 12, 2024

@wconstab good question, it is already used in TorchCompile already so the risk is kind of low.

@fduwjj
Copy link
Contributor Author

fduwjj commented Nov 13, 2024

I worked with Boris to verify that on a internal typical workload, the perf difference after adding this counter is less than 5% of latency change. So we got green light for a merge.

@fduwjj fduwjj requested a review from wconstab November 13, 2024 20:53
Copy link
Contributor

@wz337 wz337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. For my learning, then should we just kill time logger and use this instead?
For exception, performance doesn't matter but time logger could affect performance.

@fduwjj
Copy link
Contributor Author

fduwjj commented Nov 13, 2024

@wz337 let's see how this goes. The init time is just one time, so it's not as expensive as this one..

@fduwjj
Copy link
Contributor Author

fduwjj commented Nov 13, 2024

@pytorchbot merge

@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

pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
…nd tensor to object (pytorch#140414)

Originally we want to leverage the timer logger to measure the time spent in object to tensor and tensor to object (pytorch#139757) But it gets reverted (internally) because of a performance regression. We now use wait counter instead which is more lightweight.

Pull Request resolved: pytorch#140414
Approved by: https://github.com/c-p-i-o, https://github.com/XilunWu, https://github.com/wz337
@github-actions github-actions bot deleted the gh/fduwjj/155/head branch December 14, 2024 02:12
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 topic: devs Developer feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants