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

add rank warning #1428

Merged
merged 10 commits into from
Apr 9, 2020
Merged

add rank warning #1428

merged 10 commits into from
Apr 9, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented Apr 9, 2020

What does this PR do?

Fixes # (issue).

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 馃檭

@Borda Borda added the feature Is an improvement or enhancement label Apr 9, 2020
@Borda Borda added this to the 0.7.3 milestone Apr 9, 2020
@Borda Borda requested a review from williamFalcon April 9, 2020 14:32
@mergify mergify bot requested a review from a team April 9, 2020 14:32
@Borda
Copy link
Member Author

Borda commented Apr 9, 2020

now it is implemented only for model, but shall we doe rank warning also for callbacks?

@williamFalcon
Copy link
Contributor

williamFalcon commented Apr 9, 2020

i think it needs to be a standalone package.

from pl import warnings

# from trainer.__init__
warnings.set_rank(rank)

# anywhere now including a lightning  module,   trainer, etc.
warnings.rank_zero_warn()

don't make it so we have to instantiate an instance... also instance doesn't make sense since we just need to call it from wherever.

Copy link
Contributor

@williamFalcon williamFalcon left a comment

Choose a reason for hiding this comment

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

see comments

@mergify mergify bot requested a review from a team April 9, 2020 14:40
@williamFalcon
Copy link
Contributor

Also, replace all the warnings across the project with this.

@Borda
Copy link
Member Author

Borda commented Apr 9, 2020

but the rank is depending on the backend so you cannot use a global rank value... can you?

@codecov
Copy link

codecov bot commented Apr 9, 2020

Codecov Report

Merging #1428 into master will decrease coverage by 0%.
The diff coverage is 85%.

@@           Coverage Diff           @@
##           master   #1428    +/-   ##
=======================================
- Coverage      92%     92%    -0%     
=======================================
  Files          63      66     +3     
  Lines        3404    3508   +104     
=======================================
+ Hits         3123    3212    +89     
- Misses        281     296    +15     

@Borda
Copy link
Member Author

Borda commented Apr 9, 2020

warnings.rank_zero_warn()

but this has to have an extra parameter of the actual rank...
so we can have warning called from where ever but not with rank specific

@williamFalcon
Copy link
Contributor

warnings inside lightning are ALL rank specific.

@pep8speaks
Copy link

pep8speaks commented Apr 9, 2020

Hello @Borda! Thanks for updating this PR.

Line 206:111: E501 line too long (116 > 110 characters)

Line 957:111: E501 line too long (119 > 110 characters)

Comment last updated at 2020-04-09 17:26:48 UTC

@mergify mergify bot requested a review from a team April 9, 2020 16:11
@Borda Borda marked this pull request as ready for review April 9, 2020 16:52
@Borda Borda requested a review from williamFalcon April 9, 2020 16:52
@williamFalcon williamFalcon merged commit 17f58d2 into master Apr 9, 2020
@Borda Borda deleted the feature/warning branch April 9, 2020 18:13
@Borda Borda modified the milestones: 0.7.4, 0.7.3 Apr 10, 2020
tullie pushed a commit to tullie/pytorch-lightning that referenced this pull request Jun 7, 2020
* add rank warning

* changelog

* use rank_zero_warn

* user trainer_init

* replace warnings

* fix test

* flake8

* docs

* changelog

* bug lol
@Borda Borda modified the milestones: 0.7.3, v0.7.x Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants