Lightning-AI / Lightning-AI/pytorch-lightning

Resuming from checkpoint, mid epoch gives a very distorted time estimate

Open
#18,220 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted priority: 1 progress bar: tqdm ver: 2.0.x
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Bug description

This might be related to : https://github.com/Lightning-AI/lightning/issues/13124

Currently when resuming from a deepspeed checkpoint, it seems like the time estimate, uses the "current running time" against the "total dataset steps". This gives incredibly warped numbers, when resuming mid epoch for long 1 day+ runs.

Where you can see estimates for runs which would have taken hours, being in minutes.

Screenshot 2023-08-03 at 4 00 40 PM

This can be observed even in small dataset / models, where you can see crazy it/s rates - and remaining time estimate - at the start, which improves over time, but never fall back inline with a more realistic estimate (especially if it resumed > 50% mark)

I do not have full repro steps here, but i am filing it so that others might be able to confirm / follow up on it.

### What version are you seeing the problem on?

v2.0

### How to reproduce the bug

_No response_

### Error messages and logs

_No response_

### Environment

Current environment

```
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):
```

### More info

_No response_

cc @tchaton @awaelchli

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 by reproducing a run resumed from a DeepSpeed checkpoint in the middle of an epoch, comparing the reported time estimate with a fresh run on a small dataset. Done means the elapsed-rate and remaining-time estimates remain realistic after resuming, including when more than half the epoch has already completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.