Skip to main content

Synopsis

Description

The dvc repro command reproduces (executes) stages in your DVC pipeline. It’s the primary way to run your ML workflows after defining stages with dvc stage add. DVC automatically determines which stages need to be run by:
  • Checking if dependencies have changed
  • Checking if outputs are missing
  • Checking if stage commands have changed
  • Checking if parameters have changed
Only stages that need updating are executed, making pipeline reproduction efficient. DVC respects the dependency graph and executes stages in the correct order.
Smart execution: DVC uses checksums to detect changes and only runs stages when necessary. This is similar to how make works but optimized for data pipelines.

Arguments

string[]
Stages to reproduce. Defaults to dvc.yaml in the current directory.Targets can be:
  • Path to a dvc.yaml or .dvc file
  • Stage name from dvc.yaml in current directory
  • Path with stage name: path/to/dvc.yaml:stage_name
Examples:

Options

Execution Control

boolean
Reproduce even if dependencies were not changed. Forces execution of specified stages regardless of whether DVC detects changes.
boolean
Only print the commands that would be executed without actually executing them. Useful for previewing what will run.
Output:
boolean
Ask for confirmation before reproducing each stage. DVC will prompt you before executing each stage command.

Pipeline Selection

boolean
Reproduce only single data item without recursive dependencies check. Runs only the specified stage(s) without checking or running dependencies.
Using -s may result in inconsistent outputs if dependencies have changed.
boolean
Reproduce the whole pipeline that the specified targets belong to. Executes all stages from the beginning of the pipeline.
boolean
Reproduce all pipelines in the repository. Useful for ensuring entire project is up to date.
boolean
Reproduce all stages in the specified directory recursively. Finds all dvc.yaml files in subdirectories.
boolean
Start from the specified stages when reproducing pipelines. Runs the specified stage and all stages that depend on it.
boolean
Reproduce all descendants of a changed stage even if their direct dependencies didn’t change.Useful when you want to ensure all downstream stages are updated after modifying a stage.

Data Management

boolean
Try automatically pulling missing data before reproduction. If dependencies are missing, DVC attempts to download them from remote storage.
boolean
Skip stages with missing data but no other changes. Continues execution even if some dependencies are unavailable.
boolean
Don’t put files/directories into cache. Runs stages but doesn’t cache outputs.
Useful for testing pipeline changes without polluting the cache.

Advanced Options

boolean
Execute stage commands even if they have already been run with the same command/dependencies/outputs/etc before.DVC maintains a run cache to avoid re-executing identical commands. This flag disables that optimization.
boolean
Allows targets containing shell-style wildcards.

Error Handling

boolean
Continue executing, skipping stages having dependencies on the failed stages. If a stage fails, DVC continues with independent stages.
boolean
Ignore errors from stages. Pipeline execution continues even when stages fail.
Use with caution. This can result in incomplete or incorrect outputs.

Examples

Basic reproduction

Reproduce all stages in the default dvc.yaml:
Output:
If no stages need to run, DVC will output: “Data and pipelines are up to date.”

Reproduce specific stage

This runs the train stage and any of its dependencies that have changed.

Force reproduction

Run a stage even if DVC thinks it’s up to date:
Useful when you’ve made code changes that don’t affect tracked dependencies, or when debugging.

Dry run to preview execution

Output:

Interactive reproduction

Output:

Reproduce entire pipeline

Even if you specify a single stage, reproduce from the beginning:
This ensures all stages (prepare, train, evaluate) are run in order.

Reproduce all pipelines in project

This finds and reproduces all dvc.yaml files in your repository.

Reproduce with automatic data pull

If any dependencies are missing, DVC tries to download them from remote storage before running.

Reproduce downstream stages

Run a stage and everything that depends on it:
If prepare produces data used by train and evaluate, all three will run.

Continue on failure

If you have independent pipeline branches and one fails, others will continue.

Reproduce without caching

Runs stages but doesn’t cache outputs. Useful during development.

Complex example: Force reproduce with downstream

This forces prepare to run, then forces all downstream stages (train, evaluate, etc.) to run regardless of whether their direct dependencies changed.

Working with dvc.lock

When you run dvc repro, DVC updates dvc.lock to record:
  • Checksums of dependencies
  • Checksums of outputs
  • Parameter values used
  • Commands executed
Example dvc.lock:
Always commit dvc.lock to Git. It ensures reproducibility by capturing the exact state of your pipeline.

Understanding Stage Execution

When does a stage run?

A stage is executed if:
  1. Dependencies changed: Input files have different checksums
  2. Outputs missing: Output files don’t exist or are missing from cache
  3. Command changed: The stage command was modified in dvc.yaml
  4. Parameters changed: Tracked parameters have different values
  5. Forced execution: You used -f or --force

Execution order

DVC analyzes the dependency graph and executes stages in topological order:
Stages with no dependencies run first. Stages run only after their dependencies complete.

Common Workflows

Development workflow

Reproducing on a different machine

Debugging pipeline issues

Updating after parameter changes

When you modify params.yaml:
DVC automatically detects which stages depend on the changed parameters.

Performance Tips

Use run cache: DVC’s run cache prevents re-running identical commands. Keep it enabled unless you have a specific reason to disable it.
Incremental execution: DVC only runs what’s necessary. Structure your pipeline with granular stages to maximize cache hits.
Parallel execution: While dvc repro executes stages sequentially, independent pipeline branches can be run in parallel manually using job schedulers or multiple terminals.

Troubleshooting

Pipeline appears up to date but shouldn’t be

Use -f to force execution:

Missing dependencies error

Try pulling data first:
Or allow missing dependencies:

Stage keeps running unnecessarily

Check if files are being modified by the command:
Consider using --outs-persist for outputs that shouldn’t be removed between runs.

Lock file conflicts

If you have merge conflicts in dvc.lock:

See Also