[prototype] Speed up autocontrast_image_tensor#6935
Merged
datumbox merged 3 commits intopytorch:mainfrom Nov 9, 2022
Merged
Conversation
31 tasks
Contributor
Author
Contributor
|
The failure happens in the consistency tests which test for equality by default You can add this vision/test/test_prototype_transforms_consistency.py Lines 167 to 168 in 10d47a6 to vision/test/test_prototype_transforms_consistency.py Lines 247 to 254 in 10d47a6 for reasonable default tolerances. We needed to this for a few ops where we changed algorithms and in turn got slight deviations from v1. |
Contributor
Author
|
@pmeier Thanks for the advice. Worked locally. I'll rerun the tests to be sure. |
Contributor
Author
|
The failing test is the false positive that @vfdev-5 is currently investigating (see #6933 (comment)) |
facebook-github-bot
pushed a commit
that referenced
this pull request
Nov 14, 2022
Summary: * Performance optimization for autocontrast * Fixing tests Reviewed By: NicolasHug Differential Revision: D41265202 fbshipit-source-id: cd1f9f777ecf56168def256a2ef04335a602684b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #6818
A performance improvement for uint8 images:
fn2 is the submitted variant. It is 30% faster on CPU but 15% slower on GPU.
fn3 is another candidate (not included on this PR). It's 13% faster on CPU and about the same on GPU. Here is the implementation:
In offline discussions with @pmeier and @vfdev-5 we decided to choose fn2 because it optimizes for the most common use-case which is doing the process on CPU. Moreover the fn3 variant uses the
out=idiom which doesn't play nice with autograd.cc @vfdev-5 @bjuncek @pmeier