Skip to content

local_rank or rank for multi-node FSDP #1263

Open
@Emerald01

Description

@Emerald01

I am wondering for multi-node FSDP, does local_rank and rank have any obvious difference here?
I think I understand that local_rank is the rank within a node.

I see in a few places it looks like local_rank is specifically used

For example

https://github.com/pytorch/examples/blob/main/distributed/FSDP/T5_training.py#L111
torch.cuda.set_device(local_rank)

and
https://github.com/pytorch/examples/blob/main/distributed/FSDP/utils/train_utils.py#L48
batch[key] = batch[key].to(local_rank)

Is there any problem if using rank instead?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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