Skip to content

port prototype transforms kernel tests to new architecture #6612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Sep 21, 2022

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Sep 20, 2022

Per title. There are still some references to port, but I'll do that in a follow up PR. Currently there are also quite a few failing tests. I'll have a look if I botched the sample inputs generation or if the test actually uncovered some bugs.

@pmeier pmeier marked this pull request as ready for review September 20, 2022 12:50
@pmeier
Copy link
Collaborator Author

pmeier commented Sep 20, 2022

I'll have a look if I botched the sample inputs generation or if the test actually uncovered some bugs.

Both actually.

  1. Some kernels don't support more than one batch dimension and I messed that up when porting the sample_inputs_fn. Still, our kernels should support arbitrary batch shapes, so I left # FIXME comments. Here is an overview of those that don't

    • perspective_{image_tensor, mask}
    • elastic_{image_tensor, mask}
    • gaussian_blur_image_tensor
    • equalize_image_tensor
    • adjust_sharpness_image_tensor
  2. Some PIL kernels don't support sequences of a single element for fill if the number of channels is larger. The tensor counterpart interprets this the same as if the number were passed outside a sequence. Not sure if that is a bug and thus I didn't open an issue yet. I left some # FIXME comments. Offenders:

    • pad_image_pil
    • perspective_image_pil
  3. Behavior of PIL and tensor F.pad actually diverges. Since we only wrap the stable kernels here, this is not a prototype bug. See F.crop behavior diverges between tensor and PIL images #6613.

@pmeier pmeier requested a review from vfdev-5 September 20, 2022 12:58
Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Let's enable crop_image_tensor and it is good to go

@vfdev-5
Copy link
Collaborator

vfdev-5 commented Sep 21, 2022

@pmeier can we port gaussian blur to new framework such that we may have less flaky issues with this test :)

@pmeier pmeier merged commit 56e707b into pytorch:main Sep 21, 2022
@pmeier pmeier deleted the port-kernel-tests branch September 21, 2022 11:56
facebook-github-bot pushed a commit that referenced this pull request Sep 23, 2022
…6612)

Summary:
* port vertical_flip

* port rotate

* port crop

* port resized_crop

* port pad

* port perspective

* port elastic

* port center_crop

* port gaussian_blur

* port equalize

* port invert

* port posterize

* port solarize

* port autocontrast

* port adjust_sharpness

* port erase

* fix kernel infos

* renable crop references

* add tolerances to gaussian_blur kernel info

Reviewed By: NicolasHug

Differential Revision: D39765315

fbshipit-source-id: e7cd4a9d0a22549e2f636cdf8f285e178f04733c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants