Skip to content

Correct sigmas cpu settings #6708

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

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Correct sigmas cpu settings #6708

merged 1 commit into from
Jan 26, 2024

Conversation

patrickvonplaten
Copy link
Contributor

@patrickvonplaten patrickvonplaten commented Jan 25, 2024

What does this PR do?

Correcting the incorrect PR here.
Pretty big mistake on my side here - schedulers are no nn.Modules so every attribute is a tensor and therefore nothing is set in-place. Tensors have to manually be set.

It doesn't make a difference though in practice because the sigmas are always on CPU anyways. For the most important schedulers that I tested in #6173 (Euler & DPMSolverMultistep) self.sigmas should never be set to CUDA/GPU anyways so this PR shouldn't really change anything in practice, but is "correct" and ensures that scheduler sigmas are never on GPU.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@patrickvonplaten
Copy link
Contributor Author

Thanks a mille for catching this bug @sunhs

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator

@DN6 DN6 left a comment

Choose a reason for hiding this comment

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

Nice!

@sayakpaul sayakpaul merged commit 3e9716f into main Jan 26, 2024
@sayakpaul sayakpaul deleted the correct_sigmas_cpu_settings branch January 26, 2024 01:40
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
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.

5 participants