-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Align behavior of ONNX Frontend function ReduceSumSquare-11, 13, 18 with original framework #22993
Align behavior of ONNX Frontend function ReduceSumSquare-11, 13, 18 with original framework #22993
Conversation
cc @gkrivor |
build_jenkins |
Hi @inbasperu, thank you for your contribution! I've just merged (#22462) a fix for Reduce* shape inference which should allow you to do not overcomplicate your solution. Also, your change for handling of zero-rank may solve a different issue, probably for other Reduce* operations too, I didn't check it yet. I suggest to move it to separate PR. Also, could you remove reduce_sum_square test here
So, my thoughts are:
I'll check with a team about support for a missing types. Because we also may work with "unsupported types" as with regular float (f32), but with loosing some accuracy. |
Hi, I refactored reduce.cpp and reduce.hpp. I think it should be more simple to add a new functionality. Please, rebase after merge. |
Hi @inbasperu , Please take a look on #23475 as a reference. Your implementation is missing for tests at the moment and you have a some extra changes which I think we may need to apply as a separate PR (I'm talking about zero-rank). I'll take a look on it, please, do not add it in this change right now. |
This PR will be closed in a week because of 2 weeks of no activity. |
5cd76a8
to
d384662
Compare
Hey @gkrivor, Also, would it be possible to create an issue addressing the zero rank task and assign me to that task? That way, I can work on it once I complete this current task. Thank you! |
…ith original framework (#23798) Hello maintainers, Since my previous PR (#22993 (comment)) had diverged significantly from the master branch, and also included additional changes, I thought it would be best to create a new PR. @gkrivor, could you please take a look? This closes #20563 (comment). --------- Co-authored-by: Georgy Krivoruchko <georgy.krivoruchko@intel.com>
Hello maintainers,
I have implemented the first three steps of the solution proposed in issue #20563 for the suggested table. To maintain DRY code, I created helper functions within an anonymous namespace. I also verified that the current implementation accounts for the negative range by reviewing the core helper functions.
For Opset 18, when axes are not specified as an attribute, the helper function defaults to using
noop_with_empty_axes
with a default value of 0. This is implemented in src/frontends/onnx/frontend/src/op/reduce.cpp.In addressing reduction over an empty set, I opted for a case statement that returns 0 early.
However, I have encountered uncertainties regarding type constraints. The ONNX changelog indicates that Opset 1 supports f16, f32, i32, i64, u32, u64, and double. Nevertheless, the current implementation, as referenced here, seems not to support the double data type, and I am unsure if this oversight is correct.
Moreover, for Opsets 13 and 18, there is a need to enforce the
bfloat16
type constraint, which the current implementation does not address. I believe changes are required in the core operator modules at reduce_sum.cpp. It would be great if someone could guide me on how to proceed with enforcing this type constraint.If the implementation approach is deemed acceptable, I will begin working on the test models.
Closes #20563 (comment)