Lightning-AI / Lightning-AI/pytorch-lightning

Logging with Fabric using steps

Open
#19,994 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

fabric feature logging
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.