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

Deprecate checkpoint_callback from the Trainer constructor in favour of enable_checkpointing #9754

Merged
merged 16 commits into from
Oct 12, 2021

Conversation

rohitgr7
Copy link
Contributor

What does this PR do?

Fixes #9665

Does your PR introduce any breaking changes? If yes, please list them.

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 list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is welcome to review the PR.
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?

Make sure you had fun coding 🙃

@rohitgr7 rohitgr7 changed the title Dep/ckpt callback Deprecate checkpoint_callback from the Trainer constructor in favour of enable_checkpointing Sep 29, 2021
@kaushikb11
Copy link
Contributor

IMO, it should be enable_checkpoint instead

@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Sep 29, 2021

okay..
small poll for anyone who sees this
enable_checkpointing -> 👍
enable_checkpoint -> 🎉
enable_checkpoints -> 🚀

@rohitgr7 rohitgr7 marked this pull request as ready for review September 29, 2021 15:21
@rohitgr7 rohitgr7 added this to the v1.5 milestone Sep 29, 2021
@rohitgr7 rohitgr7 added design Includes a design discussion checkpointing Related to checkpointing deprecation Includes a deprecation labels Sep 29, 2021
@codecov
Copy link

codecov bot commented Sep 29, 2021

Codecov Report

Merging #9754 (d8a347f) into master (4decbc0) will decrease coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #9754    +/-   ##
=======================================
- Coverage      93%     89%    -4%     
=======================================
  Files         178     178            
  Lines       15618   15646    +28     
=======================================
- Hits        14475   13867   -608     
- Misses       1143    1779   +636     

@mergify mergify bot removed the has conflicts label Sep 30, 2021
@tchaton
Copy link
Contributor

tchaton commented Sep 30, 2021

okay.. small poll for anyone who sees this enable_checkpointing -> 👍 enable_checkpoint -> 🎉 enable_checkpoints -> 🚀

Hey @rohitgr7,

Quick question. enable_checkpointing is True by default right ? Won't it be more intuitive to have disable_checkpointing=False ?

Best,
T.C

@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Sep 30, 2021

okay.. small poll for anyone who sees this enable_checkpointing -> 👍 enable_checkpoint -> 🎉 enable_checkpoints -> 🚀

Hey @rohitgr7,

Quick question. enable_checkpointing is True by default right ? Won't it be more intuitive to have disable_checkpointing=False ?

Best, T.C

@tchaton

  • this will flip the value we currently have with checkpoint_callback. I think just renaming is fine. so if someone is switching they just need to flip the key, that's all.
  • we have other enable_* flags inside trainer but no disable_* flags.
  • also I think it's better to ask user, do you want checkpointing or not? rather than do you not want checkpointing or do you? :|=

tests/accelerators/test_tpu_backend.py Outdated Show resolved Hide resolved
tests/accelerators/test_tpu_backend.py Outdated Show resolved Hide resolved
tests/accelerators/test_tpu_backend.py Outdated Show resolved Hide resolved
tests/accelerators/test_tpu_backend.py Outdated Show resolved Hide resolved
tests/checkpointing/test_legacy_checkpoints.py Outdated Show resolved Hide resolved
tests/checkpointing/test_model_checkpoint.py Outdated Show resolved Hide resolved
tests/loggers/test_all.py Outdated Show resolved Hide resolved
@mergify mergify bot added the has conflicts label Oct 6, 2021
@mergify mergify bot removed the has conflicts label Oct 7, 2021
@rohitgr7 rohitgr7 enabled auto-merge (squash) October 11, 2021 07:32
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 !

docs/source/common/trainer.rst Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Oct 11, 2021
docs/source/common/trainer.rst Show resolved Hide resolved
docs/source/common/trainer.rst Outdated Show resolved Hide resolved
pytorch_lightning/trainer/connectors/callback_connector.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/connectors/callback_connector.py Outdated Show resolved Hide resolved
Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com>
@rohitgr7 rohitgr7 merged commit db322f4 into master Oct 12, 2021
@rohitgr7 rohitgr7 deleted the dep/ckpt_callback branch October 12, 2021 07:55
rohitgr7 added a commit to Tshimanga/pytorch-lightning that referenced this pull request Oct 18, 2021
…our of `enable_checkpointing` (Lightning-AI#9754)

* enable_chekpointing

* update codebase

* chlog

* update tests

* fix warning

* Apply suggestions from code review

Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>

* Apply suggestions from code review

Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
daavoo added a commit to iterative/dvclive that referenced this pull request Aug 23, 2022
daavoo added a commit to iterative/dvclive that referenced this pull request Aug 23, 2022
* lightning: Update test.

Per Lightning-AI/pytorch-lightning#9754

* Unpin torchmetrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checkpointing Related to checkpointing deprecation Includes a deprecation design Includes a design discussion ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename checkpoint_callback to enable_checkpointing in Trainer constructor
7 participants