Lightning-AI / Lightning-AI/pytorch-lightning
Make logging_mode (`on_step` or `on_epoch`) available to loggers
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
Lightning lets you log `on_step`, or `on_epoch`. However, even when using `on_epoch`, the global step is logged on the x-axis, not the epoch number.
Loggers can manually extract `epoch` from the logged metrics and pass that as the `step`. However, this would break `on_step` logging.
Making the logging mode for a logging call available would let loggers conditionally use either the `global_step` or `current_epoch` as the `step` for that particular metric.
### Pitch
_No response_
### Alternatives
_No response_
### Additional context
_No response_
cc @lantiga @borda
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 files, tests, or entry points are identified in the issue. Start by tracing how logging calls pass metrics to loggers and determine where on_step or on_epoch can remain associated with each metric. Done means loggers can choose global_step for on_step metrics and current_epoch for on_epoch metrics without breaking either mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100