Skip to content

Conversation

@awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Mar 6, 2021

What does this PR do?

Fixes #6364

All this PR does is delay the first calls to the logger to a point where the worker processes (e.g. in DDP) have access to their rank information. This prevents the logger from writing to the same file in every process

The added test fails on master.

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 update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
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 🙃

@awaelchli awaelchli added the distributed Generic distributed-related topic label Mar 6, 2021
@codecov
Copy link

codecov bot commented Mar 6, 2021

Codecov Report

Merging #6380 (7604c2d) into master (523c59b) will decrease coverage by 3%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #6380    +/-   ##
=======================================
- Coverage      94%     90%    -3%     
=======================================
  Files         161     161            
  Lines       11497   11388   -109     
=======================================
- Hits        10753   10284   -469     
- Misses        744    1104   +360     

@awaelchli awaelchli marked this pull request as ready for review March 7, 2021 03:11
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Great! Does the test fail in current master?

@carmocca carmocca added this to the 1.2.x milestone Mar 7, 2021
@carmocca carmocca added the ready PRs ready to be merged label Mar 7, 2021
@awaelchli
Copy link
Contributor Author

@carmocca yes, it fails on master :)

@mergify mergify bot added the has conflicts label Mar 8, 2021
@mergify mergify bot removed the has conflicts label Mar 8, 2021
@Borda Borda enabled auto-merge (squash) March 8, 2021 07:17
@mergify mergify bot added the has conflicts label Mar 8, 2021
@mergify mergify bot removed the has conflicts label Mar 9, 2021
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

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

LGTM !

def pre_dispatch(self):
self.accelerator.pre_dispatch()

# log hyper-parameters
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we wrap this into a function ?

@Borda Borda merged commit fc6d402 into master Mar 9, 2021
@Borda Borda deleted the bugfix/logger-init branch March 9, 2021 09:50
@carmocca carmocca mentioned this pull request Mar 15, 2021
SeanNaren pushed a commit that referenced this pull request Mar 16, 2021
* fix

* add simple test

* fix imports

* add changelog

* tighter test with on_fit_start hook closer to the dispatch call

* move class inside test f unction

* add a comment

(cherry picked from commit fc6d402)
lexierule pushed a commit that referenced this pull request Mar 16, 2021
* fix

* add simple test

* fix imports

* add changelog

* tighter test with on_fit_start hook closer to the dispatch call

* move class inside test f unction

* add a comment

(cherry picked from commit fc6d402)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working distributed Generic distributed-related topic ready PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DDP: Multiple processes try to create the logger directory tree

7 participants