Skip to content

Conversation

@awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Apr 22, 2021

What does this PR do?

Part of #6467
Follow up to #6886 and #7187

Also:
Fixes #8833

Several cleanups to handle a warning message properly after the changes in #7187.

  • backward compatibility for a warning message informing user about missing callbacks
  • add test for warning appearing when a callback is missing
  • add test that no warning is shown when callbacks are all present (Unnecessary warning when resuming training #8833)
  • move the code that initializes the save_on_train_epoch_end attribute. this attribute needs to be fully resolved at the time we load the checkpoint, since it is included in the state_key and will be used to determine if the callback matches what's in the checkpoint

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)
    NOT NEEDED because the changes were only introduced in master.

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?

I made sure I had fun coding 🙃

@awaelchli awaelchli added feature Is an improvement or enhancement checkpointing Related to checkpointing labels Apr 22, 2021
@pep8speaks
Copy link

pep8speaks commented Apr 22, 2021

Hello @awaelchli! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

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

Comment last updated at 2021-07-28 22:21:18 UTC

@awaelchli awaelchli changed the title [2/N] improvements to saving and loading callback state [2 / N] improvements to saving and loading callback state Apr 22, 2021
@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #7161 (28ac360) into master (f959b13) will increase coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #7161    +/-   ##
=======================================
+ Coverage      88%     92%    +4%     
=======================================
  Files         176     175     -1     
  Lines       14649   14667    +18     
=======================================
+ Hits        12875   13501   +626     
+ Misses       1774    1166   -608     

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 !

@awaelchli awaelchli changed the title [2 / N] improvements to saving and loading callback state [2 / 3] improvements to saving and loading callback state Apr 22, 2021
@awaelchli awaelchli force-pushed the feature/migration-2 branch from 6afe6c3 to d20b4f4 Compare April 22, 2021 21:32
@stale
Copy link

stale bot commented May 7, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://pytorch-lightning.readthedocs.io/en/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Slack. Thank you for your contributions.

@stale stale bot added the won't fix This will not be worked on label May 7, 2021
@awaelchli awaelchli added this to the v1.4 milestone May 7, 2021
@stale stale bot removed the won't fix This will not be worked on label May 7, 2021
@awaelchli awaelchli modified the milestones: v1.4, v1.5 Jul 9, 2021
@awaelchli awaelchli force-pushed the feature/migration-2 branch from d20b4f4 to 2620069 Compare July 26, 2021 10:01
@awaelchli awaelchli changed the base branch from master to bugfix/callback-state July 26, 2021 10:02
Base automatically changed from bugfix/callback-state to master July 28, 2021 22:12
@awaelchli awaelchli changed the title [2 / 3] improvements to saving and loading callback state [3 / 3] improvements to saving and loading callback state Jul 28, 2021
@awaelchli awaelchli force-pushed the feature/migration-2 branch from f8f746e to e775881 Compare August 25, 2021 10:16
@awaelchli awaelchli force-pushed the feature/migration-2 branch from 6fe4a5b to 9ddb211 Compare August 25, 2021 13:37
@awaelchli awaelchli marked this pull request as ready for review August 25, 2021 15:26
@mergify mergify bot added the ready PRs ready to be merged label Aug 25, 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.

Looks great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

checkpointing Related to checkpointing feature Is an improvement or enhancement ready PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unnecessary warning when resuming training

5 participants