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

Remove rank 0 restrictions from logger #8608

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

edward-io
Copy link
Contributor

@edward-io edward-io commented Jul 28, 2021

What does this PR do?

Fixes #8589

This PR removes is_global_zero check before logging in the Trainer. It does not change the rank-zero-only behavior that the logger implementations already have and instead enables implementations of loggers that do need to log on each rank when designed that way.

Does your PR introduce any breaking changes? If yes, please list them.

All existing loggers already have guards to only run on rank 0.

But any logger implemented by users who rely on this might fail now.

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

EDIT(@awaelchli) updated description to motivate these changes

tests/loggers/test_all.py Outdated Show resolved Hide resolved
tests/loggers/test_all.py Outdated Show resolved Hide resolved
tests/loggers/test_all.py Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #8608 (a3d0b65) into master (4928dc5) will decrease coverage by 0%.
The diff coverage is 100%.

❗ Current head a3d0b65 differs from pull request most recent head e10ebac. Consider uploading reports for the commit e10ebac to get more accurate results

@@          Coverage Diff           @@
##           master   #8608   +/-   ##
======================================
- Coverage      89%     89%   -0%     
======================================
  Files         169     169           
  Lines       14073   14072    -1     
======================================
- Hits        12466   12465    -1     
  Misses       1607    1607           

@awaelchli awaelchli added feature Is an improvement or enhancement logger Related to the Loggers labels Jul 29, 2021
@carmocca carmocca added this to the v1.5 milestone Jul 30, 2021
tests/loggers/test_all.py Outdated Show resolved Hide resolved
@edward-io edward-io force-pushed the all-rank-logger branch 3 times, most recently from b0cd598 to 7649f69 Compare August 2, 2021 18:27
Copy link
Contributor

@ananthsub ananthsub left a comment

Choose a reason for hiding this comment

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

LGTM!

Unrelated to the PR, @carmocca @Borda is pre-commit expected to run on the changelog? is there a concern that this will lose git blame for the changelog?

CHANGELOG.md Outdated Show resolved Hide resolved
@mergify mergify bot added the has conflicts label Aug 2, 2021
@carmocca
Copy link
Contributor

carmocca commented Aug 2, 2021

is pre-commit expected to run on the changelog?

There isn't any bot merged to do it... what caused all those changes?

is there a concern that this will lose git blame for the changelog?

Why would blame be important for the CHANGELOG? Each line links to the PR that made the change

@mergify mergify bot removed the has conflicts label Aug 3, 2021
@edward-io
Copy link
Contributor Author

edward-io commented Aug 3, 2021

@carmocca sorry, Prettier automatically formatted the changelog file. I've fixed this.

@pep8speaks
Copy link

pep8speaks commented Aug 4, 2021

Hello @edward-io! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-08-05 22:46:20 UTC

@carmocca carmocca added the breaking change Includes a breaking change label Aug 4, 2021
@mergify mergify bot added the ready PRs ready to be merged label Aug 4, 2021
@tchaton tchaton enabled auto-merge (squash) August 5, 2021 08:11
auto-merge was automatically disabled August 5, 2021 19:54

Head branch was pushed to by a user without write access

@mergify mergify bot added the has conflicts label Aug 5, 2021
@mergify mergify bot removed the has conflicts label Aug 5, 2021
@edward-io edward-io force-pushed the all-rank-logger branch 2 times, most recently from a3d0b65 to 5a78b42 Compare August 5, 2021 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Includes a breaking change feature Is an improvement or enhancement logger Related to the Loggers ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove rank restrictions on loggers
8 participants