Skip to content

how to set num_processes in multi-node training #2521

@lxww302

Description

@lxww302

Is it the total num of gpus or the number of gpus on a single node?
I have seen contradictory signals in the code.

self.num_processes = torch.distributed.get_world_size()

here, it seems like the total number of gpus.

accelerate launch --num_processes $GPUS_PER_NODE $SCRIPT $SCRIPT_ARGS

here, it sees like the number of gpus per node.

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