You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logger should be written to in the same class where it is owned
The Trainer class is already giant and does a lot, so let's have the logger_connector own all things related to the loggers, including the loggers themselves. (We will still have a read-only property for the loggers on the Trainer)
This approach is similar to what we do for the accelerator_connector. The accelerator_connector owns the accelerator related properties, and has no reference to the Trainer.
Update all the reference of trainer.logger on the logger_connector to self.logger
Create a read-only property on the Trainer called logger which returns logger_connector.logger
Update all the other places where the trainer is used in logger_connector - some variables will have to be passed in the constructor, and others will have to be passed as arguments to some methods such as should_flush_logs
Proposed refactor
logger
property on the logger_connectorlogger
which returnslogger_connector.logger
Motivation
https://github.com/PyTorchLightning/pytorch-lightning/blob/32e7d32956e1685d36f2ab0ca3770baa2f76ce10/pytorch_lightning/trainer/connectors/logger_connector/logger_connector.py#L78-L91
Part of #10417
Pitch
logger
property on the logger_connectortrainer.logger
on the logger_connector toself.logger
logger
which returnslogger_connector.logger
should_flush_logs
cc @justusschock @awaelchli @akihironitta @rohitgr7 @edward-io @Borda @ananthsub @kamil-kaczmarek @Raalsky @Blaizzy @kaushikb11 @ninginthecloud
The text was updated successfully, but these errors were encountered: