Describe the bug
When the device set to mps, str(device) can return "mps:0".
The proper way to test the device would be device.type == "mps".
The wrong test is used in EulerAncestralDiscreteScheduler preventing to run the right code:
device = model_output.device if torch.is_tensor(model_output) else "cpu"
if str(device) == "mps":
# randn does not work reproducibly on mps
noise = torch.randn(model_output.shape, dtype=model_output.dtype, device="cpu", generator=generator).to(
device
)
else:
noise = torch.randn(model_output.shape, dtype=model_output.dtype, device=device, generator=generator).to(
device
)
if str(device) == "mps" should be replaced by if device.type == "mps":
Reproduction
Run twice an inference with the same seed and the EulerAncestral scheduler doest generate the same image
Logs
System Info
diffusers 0.7.2, Mac OS ventura, M1 Max env with Python 3.9.2
Describe the bug
When the device set to mps, str(device) can return "mps:0".
The proper way to test the device would be device.type == "mps".
The wrong test is used in EulerAncestralDiscreteScheduler preventing to run the right code:
if str(device) == "mps"should be replaced byif device.type == "mps":Reproduction
Run twice an inference with the same seed and the EulerAncestral scheduler doest generate the same image
Logs
System Info
diffusers 0.7.2, Mac OS ventura, M1 Max env with Python 3.9.2