Skip to content
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

make init_trackers to launch on main process #642

Merged
merged 1 commit into from
Aug 19, 2022
Merged

make init_trackers to launch on main process #642

merged 1 commit into from
Aug 19, 2022

Conversation

Gladiator07
Copy link
Contributor

@Gladiator07 Gladiator07 commented Aug 19, 2022

While on distributed setup the accelerator.init_trackers() method initializes multiple runs of the tracker on all processes. It should be initialized on the main process. Added a @on_main_process decorator to achieve the expected behavior.

@muellerzr @sgugger

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Aug 19, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Thanks! For right now I think this is fine, and if folks don't like it we can revert back or make it optional to do so. There may be situations when spinning up a tracker on all the processes could be useful (and then manually logging them instead), so we'll keep an eye out for this on feedback

@muellerzr
Copy link
Collaborator

@Gladiator07 could you adjust the following code in the examples as well? Since this removes the need for the check:

https://github.com/huggingface/accelerate/blob/main/examples/by_feature/tracking.py#L168-L172

@Gladiator07
Copy link
Contributor Author

@muellerzr adjust as in? Should I remove the accelerator.is_main_process check?

@muellerzr
Copy link
Collaborator

@Gladiator07 correct. We're putting this in place so that is no longer needed, so the examples should show this :)

@Gladiator07
Copy link
Contributor Author

Cool, doing this in a separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants