Lightning-AI / Lightning-AI/pytorch-lightning
Create a link for the best checkpoint
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Description & Motivation
As illustrated in #19294 , since we already implement the link of `last.ckpt`, how about adding a new feature on `best.ckpt`? Although we support saving the topk checkpoints already, there is no consistent way to reference the top1 checkpoint.
For example, in the above figure, I have to check the files under the folder `work_dirs/medclip_resnet50_iu_xray_R2GenGPT_30x/2024.01.16_17.44.40.927262/checkpoints` to determine the file name `epoch:5-val_loss:3.264.ckpt` to reference the best checkpoint if I have not created the `best.ckpt` checkpoint. It will be more convenient if we implement the hard link of `best.ckpt` also. It can be implemented with the similar code as the `last.ckpt` part.
### Pitch
Create a link for the best checkpoint when it is updated.
### Alternatives
_No response_
### Additional context
_No response_
cc @borda @carmocca @awaelchli
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 by locating the existing `last.ckpt` link implementation and the code that updates top-k checkpoints. Trace how the top1/best checkpoint is selected, then verify that a `best.ckpt` hard link is created or updated whenever that checkpoint changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100