- Inspect each rollout trajectory step-by-step, including prompts, model responses, and tool invocations.
- Filter trajectories by step, sample index, rollout number, and experiment name.
- Compare multiple trajectories side-by-side to debug agent behavior across training steps.
Prerequisites
- A W&B account and API key.
- A VERL installation that supports rollout tracing. Rollout tracing was added in verl#2345.
- An async rollout configuration. Tracing only applies to asynchronous rollouts; synchronous rollouts are not traced.
Enable Weave tracing
Set your W&B API key in the environment so VERL can authenticate with your W&B account:actor_rollout_ref.rollout.trace.backend=weave: Selects Weave as the trace backend.actor_rollout_ref.rollout.mode=async: Enables async rollout for vLLM or SGLang. Tracing has no effect on synchronous rollouts.trainer.project_name: Sets the project you want to log traces and metrics to.trainer.experiment_name: Sets the name of your experiment.trainer.logger=['console','wandb']: Enables the wandb logger alongside Weave so metrics and traces appear in the same project.
weave.init().
Tune trace volume
By default, VERL traces every sample in every rollout, which can produce very large amounts of trace data. You can limit the volume by setting the following fields in yourppo_trainer.yaml configuration file:
max_samples_per_step_per_worker: The number of unique samples workers trace per training step. Defaults tonullto trace all samples.token2text: Set toTrueto add decodedprompt_textandresponse_textto theToolAgentLoop.runoutput. Defaults toFalsefor performance. Enable it when you want to read prompts and completions directly in the Weave UI.
View traces
To view the traces emitted during training, open your W&B project page and select Traces. Each trace corresponds to a rollout trajectory. You can select multiple traces and use Weave’s comparison view to inspect differences between trajectories. This can help you debug changes in agent behavior across training steps or experiments.Trace additional functions
VERL exposes two helpers for extending the default trace coverage:rollout_trace_op: A decorator that maps toweave.opand marks a method on a class instance for tracing. By default, only a small number of methods are decorated. You can add this decorator to methods on your custom agent loop or tool implementations to capture more detail.rollout_trace_attr: A context manager that marks the entry of a trajectory and attaches trajectory metadata (sample index, step, rollout number, experiment name). If you introduce a new agent type, wrap its trajectory entrypoint withrollout_trace_attrso the trace is associated with the run.