Skip to content

Commit 0e12ba7

Browse files
authored
fix 3 xpu failures uts w/ latest pytorch (#12408)
fix xpu ut failures w/ latest pytorch Signed-off-by: Yao, Matrix <[email protected]>
1 parent 20fd00b commit 0e12ba7

File tree

3 files changed

+34
-29
lines changed

3 files changed

+34
-29
lines changed

tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def test_controlnet_hunyuandit(self):
155155

156156
if torch_device == "xpu":
157157
expected_slice = np.array(
158-
[0.6376953, 0.84375, 0.58691406, 0.48046875, 0.43652344, 0.5517578, 0.54248047, 0.5644531, 0.48217773]
158+
[0.6948242, 0.89160156, 0.59375, 0.5078125, 0.57910156, 0.6035156, 0.58447266, 0.53564453, 0.52246094]
159159
)
160160
else:
161161
expected_slice = np.array(

tests/pipelines/flux/test_pipeline_flux.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
)
1616

1717
from ...testing_utils import (
18+
Expectations,
1819
backend_empty_cache,
1920
nightly,
2021
numpy_cosine_similarity_distance,
@@ -276,10 +277,14 @@ def test_flux_inference(self):
276277
image = pipe(**inputs).images[0]
277278
image_slice = image[0, :10, :10]
278279
# fmt: off
279-
expected_slice = np.array(
280-
[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],
281-
dtype=np.float32,
280+
281+
expected_slices = Expectations(
282+
{
283+
("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,),
284+
("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,),
285+
}
282286
)
287+
expected_slice = expected_slices.get_expectation()
283288
# fmt: on
284289

285290
max_diff = numpy_cosine_similarity_distance(expected_slice.flatten(), image_slice.flatten())

tests/quantization/gguf/test_gguf.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -360,33 +360,33 @@ def test_pipeline_inference(self):
360360
{
361361
("xpu", 3): np.array(
362362
[
363-
0.1953125,
364-
0.3125,
365-
0.31445312,
366-
0.13085938,
367-
0.30664062,
368-
0.29296875,
369-
0.11523438,
370-
0.2890625,
363+
0.16796875,
364+
0.27929688,
371365
0.28320312,
372-
0.16601562,
373-
0.3046875,
374-
0.328125,
375-
0.140625,
376-
0.31640625,
366+
0.11328125,
367+
0.27539062,
368+
0.26171875,
369+
0.10742188,
370+
0.26367188,
371+
0.26171875,
372+
0.1484375,
373+
0.2734375,
374+
0.296875,
375+
0.13476562,
376+
0.2890625,
377+
0.30078125,
378+
0.1171875,
379+
0.28125,
380+
0.28125,
381+
0.16015625,
382+
0.31445312,
383+
0.30078125,
384+
0.15625,
377385
0.32421875,
378-
0.12304688,
379-
0.3046875,
380-
0.3046875,
381-
0.17578125,
382-
0.3359375,
383-
0.3203125,
384-
0.16601562,
385-
0.34375,
386-
0.31640625,
387-
0.15429688,
388-
0.328125,
389-
0.31054688,
386+
0.296875,
387+
0.14453125,
388+
0.30859375,
389+
0.2890625,
390390
]
391391
),
392392
("cuda", 7): np.array(

0 commit comments

Comments
 (0)