-
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
Deprecate LightningModule.get_progress_bar_dict #8985
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #8985 +/- ##
=======================================
- Coverage 92% 89% -4%
=======================================
Files 178 179 +1
Lines 14899 14924 +25
=======================================
- Hits 13752 13252 -500
- Misses 1147 1672 +525 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can deprecate the method in this manner. In fact, there's further cleanup we can do, which is kind of related to #8946
LightningModule.get_progress_bar_dict
is called here: https://github.com/PyTorchLightning/pytorch-lightning/blob/6de66eb110a63d67dc2ebb74e149981cd93aa431/pytorch_lightning/trainer/properties.py#L296-L313
which is then used here inside the progress bar callback:
Here's what I think we could do:
- Make the default implementation of
LightningModule.get_progress_bar_dict
return an empty dict - Carry the existing implementation forward into a private utility function of the progress bar callback, which accepts a LightningModule and trainer as input args
- Deprecate
progress_bar_metrics
from the Trainer properties
To justify these changes, we can argue this is only a temporary state and we will invest efforts in making the trainer less a god class in the future.
this is one of those ways we can start whittling away at this property list and make the trainer less of a god class
@ananthsub thanks so much for the helpful feedback! A few questions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @ananthsub , an intermediate function that merges the metrics from trainer and get_progress_bar_dict hook is probably the best here
for more information, see https://pre-commit.ci
@ananthsub is this ready to be merged? |
Some conflicts to be resolved. |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daniellepintz Thank you for this PR! But blocking the merge for now, as I would need to take a look at the changes for RichProgressBar
and test it locally and think of a better design. Will get back to it by tomorrow morning (IST)!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @daniellepintz, the changes were breaking for RichProgressBar
callback. I have pushed some updates for it and the PR is good to go. We could have one more iteration to improve the MetricsTextColumn
component. Will create an issue around it. Thanks!
@kaushikb11 thanks for fixing that and sorry I didn't notice in the first place! |
What does this PR do?
Deprecates get_progress_bar_dict from lightning module and moves it to progress bar callback
Fixes #8742
Before submitting
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:
Did you have fun?
Make sure you had fun coding 🙃