Skip to main content

Description

Run a DVC experiment to test different hyperparameters, code changes, or data versions. This command executes your pipeline stages and tracks the results as experiments. It inherits functionality from dvc repro but adds experiment-specific features like parameter overrides, queueing, and parallel execution.
Experiments are lightweight and don’t clutter your Git history. Use dvc exp show to view results and dvc exp apply to promote successful experiments.

Usage

Arguments

string[]
Stages to reproduce. Defaults to dvc.yaml from the current directory. Can be:
  • Path to a dvc.yaml or .dvc file
  • Stage name from dvc.yaml in current directory
  • Path followed by colon and stage name (e.g., path/to/dvc.yaml:stage_name)

Options

Experiment Options

string
Human-readable experiment name. If not specified, a name will be auto-generated.
string
Override parameter values for this experiment run. Can be used multiple times.Format: [<filename>:]<param_name>=<param_value>
boolean
default:"false"
Stage this experiment in the run queue for future execution instead of running immediately.
boolean
default:"false"
Execute all experiments in the run queue. Implies --temp.
integer
default:"1"
Run the specified number of experiments in parallel. Useful with --run-all.
boolean
default:"false"
Run experiment in a separate temporary directory instead of your workspace. Prevents workspace pollution during experiments.
string[]
List of ignored or untracked paths to copy into the temp directory. Only used with --temp or --queue.
string
Custom commit message to use when committing the experiment.
boolean
default:"false"
Disable automatic updating of params.yaml with Hydra configuration. You can still use --set-param to update individual params.

Pipeline Execution Options

boolean
default:"false"
Reproduce even if dependencies were not changed.
boolean
default:"false"
Ask for confirmation before reproducing each stage.
boolean
default:"false"
Reproduce only single data item without recursive dependencies check.
boolean
default:"false"
Reproduce the whole pipeline that the specified targets belong to.
boolean
default:"false"
Reproduce all pipelines in the repository.
boolean
default:"false"
Reproduce all stages in the specified directory.
boolean
default:"false"
Start from the specified stages when reproducing pipelines.
boolean
default:"false"
Reproduce all descendants of a changed stage even if their direct dependencies didn’t change.
boolean
default:"false"
Try automatically pulling missing data before running.
boolean
default:"false"
Skip stages with missing data but no other changes.
boolean
default:"false"
Only print the commands that would be executed without actually executing them.
boolean
default:"false"
Continue executing, skipping stages having dependencies on failed stages.
boolean
default:"false"
Ignore errors from stages and continue execution.

Examples

Run a basic experiment

This runs your pipeline and creates an experiment with an auto-generated name.

Run with custom parameters

Output:

Queue multiple experiments

Output:
Queueing experiments is useful for hyperparameter sweeps. Queue all variations, then run them in parallel with --run-all --jobs N.

Run in temporary directory

Using --temp keeps your workspace clean. The experiment runs in an isolated temporary directory.

Test parameters without execution

Output:

Run specific pipeline stage

The -f flag forces re-execution even if dependencies haven’t changed. Use carefully as it can be time-consuming.

Common Workflows

Hyperparameter tuning

Testing code changes

  • dvc exp show - View experiment results
  • dvc exp diff - Compare experiments
  • dvc exp apply - Apply experiment changes to workspace
  • dvc repro - Reproduce pipelines without experiment tracking