TECHNOLOGY

DVC persistent outputs: preserving a directory makes its previous contents part of the stage design

In this article
THE QUICK TAKE

persist preserves an output path during reproduction; the stage program must define how existing contents affect the next result.

Find the state that survives between executions

A preprocessing stage writes embedding shards into an output directory. A developer enables persistence to avoid deleting a useful intermediate checkpoint, then discovers that rerunning with a smaller input leaves extra old shards. The output field reference defines persist as preservation of the output during reproduction. It does not define which files the program should overwrite, retain or remove. Those choices now matter to the dataset actually consumed downstream.

Separate path preservation from application resumption

The reproduction command normally removes stage outputs before executing their producer, with a persistence exception. Keeping a checkpoint file available does not itself load optimizer state or advance a training loop from that checkpoint. The application must select and restore the appropriate state. Record that decision explicitly rather than inferring successful resumption from the mere survival of a directory after the stage started.

Make repeated execution semantics explicit

An append-only writer, a writer replacing named files and a writer recreating a manifest have different relationships to pre-existing output. Decide which representation defines the valid result. A manifest can enumerate the shards belonging to the current run, while a downstream wildcard might accidentally include leftovers. If incremental accumulation is intended, describe its input state and deduplication rule. Otherwise a repeated run may change membership without any change in the nominal source dataset.

Keep caching and remote retention distinct

The same output schema separately describes caching and pushing, while cached data upload follows configured object references. Persistence alone is not a promise that the preserved output was uploaded or retained elsewhere. A directory can survive locally and still be unavailable on a fresh worker. Identify the result files and their storage policy independently of the decision to keep them during a local stage execution.

Test a shrinking input and an interrupted write

Run a small fixture, then reduce the input population and inspect both the output manifest and physical directory. Also examine recovery after an interrupted write so incomplete files do not become valid samples. Related guides cover dataset membership schemas and shard replay. The acceptance criterion is a defined output population, not simply that the command completed without deleting the directory you wanted to preserve.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles