Lightning-AI / Lightning-AI/pytorch-lightning

[RFC] Move logger `v_num` information out of progress bar and into simple log statement

Open
#12,175 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

logger progress bar: tqdm refactor
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

## Proposed refactor

Remove `v_num` from the progress bar here:
https://github.com/PyTorchLightning/pytorch-lightning/blob/5da065e287b44e2c1fe4f7951003813ed45365c9/pytorch_lightning/callbacks/progress/base.py#L217-L223

And add a simple Python log statement at the start of training with the version number for each logger.

### Motivation

1. It is a bit unclear to me why we have the logger v_num on the progress bar - there is no direct relation between the two. Why not have this information in a simple log statement at the start of training, and leave more space in the progress bar for other information? As @carmocca put it, the progress bar is "prime real estate".

2. When we have multiple loggers, we have the strange behavior of concatenating the two version numbers (relic of LoggerCollection) and if the concatenated version numbers is longer than 4 digits we truncate it:
https://github.com/PyTorchLightning/pytorch-lightning/blob/5da065e287b44e2c1fe4f7951003813ed45365c9/pytorch_lightning/callbacks/progress/base.py#L220-L222

Instead, we can just have log statements like this at the start of training:
```
Initialized TensorBoardLogger with version X.
Initialized WandbLogger with version Y.
```

cc @justusschock @awaelchli @rohitgr7 @edward-io @borda @ananthsub @kamil-kaczmarek @Raalsky @Blaizzy @carmocca

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pytorch_lightning/callbacks/progress/base.py at the linked v_num handling, then trace where training begins and logger initialization occurs for TensorBoardLogger and WandbLogger. Remove the progress-bar version display and add one startup log statement per logger, with tests confirming multiple logger versions are reported separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.