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

[tmva][sofie] Add new operators and function to check input ONNX model #17248

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lmoneta
Copy link
Member

@lmoneta lmoneta commented Dec 11, 2024

This Pull request adds these new operators (including their tests):

In addition, implement:

  • a function to check the ONNX model for missing operators (not yet implmented in SOFIE) in the ONNX parser.
    Example of usage:
    TMVA::Experimental::SOFIE::RModelParser_ONNX p;
    bool ret = p.CheckModel("model.onnx");
  • Fix retrieving the value data for the Constant operator
  • Optimize Broadcast function to avoid unneeded allocations

- optimize broadcast for the special case of last dim and add interface avoiding allocations
- optimize Expand and Binary to use new broadcast interface
A new function has been added to check the model operators (nodes) and
print the list of missing ones (not yet supported)

To use it do:

```
TMVA::Experimental::SOFIE::RModelParser_ONNX p;
bool ret = p.CheckModel("model.onnx");
```

It will return true if all operators of the model are supported.
In case of missing ones, it will print their list.
The check will also extend to subgraph presented in the model as attributes of
some specific nodes (e.g. of If operator)
@lmoneta lmoneta self-assigned this Dec 11, 2024
@lmoneta lmoneta requested a review from bellenot as a code owner December 11, 2024 13:14
Add new pad operator and a corresponding test.

Fix also the parsing of Constant in case explicitly the data are not stored as
raw_data in the onnx::TensorProto class
@lmoneta lmoneta force-pushed the tmva_sofie_operator_devs branch from 9075077 to 8a7d0d4 Compare December 11, 2024 13:15
Copy link

github-actions bot commented Dec 11, 2024

Test Results

    18 files      18 suites   3d 23h 3m 4s ⏱️
 2 665 tests  2 665 ✅ 0 💤 0 ❌
46 252 runs  46 252 ✅ 0 💤 0 ❌

Results for commit 4b12e44.

♻️ This comment has been updated with latest results.

Rename the RModel function IsINputTensor because was valid only for tensors without a defined shape.
Add function IsReadyInputTensor to check if a tensor with a defined shape is an input tensor of the model

This change avoids confusion
Add support for new operator Where and add corrisponding test

Fix broadcasting of tensor in case of boolean tensor where one uses a std::vector<bool> instead of a span of bool
@lmoneta lmoneta changed the title [tmva][sofie] Add new Pad operator and a funciton to check ONNX model [tmva][sofie] Add new operators and a funciton to check ONNX model Dec 12, 2024
@lmoneta lmoneta changed the title [tmva][sofie] Add new operators and a funciton to check ONNX model [tmva][sofie] Add new operators and function to check input ONNX model Dec 12, 2024
Add Sin and Cos operators as new Unary operators.
Add also tests, taken from Vedant's PR  root-project#16809
@lmoneta lmoneta force-pushed the tmva_sofie_operator_devs branch from 812964f to 4b12e44 Compare December 13, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant