Skip to content
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

[prototype] Speed improvement for adjust gamma op #6820

Merged
merged 4 commits into from
Oct 24, 2022

Conversation

datumbox
Copy link
Contributor

@datumbox datumbox commented Oct 24, 2022

[---------------- Adjust_gamma cpu torch.uint8 ---------------]
                     |  adjust_gamma stable  |  adjust_gamma v2
1 threads: ----------------------------------------------------
      (3, 400, 400)  |          1300         |         828     
6 threads: ----------------------------------------------------
      (3, 400, 400)  |          1610         |        1070     

Times are in microseconds (us).

[--------------- Adjust_gamma cuda torch.uint8 ---------------]
                     |  adjust_gamma stable  |  adjust_gamma v2
1 threads: ----------------------------------------------------
      (3, 400, 400)  |          83.2         |        41.7     
6 threads: ----------------------------------------------------
      (3, 400, 400)  |          82.8         |        41.7     

Times are in microseconds (us).

[--------------- Adjust_gamma cpu torch.float32 --------------]
                     |  adjust_gamma stable  |  adjust_gamma v2
1 threads: ----------------------------------------------------
      (3, 400, 400)  |          8.09         |        7.74     
6 threads: ----------------------------------------------------
      (3, 400, 400)  |          6.30         |        5.87     

Times are in milliseconds (ms).

[-------------- Adjust_gamma cuda torch.float32 --------------]
                     |  adjust_gamma stable  |  adjust_gamma v2
1 threads: ----------------------------------------------------
      (3, 400, 400)  |          30.2         |        9.0      
6 threads: ----------------------------------------------------
      (3, 400, 400)  |          30.2         |        8.8      

Times are in microseconds (us).

Benchmark script from here

cc @vfdev-5 @bjuncek @pmeier

@datumbox datumbox added module: transforms Perf For performance improvements prototype labels Oct 24, 2022
@datumbox datumbox requested review from pmeier and vfdev-5 and removed request for pmeier October 24, 2022 11:10
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.

Lgtm, thanks @datumbox

@datumbox
Copy link
Contributor Author

datumbox commented Oct 24, 2022

The failures on windows are unrelated. It seems a Datapipes issue. cc @pmeier

@datumbox datumbox merged commit 6979888 into pytorch:main Oct 24, 2022
@datumbox datumbox deleted the transforms/adjust_gamma branch October 24, 2022 12:08
facebook-github-bot pushed a commit that referenced this pull request Oct 27, 2022
Summary:
* Speed improvement for adjust gamma op

* Adding comments and optimizations.

* fixing typo

* Remove unnecessary channel check.

Reviewed By: YosuaMichael

Differential Revision: D40722911

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

Successfully merging this pull request may close these issues.

3 participants