KEMBAR78
[PGNCCL] Deprecate suppport of onCompletionHook by kwen2501 · Pull Request #142390 · pytorch/pytorch · GitHub
Skip to content

Conversation

@kwen2501
Copy link
Contributor

@kwen2501 kwen2501 commented Dec 9, 2024

Stack from ghstack (oldest at bottom):

The usage of onCompletionHook is mostly similar to what Flight Recorder does today -- for example, measuring how long a collective takes and put it into a profiler's "database".

Since FR already records and can dump info like this, we are considering deprecating the onCompletionHook support to save a side thread. (Each PG runs 3 side threads today, which is resource consuming and complicates the code)

User can file an issue if additional information needs to be recorded.
They can also file an RFC if Flight Recorder needs to accept plugins that customize the recording.

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

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 9, 2024

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 6fee2fa with merge base db13bd9 (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 Dec 9, 2024
kwen2501 added a commit that referenced this pull request Dec 9, 2024
ghstack-source-id: 3ae33fd
Pull Request resolved: #142390
Copy link
Contributor

@fduwjj fduwjj left a comment

Choose a reason for hiding this comment

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

cc: @mrshenli

@kwen2501
Copy link
Contributor Author

kwen2501 commented Dec 9, 2024

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 9, 2024
@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

@wconstab
Copy link
Contributor

wconstab commented Dec 9, 2024

isn't the onCompletionHook sort of orthogonal to the flight-recorder? The flight recorder today does not have its own thread, so if a user wants to register some kind of callback it is reasonable to assume that we'd have to have a thread to do this.

Potentially OK to deprecate this but only if we're sure we don't want to add it back soon.

Otoh as we aim to generalize the FR infra, maybe its still better to move the thread into that general infra instead of ProcessGroupNCCL.

@kwen2501
Copy link
Contributor Author

kwen2501 commented Dec 9, 2024

isn't the onCompletionHook sort of orthogonal to the flight-recorder?

True, except they have one thing in common: call site = on completion.

so if a user wants to register some kind of callback it is reasonable to assume that we'd have to have a thread to do this.

The thing is I can't think of anything else than profiling or status book-keeping a user may want to do for all work, in the background. Definitely not computation on the tensor, because the user would not be able to know if it completes or consume the result if it is run in the background.

bluenote10 pushed a commit to bluenote10/pytorch that referenced this pull request Dec 14, 2024
The usage of `onCompletionHook` is mostly similar to what Flight Recorder does today -- for example, measuring how long a collective takes and put it into a profiler's "database".

Since FR already records and can dump info like this, we are considering deprecating the onCompletionHook support to save a side thread. (Each PG runs 3 side threads today, which is resource consuming and complicates the code)

User can file an issue if additional information needs to be recorded.
They can also file an RFC if Flight Recorder needs to accept plugins that customize the recording.

Pull Request resolved: pytorch#142390
Approved by: https://github.com/fduwjj, https://github.com/fegin
@github-actions github-actions bot deleted the gh/kwen2501/115/head branch January 9, 2025 02:20
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