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

[hotfix] fix zero ddp buffer cast #1376

Merged
merged 2 commits into from
Jul 28, 2022
Merged

Conversation

ver217
Copy link
Member

@ver217 ver217 commented Jul 27, 2022

No description provided.


def _cast_buffers(self):
for buffer in self.module.buffers():
buffer.data = buffer.cuda()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this must be on cuda?

Copy link
Member Author

@ver217 ver217 Jul 28, 2022

Choose a reason for hiding this comment

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

Buffers are computed on cuda. Zero doesn't manage buffers, so we just move them to cuda during initializing.

@ver217 ver217 merged commit 8332832 into hpcaitech:main Jul 28, 2022
@ver217 ver217 deleted the hotfix/zero-ddp branch July 28, 2022 02:54
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.

None yet

3 participants