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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix local rank zero casting #2640

Merged
merged 2 commits into from
Jul 19, 2020
Merged

Fix local rank zero casting #2640

merged 2 commits into from
Jul 19, 2020

Conversation

ananthsub
Copy link
Contributor

@ananthsub ananthsub commented Jul 18, 2020

What does this PR do?

The environment variable 'LOCAL_RANK' can be a string, causing the if rank_zero_only.rank == 0 check to fail. This is similar to the casting added in #1811

Fixes #2641

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • 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? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 馃檭

The environment variable 'LOCAL_RANK' can be a string, causing the `if rank_zero_only.rank == 0` check to fail
@mergify mergify bot requested a review from a team July 18, 2020 15:34
@codecov
Copy link

codecov bot commented Jul 18, 2020

Codecov Report

Merging #2640 into master will decrease coverage by 0%.
The diff coverage is 50%.

@@          Coverage Diff           @@
##           master   #2640   +/-   ##
======================================
- Coverage      91%     91%   -0%     
======================================
  Files          70      70           
  Lines        5778    5775    -3     
======================================
- Hits         5270    5267    -3     
  Misses        508     508           

@mergify mergify bot requested a review from a team July 18, 2020 16:54
address comment
@Borda Borda added the bug Something isn't working label Jul 18, 2020
@williamFalcon williamFalcon merged commit ed581eb into Lightning-AI:master Jul 19, 2020
@ananthsub ananthsub deleted the fix-rank-zero branch July 19, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Utility rank_zero_only doesn't properly handle environment variable LOCAL_RANK
4 participants