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

Update register_empty_buffer to match torch args #1465

Merged
merged 1 commit into from
May 24, 2023
Merged

Conversation

NouamaneTazi
Copy link
Member

@NouamaneTazi NouamaneTazi commented May 22, 2023

Fixes the following case

import torch
from torch import nn
from accelerate import init_on_device
with init_on_device(device="meta", include_buffers=True):
    dummy_module = nn.Module()
    dummy_module.register_buffer("dummy_buffer", torch.tensor([1.0]), persistent=False)

cc @thomasw21

@NouamaneTazi NouamaneTazi requested a review from sgugger May 22, 2023 12:59
Copy link
Contributor

@thomasw21 thomasw21 left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM!

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 22, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

@sgugger sgugger merged commit 2249fbd into main May 24, 2023
@sgugger sgugger deleted the NouamaneTazi-patch-1 branch May 24, 2023 12:32
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.

4 participants