Skip to content

Deprecate on_before_accelerator_backend_setup callback hook #11655

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

Merged
merged 12 commits into from
Feb 7, 2022
Merged

Deprecate on_before_accelerator_backend_setup callback hook #11655

merged 12 commits into from
Feb 7, 2022

Conversation

krishnakalyan3
Copy link
Contributor

@krishnakalyan3 krishnakalyan3 commented Jan 28, 2022

What does this PR do?

Fixes #11559

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 🙃

@krishnakalyan3
Copy link
Contributor Author

@ananthsub this is part 2 of this PR. Does it look okay?

@daniellepintz
Copy link
Contributor

@krishnakalyan3 currently this PR is only changing the changelog. It should be deprecating the hook, like in #10940

Please also update the title to be the same as #11559

@ananthsub ananthsub changed the title Replace occurrences of on_before_accelerator_backend_setup_called with setup hook part2 Deprecate on_before_accelerator_backend_setup callback hook Jan 28, 2022
@ananthsub ananthsub added callback deprecation Includes a deprecation labels Jan 28, 2022
@ananthsub ananthsub added this to the 1.6 milestone Jan 28, 2022
Copy link
Contributor

@ananthsub ananthsub left a comment

Choose a reason for hiding this comment

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

Requesting changes based on @daniellepintz 's feedback

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 once comments are addressed.

@daniellepintz
Copy link
Contributor

The title and description of this PR don't match the contents - you seem to be removing the on_pretrain_routine_start hooks

@krishnakalyan3
Copy link
Contributor Author

@daniellepintz You are right. Now, this PR only contains the change log.

@krishnakalyan3 krishnakalyan3 marked this pull request as draft February 2, 2022 15:54
@krishnakalyan3 krishnakalyan3 marked this pull request as ready for review February 7, 2022 09:17
@mergify mergify bot added the ready PRs ready to be merged label Feb 7, 2022
@krishnakalyan3
Copy link
Contributor Author

Thanks @rohitgr7

@rohitgr7 rohitgr7 enabled auto-merge (squash) February 7, 2022 10:52
@codecov
Copy link

codecov bot commented Feb 7, 2022

Codecov Report

Merging #11655 (b517d82) into master (a64438c) will decrease coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff            @@
##           master   #11655    +/-   ##
========================================
- Coverage      92%      88%    -4%     
========================================
  Files         198      198            
  Lines       17310    17315     +5     
========================================
- Hits        15846    15180   -666     
- Misses       1464     2135   +671     

@rohitgr7 rohitgr7 merged commit f509e40 into Lightning-AI:master Feb 7, 2022
@@ -264,8 +264,8 @@ def configure_optimizers(self):


def test_on_before_accelerator_backend_setup(tmpdir):
Copy link
Contributor

@daniellepintz daniellepintz Feb 7, 2022

Choose a reason for hiding this comment

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

the name of this test should be changed to test_setup_hook

Copy link
Contributor

Choose a reason for hiding this comment

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

actually on second thought it looks like this test doesn't really belong in this file. Do people think we still need this test given it is similar to this one? https://github.com/PyTorchLightning/pytorch-lightning/blob/43a89eb132511f99441671ee0ba4d2b92ebbcbd7/tests/trainer/test_trainer.py#L1654-L1674

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably not, it's also covered by tests/models/test_hooks.py::test_trainer_model_hook_system_fit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback deprecation Includes a deprecation ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC] Deprecate on_before_accelerator_backend_setup hook
6 participants