Loguru
We log to console and files usingloguru using a global logger instance. Each entrypoint should call setup_logger exactly once at the beginning of execution. Afterwards, all components can log using the global logger instance. For more details on loguru, see the documentation. All logs are written into {output_dir}/logs and for RL training we recommend viewing logs by streaming the file logs into tmux panes, as set up by the tmux.sh script.
Torchrun
For multi-node training, we usetorchrun to set up distributed training. Because torchrun is SPMD, all ranks are logging to console and file at the same time. To only view the logs from the master rank, you can use the --local-ranks-filter flag.
For example, to only view the logs from the master rank when training on a full node
--log-dir and --redirects and --tee flags to redirect the console logs to files.
outputs/torchrun/{rdzv_id}/attempt_0/{rank}/{stdout,stderr}.log.
W&B
For most runs we recommend logging to W&B. Before enabling W&B, make sure that you have an account and are logged in.SFT
Logging to W&B is disabled by default. Enable the default configuration with--wandb
prime-rl project with a random run name. You can specify which project and name to log to
torchrun. Note, that we only log global metrics from the master rank (e.g. the all-reduced loss)
RL
For RL training, both the trainer and orchestrator log to W&B as separate runs. Again, logging to W&B is disabled by default. Enable the default configuration with--wandb
prime-rl project with a random run name. The trainer run is suffixed with -trainer and the orchestrator run is suffixed with -orchestrator. You can specify which project and name to log to using the same flags as for SFT.
wandb.log-extras subconfig. If W&B is setup, this is enabled by default and will log for the RL trainer and orchestrator every 10 steps.
You can configure this on the trainer and orchestrator separately. For example, to only log samples on the orchestrator every 50 steps, but not distribution on either