-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Remove the redundant precision attribute from LightningModule #16203
Conversation
acdd0c2
to
9aba366
Compare
changelog fix
for more information, see https://pre-commit.ci
108fa4b
to
e7618cd
Compare
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflowThese checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🟢 pytorch_lightning: Azure HPU
These checks are required after the changes to 🟢 pytorch_lightning: Azure IPU
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 installThese checks are required after the changes to Thank you for your contribution! 💜
|
Co-authored-by: Carlos Mocholí <[email protected]>
Co-authored-by: Carlos Mocholí <[email protected]>
Co-authored-by: Carlos Mocholí <[email protected]>
What does this PR do?
Today, the LightningModule has a precision attribute that is being set during use with the Trainer. However, it is not reliable to use it in your code, because it only makes sense when a trainer is attached. If no trainer is attached, then the value is simply "outdated" and incorrect. Example: The LightningModule is being used without a Trainer, or within a Lite training loop.
Does your PR introduce any breaking changes? If yes, please list them.
Yes, but there is no point in keeping this unreliable attribute. We also want to change the precision representation to string, see #14857
Before submitting
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:
Did you have fun?
I made sure I had fun coding 🙃
cc @Borda