Skip to content

Progress bar for non interactive environments #12185

@austinmw

Description

@austinmw

🚀 Feature

I'd like to request a progress bar for non-terminal, non-interactive environments, like for example Amazon CloudWatch. The TQDM and Rich progress bars are not ideal for tracking progress in these more simple logging environments.

Additionally, I'd like to request the ability to automatically adapt to a known-length or an unknown length iterable dataset, by displaying percentage based progress in the former case, and simply iteration count in the latter case. (It appears that the default TQDM progress bar produced errors for me with an unknown length iterable webdataset.)

Motivation

I'm training on both EC2 and Amazon SageMaker, and neither the TQDM nor the Rich progress bars seem appropriate for monitoring progress in CloudWatch. I asked on slack if a more appropriate alternative or configuration setting was available, and was advised that there's not anything currently, but I should create a GitHub issue for one.

Pitch

At the most basic level, the progress indicator would print something like this on rank 0:
[Epoch 0 | Iteration 100] train_loss: 0.01, val_acc: 0.74

Another useful feature would be optionally passing a logger to use instead of print, so for example if you pass a logger that writes to stdout:
LoggerName - INFO - [Epoch 0 | Iteration 100] train_loss: 0.01, val_acc: 0.74

If the epoch has a known total number of batches, additional information on the completion percentage would be nice. For example:
[Epoch 0 | Iteration 100/450 (22.22% complete)] train_loss: 0.01, val_acc: 0.74

Alternatives

I guess whenever anyone needs more simple progress tracking they could write their own custom progress meter based on ProgressBarBase.

cc @Borda @carmocca @awaelchli

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementprogress tracking (internal)Related to the progress tracking dataclasses

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions