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

Allow reinits in sub procs #1149

Closed
wants to merge 4 commits into from
Closed

Conversation

vanpelt
Copy link
Contributor

@vanpelt vanpelt commented Mar 14, 2020

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 to update the docs?
  • Did you write any new necessary tests?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

What does this PR do?

Fixes #981

When using multiprocessing the default behavior of wandb is to return None for multiple calls to init. Passing reinit=True ensure we always create an experiment. This could lead to cases where a single experiment has multiple runs in wandb, but it's a much better default than throwing an exception.

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 🙃

@codecov
Copy link

codecov bot commented Mar 15, 2020

Codecov Report

Merging #1149 into master will decrease coverage by 0%.
The diff coverage is 80%.

@@          Coverage Diff           @@
##           master   #1149   +/-   ##
======================================
- Coverage      93%     92%   -0%     
======================================
  Files          61      61           
  Lines        2672    2676    +4     
======================================
+ Hits         2472    2475    +3     
- Misses        200     201    +1     

Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

  • add a note to changelog about this fix
  • consider adding a simple test for DDP

Comment on lines +66 to +69
if self._experiment is not None:
state['_id'] = self._experiment.id
else:
state['_id'] = None
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self._experiment is not None:
state['_id'] = self._experiment.id
else:
state['_id'] = None
state['_id'] = self._experiment.id if self._experiment is not None else None

Comment on lines +119 to +122
if self._experiment:
return self._experiment.project_name()
else:
return None
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self._experiment:
return self._experiment.project_name()
else:
return None
if self._experiment:
return self._experiment.project_name()
return None

Comment on lines +127 to +130
if self._experiment:
return self._experiment.id
else:
return None
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if self._experiment:
return self._experiment.id
else:
return None
if self._experiment:
return self._experiment.id
return None

@Borda Borda added the bug Something isn't working label Mar 15, 2020
@Borda Borda added this to the 0.7.2 milestone Mar 15, 2020
@Borda
Copy link
Member

Borda commented Mar 16, 2020

@vanpelt thx for you work, could you please check my comments so we can get it done :]

@Borda
Copy link
Member

Borda commented Mar 30, 2020

Hey, any update here?

@mergify mergify bot requested a review from a team March 30, 2020 22:33
@mergify
Copy link
Contributor

mergify bot commented Apr 2, 2020

This pull request is now in conflict... :(

@williamFalcon
Copy link
Contributor

@vanpelt mind rebasing? looks like there are conflicts

@Borda
Copy link
Member

Borda commented Apr 2, 2020

@vanpelt mind allow edit for maintainers?

@williamFalcon
Copy link
Contributor

Finished in #1360

@Borda Borda mentioned this pull request Apr 4, 2020
@Borda Borda modified the milestones: v0.7., 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
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WandbLogger cannot be used with 'ddp'
4 participants