Skip to main content
Miles emits per-rollout metrics to stdout and (optionally) Weights & Biases. SGLang and Ray write their own logs to their default directories.

What gets logged by default

Each rollout iteration emits a structured row to stdout (illustrative shape — exact fields depend on backend and config):
When --use-wandb is set, metrics also go to wandb under the train/, rollout/, and perf/ namespaces (see miles/utils/tracking_utils/wandb_utils.py).

Enabling wandb

Available flags: --use-wandb, --wandb-project, --wandb-group. WANDB_API_KEY should be supplied via Ray’s env_vars rather than baked into the launch script.

What to watch

Panel names follow what loss.py and the rollout logger emit; Miles’s wandb metrics live under train/, rollout/, perf/, multi_turn/, passrate/ namespaces.

Custom loggers

Replace the default rollout logger with your own to push to internal systems:

Profiling

Built-in PyTorch profiler

The PyTorch profiler is wired into Miles via miles/utils/profile_utils.py. It reads Megatron’s profiling flags on every backend (FSDP and torchtitan mirror them):
--profile-target train_overall (the default) traces whole training steps on every backend. train_actor and train_log_probs trace the microbatch loop of each optimizer step, so their window counts microbatches and restarts at every step; the Megatron backend rejects them. --record-memory-history records a memory snapshot instead (CUDA with the default --memory-recorder torch, host memory with memray; it needs train_overall in --profile-target). It is written under --memory-snapshot-dir once rollout id --memory-snapshot-num-steps - 1 has trained, and the torch recorder also writes one on a CUDA OOM. Open the trace in chrome://tracing or Perfetto.

Where the log files live

Router endpoints

The router exposes a small FastAPI surface used internally by Miles: