-
Notifications
You must be signed in to change notification settings - Fork 158
fix: [FSDP2] reshard_after_forward=False for root model #464
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
Conversation
|
would love to support more from pytorch fsdp2 side @gshennvm @yuki-666 @terrykong @parthchadha |
thanks for the contribution! Just for my understanding -- doesn't pytorch set this to False by default already? from the pytorch docs: cc @terrykong on how we can work together for better fsdp2 integration :) |
I am about to remove the heuristic for future pytorch release: pytorch/pytorch#154704 for root model, if user set
I will change the doc as well to recommend reshard_after_forward=False for root model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that makes sense. Thanks for the info! Approved.
We can merge tests are resolved
|
Hi @weifengpy . Thanks, could you rebase your commits to |
just commited with |
Signed-off-by: Wei Feng <weif@meta.com>
Signed-off-by: Wei Feng <weif@meta.com>
What does this PR do ?
Hi from pytorch fsdp2! set
fully_shard(reshard_after_forward=False)to keep the memory behavior the same after pytorch side change: pytorch/pytorch#154704for root model,
reshard_after_forward=Falsemeans keep root parameters unsharded after forward, since they will be used in the backward immeidately. This is a AA changeIssues
List issues that this PR closes (syntax):
Usage
Before your PR is "Ready for review"
Pre checks:
Additional Information