sandeep-krishnamurthy opened a new pull request #14055: Fix performance regression in normalize operator URL: https://github.com/apache/incubator-mxnet/pull/14055 ## Description ## 1. In PR #13802 we added additional support for normalize operator and also re-organized with kernel launch/map functionality. 2. However, PR #13802 introduced performance regression. 3. In this PR, I fix the performance issue and bring it close to the original performance. 4. Earlier, I was parallelizing kernel launch based on length (h*w) and hence, there was a significant overhead compared to simple operation being performance in the kernel (x-mean/std) 5. Main changes in this PR includes - Parallelizing kernel launch based on number of channels rather than length, using omp parallel in the kernel. ## Before regressing PR #13802 Total time for 50000 images of shape (3,300,300) to do normalization - 67.39s Total time for 100000 images of shape (3,300,300) to do normalization - 134.72s ## After regressing PR #13802 Total time for 50000 images of shape (3,300,300) to do normalization - 104.09s Total time for 100000 images of shape (3,300,300) to do normalization - 203.78s ## With changes in this PR Total time for 50000 images of shape (3,300,300) to do normalization - 68.54s Total time for 100000 images of shape (3,300,300) to do normalization - 136.12s **NOTE** I have a revert PR #14054 , just in case, this PR gets delayed to be merged. ## Checklist ## ### Essentials ### Please feel free to remove inapplicable items for your PR. - [X] Changes are complete (i.e. I finished coding on this PR) - [X] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - [X] Code is well-documented: - [X] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ### Changes ### - Parallelize kernel launch in normalize operator based on channel. @nswamy @zhreshold @stu1130
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services