Improve the precision of our integration tests
See original GitHub issueWe currently have a rather low precision when testing our pipeline due to due reasons.
-
- Our reference is an image and not a numpy array. This means that when we created our reference image we lost float precision which is unnecessary
-
- We only test for
.max() < 1e-2
. IMO we should test for.max() < 1e-4
with the numpy arrays. In my experiements across multiple devices I have not seen differences bigger than.max() < 1e-4
when using full precision.
- We only test for
IMO this could have also prevented: https://github.com/huggingface/diffusers/issues/902
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top Results From Across the Web
6 best practices for integration testing with continuous ...
How integration testing works with CI and DevOps · Run integration tests until something fails · Determine what needs to be added or...
Read more >What is integration testing? The basics explained!
Integration testing is the second level in the software testing hierarchy. Learn more about its goals, roles, and commonly used approaches.
Read more >The Best Way to Manage Continuous Integration Testing
Advantages of Continuous Integration Testing. Increase Your Testing Coverage: Testing most of your code base isn't enough.
Read more >Confident Testing: Why Unit-Testing Over Integration-Testing
When we develop using Continuous Confidence, when we get to the point of considering testing, our focus becomes Confidence. Confident code.
Read more >A Breakdown of Continuous Integration Testing - Harness
Let's explore how you can adopt CI/CD to improve your organization's efficiency and delivery pipeline in Harness.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patrickvonplaten after some research I think I understand the issue.
The images are currently stored in a low-precision format (e.g. png) which prevents us from testing with any greater precision than
1e-2
. Even if we convert the image into a numpy array this will not help since the image itself is missing precision.What we need to do is store a numpy representation of the image, say somewhere inside
https://huggingface.co/datasets
which we can then download and use for comparison.The way we could do this is by generating the test output, saving that output as a numpy image and uploading it.
This is what I plan to do tomorrow.
This stack overflow thread was very helpful in understanding the issue.
@patrickvonplaten I made a PR adding the files: https://huggingface.co/datasets/hf-internal-testing/diffusers-images/discussions/2