Skip to content

Change the command to initialize DDP subprocess with Hydra #16694

@zihaozou

Description

@zihaozou

Description & Motivation

Hi,

the current behavior to initialize DDP subprocesses with Hydra is here, which overrides the hydra.run.dir with os.getcwd().

This is assuming the os.getcwd() will return the output directory that Hydra assigned. However, since Hydra 1.2, Hydra will keep the cwd as the project directory by default. This command will result in logging the subprocess in the project directory.

Pitch

Logging the DDP subprocess correctly in the output directory created by Hydra

Alternatives

use:

os_cwd = hydra.core.hydra_config.HydraConfig.get()['runtime']['output_dir']
os_cwd = f'"{os_cwd}"'

instead

Additional context

No response

cc @Borda @justusschock @awaelchli

Metadata

Metadata

Assignees

No one assigned

    Labels

    3rd partyRelated to a 3rd-partyfeatureIs an improvement or enhancementstrategy: ddpDistributedDataParallelwon't fixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions