File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
trainer/connectors/logger_connector Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -303,7 +303,7 @@ def log(
303303 add_dataloader_idx : bool = True ,
304304 batch_size : Optional [int ] = None ,
305305 metric_attribute : Optional [str ] = None ,
306- rank_zero_only : Optional [ bool ] = None ,
306+ rank_zero_only : bool = False ,
307307 ) -> None :
308308 """Log a key, value pair.
309309
@@ -441,7 +441,7 @@ def log_dict(
441441 sync_dist_group : Optional [Any ] = None ,
442442 add_dataloader_idx : bool = True ,
443443 batch_size : Optional [int ] = None ,
444- rank_zero_only : Optional [ bool ] = None ,
444+ rank_zero_only : bool = False ,
445445 ) -> None :
446446 """Log a dictionary of values at once.
447447
Original file line number Diff line number Diff line change @@ -616,8 +616,8 @@ def cpu(self) -> "ResultCollection":
616616
617617 def sync (self ) -> None :
618618 for result_metric in self .result_metrics :
619- if result_metric .is_tensor :
620- result_metric .sync ()
619+ if result_metric .is_tensor and not result_metric . _is_synced :
620+ result_metric .sync (should_sync = not result_metric . meta . sync . rank_zero_only )
621621
622622 def unsync (self ) -> None :
623623 for result_metric in self .result_metrics :
You can’t perform that action at this time.
0 commit comments