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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Rich Progress Bar #8929

Merged
merged 26 commits into from
Aug 24, 2021
Merged

Conversation

kaushikb11
Copy link
Contributor

@kaushikb11 kaushikb11 commented Aug 16, 2021

What does this PR do?

Screen Shot 2021-08-17 at 10 11 50 PM

Next PR will be to support rich Model Summary

Fixes #8255

Does your PR introduce any breaking changes? If yes, please list them.

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 🙃

@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Merging #8929 (721a7a6) into master (92c7eec) will decrease coverage by 5%.
The diff coverage is 50%.

@@           Coverage Diff           @@
##           master   #8929    +/-   ##
=======================================
- Coverage      93%     88%    -5%     
=======================================
  Files         175     178     +3     
  Lines       14497   14651   +154     
=======================================
- Hits        13444   12890   -554     
- Misses       1053    1761   +708     

@kaushikb11 kaushikb11 self-assigned this Aug 17, 2021
@kaushikb11 kaushikb11 added callback feature Is an improvement or enhancement labels Aug 17, 2021
@kaushikb11 kaushikb11 added this to the v1.5 milestone Aug 17, 2021
@kaushikb11 kaushikb11 marked this pull request as ready for review August 17, 2021 16:49
pytorch_lightning/callbacks/progress/rich_progress.py Outdated Show resolved Hide resolved
pytorch_lightning/callbacks/progress/rich_progress.py Outdated Show resolved Hide resolved
pytorch_lightning/utilities/imports.py Outdated Show resolved Hide resolved
pytorch_lightning/utilities/model_summary.py Outdated Show resolved Hide resolved
Copy link
Contributor

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

this looks great as a first version
for my personal taste it is too colorful, there is no meaning to the colors and I believe a simple dual-color branding would look much cleaner.

also, expect there to be a couple display issues we have to fix in the future.

pytorch_lightning/callbacks/progress/progress.py Outdated Show resolved Hide resolved
pytorch_lightning/callbacks/progress/rich_progress.py Outdated Show resolved Hide resolved
@mergify mergify bot removed the has conflicts label Aug 23, 2021
@kaushikb11
Copy link
Contributor Author

for my personal taste it is too colorful, there is no meaning to the colors and I believe a simple dual-color branding would look much cleaner.

That's the reason I didn't add colors to the metrics. We could define meaning to the colors and the design with one more iteration. :)

We could support dual-color branding with an extra argument to the Callback. The styles and colors are configurable :D

@SeanNaren
Copy link
Contributor

for my personal taste it is too colorful, there is no meaning to the colors and I believe a simple dual-color branding would look much cleaner.

That's the reason I didn't add colors to the metrics. We could define meaning to the colors and the design with one more iteration. :)

We could support dual-color branding with an extra argument to the Callback. The styles and colors are configurable :D

Agree with Adrian here, maybe we can try a few iterations on colour schemes to see what sticks!

I'm hoping we can intuitively add some stats to the bar that would be neat, such as average GPU mem allocation. It might also be worth trying to compact the progress bar a bit to reduce space, but a personal preference :)

@mergify mergify bot added ready PRs ready to be merged has conflicts labels Aug 23, 2021
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.

LGTM !

pytorch_lightning/callbacks/progress/base.py Show resolved Hide resolved
@mergify mergify bot removed the has conflicts label Aug 23, 2021
@tchaton tchaton enabled auto-merge (squash) August 23, 2021 19:15
@mergify mergify bot removed the has conflicts label Aug 23, 2021
@tchaton tchaton merged commit 538e743 into Lightning-AI:master Aug 24, 2021
@ananthsub
Copy link
Contributor

@kaushikb11 on naming, would we rename the existing progress bar as TQDMProgressBar? To clarify there's no code dependency between the rich one and the existing one?

@carmocca
Copy link
Contributor

Yeah, have the following

class TQDMProgressBar(ProgressBarBase):
    ...

# points to the default implementation
ProgressBar = TQDMProgressBar

@daniellepintz
Copy link
Contributor

@ananthsub @carmocca I can rename the existing one after #8985

Also @kaushikb11 I am wondering if you forgot to add the RichProgressBar to the documentation, i.e. callbacks.rst?

@@ -84,6 +84,7 @@ def _compare_version(package: str, op, version) -> bool:
_NATIVE_AMP_AVAILABLE = _module_available("torch.cuda.amp") and hasattr(torch.cuda.amp, "autocast")
_OMEGACONF_AVAILABLE = _module_available("omegaconf")
_POPTORCH_AVAILABLE = _module_available("poptorch")
_RICH_AVAILABLE = _module_available("rich")
Copy link
Contributor

@ananthsub ananthsub Aug 31, 2021

Choose a reason for hiding this comment

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

@kaushikb11 - is there a minimum version of rich we should specify here that's compatible with the progress bar features?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
callback 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.

Implement Rich ProgressBar
7 participants