Skip to main content
When running distributed training with torchrun across multiple nodes or processes, all workers can log metrics to the same experiment using a shared run_id. This enables unified tracking of distributed training runs.

How It Works

Pluto supports attaching multiple processes to the same experiment run. When the first process calls pluto.init(), a new run is created. Subsequent processes with the same run_id will attach to that existing run instead of creating new ones.

Setting Up Distributed Logging

1. Set a Shared Run ID

Before launching your distributed job, set the PLUTO_RUN_ID environment variable to a unique identifier:
All processes that share this environment variable will log to the same experiment.
When using konduktor launch , PLUTO_RUN_ID is set to the job name by default so you don’t need to explicitly set it yourself.

2. Initialize Pluto in Your Training Script

In your training script, initialize Pluto after setting up the distributed process group:

3. Log Metrics with Rank Prefixes

To distinguish metrics from different processes, prefix them with the rank:

Complete Example

Here’s a full example for a Konduktor task that runs distributed training with Pluto logging:
And the corresponding training script:

Run Properties

The run object provides useful properties for distributed scenarios:

Environment Variables

Pluto recognizes the following environment variables for distributed logging:

Best Practices

  1. Set run_id before launching: Ensure PLUTO_RUN_ID is set before calling torchrun so all processes inherit the same value.
  2. Use rank prefixes: Prefix metrics with the rank to distinguish data from different processes in the dashboard.
  3. Log config from rank 0 only: Pass config only from rank 0 to avoid duplicate metadata.
  4. Unique run IDs: Include a timestamp or UUID in your run ID to ensure each training run is distinct.
  5. Handle the name parameter: The name parameter is only used when creating a new run. Processes that resume an existing run will ignore this parameter (a warning is logged to indicate this).