From 43fbc3aec54a62c33b3c3e7faf28177c468be3b4 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 7 Mar 2024 17:40:24 +0530 Subject: [PATCH 1/5] debug --- .../stable_diffusion_xl/pipeline_stable_diffusion_xl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py index 776696e9d486..a8ded708496a 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py @@ -693,6 +693,7 @@ def prepare_latents(self, batch_size, num_channels_latents, height, width, dtype ) if latents is None: + print(f"From pipeline: device: {device}") latents = randn_tensor(shape, generator=generator, device=device, dtype=dtype) else: latents = latents.to(device) From ec64d34d5cc6eb27c02e47d0a8870c512d2035d9 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 7 Mar 2024 17:41:57 +0530 Subject: [PATCH 2/5] checking --- tests/pipelines/test_pipelines_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pipelines/test_pipelines_common.py b/tests/pipelines/test_pipelines_common.py index 1475e2ff07d2..eec00b755dd2 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -106,7 +106,7 @@ def test_vae_tiling(self): if "safety_checker" in components: components["safety_checker"] = None pipe = self.pipeline_class(**components) - pipe = pipe.to(device) + pipe = pipe.to(torch_device) pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) From c2cc79c2c0203cb17a4587646b83228bd58dc072 Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 7 Mar 2024 17:42:52 +0530 Subject: [PATCH 3/5] fix more --- tests/pipelines/test_pipelines_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pipelines/test_pipelines_common.py b/tests/pipelines/test_pipelines_common.py index eec00b755dd2..6fa316e1d518 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -126,7 +126,7 @@ def test_vae_tiling(self): # test that tiled decode works with various shapes shapes = [(1, 4, 73, 97), (1, 4, 97, 73), (1, 4, 49, 65), (1, 4, 65, 49)] for shape in shapes: - zeros = torch.zeros(shape).to(device) + zeros = torch.zeros(shape).to(torch_device) pipe.vae.decode(zeros) def test_freeu_enabled(self): From a0fcca6dd574203601572b8f2f1f7d8f8b4f086a Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 7 Mar 2024 17:46:23 +0530 Subject: [PATCH 4/5] remove device. --- tests/pipelines/test_pipelines_common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/pipelines/test_pipelines_common.py b/tests/pipelines/test_pipelines_common.py index 6fa316e1d518..2b29e3ae9eeb 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -99,7 +99,6 @@ def test_vae_slicing(self): assert np.abs(output_2[0].flatten() - output_1[0].flatten()).max() < 1e-2 def test_vae_tiling(self): - device = "cpu" # ensure determinism for the device-dependent torch.Generator components = self.get_dummy_components() # make sure here that pndm scheduler skips prk From c980c53a8ad9b5816496b77f48ac57e654d11bca Mon Sep 17 00:00:00 2001 From: sayakpaul Date: Thu, 7 Mar 2024 17:51:18 +0530 Subject: [PATCH 5/5] fix-copies --- .../stable_diffusion_xl/pipeline_stable_diffusion_xl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py index a8ded708496a..776696e9d486 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py @@ -693,7 +693,6 @@ def prepare_latents(self, batch_size, num_channels_latents, height, width, dtype ) if latents is None: - print(f"From pipeline: device: {device}") latents = randn_tensor(shape, generator=generator, device=device, dtype=dtype) else: latents = latents.to(device)