Skip to content

Deprecate LightningModule.get_progress_bar_dict #8742

@ananthsub

Description

@ananthsub

🚀 Feature

Deprecate this method off the LightningModule and move this to the ProgressBar callback:
https://github.com/PyTorchLightning/pytorch-lightning/blob/efec3d461c38e00c4db36acecf946ac45e08b0e1/pytorch_lightning/core/lightning.py#L1772-L1818

Motivation

We are auditing the Lightning components and APIs to assess opportunities for improvements:

Moving this logic to the progress bar callback is far more natural:

  • Customization for the progress bar display should sit inside the ProgressBar class, not inside the LightningModule
  • The Callback API already has access to both the Trainer and LightningModule, so it can combine properties of both. The progress bar can access the available progress bar metrics from the Trainer, and filter down or supplement with additional keys to display
  • This reduces the non-ML modeling surface area of the LightningModule cleaner, making it more focused
  • This helps separate the LightningModule & Trainer APIs: Remove Trainer reference from lightning module and datamodule #7315

Pitch

  • Offer corresponding utilities on the progress bar callback to filter/enrich the metrics used for the TQDM display
  • Deprecate this method in v1.5
  • Remove this method in v1.7

Alternatives

Additional context


If you enjoy Lightning, check out our other projects! ⚡

  • Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

  • Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, finetuning and solving problems with deep learning

  • Bolts: Pretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorch

  • Lightning Transformers: Flexible interface for high performance research using SOTA Transformers leveraging Pytorch Lightning, Transformers, and Hydra.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions