Skip to content

Comments

Expose logger logging mode and stabilize rank-zero logging#21526

Open
MagellaX wants to merge 3 commits intoLightning-AI:masterfrom
MagellaX:issue-20502-logging-mode
Open

Expose logger logging mode and stabilize rank-zero logging#21526
MagellaX wants to merge 3 commits intoLightning-AI:masterfrom
MagellaX:issue-20502-logging-mode

Conversation

@MagellaX
Copy link

@MagellaX MagellaX commented Feb 3, 2026

What does this PR do?

Expose the current logging mode ("step" or "epoch") to loggers so they can adapt behavior based on the caller context. The connector now sets this mode around log_metrics, and a test covers it.

Additionally, this makes rank-zero logging consistently use the PyTorch logger (fixes debug log capture in tests) and skips symlink-dependent tests on platforms that don’t support symlinks. The model registry doctest was updated to be OS-path-agnostic.

Fixes #20502

Dependencies: None

Breaking changes: None

Tests:

  • python -m pytest tests/tests_pytorch/trainer/connectors/test_logger_connector.py -q
  • python -m pytest tests/tests_pytorch/loops/test_training_loop.py::test_fit_loop_done_log_messages -q
  • python -m pytest tests/tests_pytorch/loops/test_training_loop.py::test_should_stop_early_stopping_conditions_met -q
  • python -m pytest tests/tests_pytorch/checkpointing/test_model_checkpoint.py -q
  • python -m pytest tests/tests_pytorch/loggers/test_tensorboard.py -q
  • python -m pytest src/lightning/pytorch tests/tests_pytorch -q (timed out after 30 min)
Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

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

@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Feb 3, 2026
@MagellaX
Copy link
Author

can anybody review this and merge it!!!?

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.

Make logging_mode (on_step or on_epoch) available to loggers

1 participant