pytorch-lightning icon indicating copy to clipboard operation
pytorch-lightning copied to clipboard

Flexible and easy to use HSDP setting

Open Liyang90 opened this issue 1 year ago • 2 comments

What does this PR do?

Fixes #19502

It allows users to provide device_mesh as a tuple to the FSDPStrategy.

The test case for hybrid fsdp strategy would be broken, because _init_sharding_strategy is moved out of the __init__ function.

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • [ ] Did you read the contributor guideline, Pull Request section?
  • [ ] Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • [ ] Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR. Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • [ ] Is this pull request ready for review? (if not, please submit in draft mode)
  • [ ] Check that all items from Before submitting are resolved
  • [ ] Make sure the title is self-explanatory and the description concisely explains the PR
  • [ ] Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--19504.org.readthedocs.build/en/19504/

Liyang90 avatar Feb 20 '24 22:02 Liyang90

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes missing coverage. Please review.

Project coverage is 59%. Comparing base (1a6786d) to head (949d36f). Report is 97 commits behind head on master.

:exclamation: There is a different number of reports uploaded between BASE (1a6786d) and HEAD (949d36f). Click for more details.

HEAD has 188 uploads less than BASE
Flag BASE (1a6786d) HEAD (949d36f)
python3.10 23 15
cpu 91 43
lightning 55 31
pytest 71 26
examples 9 0
app 9 0
lightning_fabric 19 8
python3.11 34 16
python3.8 18 12
pytorch2.0 12 11
pytest-full 24 21
pytorch_lightning 10 8
pytorch2.1 6 5
pytorch2.3 3 2
lightning_app 2 0
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #19504     +/-   ##
=========================================
- Coverage      84%      59%    -25%     
=========================================
  Files         426      421      -5     
  Lines       35264    35182     -82     
=========================================
- Hits        29553    20772   -8781     
- Misses       5711    14410   +8699     

codecov[bot] avatar Mar 05 '24 00:03 codecov[bot]

Any updates on this?

npuichigo avatar Apr 20 '24 08:04 npuichigo

Hi @awaelchli , I just fixed a merge conflict with the master and pushed the change. Could you take another look? Let me know if you have any concerns.

Liyang90 avatar May 16 '24 22:05 Liyang90

All checks have passed. But I don't have access to merge the PR.

Liyang90 avatar Jun 05 '24 21:06 Liyang90