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

Move model to device before wrapping with FSDP #1801

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mieshkiwrk
Copy link

@mieshkiwrk mieshkiwrk commented Feb 26, 2025

Seems to be a better approach due to known issue with moving view tensors to device within FSDP: pytorch/pytorch#147321

Also PyTorch recommendation in FSDP tutorial does it like that:
https://pytorch.org/tutorials/intermediate/FSDP_tutorial.html

model = Net().to(rank)
model = FSDP(model)

Seems to be a better approach due to known issue with moving view tensors to device within FSDP: pytorch/pytorch#147321
@mieshkiwrk mieshkiwrk requested a review from regisss as a code owner February 26, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant