Skip to content

Improve the precision of our integration tests #914

Closed

Description

@patrickvonplaten

We 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.

IMO this could have also prevented: #902

Activity

  1. Lewington-pitsos commented on Oct 24, 2022

    @Lewington-pitsos
    Contributor

    I'm going to start work on this right now

  2. Lewington-pitsos commented on Oct 24, 2022

    @Lewington-pitsos
    Contributor

    @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.

  3. patrickvonplaten commented on Oct 26, 2022

    @patrickvonplaten
    ContributorAuthor

    Hey @Lewington-pitsos,

    That's a very good observation - we came to the same conclusion here: #937 :-)
    Do you have an account on the Hugging Face Hub? Would you like to upload the numpy images to a dataset on the Hub maybe? :-) This would be super useful!

  4. Lewington-pitsos commented on Oct 27, 2022

    @Lewington-pitsos
    Contributor

    Hey, yes I am currently working on this in fact!

  5. Lewington-pitsos commented on Oct 27, 2022

    @Lewington-pitsos
    Contributor
  6. patrickvonplaten commented on Nov 2, 2022

    @patrickvonplaten
    ContributorAuthor
  7. github-actions commented on Dec 24, 2022

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

    Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

staleIssues that haven't received updates

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions