Skip to content

Commit

Permalink
Still log something on the other ranks
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkgr committed Mar 11, 2024
1 parent c6ad0c1 commit 696afb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions olmo/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,11 @@ def on_trace_ready(p):
metrics.update(lr_monitor.check())

# Log metrics to console.
if self.global_step % self.cfg.console_log_interval == 0 and get_global_rank() == 0:
self.log_metrics_to_console(f"[step={self.global_step}/{self.max_steps}]", metrics)
if self.global_step % self.cfg.console_log_interval == 0:
if get_global_rank() == 0:
self.log_metrics_to_console(f"[step={self.global_step}/{self.max_steps}]", metrics)
else:
log.info(f"[step={self.global_step}/{self.max_steps}]")

# Log metrics to W&B.
if (
Expand Down

0 comments on commit 696afb5

Please sign in to comment.