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

Add LightningModule.lr_scheduler_step #10249

Merged
merged 40 commits into from
Jan 12, 2022
Merged

Add LightningModule.lr_scheduler_step #10249

merged 40 commits into from
Jan 12, 2022

Conversation

rohitgr7
Copy link
Contributor

@rohitgr7 rohitgr7 commented Oct 29, 2021

What does this PR do?

Fixes #10190

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 🙃

cc @Borda @carmocca @justusschock @awaelchli @ananthsub @ninginthecloud @jjenniferdai @rohitgr7

Copy link
Contributor

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

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

Which function name do you think is better?

  • 🚀 scheduler_step() or
  • 🎉 lr_scheduler_step()

We have LightningModule.lr_schedulers(), so I'm in favour of lr_scheduler_step() to be consistent.

@rohitgr7
Copy link
Contributor Author

sure :)

@rohitgr7 rohitgr7 changed the title Add LightningModule.scheduler_step Add LightningModule.lr_scheduler_step Oct 30, 2021
docs/source/common/optimizers.rst Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
@rohitgr7 rohitgr7 added this to the v1.6 milestone Nov 1, 2021
docs/source/common/optimizers.rst Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
@ananthsub
Copy link
Contributor

Where is the issue/RFC describing this feature and what it aims to solve? The PR has 0 summary for what this PR does. This makes it very difficult for anyone in the community to review.

This is touching the core LightningModule! There needs to be much more information about this before changes are just merged

@rohitgr7
Copy link
Contributor Author

rohitgr7 commented Nov 3, 2021

Where is the issue/RFC describing this feature and what it aims to solve? The PR has 0 summary for what this PR does. This makes it very difficult for anyone in the community to review.

This is touching the core LightningModule! There needs to be much more information about this before changes are just merged

It's still draft. Attached the issue link in the description.

pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/optimizers.py Outdated Show resolved Hide resolved
docs/source/common/optimizers.rst Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/loops/epoch/training_epoch_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/optimizers.py Outdated Show resolved Hide resolved
@awaelchli awaelchli added lightningmodule pl.LightningModule feature Is an improvement or enhancement labels Jan 5, 2022
@mergify mergify bot added the has conflicts label Jan 5, 2022
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/optimizer.py Outdated Show resolved Hide resolved
pytorch_lightning/utilities/auto_restart.py Outdated Show resolved Hide resolved
@rohitgr7 rohitgr7 requested a review from carmocca January 5, 2022 19:28
@mergify mergify bot removed the has conflicts label Jan 7, 2022
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

I've simplified two of the tests

tests/trainer/optimization/test_optimizers.py Outdated Show resolved Hide resolved
tests/trainer/optimization/test_optimizers.py Show resolved Hide resolved
pytorch_lightning/core/optimizer.py Outdated Show resolved Hide resolved
@rohitgr7 rohitgr7 requested a review from carmocca January 8, 2022 20:10
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

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

Epic!

@mergify mergify bot added the ready PRs ready to be merged label Jan 8, 2022
@rohitgr7 rohitgr7 enabled auto-merge (squash) January 8, 2022 20:40
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.

Love it!

@rohitgr7 rohitgr7 merged commit 82c8875 into master Jan 12, 2022
@rohitgr7 rohitgr7 deleted the enhance/scheduler_step branch January 12, 2022 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement lightningmodule pl.LightningModule lr scheduler ready PRs ready to be merged
Projects
None yet
7 participants