Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local_rank or rank for multi-node FSDP #1263

Open
Emerald01 opened this issue May 30, 2024 · 0 comments
Open

local_rank or rank for multi-node FSDP #1263

Emerald01 opened this issue May 30, 2024 · 0 comments

Comments

@Emerald01
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant