Skip to content

Conversation

fanchenkong1
Copy link

Summary

This PR adds a larger scalar kernel (convBlockNoSIMD4x24) in the DNN fastConv path. It targets non-SIMD WebAssembly build.

Background

In OpenCV.js/no-SIMD builds, OpenCV.js 4.x shows ~35% slowdown compared to 4.5.2 on Intel Core Ultra 7 258V. The regression comes from using a small scalar fallback, which increases the memory load/store pressure.

What's changed

  • Add 4x24 scalar micro-kernel (convBlockNoSIMD4x24) for WASM no-SIMD path, other shapes keep on existing convBlockNoSIMD code.
  • Kernel processes 2 rows at a time to avoid store-bound.

Performance

Workload: Face detection and image classification using res10_300x300_ssd_iter_140000_fp16.caffemodel and squeezenet.onnx v 1.0 on five images (720x480)
Environment: WASM no-SIMD build/Chrome stable 138/on Intel Core Ultra 7 258V

OpenCV.js 4.5.2 (baseline) OpenCV.js 4.x OpenCV.js 4.x + this PR
Diff(execution time) 0% +35% -19%

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

@fanchenkong1
Copy link
Author

Ubuntu2004-x64-OpenVINO bot reports a timeout failure at Accuracy:gapi.

The action 'Accuracy:gapi' has timed out after 60 minutes.

This PR only touches the WASM build path. May I re-run the trybot to check if it was a temporary issue?

@fanchenkong1
Copy link
Author

Ubuntu2004-x64-OpenVINO bot reports a timeout failure at Accuracy:gapi.

The action 'Accuracy:gapi' has timed out after 60 minutes.

This PR only touches the WASM build path. May I re-run the trybot to check if it was a temporary issue?

@vpisarev , could you please take a look? Thanks!

@fanchenkong1
Copy link
Author

Ubuntu2004-x64-OpenVINO bot reports a timeout failure at Accuracy:gapi.

The action 'Accuracy:gapi' has timed out after 60 minutes.

This PR only touches the WASM build path. May I re-run the trybot to check if it was a temporary issue?
@asmorkalov, could you please take a look? Thanks!

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.

2 participants