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

[FSDP] Consolidate FSDP state_dict offload_to_cpu settings #86211

Closed
wants to merge 4 commits into from

Conversation

fegin
Copy link
Contributor

@fegin fegin commented Oct 4, 2022

Stack from ghstack (oldest at bottom):

Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: D40065969

Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)

[ghstack-poisoned]
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 4, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: fegin / name: Chien-Chin Huang (97498b4)

@pytorch-bot pytorch-bot bot added the release notes: distributed (fsdp) release notes category label Oct 4, 2022
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 4, 2022

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/86211

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 0798b95:
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added cla signed oncall: distributed Add this issue/PR to distributed oncall triage queue labels Oct 4, 2022
fegin added a commit that referenced this pull request Oct 4, 2022
Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)

ghstack-source-id: 169306202
Pull Request resolved: #86211
Copy link
Member

@rohan-varma rohan-varma left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Do we need to update the appropriate documentation anywhere?

_UNFLATTENED_STATE_DICT_IMPLS = ["state_dict", "sharded_state_dict"]
_FLATTENED_STATE_DICT_IMPLS = ["local_state_dict"]
_UNFLATTENED_STATE_DICT_IMPLS = ["state_dict"]
_FLATTENED_STATE_DICT_IMPLS = []
Copy link
Member

Choose a reason for hiding this comment

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

why is local_state_dict out of this flattened state_dict impls list? Isn't still a flattened version of state_dict?

Copy link
Contributor Author

@fegin fegin Oct 5, 2022

Choose a reason for hiding this comment

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

oops, accidentally commit this change. Will revert it.

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 5, 2022
else:
config = None
raise ValueError("Unspported state_dict_type")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
raise ValueError("Unspported state_dict_type")
raise ValueError("Unsupported state_dict_type")

test/distributed/fsdp/test_fsdp_state_dict.py Outdated Show resolved Hide resolved
Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)

[ghstack-poisoned]
fegin added a commit that referenced this pull request Oct 5, 2022
Pull Request resolved: #86211

Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.
ghstack-source-id: 169442813

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)
Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)

[ghstack-poisoned]
fegin added a commit that referenced this pull request Oct 11, 2022
Pull Request resolved: #86211

Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.
ghstack-source-id: 170025910

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)
Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)

[ghstack-poisoned]
fegin added a commit that referenced this pull request Oct 13, 2022
Pull Request resolved: #86211

Consolidate FSDP state_dict offload_to_cpu settings. All state_dict_types now
have offload_to_cpu options.
ghstack-source-id: 170308168

Differential Revision: [D40065969](https://our.internmc.facebook.com/intern/diff/D40065969/)
@fegin
Copy link
Contributor Author

fegin commented Oct 14, 2022

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions
Copy link

Hey @fegin.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

@facebook-github-bot facebook-github-bot deleted the gh/fegin/30/head branch June 8, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request cla signed Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (fsdp) release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants