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

allow strict=True in load_checkpoint_and_dispatch #2640

Closed
yiyixuxu opened this issue Apr 9, 2024 · 2 comments · Fixed by #2641
Closed

allow strict=True in load_checkpoint_and_dispatch #2640

yiyixuxu opened this issue Apr 9, 2024 · 2 comments · Fixed by #2641

Comments

@yiyixuxu
Copy link

yiyixuxu commented Apr 9, 2024

System Info

accelerate = 0.29.1

Information

this PR #2588 breaks the loading behavior in diffusers when:

  1. accelerate.load_checkpoint_and_dispatch is used
  2. the checkpoint contains deprecated weight names for the attention class

As you can see here, we rely on the error to rename the parameters' names on our end. Is there a better way to do this in diffusers?
The alternative is to allow us a pass a strict=True from load_checkpoint_and_dispatch- let me know what you think :)

Reproduction

this script fails currently but it should not

from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained(
    "hf-internal-testing/tiny-stable-diffusion-pipe", device_map="sequential", safety_checker=None
)
@yiyixuxu
Copy link
Author

yiyixuxu commented Apr 9, 2024

cc @SunMarc

@SunMarc
Copy link
Member

SunMarc commented Apr 9, 2024

Let's just pass strict=True in load_checkpoint_and_dispatch. Sorry for introducing a breaking change ;)

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 a pull request may close this issue.

2 participants