Skip to content

Add FSDP docs #7791

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

Merged
merged 6 commits into from
Jun 2, 2021
Merged

Add FSDP docs #7791

merged 6 commits into from
Jun 2, 2021

Conversation

SeanNaren
Copy link
Contributor

@SeanNaren SeanNaren commented Jun 1, 2021

What does this PR do?

Adds docs for #7487, with usage instructions for this V1 case

cc @shuyingsunshine21 @ananthsub

Before submitting

  • Was this discussed/approved 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 update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

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

  • 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

Did you have fun?

Make sure you had fun coding 🙃

@SeanNaren SeanNaren added docs Documentation related 3rd party Related to a 3rd-party labels Jun 1, 2021
@SeanNaren SeanNaren self-assigned this Jun 1, 2021
@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

Merging #7791 (d759d47) into master (9a001fe) will decrease coverage by 0%.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           master   #7791   +/-   ##
======================================
- Coverage      93%     92%   -0%     
======================================
  Files         199     199           
  Lines       12987   13008   +21     
======================================
- Hits        12020   12006   -14     
- Misses        967    1002   +35     

Wrap the Model
""""""""""""""

To activate parameter sharding, you must wrap your model using provided ``wrap`` or ``auto_wrap`` functions as described below. Internally in Lightning, we enable a context manager around the ``configure_sharded_model`` function to make sure the ``wrap`` and ``auto_wrap`` parameters are passed correctly.
Copy link
Member

Choose a reason for hiding this comment

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

Not really docs, but came to my mind (ignore it if not appropriate): Is it possible to add a maximum recursion depth here as a stopping condition for recursion instead of just the parameter number?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Atm we use a policy in lightning to wrap modules, but this can be changed. Will be exposed eventually but I think the current consensus is to use wrap right now as things are getting ironed out!

@SeanNaren
Copy link
Contributor Author

Test is failing atm, but let's keep it like that cos I want @ananthsub and @shuyingsunshine21 to take a look :)

@shuyingsunshine21
Copy link
Contributor

lgtm overall, thanks @SeanNaren

@kaushikb11
Copy link
Contributor

Re-running the jobs!

@SeanNaren SeanNaren enabled auto-merge (squash) June 1, 2021 20:56
@SeanNaren SeanNaren merged commit 0a72fd2 into master Jun 2, 2021
@SeanNaren SeanNaren deleted the doc/fsdp branch June 2, 2021 09:52
@carmocca carmocca added this to the v1.4 milestone Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party Related to a 3rd-party docs Documentation related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants