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

Introduce Strategy in favour of TrainingTypePlugin #10548

Closed
wants to merge 5 commits into from

Conversation

kaushikb11
Copy link
Contributor

@kaushikb11 kaushikb11 commented Nov 15, 2021

What does this PR do?

Part of #9932

As this PR is already huge enough, breaking the task into these follow up PRs:

  • Deprecate TrainingTypePlugin (as it has a lot of references, seperate PR)
  • Deprecate _training_type_plugin in favour of _strategy_plugin
  • Add strategy_plugin argument to Accelerator
  • Update Training Type Registry

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 🙃

@ananthsub
Copy link
Contributor

ananthsub commented Nov 15, 2021

I'd drop Plugin from the name of the class:

  1. Matches conventions with the other "pluggable" arguments Lightning offers: none of Accelerator, Callback, Profiler, Logger have the plugin suffix.
  2. So people know they should specify this via the strategy argument on the Trainer and not the plugins argument.
  3. to match convention again, the base class + implementations should be under pytorch_lightning/strategy

and over time, these classes could be renamed like <blank>Strategy the same way we have SimpleProfiler and TensorboardLogger

@four4fish what do you think?

@four4fish
Copy link
Contributor

I'd drop Plugin from the name of the class:

  1. Matches conventions with the other "pluggable" arguments Lightning offers: none of Accelerator, Callback, Profiler, Logger have the plugin suffix.
  2. So people know they should specify this via the strategy argument on the Trainer and not the plugins argument.
  3. to match convention again, the base class + implementations should be under pytorch_lightning/strategy

and over time, these classes could be renamed like <blank>Strategy the same way we have SimpleProfiler and TensorboardLogger

@four4fish what do you think?

Yeah, agree, I think we should drop plugin this word completely. Also remove the plugins flag from trainer

Comment on lines +21 to +25
rank_zero_deprecation(
"`pytorch_lightning.plugins.training_type.ddp2.DDP2Plugin` has been deprecated in v1.6"
" and will be removed in v1.8. Use `pytorch_lightning.plugins.strategy.ddp2.DDP2Plugin`"
" instead."
)
Copy link
Contributor

@carmocca carmocca Nov 15, 2021

Choose a reason for hiding this comment

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

Since you are making these changes to each file, git does not properly move the file and interprets it as a deletion + addition.

I strongly suggest we do this in two PRs:

  1. Move the code.
  2. Add the backwards compatible paths.

This is to preserve the git history.

In between, the backwards compatibility would be broken but should be okay as there will not be a release in-between.

Since the Meta team relies on master, we just need them to skip the commits including step (1) until step (2) is merged when they update their internal fork. Would that be okay @ananthsub?

Copy link
Contributor

@four4fish four4fish Nov 15, 2021

Choose a reason for hiding this comment

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

And move files lost the historical tracks, it's hard to tracking back changes and old issues related to it. Is moving files and name change necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

git mv supports moving the location and changing the filename.

The problem is then adding changes to the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

git mv supports moving the location and changing the filename.

The problem is then adding changes to the file.

Got you! that's why you suggested separate the steps, make sense! thanks~~

@ethanwharris ethanwharris changed the title Introduce StrateyPlugin in favour of TrainingTypePlugin Introduce StrategyPlugin in favour of TrainingTypePlugin Nov 16, 2021
@kaushikb11 kaushikb11 changed the title Introduce StrategyPlugin in favour of TrainingTypePlugin Introduce Strategy in favour of TrainingTypePlugin Nov 16, 2021
@stale
Copy link

stale bot commented Dec 1, 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 Dec 1, 2021
@stale
Copy link

stale bot commented Dec 8, 2021

This pull request is going to be closed. Please feel free to reopen it create a new from the actual master.

@stale stale bot closed this Dec 8, 2021
@Borda Borda deleted the rename/strategy_plugin branch March 29, 2022 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
won't fix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants