File size: 371 Bytes
3e56913 | 1 2 3 4 5 6 7 8 9 10 11 12 | import pytorch_lightning as pl
from utils.logging_project import silence_non_rank_zero_output
class RankZeroOutputCallback(pl.Callback):
"""Ensure only global rank 0 keeps console output once distributed training starts."""
def on_fit_start(self, trainer, pl_module):
if trainer.global_rank != 0:
silence_non_rank_zero_output()
|