Lightning-AI / Lightning-AI/pytorch-lightning
Load callback states while testing.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
## 🚀 Feature
Load callback states while testing.
### Motivation
https://github.com/PyTorchLightning/pytorch-lightning/pull/5161#issuecomment-759083492
### Pitch
Two possible API changes:
with an additional argument `restore_states`:
```python
test(ckpt_path, restore_states=True/False) # give an option whether to load states or not
test(model, ckpt_path, restore_states=True/False) # same as above but will just load checkpoint states and not the model
# raise an error
test(ckpt_path=None, restore_states=True)
```
or without any additional argument:
```python
test(ckpt_path) # always load states
test(ckpt_path=None) # don't load any states.
test(model, ckpt_path) # reload checkpoint states only from ckpt_path
```
### Alternatives
Alternatively, one can just reload checkpoints manually, call `on_load_checkpoint` for all the callbacks manually, and test.
PS: There may be a better solution. Open to suggestions :)
cc: @ananthsub
cc @borda @awaelchli @ananthsub @ninginthecloud @rohitgr7 @tchaton @akihironitta
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
No implementation files or tests are named. Start by reviewing the linked pull request discussion and the proposed test API alternatives, then establish which checkpoint and callback-state behavior is intended. Done means the API choice is settled and callback states load during testing with defined behavior for each shown call form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100