TQDMProgressBar calls tqdm.refresh instead of tqdm.update.
Bug description
As of GH-13962, TQDMProgressBar calls tqdm.refresh instead of tqdm.update, explicitly setting n:
if not bar.disable:
bar.n = value
bar.refresh()
However, I believe the proper API is to use update instead.
In particular, this means that things done as part of update like EMAs are not updated, which means that using a custom callback to e.g. pass smoothing to have instantaneous values doesn't work, or more generally it might break things in subtle ways.
cc @ethanwharris @lantiga @awaelchli
What version are you seeing the problem on?
master
Reproduced in studio
No response
How to reproduce the bug
Error messages and logs
# Error messages and logs here please
Environment
Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
More info
No response
@cf-natali thanks for raising this issue. I am fine changing back to using update instead of refresh (sine update just calls refresh underneath https://github.com/tqdm/tqdm/blob/0ed5d7f18fa3153834cbac0aa57e8092b217cc16/tqdm/std.py#L1242) as long as we are not introducing the original visual bugs that lead to the change.
@SkafteNicki could you provide more info about the visual bugs we are trying to avoid? I would like to tackle this issue, and I'd love to have more details.
@giacomo-ciro if I look through the linked PR, which link to issues, which link to PRs...it seems this is the original issue that prompted the change from update to refresh:
https://github.com/Lightning-AI/pytorch-lightning/issues/13124
it may be that this issue is not relevant anymore, but it should be checked
Thank you! I'll start digging.