Lightning-AI / Lightning-AI/pytorch-lightning
Logging with Fabric using steps
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
Logging using Fabric does not consider any steps during training, unlike when using the Lightning Trainer. A LightningModule calling self.log simply passes the logged dictionary and nothing else to the Fabric logging code when using Fabric but when using the Trainer it is handled by grouping/frequency adjustments (such as aggregating during multi-gpu training or logging every X steps [default 50]).
### Pitch
An option to enable similar logging in Fabric as the Lightning Trainer. This could be off by default but could track steps that are submitted with fabric hooks/calls, such as:
`fabric.call('on_train_step')`
This would allow for logged values to be aggregated during the same step, which makes logs more readable.
### Alternatives
_No response_
### Additional context
_No response_
cc @lantiga @borda @justusschock
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 tracing Fabric's logging path and comparing it with the Lightning Trainer's handling of self.log, including grouping and frequency adjustments. Check how fabric.call('on_train_step') exposes step information, then define completion as optional step-aware aggregation that preserves current behavior when disabled and produces readable logs for values from the same step.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100