-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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]: add support for microsoft.range operator for ONNX frontend #28202
base: master
Are you sure you want to change the base?
Conversation
Humble Ping @mlukasze , @p-wysocki to please review this PR. |
@11happy could you please remove GPU's onednn submodule update from the changes? |
@sshlyapn I have removed this submodule |
@sshlyapn can you please review this |
build_jenkins |
I ran clang format to resolve some of the build issues. |
build_jenkins |
@11happy please check if oneDNN changes are required. Looks not |
Signed-off-by: 11happy <soni5happy@gmail.com>
03a8081
to
dee0205
Compare
@p-durandin done. |
@11happy, thanks. GPU review is not required for this PR, please fix code style |
Signed-off-by: 11happy <soni5happy@gmail.com>
I have corrected the code style & also corrected the checks related to size check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, could you apply a few comments, please? And as I may see - PR is mostly ready for merge.
@@ -0,0 +1,31 @@ | |||
// Copyright (C) 2018-2024 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use 2025 for now :) Happy new year!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Happy new year :)
namespace opset_1 { | ||
ov::OutputVector range(const ov::frontend::onnx::Node& node) { | ||
auto nodes = node.get_ov_inputs(); | ||
FRONT_END_GENERAL_CHECK(nodes.size() >= 2 && nodes.size() <= 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use commom::default_op_checks procedure from "utils/common.hpp". Like here:
openvino/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp
Line 28 in 0db7f8e
common::default_op_checks(node, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
auto nodes = node.get_ov_inputs(); | ||
FRONT_END_GENERAL_CHECK(nodes.size() >= 2 && nodes.size() <= 3, | ||
"Range takes 2 or 3 inputs. Provided " + std::to_string(nodes.size())); | ||
auto start = nodes.at(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And use nodes[0] and nodes[1] for inputs which availability was checked before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"Range takes 2 or 3 inputs. Provided " + std::to_string(nodes.size())); | ||
auto start = nodes.at(0); | ||
auto limit = nodes.at(1); | ||
auto step = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.Range
Documentation requires same input tensors for all inputs. Could you add a check for element types?
Like here:
openvino/src/frontends/onnx/frontend/src/op/com.microsoft/simplified_layer_normalization.cpp
Line 34 in 0db7f8e
CHECK_VALID_NODE(node, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this , but this is causing repeated code which I think is not preferred , so should I put this in a loop or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also I have changed step to delta to keep it consistent with documentation.
thank you
Signed-off-by: 11happy <soni5happy@gmail.com>
Overview:
This pull request fixes #17575 .
Dependencies:
CC: