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 DDP model to device if it hasn't been wrapped yet #3566

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Conversation

tgaddair
Copy link
Collaborator

No description provided.

@@ -128,8 +130,12 @@ def create_checkpoint_handle(

return MultiNodeCheckpoint(self, model, optimizer, scheduler)

def to_device(self, model: nn.Module, device: Optional[torch.device] = None) -> nn.Module:
return model
def to_device(self, model: "BaseModel", device: Optional[torch.device] = None) -> nn.Module:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do we want to add model: Union["BaseModel", "DistributedDataParallel"]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@tgaddair tgaddair added the bug Something isn't working label Aug 31, 2023
@jeffkinnison jeffkinnison merged commit b802cdd into master Aug 31, 2023
14 of 15 checks passed
@jeffkinnison jeffkinnison deleted the to-dev branch August 31, 2023 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants