-
Notifications
You must be signed in to change notification settings - Fork 967
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
destroy process group in end_training
#3012
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
With the removal of @on_main_process
, would tracker.finish()
not be called on all processes where previously that was only called on the main process?
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.
Nice!
All of the trackers come loaded with |
@@ -2678,11 +2678,10 @@ def log(self, values: dict, step: int | None = None, log_kwargs: dict | None = { | |||
for tracker in self.trackers: | |||
tracker.log(values, step=step, **log_kwargs.get(tracker.name, {})) | |||
|
|||
@on_main_process | |||
def end_training(self): |
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.
Note that eventually we'll get to a point where users will want to pass in their own pg's and init them, e.g. this is needed for hybrid shard w/ FSDP. So we may need to take that in there potentially. Will see how it ends up looking
What does this PR do ?
With the latest version of torch, when we use multi-gpu, torch will trigger a warning asking us to call
destoy_process_group()
. This PR fixes this by adding that in end_training method. Note that this function needs to be called on all process.For trackers, we are already only executing the methods on the main process. See here. So it should be safe to remove the on_main_process decorator in the end_training method.
However, I see for WandBTracker that
main_process_only = False
. Is there a specific reason @muellerzr ?