-
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
[CPU] [TRANSFORMATIONS] FakeConvert decomposition transformation #28118
[CPU] [TRANSFORMATIONS] FakeConvert decomposition transformation #28118
Conversation
a5654fb
to
7412bc2
Compare
...common/transformations/include/transformations/op_conversions/fake_convert_decomposition.hpp
Outdated
Show resolved
Hide resolved
const Output<Node> input_scale{fake_convert_node->input_value(1)}; | ||
auto input_type = data.get_element_type(); | ||
|
||
ov::NodeVector decomp_ops; |
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.
ov::NodeVector decomp_ops; | |
ov::pass::NodeRegistry decomp_ops; |
use it instead then :
if (input_type != input_scale.get_element_type()) {
input_type = input_scale.get_element_type();
decomp_ops.make<ov::op::v0::Convert>(data, input_type); // it returns created node which can be used later if required
}
/// at end
ov::copy_runtime_info(fake_convert_node, decomp_ops.get());
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.
Applied. Thanks Pawel!
bool default_shift; | ||
std::tie(data_shape, scale_shape, shift_shape, data_prec, dst_prec, default_shift) = params; | ||
|
||
std::shared_ptr<ov::Model> f(nullptr); |
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.
std::shared_ptr<ov::Model> f(nullptr); | |
std::shared_ptr<ov::Model> model; |
Detail: use model instead f
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.
Applied. Thanks Pawel!
manager.register_pass<ov::pass::FakeConvertDecomposition>(); | ||
manager.run_passes(f); | ||
|
||
OV_ASSERT_NO_THROW(check_rt_info(f)); |
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.
Can test be added in test body instead test's setup?
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.
Applied. Thanks Pawel!
5690a3e
to
13dbba9
Compare
@praasz @t-jankowski Hi Pawel and Tomasz, do you have more comments? |
@dmitry-gorokhov Hi Dmitry, could you please also take a look? |
13dbba9
to
f5b166a
Compare
...common/transformations/include/transformations/op_conversions/fake_convert_decomposition.hpp
Show resolved
Hide resolved
@xuchen-intel Could you please also implement shared single layer test for FakeConvert operation and add its instance for CPU plugin? |
f5b166a
to
cd1b9a9
Compare
Applied. Thanks Dmitry! |
Details:
Tickets:
Prerequisites: