Skip to content

Conversation

@awaelchli
Copy link
Contributor

@awaelchli awaelchli commented Dec 22, 2021

What does this PR do?

Part of #10549

Adds a deprecation path for the training type plugins that we renamed in #11226.
Example: In 1.6 this usage will be deprecated

from pytorch_lightning.training_type import DDPPlugin
Trainer(strategy=DDPPlugin(find_unused_parameters=False))

and should be replaced with

from pytorch_lightning.strategies import DDPStrategy
Trainer(strategy=DDPStrategy(find_unused_parameters=False))

TODO:

  • add tests for the deprecated classes
  • add deprecation warning to the docstring

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

No, but after v1.8, when the old plugin aliases are removed, all imports will break.

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)

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 🙃

Part of #1 (it's a lie, this is just here to avoid noisy GitHub bot)

cc @tchaton @rohitgr7 @Borda

@awaelchli awaelchli added deprecation Includes a deprecation breaking change Includes a breaking change labels Dec 22, 2021
@awaelchli awaelchli added this to the 1.6 milestone Dec 22, 2021
Base automatically changed from rename/strategy to master December 22, 2021 20:23
@awaelchli awaelchli mentioned this pull request Dec 22, 2021
11 tasks
@awaelchli awaelchli force-pushed the refactor/training-type/deprecation branch from 992b6c7 to 903e6fd Compare December 23, 2021 14:42
pytest.param(DeepSpeedPlugin, marks=RunIf(deepspeed=True)),
DataParallelPlugin,
DDPFullyShardedPlugin,
pytest.param(IPUPlugin, marks=RunIf(ipu=True)),
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't run at the moment because we only run ipu tests on the ipu test file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you think #11170 will land? I can drop the test case completely, move it to the ipu test file, or keep as is

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know. I would move the test to test_ipu.py and add a comment here referencing it.

@mergify mergify bot added the ready PRs ready to be merged label Dec 23, 2021
@four4fish four4fish mentioned this pull request Dec 23, 2021
12 tasks
@awaelchli awaelchli force-pushed the refactor/training-type/deprecation branch from 650a04e to 4cd25b2 Compare December 24, 2021 00:06
@awaelchli awaelchli enabled auto-merge (squash) January 3, 2022 08:28
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 merged commit 4eede7c into master Jan 3, 2022
@awaelchli awaelchli deleted the refactor/training-type/deprecation branch January 3, 2022 12:41
rohitgr7 pushed a commit that referenced this pull request Jan 4, 2022
Co-authored-by: Kaushik B <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@carmocca carmocca mentioned this pull request Jan 9, 2022
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Includes a breaking change deprecation Includes a deprecation ready PRs ready to be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants