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

1/n Move precision plugin into strategy - update reference #10570

Merged
merged 27 commits into from Nov 19, 2021

Conversation

four4fish
Copy link
Contributor

@four4fish four4fish commented Nov 16, 2021

What does this PR do?

1/n Move Precision Plugin into Strategy and update references
2/n Move optimizer, lr to Strategy, remove accelerator routing functions
3/n Simplify and reduce hooks and redundancies

Fixes #7324 which is part of #10416

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 🙃

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.

It'd be very good to list what APIs this lets us simplify or remove from the Accelerator/strategy/precision plugin. Those could be listed as immediate followups to this PR

pytorch_lightning/accelerators/accelerator.py Outdated Show resolved Hide resolved
@four4fish four4fish marked this pull request as ready for review November 16, 2021 23:56
@mergify mergify bot removed the has conflicts label Nov 17, 2021
@four4fish four4fish linked an issue Nov 17, 2021 that may be closed by this pull request
4 tasks
@mergify mergify bot added the ready PRs ready to be merged label Nov 17, 2021
@four4fish
Copy link
Contributor Author

@tchaton @carmocca Addressed the comments, could you guys take a look?

  1. Now this 1/n is backward compatible.
  2. Updated the deprecation message and format. Add to @awaelchli mentioned before: there will breaking change in refactor step3 "move accelerator into strategy". Which means we will have to remove precision_plugin param from Accelerator BEFORE we have a stable version to release. So the deprecation message is "will be deprecated soon" instead of "deprecated in 1.6 remove in 1.7"

Copy link
Contributor

@kaushikb11 kaushikb11 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @four4fish

@four4fish four4fish merged commit 700521c into Lightning-AI:master Nov 19, 2021
@four4fish four4fish removed the breaking change Includes a breaking change label Nov 19, 2021
Raalsky pushed a commit to neptune-ai/pytorch-lightning that referenced this pull request Nov 23, 2021
…-AI#10570)

* 1/n move precision plugin into strategy - update reference

* update precision plugin reference in tpu_spawn

* add missing reference in error message

* add back removed license line

* update references in tests

* update reference in trainer

* update return annotation for precision_plugin property on TTP

* simplify access to precision plugin reference in sharded plug

* add changelog

* remove precision property from ttp and add deprecation message

* fix make doc and update precision reference

* simplify a reference to precision

accidentally overridden Adrian's change, now add it back

* Update CHANGELOG.md

add Adrian's change back

* Update accelerator precision

Add Adrian's change back

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

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

* Add none check for precision plugin

just to be safe

* Update ipu.py

* update precision_plugin param deprecation message

* Update accelerator.py

* Remove deprecated warning 

Tests will fail after 9940

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PRs ready to be merged refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Main Issue] Accelerator and Plugin refactor Precision Plugins should be part of Training Type Plugins
7 participants