Skip to content

Conversation

SeanNaren
Copy link
Contributor

@SeanNaren SeanNaren commented Sep 22, 2021

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 (the ProgressBar). 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 the RichProgressBar to callbacks like callbacks=RichProgressBar(refresh_rate_per_second=20).

cc @daniellepintz

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 🙃

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.

LGMT !

Copy link
Member

@ethanwharris ethanwharris left a comment

Choose a reason for hiding this comment

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

LGTM 😃

@mergify mergify bot added the ready PRs ready to be merged label Sep 22, 2021
@awaelchli awaelchli added this to the v1.5 milestone Sep 22, 2021
@SeanNaren SeanNaren self-assigned this Sep 22, 2021
@SeanNaren SeanNaren added the rich label Sep 22, 2021
@Borda Borda removed the rich label Sep 23, 2021
SeanNaren and others added 3 commits September 23, 2021 11:11
…eat/enable_rich_default

# Conflicts:
#	pytorch_lightning/trainer/connectors/callback_connector.py
@SeanNaren SeanNaren mentioned this pull request Oct 25, 2021
12 tasks
Comment on lines 245 to 249
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)

@mergify mergify bot removed the has conflicts label Nov 1, 2021
@mergify mergify bot added the has conflicts label Nov 1, 2021
" please pass `callbacks=RichProgressBar(refresh_rate=X)`."
" Setting to the `TQDM ProgressBar`."
)
# else return new TQDMProgressBar
Copy link
Contributor

Choose a reason for hiding this comment

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

should be indented in?

@kaushikb11
Copy link
Contributor

Closing it in favor of #10912

@kaushikb11 kaushikb11 closed this Feb 22, 2022
@carmocca carmocca deleted the feat/enable_rich_default branch February 22, 2022 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Rich Progress Bar/Model Summary if Rich is available
9 participants