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

feat(wandb): add sync_step #5351

Merged
merged 16 commits into from
Jan 24, 2021

Conversation

borisdayma
Copy link
Contributor

@borisdayma borisdayma commented Jan 4, 2021

What does this PR do?

Add more flexiblitiy to WandbLogger with sync_step parameter.

Fixes #5194
Fixes #4980
Fixes #5070

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?
  • Did you make sure to update the documentation with your changes [if needed]?
  • Did you write any new necessary tests [no need for typos, docs]?
  • 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.
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
  • Check that target branch and milestone are aligned!

Did you have fun?

Make sure you had fun coding 🙃

@pep8speaks
Copy link

pep8speaks commented Jan 4, 2021

Hello @borisdayma! Thanks for updating this PR.

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

Comment last updated at 2021-01-24 16:18:30 UTC

@codecov
Copy link

codecov bot commented Jan 5, 2021

Codecov Report

Merging #5351 (f650d72) into release/1.2-dev (0c9960b) will increase coverage by 4%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##           release/1.2-dev   #5351    +/-   ##
================================================
+ Coverage               89%     92%    +4%     
================================================
  Files                  153     153            
  Lines                10840   10845     +5     
================================================
+ Hits                  9628   10022   +394     
+ Misses                1212     823   -389     

@rohitgr7
Copy link
Contributor

rohitgr7 commented Jan 5, 2021

this shall go in release/1.2-dev?

@Borda Borda added this to the 1.2 milestone Jan 5, 2021
@Borda Borda changed the base branch from master to release/1.2-dev January 6, 2021 00:15
@Borda
Copy link
Member

Borda commented Jan 6, 2021

@borisdayma mind rebase your change on release/1.2-dev 🐰 or do you prefer to have it as bugfix to master?

@borisdayma
Copy link
Contributor Author

borisdayma commented Jan 6, 2021

@Borda I tried to rebase, then just merge release/1.2-dev but there's a lot of conflicts (on files I didn't touch) so it scares me a little bit…
If it's ok with you a bugfix to master may be easier… at least for me!

@rohitgr7 rohitgr7 added feature Is an improvement or enhancement and removed bug Something isn't working labels Jan 6, 2021
prefix: A string to put at the beginning of metric keys.
sync_step: Sync Trainer step with wandb step.
Copy link
Member

Choose a reason for hiding this comment

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

Can you put this after the experiment flag, so that old args order is still working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the order within the function itself.
For the description of args, I let this order because I thought it made more sense. For example id and version are the same thing. Is that ok?

pytorch_lightning/loggers/wandb.py Show resolved Hide resolved
pytorch_lightning/loggers/wandb.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/wandb.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/wandb.py Show resolved Hide resolved
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
@borisdayma
Copy link
Contributor Author

Hi, just checking if I need to do anything else on my side?
I know of a few people eager to see this PR merged.

@awaelchli awaelchli enabled auto-merge (squash) January 21, 2021 13:01
@SeanNaren SeanNaren enabled auto-merge (squash) January 23, 2021 19:27
@@ -85,14 +86,15 @@ def __init__(
self,
name: Optional[str] = None,
save_dir: Optional[str] = None,
offline: bool = False,
offline: Optional[bool] = False,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the change here is necessary. Optional[bool] is equivalent to Union[bool, None], and offline only accepts bool, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should work but actually I want to clean up the way we pass init parameters in a follow-up PR and suggest to just use kwargs.
The possible parameters has evolved and we could just refer to wandb.init doc

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense.

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 !

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 logger Related to the Loggers ready PRs ready to be merged
Projects
None yet
10 participants