Unverified Commit 52b460fe authored by Fanli Lin's avatar Fanli Lin Committed by GitHub
Browse files

[tests] HunyuanDiTControlNetPipeline inference precision issue on XPU (#11197)

* add xpu part

* fix more cases

* remove some cases

* no canny

* format fix
parent d8c617cc
...@@ -153,9 +153,14 @@ class HunyuanDiTControlNetPipelineFastTests(unittest.TestCase, PipelineTesterMix ...@@ -153,9 +153,14 @@ class HunyuanDiTControlNetPipelineFastTests(unittest.TestCase, PipelineTesterMix
image_slice = image[0, -3:, -3:, -1] image_slice = image[0, -3:, -3:, -1]
assert image.shape == (1, 16, 16, 3) assert image.shape == (1, 16, 16, 3)
expected_slice = np.array( if torch_device == "xpu":
[0.6953125, 0.89208984, 0.59375, 0.5078125, 0.5786133, 0.6035156, 0.5839844, 0.53564453, 0.52246094] expected_slice = np.array(
) [0.6376953, 0.84375, 0.58691406, 0.48046875, 0.43652344, 0.5517578, 0.54248047, 0.5644531, 0.48217773]
)
else:
expected_slice = np.array(
[0.6953125, 0.89208984, 0.59375, 0.5078125, 0.5786133, 0.6035156, 0.5839844, 0.53564453, 0.52246094]
)
assert ( assert (
np.abs(image_slice.flatten() - expected_slice).max() < 1e-2 np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
...@@ -351,6 +356,7 @@ class HunyuanDiTControlNetPipelineSlowTests(unittest.TestCase): ...@@ -351,6 +356,7 @@ class HunyuanDiTControlNetPipelineSlowTests(unittest.TestCase):
assert image.shape == (1024, 1024, 3) assert image.shape == (1024, 1024, 3)
original_image = image[-3:, -3:, -1].flatten() original_image = image[-3:, -3:, -1].flatten()
expected_image = np.array( expected_image = np.array(
[0.43652344, 0.44018555, 0.4494629, 0.44995117, 0.45654297, 0.44848633, 0.43603516, 0.4404297, 0.42626953] [0.43652344, 0.44018555, 0.4494629, 0.44995117, 0.45654297, 0.44848633, 0.43603516, 0.4404297, 0.42626953]
) )
......
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