Skip to content

make init_trackers to launch on main process#642

Merged
muellerzr merged 1 commit into
huggingface:mainfrom
Gladiator07:fix-init_trackers
Aug 19, 2022
Merged

make init_trackers to launch on main process#642
muellerzr merged 1 commit into
huggingface:mainfrom
Gladiator07:fix-init_trackers

Conversation

@Gladiator07

@Gladiator07 Gladiator07 commented Aug 19, 2022

Copy link
Copy Markdown
Contributor

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

HuggingFaceDocBuilderDev commented Aug 19, 2022

Copy link
Copy Markdown

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

@muellerzr muellerzr left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor Author

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

@muellerzr

Copy link
Copy Markdown
Contributor

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

@Gladiator07

Copy link
Copy Markdown
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