TECHNOLOGY

Hydra output directories: generated run folders and the process working directory are separate settings

In this article
THE QUICK TAKE

An output directory can exist without a working-directory change; relative input paths must follow the intended base rather than an assumed run-folder policy.

Observe both paths at application entry

A training script works when launched manually but cannot find its tokenizer after a Hydra configuration change. The working-directory tutorial distinguishes the generated output directory from the application’s current directory. Inspect both values when the decorated application starts. The presence of a new run folder does not by itself establish that relative input paths are now resolved inside that folder, or that they still use the original project root.

Treat chdir as an explicit execution choice

The job configuration reference defines hydra.job.chdir as the control for changing the process directory. Set the intended behavior explicitly when portability matters instead of depending on remembered defaults from another Hydra version or application setup. A relative path is interpreted by the code that opens it. If an imported library opens a file later, that call observes the current process directory at that time rather than the directory where the configuration file happened to live.

Separate input roots from output destinations

The output pattern guide describes configuring run and sweep destinations. That policy organizes logs and configuration snapshots; it need not define where a shared dataset or pretrained checkpoint resides. Resolve inputs against an intentional root and outputs against the selected run destination. Keeping those roles distinct prevents a convenient run-folder customization from silently redirecting reads to an empty folder or writes into a shared source dataset.

Preserve original-directory resolution where intended

Hydra exposes helpers for accessing the original working directory and resolving a path relative to it. Use that contract for project-relative inputs when it matches the application design. It does not turn an arbitrary relative path into a portable dataset identity, and the original launch location itself may differ between machines. For shared training workers, preserve the resolved dataset or artifact identity in addition to its filesystem path so the input remains explainable after relocation.

Test the same input under both directory policies

Use a recognizable small input file and inspect where it is read and where results are written with the intended directory behavior. Related guides explain artifact release manifests and pipeline state records. The test should establish path roles without assuming a directory name proves data identity. A saved Hydra configuration snapshot is useful provenance, while actual input resolution and file availability remain necessary checks at execution time.

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