-
Notifications
You must be signed in to change notification settings - Fork 6.5k
[MPS] call contiguous after permute #1411
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
Conversation
Fixes for MPS device
|
The documentation is not available anymore as the PR was closed or merged. |
|
@pcuenca I can also fix the warning: By replacing it with: step_index = self.timesteps.tolist().index(timestep)what do you think? |
I think it should be ok, let's do it and see what other people think. It's nice to remove the warning, but that operation will still move the tensor to the CPU (just as the fallback implementation of |
pcuenca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on this!
|
@pcuenca at the moment with this scheduler with scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
pipe = StableDiffusionPipeline.from_pretrained(
model_id,
torch_dtype=torch.float16,
revision="fp16",
scheduler=scheduler
).to("mps") |
|
@pcuenca I leave it up to you to merge :-) |
|
@pcuenca let me double check this now on my cuda box |
|
@pcuenca also works fine on "cuda" |
src/diffusers/schedulers/scheduling_euler_ancestral_discrete.py
Outdated
Show resolved
Hide resolved
This reverts commit b46c328.
* call contiguous after permute Fixes for MPS device * Fix MPS UserWarning * make style * Revert "Fix MPS UserWarning" This reverts commit b46c328.
* call contiguous after permute Fixes for MPS device * Fix MPS UserWarning * make style * Revert "Fix MPS UserWarning" This reverts commit b46c328.
Fixes for MPS device.
I believe is a better fix that #1410
Testing with on main branch: