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

[Good First Issue]: Align behavior of ONNX Frontend function ReduceLogSumExp-11, 13, 18 with original framework #20562

Open
gkrivor opened this issue Oct 18, 2023 · 14 comments
Assignees
Labels
category: ONNX FE OpenVINO ONNX FrontEnd good first issue Good for newcomers no_stale Do not mark as stale ONNX Related to support for ONNX standard.

Comments

@gkrivor
Copy link
Contributor

gkrivor commented Oct 18, 2023

Context

Neural networks are graphs consisting of nodes called operators. Each operator corresponds to a mathematical function, usually described in framework's documentation or an AI standard, such as ONNX.
OpenVINO ONNX Frontend is a component responsible for working with ONNX graphs and requires implementation of different ONNX operators in order to use ONNX models.
This task requires alignment between OpenVINO ONNX Frontend and original framework implementations of ReduceLogSumExp for next list of opsets: opset 11, opset 13, opset 18
Necessary help will be provided by ONNX Fronted team.

What needs to be done?

First of all, please, take a look on ReduceMax PR for a reference.

Operator details can be found in ONNX Operators
More details can be found in ONNX Changelog: opset 11, opset 13, opset 18

  1. Function already has a common implementation in OpenVINO. First of all, you need to review a documentation and prepare a table with differences between versions. It could be, for instance, a missing property, extended/reduced coverage of existing property, etc...
  2. Copy existing implementation here to make it aligned with original framework (extend or reduce coverage of a common implementation). Copy of modified implementation should be in a defined opset, or in opset 1 in case it implements oldest implementation. Example of multi-opset operation.
  3. Register the function in ops_bridge.cpp while keeping alphabetical order
  4. Create test model(s) in ONNX models directory. OpenVINO test infrastructure then converts prototxt files to ONNX models - you will use those models later in tests
  5. Add tests covering all use cases here
  6. Check Python xfailed tests to find a test marked as a xfailed for added functionality. If any exist - remove corresponding lines and try to verify by using cmdline "python -m pytest -k name_of_test".
    More details in adding operators to ONNX Frontend guide

Example Pull Requests

No response

Resources

Contact points

@gkrivor

Ticket

No response

@gkrivor gkrivor added good first issue Good for newcomers category: ONNX FE OpenVINO ONNX FrontEnd no_stale Do not mark as stale labels Oct 18, 2023
@mlukasze mlukasze added the ONNX Related to support for ONNX standard. label Oct 26, 2023
@kshitij01042002
Copy link

Hi @gkrivor I would like to take up this issue, if it's available! Thanks.

@p-wysocki
Copy link
Contributor

Hello @kshitij01042002, are you still working on that issue?

@mwilczy
Copy link

mwilczy commented Mar 13, 2024

.take

Copy link
Contributor

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

@mwilczy
Copy link

mwilczy commented Mar 16, 2024

Hi, Started working on this,

  ReduceLogSumExp-11 ReduceLogSumExp-13 ReduceLogSumExp-18
Decription Computes the log sum exponent of the input tensor's element along the provided axes. The resulting tensor has the same rank as the input if keepdims equals 1. If keepdims equal 0, then the resulted tensor have the reduced dimension pruned. +Input tensors of rank zero are valid.Reduction over an empty set of values yields minus infinity (if supported by the datatype) or undefined otherwise. NO CHANGE
Attributes axes : list of intsA list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Accepted range is [-r, r-1] where r = rank(data).keepdims : int (default is 1)Keep the reduced dimension or not, default 1 means keep reduced dimension. NO CHANGE +noop_with_empty_axes : int (default is 0)Defines behavior if 'axes' is empty. Default behavior with 'false' is to reduce all axes. When axes is empty and this attribute is set to true, input tensor will not be reduced,and the output tensor would be equivalent to input tensor.-axes : list of intsA list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor. Accepted range is [-r, r-1] where r = rank(data).
Inputs data : TAn input tensor. data (differentiable) : TAn input tensor. axes (optional, non-differentiable) : tensor(int64)Optional input list of integers, along which to reduce. The default is to reduce over all the dimensions of the input tensor if 'noop_with_empty_axes' is false, else act as an Identity op when 'noop_with_empty_axes' is true. Accepted range is [-r, r-1] where r = rank(data).
Outputs reduced : TReduced output tensor. reduced (differentiable) : TReduced output tensor. NO CHANGE
Type constraints T : tensor(uint32), tensor(uint64), tensor(int32), tensor(int64), tensor(float16), tensor(float), tensor(double), tensor(bfloat16)Constrain input and output types to numeric tensors. NO CHANGE NO CHANGE

Created table with differences, now making on code changes in relevant files namely src/frontends/onnx/frontend/src/op/reduce.cpp , and src/frontends/onnx/tests/onnx_import.in.cpp .I'm also creating a model for test.

However I'm going for a vacation for a week starting tomorrow, so there will be no updates for a week.

@gkrivor
Copy link
Contributor Author

gkrivor commented Mar 18, 2024

Hi @mwilczy , thanks for your contribution! I'm only disagree about types, bfloat introduced in opset-13, opset-1 and opset-11 has same list of supported types.

@inbasperu
Copy link
Contributor

Hi @mwilczy, just wanted to check if you're still working on this issue. If not, @gkrivor, I'd be keen to take it on if it's available!
Thanks

@mlukasze
Copy link
Contributor

mlukasze commented Apr 3, 2024

@inbasperu you just took another ticket, please follow that assignment first, if I may ask ;)

@mwilczy
Copy link

mwilczy commented Apr 3, 2024 via email

@mlukasze
Copy link
Contributor

mlukasze commented Apr 3, 2024

please continue, we can wait a little bit longer ;)

@p-wysocki
Copy link
Contributor

Hello @mwilczy, are you still working on that issue? Do you need any help?

@mwilczy
Copy link

mwilczy commented May 6, 2024 via email

@gkrivor
Copy link
Contributor Author

gkrivor commented Jul 26, 2024

.take

Copy link
Contributor

Thank you for looking into this issue! Please let us know if you have any questions or require any help.

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 good first issue Good for newcomers no_stale Do not mark as stale ONNX Related to support for ONNX standard.
Projects
None yet
Development

No branches or pull requests

6 participants