cuda4dnn(region): optimize kernels#16096
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Dec 9, 2019
Merged
Conversation
9103f52 to
dd3f517
Compare
opencv-pushbot
pushed a commit
that referenced
this pull request
Dec 9, 2019
HagegeR
referenced
this pull request
in AlexeyAB/darknet
Dec 10, 2019
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.
This pullrequest changes
The CUDA part of the region layer took nearly 700us for single image inference on GTX 1050. It now takes around 270us. That's over 2.6x improvement.
The YOLOv2 path is poorly optimized but it's better than before. It can be optimized further if required (I don't think anybody uses YOLOv2 anyway).
Benchmark:
Warmup runs: 3
Benchmark runs: 100
Benchmark code: https://gist.github.com/YashasSamaga/26eb2eb16be2cc749e3394d300a7585e
DISCLAIMER: I am not very comfortable editing darknet code but I hope it's correct.