Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNX] Align behavior of ReduceL2-11, 13, 18 with original framework #22741

Merged
merged 38 commits into from
Apr 24, 2024

Conversation

LucaTamSapienza
Copy link
Contributor

@LucaTamSapienza LucaTamSapienza commented Feb 8, 2024

Details:

  • I've aligned the ReduceL2 operation with opset 11, 13, and 18. I have some doubts about how to implement support for the tensor bfloat16 for opset 13 and also some doubts about opset 18. I've registered the function inside the ops_bridge.cpp, created test models, and added them inside onnx_import.in.cpp.

Tickets:

@p-wysocki
Copy link
Contributor

Hello @LucaTamSapienza, is this PR ready for review?

@LucaTamSapienza
Copy link
Contributor Author

Hello @LucaTamSapienza, is this PR ready for review?

Hi @p-wysocki. The code compiles, but I have some pending issues. I have described my problems in the PR specification. I was waiting for someone to provide me with some clarifications on the doubts I encountered. I took a look at softmax.cpp file and to this conversation to see how to implement the features of the different versions. Unfortunately, I still have some doubts about opset13, on how to support the bfloat input. And I'm not too sure about my implementation of opset11. If you could take a look at my code and give me some feedback, it would be greatly appreciated. Thanks!

@LucaTamSapienza LucaTamSapienza marked this pull request as ready for review February 25, 2024 18:18
@LucaTamSapienza LucaTamSapienza requested a review from a team as a code owner February 25, 2024 18:18
Copy link
Contributor

@gkrivor gkrivor left a comment

Choose a reason for hiding this comment

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

Hi @LucaTamSapienza, thanks for your contribution!

Please, rebase your solution to a fresh master, because I've merged a change #22462 with fix for all Reduce* operations which may affect your test cases.

Also, could you enable tests here

"OnnxBackendNodeModelTest.test_reduce_l2_do_not_keepdims_example_cpu",

They should work after rebasing to a fresh master

src/frontends/onnx/frontend/src/op/reduce.cpp Outdated Show resolved Hide resolved
src/frontends/onnx/frontend/src/op/reduce.cpp Outdated Show resolved Hide resolved
src/frontends/onnx/frontend/src/op/reduce.cpp Outdated Show resolved Hide resolved
@LucaTamSapienza
Copy link
Contributor Author

Please, rebase your solution to a fresh master, because I've merged a change #22462 with fix for all Reduce* operations which may affect your test cases.

Sure, i'll sync && pull immediatly.

Also, could you enable tests here

Do you mean for v 11, 13 ,18?

@LucaTamSapienza
Copy link
Contributor Author

Please take a look on #23475 as a reference.

@gkrivor ,

Thank you very much for your help and linking me to this PR, I have properly aligned versions 13 and 18. I noticed that you left a comment under version 11. Perhaps I should remove the call from reduce.cpp file and simply use the same implementation used in v1 by calling it in reduce.hpp within v11? Something like

namespace set_11 {
using set_1::reduce_l2;
} // namespace set_11

Especially take a look on test cases. For example, as I can see you've missed in opset-18 prototxt mention of an "axes" input. It is very important to verify this way.

For this correction, I took inspiration from the prototxt of the reduceMax operation in set_18. Now should be good.

Also check changes in onnx/tests/init.py and onnx/tests/tests_python/test_backend.py

I've deleted the ReduceL2 references from ticket 99962 && 99968 inside the init.py and removed for 99968 declaration about reduce_l2. I just have some doubts about this "OnnxBackendNodeModelTest.test_reduce_l2_empty_set_cpu", should I leave this?

@gkrivor
Copy link
Contributor

gkrivor commented Mar 26, 2024

Hi @LucaTamSapienza, thanks for the update!

Regarding opset-11. Actually, I think it is a good idea, I also thought about something like this. But currently, we have an internal discussion about "following the standards". I suggest to keep it as is. When we will decide how strictly we want to support standards - I could easily extend/reduce code base.

Also, I don't recommend to touch this place because several developers are working on reduce* operations right now and you may introduce additional merge-conflicts between you and them.

About "OnnxBackendNodeModelTest.test_reduce_l2_empty_set_cpu" - depends on a test result. If it become passing (you will see in test results), and leave it if it is still xfailed.

@LucaTamSapienza
Copy link
Contributor Author

Also, I don't recommend to touch this place because several developers are working on reduce* operations right now and you may introduce additional merge-conflicts between you and them.

You're right @gkrivor , I've just resolved some merge conflicts I had, now everything should be fine.

About "OnnxBackendNodeModelTest.test_reduce_l2_empty_set_cpu" - depends on a test result. If it become passing (you will see in test results), and leave it if it is still xfailed.

I ran /bin/arm64/Release/ov_onnx_frontend_tests --gtest_filter=\*reduce_l2\* and all the tests passed successfully.

@gkrivor
Copy link
Contributor

gkrivor commented Apr 2, 2024

build_jenkins

@gkrivor
Copy link
Contributor

gkrivor commented Apr 3, 2024

build_jenkins

@gkrivor
Copy link
Contributor

gkrivor commented Apr 5, 2024

build_jenkins

Copy link
Contributor

This PR will be closed in a week because of 2 weeks of no activity.

@github-actions github-actions bot added the Stale label Apr 20, 2024
@gkrivor gkrivor changed the title Align behavior of ONNX Frontend function ReduceL2-11, 13, 18 with original framework [ONNX] Align behavior of ReduceL2-11, 13, 18 with original framework Apr 24, 2024
@gkrivor gkrivor added this pull request to the merge queue Apr 24, 2024
Merged via the queue into openvinotoolkit:master with commit 69ffb51 Apr 24, 2024
108 checks passed
@mlukasze mlukasze added this to the 2024.2 milestone Apr 24, 2024
alvoron pushed a commit to alvoron/openvino that referenced this pull request Apr 29, 2024
…penvinotoolkit#22741)

### Details:
- I've aligned the ReduceL2 operation with opset 11, 13, and 18. I have
some doubts about how to implement support for the tensor bfloat16 for
opset 13 and also some doubts about opset 18. I've registered the
function inside the ops_bridge.cpp, created test models, and added them
inside onnx_import.in.cpp.
### Tickets:
 - Closes openvinotoolkit#20560

---------

Co-authored-by: Przemyslaw Wysocki <przemyslaw.wysocki@intel.com>
Co-authored-by: Georgy Krivoruchko <georgy.krivoruchko@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: ONNX FE OpenVINO ONNX FrontEnd ExternalPR External contributor Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Align behavior of ONNX Frontend function ReduceL2-11, 13, 18 with original framework
5 participants