Skip to content

Conversation

@awaelchli
Copy link
Contributor

What does this PR do?

Part of #9987

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)

@awaelchli awaelchli added refactor design Includes a design discussion labels Oct 27, 2021
@awaelchli awaelchli added this to the v1.5 milestone Oct 27, 2021
@awaelchli awaelchli marked this pull request as ready for review October 27, 2021 07:49
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.

LGMT !

@tchaton tchaton enabled auto-merge (squash) October 27, 2021 09:00
@mergify mergify bot added the ready PRs ready to be merged label Oct 27, 2021
@mergify mergify bot requested a review from a team October 27, 2021 09:01
@tchaton tchaton merged commit 808edcd into master Oct 27, 2021
@tchaton tchaton deleted the lightning-lite/run-backward-type branch October 27, 2021 11:16
@daniellepintz
Copy link
Contributor

daniellepintz commented Nov 24, 2021

@awaelchli this PR is causing a type error in #10682:

pytorch_lightning/plugins/precision/deepspeed.py:52: error: Argument 2 of "_run_backward" is incompatible with supertype "PrecisionPlugin"; supertype defines the argument type as "Optional[Module]"  [override]
pytorch_lightning/plugins/precision/deepspeed.py:52: note: This violates the Liskov substitution principle
pytorch_lightning/plugins/precision/deepspeed.py:52: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

pytorch_lightning/plugins/precision/native_amp.py:65: error: Argument 2 of "_run_backward" is incompatible with supertype "PrecisionPlugin"; supertype defines the argument type as "Optional[Module]"  [override]
pytorch_lightning/plugins/precision/native_amp.py:65: note: This violates the Liskov substitution principle
pytorch_lightning/plugins/precision/native_amp.py:65: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

should I set the type to Optional[Module] for deepseed and native_amp as well?

@awaelchli
Copy link
Contributor Author

Hmm, for native amp that would be ok, but in deepspeed it's not optional. I don't know how to express this with mypy.

@awaelchli
Copy link
Contributor Author

awaelchli commented Nov 24, 2021

I'll send a fix for this, it will be ugly.

@awaelchli awaelchli mentioned this pull request Nov 24, 2021
11 tasks
@carmocca carmocca mentioned this pull request Nov 25, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Includes a design discussion ready PRs ready to be merged refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants