-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Enable RichProgressBar by default if Rich is available #9647
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
Conversation
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.
LGMT !
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 😃
# Conflicts: # CHANGELOG.md
Co-authored-by: Rohit Gupta <[email protected]>
…eat/enable_rich_default # Conflicts: # pytorch_lightning/trainer/connectors/callback_connector.py
Co-authored-by: Danielle Pintz <[email protected]>
if os.getenv("COLAB_GPU") and refresh_rate is None: | ||
# smaller refresh rate on colab causes crashes for TQDM, choose a higher value | ||
refresh_rate = 20 | ||
refresh_rate = 1 if refresh_rate is None else refresh_rate | ||
progress_bar_callback = ProgressBar(refresh_rate=refresh_rate, process_position=process_position) |
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.
if os.getenv("COLAB_GPU") and refresh_rate is None: | |
# smaller refresh rate on colab causes crashes for TQDM, choose a higher value | |
refresh_rate = 20 | |
refresh_rate = 1 if refresh_rate is None else refresh_rate | |
progress_bar_callback = ProgressBar(refresh_rate=refresh_rate, process_position=process_position) | |
if refresh_rate is None: | |
if os.getenv("COLAB_GPU"): | |
# smaller refresh rate on colab causes crashes for TQDM, choose a higher value | |
refresh_rate = 20 | |
else: | |
refresh_rate = 1 | |
progress_bar_callback = ProgressBar(refresh_rate=refresh_rate, process_position=process_position) |
for more information, see https://pre-commit.ci
" please pass `callbacks=RichProgressBar(refresh_rate=X)`." | ||
" Setting to the `TQDM ProgressBar`." | ||
) | ||
# else return new TQDMProgressBar |
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.
should be indented in?
Closing it in favor of #10912 |
What does this PR do?
Closes #9580. By default if Rich (10.0.2 or later) is available, we use the Rich Progress Bar!
Related to #9616, we throw a warning if the user sets
progress_bar_refresh_rate
from the Trainer and default to TQDM (theProgressBar
). This is because the meaning of refresh rate is different for Rich/TQDM, and are not related. Since in #9616 the argument is being deprecated, I felt it made sense to ask the users to pass theRichProgressBar
to callbacks likecallbacks=RichProgressBar(refresh_rate_per_second=20)
.cc @daniellepintz
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 🙃