Skip to content

dnn: improve scatter and scatterND speed with multi-threading#24813

Merged
asmorkalov merged 5 commits intoopencv:4.xfrom
fengyuentau:speedup_scatter
Jan 17, 2024
Merged

dnn: improve scatter and scatterND speed with multi-threading#24813
asmorkalov merged 5 commits intoopencv:4.xfrom
fengyuentau:speedup_scatter

Conversation

@fengyuentau
Copy link
Copy Markdown
Member

@fengyuentau fengyuentau commented Jan 5, 2024

Benchmark was done on M1 Macbook Air (16G mem). Time is in milliseconds.

*: Shapes of input, indices, updates are all [2, 128, 64, 50].

Operator w/ this PR w/o this PR ORT
Scatter (Reduction=None, axis=0) 2.04 7.36 6.81
Scatter (Reduction=Add, axis=0) 2.00 7.61 6.33
ScatterND (Reduction=None) 1.41 6.59 17.52
ScatterND (Reduction=Add) 1.37 6.83 16.34

Scripts for ORT benchmark: ort_benchmark.zip

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=Linux OpenCL

@asmorkalov asmorkalov requested a review from vpisarev January 17, 2024 09:18
@asmorkalov
Copy link
Copy Markdown
Contributor

@vpisarev @dkurt Friendly reminder.

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

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

Good improvement, thanks!

@asmorkalov asmorkalov merged commit ac4c0bf into opencv:4.x Jan 17, 2024
@opencv-alalek
Copy link
Copy Markdown
Contributor

@fengyuentau
Copy link
Copy Markdown
Member Author

Let me take care of that.

@fengyuentau fengyuentau deleted the speedup_scatter branch January 18, 2024 02:40
@asmorkalov asmorkalov mentioned this pull request Jan 23, 2024
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.

4 participants