From dca2502b1aea35a405ff58e6ed1512e5375c18e0 Mon Sep 17 00:00:00 2001 From: "Liu, Kaixuan" Date: Fri, 10 Oct 2025 13:59:24 +0800 Subject: [PATCH 1/4] Loose the criteria tolerance appropriately for Intel XPU devices Signed-off-by: Liu, Kaixuan --- tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py | 2 +- tests/pipelines/test_pipelines_common.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py index 4054e38c5691..b2ffd7f8a789 100644 --- a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py +++ b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py @@ -290,4 +290,4 @@ def test_kandinsky_controlnet(self): assert image.shape == (512, 512, 3) max_diff = numpy_cosine_similarity_distance(expected_image.flatten(), image.flatten()) - assert max_diff < 2e-4 + assert max_diff < 2e-3 diff --git a/tests/pipelines/test_pipelines_common.py b/tests/pipelines/test_pipelines_common.py index db8209835be4..51cd65d08dc3 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -2069,7 +2069,7 @@ def test_loading_with_incorrect_variants_raises_error(self): assert f"You are trying to load the model files of the `variant={variant}`" in str(error.exception) - def test_encode_prompt_works_in_isolation(self, extra_required_param_value_dict=None, atol=1e-4, rtol=1e-4): + def test_encode_prompt_works_in_isolation(self, extra_required_param_value_dict=None, atol=1e-2, rtol=1e-4): if not hasattr(self.pipeline_class, "encode_prompt"): return From 91eb9f8267307376b725e39a6a6d75cdc4e694c7 Mon Sep 17 00:00:00 2001 From: "Liu, Kaixuan" Date: Sat, 11 Oct 2025 09:47:59 +0800 Subject: [PATCH 2/4] change back the atol value Signed-off-by: Liu, Kaixuan --- 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 51cd65d08dc3..db8209835be4 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -2069,7 +2069,7 @@ def test_loading_with_incorrect_variants_raises_error(self): assert f"You are trying to load the model files of the `variant={variant}`" in str(error.exception) - def test_encode_prompt_works_in_isolation(self, extra_required_param_value_dict=None, atol=1e-2, rtol=1e-4): + def test_encode_prompt_works_in_isolation(self, extra_required_param_value_dict=None, atol=1e-4, rtol=1e-4): if not hasattr(self.pipeline_class, "encode_prompt"): return From d557560492fdb337e89e2bbaba14883797855ff8 Mon Sep 17 00:00:00 2001 From: "Liu, Kaixuan" Date: Wed, 22 Oct 2025 17:04:43 +0800 Subject: [PATCH 3/4] use expectations Signed-off-by: Liu, Kaixuan --- .../kandinsky2_2/test_kandinsky_controlnet.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py index b2ffd7f8a789..66940d1a7d75 100644 --- a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py +++ b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py @@ -29,6 +29,7 @@ ) from ...testing_utils import ( + Expectations, backend_empty_cache, enable_full_determinism, floats_tensor, @@ -290,4 +291,11 @@ def test_kandinsky_controlnet(self): assert image.shape == (512, 512, 3) max_diff = numpy_cosine_similarity_distance(expected_image.flatten(), image.flatten()) - assert max_diff < 2e-3 + expected_slices = Expectations( + { + ("xpu", 3): 2e-3, + ("cuda", 7): 2e-4, + } + ) + expected_max_diff = expected_slices.get_expectation() + assert max_diff < expected_max_diff From 2d77e3ef33b58afec947fc8de843d556ec26de22 Mon Sep 17 00:00:00 2001 From: Ilyas Moutawwakil <57442720+IlyasMoutawwakil@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:53:06 +0200 Subject: [PATCH 4/4] Update tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py --- tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py index 66940d1a7d75..8f8e58a8c4c8 100644 --- a/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py +++ b/tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py @@ -291,11 +291,11 @@ def test_kandinsky_controlnet(self): assert image.shape == (512, 512, 3) max_diff = numpy_cosine_similarity_distance(expected_image.flatten(), image.flatten()) - expected_slices = Expectations( + expected_max_diffs = Expectations( { ("xpu", 3): 2e-3, ("cuda", 7): 2e-4, } ) - expected_max_diff = expected_slices.get_expectation() + expected_max_diff = expected_max_diffs.get_expectation() assert max_diff < expected_max_diff