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

How to use spmd to support hybrid shard data parallelism? #7607

Open
mars1248 opened this issue Jul 2, 2024 · 3 comments
Open

How to use spmd to support hybrid shard data parallelism? #7607

mars1248 opened this issue Jul 2, 2024 · 3 comments

Comments

@mars1248
Copy link
Contributor

mars1248 commented Jul 2, 2024

❓ Questions and Help

Fsdp can be well expressed by spmd, but hsdp seems to be unable to be expressed. Is there any way to express hsdp in spmd?

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jul 2, 2024

my understanding is that HSDP just FSDP + shard the data? Let me know what I missed here.

@mars1248
Copy link
Contributor Author

mars1248 commented Jul 3, 2024

You have a point, but how to implement FSDP+shard data? How would you represent this in spmd's mark_sharding? Or is there any other way to represent it

@JackCaoG
Copy link
Collaborator

JackCaoG commented Jul 3, 2024

take a look at https://github.com/pytorch/xla/blob/master/examples/fsdp/train_decoder_only_fsdp_v2.py, you just need to pass the sharding to the parallel loader which will shard the data for you.

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

2 participants