Skip to content

Update examples/documentation for torch.distributed.run #13850

@BramVanroy

Description

@BramVanroy

Most examples now read local rank from a CLI argument --local_rank. This ensures for it to work when using the torch launch utility torch.distributed.launch. However, since recent torch versions, launch is deprecated. The new suggested way to run distributed code from CLI is with torch.distributed.run. The difference from before is that instead of automatically passing CLI arguments, it sets the rank as an environment variable. The examples therefore need to be updated to read the ENV variable instead of the CLI argument.

See https://pytorch.org/docs/stable/elastic/run.html#launcher-api for more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions