Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
AttentionOnnxAiLayer#27988
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
base:5.x
Are you sure you want to change the base?
AttentionOnnxAiLayer#27988
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
nklskyoy commentedNov 12, 2025 • 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.
@vpisarev@asmorkalov , I noticed some issues with graph simplification (in particular attention subgraph - see the failing test cases). Right now we have
So currently, the graph simplifier takes subgraph consisting ofai.onnx nodes and simplifies this subgraph into a singlecom.microsoft attention operation. But at runtime, the Is there some reason why the dispatch map does not include parsers for bothai.onnx andcom.microsoft by default? This would fix the problem here. |
asmorkalov commentedNov 12, 2025
I do not know about any intent here. Most probable reason - we did not have extensions before. You are welcome to fix the issue, but I propose to do it with another PR. |
Onnx importer2 dispatch map#28032in the new onnx_importer all domains in the dispatch map should be included per default. See#27988 (comment)### 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- [ ] 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
nklskyoy commentedNov 30, 2025
@vpisarev@asmorkalov , this is ready for review |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Shlok-Saxena commentedDec 14, 2025
Hi, I was really interested in this Attention layer implementation, so I pulled the branch to test it locally on Linux. I noticed the CI was failing and encountered a few blockers during the build and test process. I managed to fix all of them and get the tests passing 100% locally. Here is a summary of the findings that might help unblock this PR:
Fix: Updated the expected string in TEST_F(
Workaround: I generated synthetic 4D ONNX models locally to verify the logic.
Fix: I replaced the generic call with a manual test block that initializes a 4D input With these changes, allAttention tests pass successfully on Linux. I have a patch file ready if you'd like me to push it or share the snippets! Great work on the layer logic itself—it works perfectly once the harness is aligned. |
nklskyoy commentedDec 14, 2025 • 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.
Hello@Shlok-Saxena , what do you mean by failing CI? Currently, all tests related to attention and dnn are passing. |
Shlok-Saxena commentedDec 14, 2025
Thanks for the detailed explanation,@nklskyoy ! That really clears up the architectural distinction between the I mainly wanted to share these logs in case there is a platform-specific quirk on Linux (I'm building onUbuntu 22.04 / GCC 13) that might affect the CI later.
Just wanted to document these behaviors from a fresh Linux build perspective in case it helps! |
implementhttps://onnx.ai/onnx/operators/onnx__Attention.html#attention-23
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.