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

Allow disabling automatic stopping after max_steps or max_epochs #8877

Conversation

EricWiener
Copy link
Contributor

@EricWiener EricWiener commented Aug 12, 2021

What does this PR do?

Adds the ability to disable automatic stopping by passing max_epochs < 0 and leaving max_steps = None.

Fixes #8818

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

None

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?

oh-yes

@codecov
Copy link

codecov bot commented Aug 12, 2021

Codecov Report

Merging #8877 (1a17f87) into master (045c879) will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #8877   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files         176     178    +2     
  Lines       14808   14858   +50     
======================================
+ Hits        13036   13098   +62     
+ Misses       1772    1760   -12     

@EricWiener EricWiener force-pushed the feature/8818_disable_automatic_stopping branch from 7583fd8 to ab6d6e0 Compare August 13, 2021 00:49
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.

thanks for working on this @EricWiener !

pytorch_lightning/loops/fit_loop.py Outdated Show resolved Hide resolved
@EricWiener EricWiener force-pushed the feature/8818_disable_automatic_stopping branch from 2087404 to 729930a Compare August 27, 2021 13:42
@EricWiener EricWiener marked this pull request as ready for review August 27, 2021 14:07
@EricWiener EricWiener marked this pull request as draft August 27, 2021 14:09
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.

pytorch_lightning/loops/fit_loop.py Outdated Show resolved Hide resolved
@EricWiener EricWiener force-pushed the feature/8818_disable_automatic_stopping branch from 652c597 to abd1131 Compare August 27, 2021 17:19
@EricWiener EricWiener force-pushed the feature/8818_disable_automatic_stopping branch from abd1131 to a239358 Compare August 27, 2021 17:21
@EricWiener EricWiener marked this pull request as ready for review August 27, 2021 17:21
@EricWiener
Copy link
Contributor Author

pytorch_lightning/loops/fit_loop.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Show resolved Hide resolved
tests/callbacks/test_timer.py Outdated Show resolved Hide resolved
tests/trainer/test_trainer.py Outdated Show resolved Hide resolved
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.

Once comments are applied, LGTM ! Neat work !

docs/source/common/trainer.rst Outdated Show resolved Hide resolved
pytorch_lightning/loops/fit_loop.py Show resolved Hide resolved
pytorch_lightning/trainer/configuration_validator.py Outdated Show resolved Hide resolved
tests/trainer/test_trainer.py Show resolved Hide resolved
Co-authored-by: ananthsub <ananth.subramaniam@gmail.com>
docs/source/common/trainer.rst Outdated Show resolved Hide resolved
pytorch_lightning/loops/fit_loop.py Show resolved Hide resolved
pytorch_lightning/trainer/configuration_validator.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/trainer.py Outdated Show resolved Hide resolved
EricWiener and others added 3 commits September 2, 2021 09:56
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

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

nice work so far, I have only some minor comments now :)

tests/trainer/test_trainer.py Outdated Show resolved Hide resolved
tests/trainer/test_trainer.py Show resolved Hide resolved
tests/trainer/test_trainer.py Outdated Show resolved Hide resolved
pytorch_lightning/trainer/configuration_validator.py Outdated Show resolved Hide resolved
@mergify mergify bot added the ready PRs ready to be merged label Sep 3, 2021
@carmocca carmocca enabled auto-merge (squash) September 4, 2021 02:08
@carmocca carmocca merged commit cf1a589 into Lightning-AI:master Sep 4, 2021
@carmocca carmocca added this to the v1.5 milestone Sep 7, 2021
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 ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow disabling automatic stopping during fitting
6 participants