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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validate logic for precision #9080

Merged
merged 8 commits into from
Aug 24, 2021
Merged

Conversation

SeanNaren
Copy link
Contributor

@SeanNaren SeanNaren commented Aug 24, 2021

What does this PR do?

Ensures that we validate the precision type when setting the precision plugin. Followup from #9049

Trainer(precision="x")
pytorch_lightning.utilities.exceptions.MisconfigurationException: Precision "x" is invalid. Allowed precision values: (16, 32, 64, 'bf16')

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 馃檭

@SeanNaren SeanNaren added the feature Is an improvement or enhancement label Aug 24, 2021
@SeanNaren SeanNaren added this to the v1.5 milestone Aug 24, 2021
@SeanNaren SeanNaren self-assigned this Aug 24, 2021
@codecov
Copy link

codecov bot commented Aug 24, 2021

Codecov Report

Merging #9080 (ddc2d2c) into master (f959b13) will increase coverage by 4%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #9080    +/-   ##
=======================================
+ Coverage      88%     92%    +4%     
=======================================
  Files         176     176            
  Lines       14649   14671    +22     
=======================================
+ Hits        12875   13504   +629     
+ Misses       1774    1167   -607     

Sean Naren and others added 2 commits August 24, 2021 10:37
Co-authored-by: Kaushik B <45285388+kaushikb11@users.noreply.github.com>
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.

LGTM!

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.

Looks great !

@mergify mergify bot added the ready PRs ready to be merged label Aug 24, 2021
@SeanNaren SeanNaren enabled auto-merge (squash) August 24, 2021 17:25
@SeanNaren SeanNaren merged commit e9f4bff into master Aug 24, 2021
@SeanNaren SeanNaren deleted the feat/add_valid_precision_check branch August 24, 2021 20:00
Copy link
Member

@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.

LGTM

@@ -78,6 +78,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added Rich Progress Bar ([#8929](https://github.com/PyTorchLightning/pytorch-lightning/pull/8929))


- Added validate logic for precision ([#9080](https://github.com/PyTorchLightning/pytorch-lightning/pull/9080))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Added validate logic for precision ([#9080](https://github.com/PyTorchLightning/pytorch-lightning/pull/9080))
- Added input validation for precision Trainer argument ([#9080](https://github.com/PyTorchLightning/pytorch-lightning/pull/9080))

this should be less ambiguous

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.

None yet

6 participants