Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
dnn cann backend: add hardswish, layernorm and instasnce norm for cann and bug fix#24462
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fengyuentau commentedNov 1, 2023
Will finalize this PR after the merge of#24409. |
dnn onnx: add instance norm layer#24378Resolves#24377Relates#24092 (comment)| Perf | multi-thread | single-thread || - | - | - || x: [2, 64, 180, 240] | 3.95ms | 11.12ms |Todo:- [x] speed up by multi-threading- [x] add perf- [x] add backend: OpenVINO- [x] add backend: CUDA- [x] add backend: OpenCL (no fp16)- [ ] add backend: CANN (will be done via#24462)### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to the proper branch- [x] There is a reference to the original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake```force_builders=Linux OpenCL,Win64 OpenCL,Custombuildworker:Custom=linux-4build_image:Custom=ubuntu:18.04modules_filter:Custom=nonedisable_ipp:Custom=ON```
01a16b5 to07559e8Comparefengyuentau commentedNov 10, 2023
Will test this PR next week. |
fengyuentau commentedNov 13, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Tests on Hardswish and LayerNormalization are passed with threshold 1e-3. However, due to the 1D mat shape problem, LayerNormalization with axis=-1 on CANN backend produces incorrect results, and InstanceNormalization on CANN backend leads to incorrect shape inference when building graph. So they are turned off for CANN backend for now. I think this PR can be merged and we leave the 1d mat shape problem to the future. |
dnn onnx: add instance norm layeropencv#24378Resolvesopencv#24377Relatesopencv#24092 (comment)| Perf | multi-thread | single-thread || - | - | - || x: [2, 64, 180, 240] | 3.95ms | 11.12ms |Todo:- [x] speed up by multi-threading- [x] add perf- [x] add backend: OpenVINO- [x] add backend: CUDA- [x] add backend: OpenCL (no fp16)- [ ] add backend: CANN (will be done viaopencv#24462)### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to the proper branch- [x] There is a reference to the original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake```force_builders=Linux OpenCL,Win64 OpenCL,Custombuildworker:Custom=linux-4build_image:Custom=ubuntu:18.04modules_filter:Custom=nonedisable_ipp:Custom=ON```
…n and bug fix (opencv#24462)* add hardswish for cann* gemm cann bug fix* fix indentation* cann: add layer norm* cann: add instance norm* add supportBackend* cann: layer norm does not support axis=-1 due to 1d mat issue* disable instance norm for now* fix doc* remove tensor desc initialization for 1D tensor
dnn onnx: add instance norm layeropencv#24378Resolvesopencv#24377Relatesopencv#24092 (comment)| Perf | multi-thread | single-thread || - | - | - || x: [2, 64, 180, 240] | 3.95ms | 11.12ms |Todo:- [x] speed up by multi-threading- [x] add perf- [x] add backend: OpenVINO- [x] add backend: CUDA- [x] add backend: OpenCL (no fp16)- [ ] add backend: CANN (will be done viaopencv#24462)### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to the proper branch- [x] There is a reference to the original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake```force_builders=Linux OpenCL,Win64 OpenCL,Custombuildworker:Custom=linux-4build_image:Custom=ubuntu:18.04modules_filter:Custom=nonedisable_ipp:Custom=ON```
…n and bug fix (opencv#24462)* add hardswish for cann* gemm cann bug fix* fix indentation* cann: add layer norm* cann: add instance norm* add supportBackend* cann: layer norm does not support axis=-1 due to 1d mat issue* disable instance norm for now* fix doc* remove tensor desc initialization for 1D tensor
dnn onnx: add instance norm layeropencv#24378Resolvesopencv#24377Relatesopencv#24092 (comment)| Perf | multi-thread | single-thread || - | - | - || x: [2, 64, 180, 240] | 3.95ms | 11.12ms |Todo:- [x] speed up by multi-threading- [x] add perf- [x] add backend: OpenVINO- [x] add backend: CUDA- [x] add backend: OpenCL (no fp16)- [ ] add backend: CANN (will be done viaopencv#24462)### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] 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- [x] The PR is proposed to the proper branch- [x] There is a reference to the original bug report and related work- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [x] The feature is well documented and sample code can be built with the project CMake```force_builders=Linux OpenCL,Win64 OpenCL,Custombuildworker:Custom=linux-4build_image:Custom=ubuntu:18.04modules_filter:Custom=nonedisable_ipp:Custom=ON```
…n and bug fix (opencv#24462)* add hardswish for cann* gemm cann bug fix* fix indentation* cann: add layer norm* cann: add instance norm* add supportBackend* cann: layer norm does not support axis=-1 due to 1d mat issue* disable instance norm for now* fix doc* remove tensor desc initialization for 1D tensor
Uh oh!
There was an error while loading.Please reload this page.
Resolves#24154
Resolvesopencv/ci-gha-workflow#120 (comment)
New CANN operator added in this PR:
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.