Lightning-AI / Lightning-AI/pytorch-lightning
How to rollback optimizer step (i.e. reload best checkpoint) during training?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Discussed in https://github.com/PyTorchLightning/pytorch-lightning/discussions/13093
Originally posted by **xsys-technology** May 17, 2022
During training, if the optimizer takes a really bad step that sends validation loss through the roof, how can one rollback the step and reload best model checkpoint (and reset logging/pbar results/metrics so that _val_loss_ remains accurate)?
I imagine the preferred way to do this is through a callback function (e.g. '_on_train_epoch_start_') but I'm not sure how to do this properly/safely when the model is dispatched and sharded across gpu's.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked discussion #13093 and the callback and checkpoint behavior described in the issue. Determine the required handling for model, optimizer, logging, progress-bar, and validation metrics during sharded multi-GPU training. Done means the rollback behavior and its scope are clearly defined and safely supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- distributed-systems, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100