From 4997d680dae2c74bfdde3aade93257a0cb77d951 Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Tue, 20 Feb 2024 06:37:55 +0000 Subject: [PATCH 1/2] update --- .../stable_video_diffusion/test_stable_video_diffusion.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py b/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py index 60c411283803..68789f98514b 100644 --- a/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py +++ b/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py @@ -22,8 +22,6 @@ from diffusers.utils.import_utils import is_xformers_available from diffusers.utils.testing_utils import ( CaptureLogger, - disable_full_determinism, - enable_full_determinism, floats_tensor, numpy_cosine_similarity_distance, require_torch_gpu, @@ -465,8 +463,6 @@ def test_model_cpu_offload_forward_pass(self, expected_max_diff=2e-4): reason="XFormers attention is only available with CUDA and `xformers` installed", ) def test_xformers_attention_forwardGenerator_pass(self): - disable_full_determinism() - expected_max_diff = 9e-4 if not self.test_xformers_attention: @@ -496,8 +492,6 @@ def test_xformers_attention_forwardGenerator_pass(self): max_diff = np.abs(to_np(output_with_offload) - to_np(output_without_offload)).max() self.assertLess(max_diff, expected_max_diff, "XFormers attention should not affect the inference results") - enable_full_determinism() - @slow @require_torch_gpu From 8aa6a889d27682006f0185a0e4f378fefa4a3f06 Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Tue, 20 Feb 2024 09:37:33 +0000 Subject: [PATCH 2/2] update --- .../stable_video_diffusion/test_stable_video_diffusion.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py b/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py index 68789f98514b..5a3c79422c2b 100644 --- a/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py +++ b/tests/pipelines/stable_video_diffusion/test_stable_video_diffusion.py @@ -22,6 +22,7 @@ from diffusers.utils.import_utils import is_xformers_available from diffusers.utils.testing_utils import ( CaptureLogger, + enable_full_determinism, floats_tensor, numpy_cosine_similarity_distance, require_torch_gpu, @@ -32,6 +33,9 @@ from ..test_pipelines_common import PipelineTesterMixin +enable_full_determinism() + + def to_np(tensor): if isinstance(tensor, torch.Tensor): tensor = tensor.detach().cpu().numpy()