Skip to content

Conversation

@kaixuanliu
Copy link
Contributor

@DN6 pls help review, thx!

@yao-matrix
Copy link
Contributor

tolerance as 1e-2 is too loose, @kaixuanliu, pls do more investigations.

@kaixuanliu
Copy link
Contributor Author

This PR is aimed to solve two precision failed test cases in diffusers CI on Intel XPU platform:
1.pytest -rA tests/pipelines/kandinsky2_2/test_kandinsky_controlnet.py::KandinskyV22ControlnetPipelineIntegrationTests::test_kandinsky_controlnet
2.pytest -rA tests/pipelines/kandinsky3/test_kandinsky3_img2img.py::Kandinsky3Img2ImgPipelineFastTests::test_encode_prompt_works_in_isolation

for case 1, I compared the output images, they are perceptualy same(see attached output.bmp
expected_output.bmp
), so I think the tolerance value change is accepatable.

for case 2, maybe the 1e-2 value is loose, I will take it back. Let's solve case 1 first.

@kaixuanliu
Copy link
Contributor Author

For case2, pls refer to the analysis and fix in #12474

@kaixuanliu
Copy link
Contributor Author

@a-r-r-o-w @DN6 , Hi, can you help review? Thx!

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you define it depending on the platform, it doesn't make sense to loosen it for everyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, do you think it's OK now?

Signed-off-by: Liu, Kaixuan <[email protected]>
@IlyasMoutawwakil IlyasMoutawwakil merged commit 7536f64 into huggingface:main Oct 24, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants