Unverified Commit 0e12ba74 authored by Yao Matrix's avatar Yao Matrix Committed by GitHub
Browse files

fix 3 xpu failures uts w/ latest pytorch (#12408)



fix xpu ut failures w/ latest pytorch
Signed-off-by: default avatarYao, Matrix <matrix.yao@intel.com>
parent 20fd00b1
...@@ -155,7 +155,7 @@ class HunyuanDiTControlNetPipelineFastTests(unittest.TestCase, PipelineTesterMix ...@@ -155,7 +155,7 @@ class HunyuanDiTControlNetPipelineFastTests(unittest.TestCase, PipelineTesterMix
if torch_device == "xpu": if torch_device == "xpu":
expected_slice = np.array( expected_slice = np.array(
[0.6376953, 0.84375, 0.58691406, 0.48046875, 0.43652344, 0.5517578, 0.54248047, 0.5644531, 0.48217773] [0.6948242, 0.89160156, 0.59375, 0.5078125, 0.57910156, 0.6035156, 0.58447266, 0.53564453, 0.52246094]
) )
else: else:
expected_slice = np.array( expected_slice = np.array(
......
...@@ -15,6 +15,7 @@ from diffusers import ( ...@@ -15,6 +15,7 @@ from diffusers import (
) )
from ...testing_utils import ( from ...testing_utils import (
Expectations,
backend_empty_cache, backend_empty_cache,
nightly, nightly,
numpy_cosine_similarity_distance, numpy_cosine_similarity_distance,
...@@ -276,10 +277,14 @@ class FluxPipelineSlowTests(unittest.TestCase): ...@@ -276,10 +277,14 @@ class FluxPipelineSlowTests(unittest.TestCase):
image = pipe(**inputs).images[0] image = pipe(**inputs).images[0]
image_slice = image[0, :10, :10] image_slice = image[0, :10, :10]
# fmt: off # fmt: off
expected_slice = np.array(
[0.3242, 0.3203, 0.3164, 0.3164, 0.3125, 0.3125, 0.3281, 0.3242, 0.3203, 0.3301, 0.3262, 0.3242, 0.3281, 0.3242, 0.3203, 0.3262, 0.3262, 0.3164, 0.3262, 0.3281, 0.3184, 0.3281, 0.3281, 0.3203, 0.3281, 0.3281, 0.3164, 0.3320, 0.3320, 0.3203], expected_slices = Expectations(
dtype=np.float32, {
("cuda", None): np.array([0.3242, 0.3203, 0.3164, 0.3164, 0.3125, 0.3125, 0.3281, 0.3242, 0.3203, 0.3301, 0.3262, 0.3242, 0.3281, 0.3242, 0.3203, 0.3262, 0.3262, 0.3164, 0.3262, 0.3281, 0.3184, 0.3281, 0.3281, 0.3203, 0.3281, 0.3281, 0.3164, 0.3320, 0.3320, 0.3203], dtype=np.float32,),
("xpu", 3): np.array([0.3301, 0.3281, 0.3359, 0.3203, 0.3203, 0.3281, 0.3281, 0.3301, 0.3340, 0.3281, 0.3320, 0.3359, 0.3281, 0.3301, 0.3320, 0.3242, 0.3301, 0.3281, 0.3242, 0.3320, 0.3320, 0.3281, 0.3320, 0.3320, 0.3262, 0.3320, 0.3301, 0.3301, 0.3359, 0.3320], dtype=np.float32,),
}
) )
expected_slice = expected_slices.get_expectation()
# fmt: on # fmt: on
max_diff = numpy_cosine_similarity_distance(expected_slice.flatten(), image_slice.flatten()) max_diff = numpy_cosine_similarity_distance(expected_slice.flatten(), image_slice.flatten())
......
...@@ -360,33 +360,33 @@ class SD35LargeGGUFSingleFileTests(GGUFSingleFileTesterMixin, unittest.TestCase) ...@@ -360,33 +360,33 @@ class SD35LargeGGUFSingleFileTests(GGUFSingleFileTesterMixin, unittest.TestCase)
{ {
("xpu", 3): np.array( ("xpu", 3): np.array(
[ [
0.1953125, 0.16796875,
0.3125, 0.27929688,
0.31445312,
0.13085938,
0.30664062,
0.29296875,
0.11523438,
0.2890625,
0.28320312, 0.28320312,
0.16601562, 0.11328125,
0.3046875, 0.27539062,
0.328125, 0.26171875,
0.140625, 0.10742188,
0.31640625, 0.26367188,
0.26171875,
0.1484375,
0.2734375,
0.296875,
0.13476562,
0.2890625,
0.30078125,
0.1171875,
0.28125,
0.28125,
0.16015625,
0.31445312,
0.30078125,
0.15625,
0.32421875, 0.32421875,
0.12304688, 0.296875,
0.3046875, 0.14453125,
0.3046875, 0.30859375,
0.17578125, 0.2890625,
0.3359375,
0.3203125,
0.16601562,
0.34375,
0.31640625,
0.15429688,
0.328125,
0.31054688,
] ]
), ),
("cuda", 7): np.array( ("cuda", 7): np.array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment