Skip to content

feat(loggers): add group_metrics_by_prefix to TensorBoardLogger for grouped plots#21582

Open
s-zx wants to merge 1 commit intoLightning-AI:masterfrom
s-zx:fix/21578-tensorboard-grouping
Open

feat(loggers): add group_metrics_by_prefix to TensorBoardLogger for grouped plots#21582
s-zx wants to merge 1 commit intoLightning-AI:masterfrom
s-zx:fix/21578-tensorboard-grouping

Conversation

@s-zx
Copy link

@s-zx s-zx commented Mar 11, 2026

Summary

Add group_metrics_by_prefix parameter. When True, metrics like losses/a, losses/b are grouped on same plot.

Fix

Split metric names by / and use add_scalars for grouped metrics.

Fixes #21578


📚 Documentation preview 📚: https://pytorch-lightning--21582.org.readthedocs.build/en/21582/

…rouped plots

When group_metrics_by_prefix=True, metrics with names containing / (e.g.
losses/a, losses/b) are grouped on the same TensorBoard plot via add_scalars.
This allows losses/a, losses/b, losses/c, losses/d to appear as 4 lines on
one plot instead of 4 separate plots.

Fixes Lightning-AI#21578
Signed-off-by: s-zx <[email protected]>
@s-zx s-zx requested a review from williamFalcon as a code owner March 11, 2026 23:12
@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group the metrics in Tensorboard

1 participant