-
Notifications
You must be signed in to change notification settings - Fork 486
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
add example for fsdp #7061
add example for fsdp #7061
Conversation
Given FSDPv1 is more or less deprecated, I don't think we should add it as an example. We should just focus on SPMD instead. |
Thanks for adding this @JackCaoG, I have a few questions.
|
Old example is kind of long, I want to make it very clear what's the minimal codes to run a feature. If user want to do a deeper dive we should directly them to the more completed example. |
I see your point, but there are users that want to use FSDP v1. It is similar that we don't really want user to use native DDP but I provide the example anyway. I think we can update our README to specify what do we recommened, in that section we can make it clear that we recommend |
@gkroiz for checkponting and gradident checkpointing, I think we should provide a similar simple examples. Let me know if you are interested in contributing. |
Happy to review, probably don't have time in the near future. |
}) | ||
else: | ||
raise Exception(f"Invalid auto-wrap policy: {auto_wrap_policy}") | ||
fsdp_wrap = lambda m: FSDP( |
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.
Why is the lambda functions needed? One case I can think of would be using it as a callable argument of auto_wrapper_callable
. But since it is not the case, can we use FSDP()
directly on the model for simplicity?
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.
good catch, I just copied it from the example. Let me clean it up
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.
LGTM
da2bb0d
to
3684982
Compare
@gkroiz FYI, for some reason I can't add you as a reviewer.