opencv/modules/dnn/test
nklskyoy 1df06488b1
Merge pull request #27238 from nklskyoy:mha-rope
Rotary positional embeddings #27238

Rotary positional embeddings let an attention block encode the relative position between tokens. Widely adopted in LLMs such as LLaMA—and equally applicable to Vision Transformers—the ONNX Runtime com.microsoft.Attention operator already exposes this via its `do_rotary` flag (see docs), and this PR adds support for that flag in OpenCV.

_Operator spec: https://github.com/microsoft/onnxruntime/blob/v1.16.1/docs/ContribOperators.md#com.microsoft.Attention_

Materials:
- RoFormer paper https://arxiv.org/abs/2104.09864
- RoPe for Vision Transformer https://github.com/naver-ai/rope-vit
- llama implementation https://github.com/meta-llama/llama/blob/main/llama/model.py#L80


Merge with https://github.com/opencv/opencv_extra/pull/1250

### Pull Request Readiness Checklist

See details at https://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
- [ ] 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
2025-04-28 19:47:23 +03:00
..
imagenet_cls_test_alexnet.py change fcn8s-heavy-pascal tests from caffe to onnx 2024-05-03 00:15:09 +08:00
imagenet_cls_test_googlenet.py Misc. modules/ typos 2018-02-12 07:09:43 -05:00
imagenet_cls_test_inception.py Merge branch 4.x 2021-12-30 21:43:45 +00:00
npy_blob.cpp Merge pull request #24411 from alexlyulkov:al/dnn-type-inference 2024-03-01 17:07:38 +03:00
npy_blob.hpp dnn: fix precomp.hpp usage 2018-02-28 17:06:26 +03:00
pascal_semsegm_test_fcn.py Merge branch '4.x' into '5.x' 2024-06-26 19:01:34 +03:00
test_backends.cpp Merge pull request #26208 from alexlyulkov:al/new-engine-caffe-parser 2024-10-28 11:32:07 +03:00
test_caffe_importer.cpp Merge pull request #26208 from alexlyulkov:al/new-engine-caffe-parser 2024-10-28 11:32:07 +03:00
test_common.cpp Merge pull request #26056 from vpisarev:new_dnn_engine 2024-10-16 15:28:19 +03:00
test_common.hpp Merge pull request #26208 from alexlyulkov:al/new-engine-caffe-parser 2024-10-28 11:32:07 +03:00
test_common.impl.hpp Merge branch 4.x 2024-11-13 09:02:39 +03:00
test_darknet_importer.cpp Merge pull request #26056 from vpisarev:new_dnn_engine 2024-10-16 15:28:19 +03:00
test_googlenet.cpp Merge pull request #26208 from alexlyulkov:al/new-engine-caffe-parser 2024-10-28 11:32:07 +03:00
test_graph_simplifier.cpp Merge pull request #26056 from vpisarev:new_dnn_engine 2024-10-16 15:28:19 +03:00
test_ie_models.cpp dnn: remove obsolete OV models tests 2024-12-23 12:59:33 +03:00
test_int8_layers.cpp Merge branch 4.x 2024-07-01 15:59:43 +03:00
test_int.cpp Merge pull request #25755 from alexlyulkov:al/more-types 2024-06-28 09:02:15 +03:00
test_layers_1d.cpp Merge pull request #26056 from vpisarev:new_dnn_engine 2024-10-16 15:28:19 +03:00
test_layers.cpp Merge pull request #27238 from nklskyoy:mha-rope 2025-04-28 19:47:23 +03:00
test_main.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
test_misc.cpp Merge pull request #26208 from alexlyulkov:al/new-engine-caffe-parser 2024-10-28 11:32:07 +03:00
test_model.cpp Merge pull request #26056 from vpisarev:new_dnn_engine 2024-10-16 15:28:19 +03:00
test_nms.cpp batched nms impl 2022-11-29 15:32:34 +08:00
test_onnx_conformance_layer_filter__cuda_denylist.inl.hpp Fix for support matrixes with number of axes = 6. 2024-08-21 09:06:46 +03:00
test_onnx_conformance_layer_filter__cuda_fp16_denylist.inl.hpp Supress more ONNX conformance test cases for quant-dequant with CUDA. 2024-08-20 17:12:26 +03:00
test_onnx_conformance_layer_filter__openvino.inl.hpp Merge pull request #26110 from Abdurrahheem:ash/hardmax-backend-fix 2024-09-06 13:14:25 +03:00
test_onnx_conformance_layer_filter__vulkan_denylist.inl.hpp Merge pull request #25644 from DaniAffCH:blockwise-quantization 2024-07-30 14:16:08 +03:00
test_onnx_conformance_layer_filter_opencv_all_denylist.inl.hpp Merge pull request #25630 from fengyuentau:nary-multi-thread 2024-07-03 10:09:05 +03:00
test_onnx_conformance_layer_filter_opencv_cpu_denylist.inl.hpp Merge branch 4.x 2024-08-06 15:31:30 +03:00
test_onnx_conformance_layer_filter_opencv_denylist.inl.hpp Merge branch 4.x 2024-08-06 15:31:30 +03:00
test_onnx_conformance_layer_filter_opencv_ocl_fp16_denylist.inl.hpp Merge pull request #26053 from alexlyulkov:al/opencl-conformance-tests 2024-08-27 17:23:11 +03:00
test_onnx_conformance_layer_filter_opencv_ocl_fp32_denylist.inl.hpp Merge pull request #26053 from alexlyulkov:al/opencl-conformance-tests 2024-08-27 17:23:11 +03:00
test_onnx_conformance_layer_parser_denylist.inl.hpp Merge pull request #26124 from fengyuentau:dnn/topk_dtype 2024-09-09 15:15:04 +03:00
test_onnx_conformance.cpp Merge branch 4.x 2024-08-06 15:31:30 +03:00
test_onnx_importer.cpp Merge pull request #27102 from nklskyoy:test_gemm_3inputs 2025-03-24 11:06:29 +03:00
test_precomp.hpp build: made environment access a separate feature 2024-10-30 18:37:22 +03:00
test_tf_importer.cpp Merge pull request #26394 from alexlyulkov:al/new-engine-tf-parser 2024-11-27 09:15:20 +03:00
test_tflite_importer.cpp Merge branch 4.x 2025-02-05 09:28:27 +03:00