Lightning-AI / Lightning-AI/pytorch-lightning

If ModelCheckpoint and Validation occur on the same step, validation should run first, reopen

Open
#17,417 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug callback: model checkpoint help wanted repro needed
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Bug description

The issue described here, is still unsolved https://github.com/Lightning-AI/lightning/issues/7694

The consequences of this issue is that n-th model is saved based on metrics from the n-1th step

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

_No response_

### How to reproduce the bug

_No response_

### Error messages and logs

```
# Error messages and logs here please
```

### 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 @carmocca @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

Read the linked issue #7694 first, then trace the ModelCheckpoint and validation scheduling behavior for steps where both occur. Done means validation runs before checkpointing on the same step so the saved model uses metrics from the current step; the payload names no files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
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.