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

[Train] Support FSDP Strategy for LightningTrainer #34148

Merged

Conversation

woshiyyya
Copy link
Member

@woshiyyya woshiyyya commented Apr 7, 2023

Why are these changes needed?

Previously, LightningTrainer only support DDP strategy for distributed training. This PR adds support for FSDP strategy.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

woshiyyya added 11 commits April 6, 2023 17:08
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
@woshiyyya woshiyyya marked this pull request as ready for review April 12, 2023 21:02
@woshiyyya woshiyyya requested review from justinvyu and gjoliver April 12, 2023 21:05
Copy link
Contributor

@justinvyu justinvyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left some questions.

python/ray/train/lightning/lightning_trainer.py Outdated Show resolved Hide resolved
python/ray/train/lightning/lightning_trainer.py Outdated Show resolved Hide resolved
python/ray/train/lightning/lightning_trainer.py Outdated Show resolved Hide resolved
python/requirements/ml/requirements_tune.txt Show resolved Hide resolved
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
@amogkam
Copy link
Contributor

amogkam commented Apr 14, 2023

Any plans to add an example, like porting over this GPT fine tuning with PTL+fsdp example https://github.com/SeanNaren/minGPT/tree/fairscale and showing how to do this on multiple nodes?

This would be a really great flagship example for this integration, and aligns well with our LLM initiative.

@woshiyyya
Copy link
Member Author

woshiyyya commented Apr 14, 2023

Any plans to add an example, like porting over this GPT fine tuning with PTL+fsdp example https://github.com/SeanNaren/minGPT/tree/fairscale and showing how to do this on multiple nodes?

This would be a really great flagship example for this integration, and aligns well with our LLM initiative.

Good idea. What do you think @matthewdeng ?

@matthewdeng
Copy link
Contributor

Yeah, we should add an example for 2.5 😃

@woshiyyya woshiyyya requested review from gjoliver and justinvyu April 14, 2023 22:12
@gjoliver gjoliver merged commit c9b6e6a into ray-project:master Apr 19, 2023
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
Signed-off-by: woshiyyya <xiaoyunxuan1998@gmail.com>
Signed-off-by: Jack He <jackhe2345@gmail.com>
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

Successfully merging this pull request may close these issues.

5 participants