Skip to content

Conversation

@awgu
Copy link
Collaborator

@awgu awgu commented Sep 16, 2024

Stack from ghstack (oldest at bottom):

  • Sometimes having access to the MixedPrecisionPolicy in the fsdp_pre_all_gather is useful. See here in the torchao INT8 mixed precision training PR.
  • Sometimes having access to the owning nn.Module allows for using it for saving state. See here for an example.

The major paint point here is how to deal with backward compatibility. For now, we use signature.inspect to check if the user subclass follows the old vs. new signature. However, for the new signature, the param_dtype in the post-all-gather is redundant, as if the user needed it, the user could save it from the mp_policy passed in the pre-all-gather now.

cc @XilunWu @H-Huang @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 16, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit b0ea438 with merge base c64ae60 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (fsdp) release notes category labels Sep 16, 2024
@awgu awgu added release notes: distributed (fsdp2) release notes category and removed release notes: distributed (fsdp) release notes category labels Sep 16, 2024
@awgu awgu marked this pull request as ready for review September 22, 2024 19:46
@awgu awgu requested a review from weifengpy September 22, 2024 19:47
@awgu awgu added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 23, 2024
@awgu
Copy link
Collaborator Author

awgu commented Sep 23, 2024

@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

pytorchmergebot pushed a commit that referenced this pull request Sep 23, 2024
I messed up the test before. The extensions were not running :/

Pull Request resolved: #136130
Approved by: https://github.com/weifengpy
ghstack dependencies: #136129
BoyuanFeng pushed a commit to BoyuanFeng/pytorch that referenced this pull request Sep 25, 2024
)

- Sometimes having access to the `MixedPrecisionPolicy` in the `fsdp_pre_all_gather` is useful. See [here](https://github.com/pytorch/ao/pull/748/files#r1760375325) in the torchao INT8 mixed precision training PR.
- Sometimes having access to the owning `nn.Module` allows for using it for saving state. See [here](pytorch#114299 (comment)) for an example.

The major paint point here is how to deal with backward compatibility. For now, we use `signature.inspect` to check if the user subclass follows the old vs. new signature. However, for the new signature, the `param_dtype` in the post-all-gather is redundant, as if the user needed it, the user could save it from the `mp_policy` passed in the pre-all-gather now.

Pull Request resolved: pytorch#136129
Approved by: https://github.com/weifengpy
BoyuanFeng pushed a commit to BoyuanFeng/pytorch that referenced this pull request Sep 25, 2024
I messed up the test before. The extensions were not running :/

Pull Request resolved: pytorch#136130
Approved by: https://github.com/weifengpy
ghstack dependencies: pytorch#136129
@github-actions github-actions bot deleted the gh/awgu/638/head branch October 25, 2024 02:08
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 Merged oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (fsdp2) release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants