From c7b4ba34c345f25d58d98cf7bae86e8492bb0fec Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Sun, 4 Feb 2024 11:30:36 +0400 Subject: [PATCH 01/55] [GHA][Model Hub Tests] Use openvino-tokenizers in model hub tests (#22638) **Details:** Use openvino-tokenizers in model hub tests. **Ticket:** TBD --------- Signed-off-by: Kazantsev, Roman --- .github/components.yml | 4 ++-- .github/workflows/job_pytorch_models_tests.yml | 10 +++++++++- .github/workflows/job_tensorflow_hub_models_tests.yml | 10 +++++++++- .github/workflows/linux.yml | 4 ++-- .../models_hub_common/test_convert_model.py | 9 ++------- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/components.yml b/.github/components.yml index 04465f78a788e9..f929f8cdf00b07 100644 --- a/.github/components.yml +++ b/.github/components.yml @@ -82,7 +82,6 @@ TEMPLATE: - C_API - Python_API - NVIDIA - - TOKENIZERS build: - IR_FE @@ -130,6 +129,7 @@ TF_FE: build: - CPU - Python_API + - TOKENIZERS TFL_FE: revalidate: @@ -144,6 +144,7 @@ PyTorch_FE: build: - CPU - Python_API + - TOKENIZERS C_API: build: @@ -196,7 +197,6 @@ IE_Tests: - TEMPLATE - AUTO - NVIDIA - - TOKENIZERS build: - IR_FE diff --git a/.github/workflows/job_pytorch_models_tests.yml b/.github/workflows/job_pytorch_models_tests.yml index f2a651e6727533..0e9bf740fc4159 100644 --- a/.github/workflows/job_pytorch_models_tests.yml +++ b/.github/workflows/job_pytorch_models_tests.yml @@ -51,6 +51,12 @@ jobs: name: openvino_package path: ${{ env.INSTALL_DIR }} + - name: Download OpenVINO tokenizers extension + uses: actions/download-artifact@v3 + with: + name: openvino_tokenizers_wheel + path: ${{ env.INSTALL_DIR }} + - name: Download OpenVINO tests package uses: actions/download-artifact@v3 with: @@ -98,7 +104,9 @@ jobs: self-hosted-runner: ${{ contains(inputs.runner, 'aks') }} - name: Install OpenVINO Python wheels - run: python3 -m pip install ${INSTALL_DIR}/tools/openvino-* + run: | + python3 -m pip install ${INSTALL_DIR}/tools/openvino-* + python3 -m pip install ${INSTALL_DIR}/openvino_tokenizers-* - name: Install PyTorch tests requirements run: | diff --git a/.github/workflows/job_tensorflow_hub_models_tests.yml b/.github/workflows/job_tensorflow_hub_models_tests.yml index 54302b7cfbef58..c0cad932fbb631 100644 --- a/.github/workflows/job_tensorflow_hub_models_tests.yml +++ b/.github/workflows/job_tensorflow_hub_models_tests.yml @@ -51,6 +51,12 @@ jobs: name: openvino_package path: ${{ env.INSTALL_DIR }} + - name: Download OpenVINO tokenizers extension + uses: actions/download-artifact@v3 + with: + name: openvino_tokenizers_wheel + path: ${{ env.INSTALL_DIR }} + - name: Download OpenVINO tests package uses: actions/download-artifact@v3 with: @@ -97,7 +103,9 @@ jobs: self-hosted-runner: ${{ contains(inputs.runner, 'aks') }} - name: Install OpenVINO Python wheels - run: python3 -m pip install ${INSTALL_DIR}/tools/openvino-* + run: | + python3 -m pip install ${INSTALL_DIR}/tools/openvino-* + python3 -m pip install ${INSTALL_DIR}/openvino_tokenizers-* - name: Install TF Hub tests requirements run: python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/tf_hub_tests/requirements.txt diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3784ccd5211cbc..ba58d094e553ae 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -479,7 +479,7 @@ jobs: name: TensorFlow Hub Models tests if: fromJSON(needs.smart_ci.outputs.affected_components).TF_FE.test || fromJSON(needs.smart_ci.outputs.affected_components).TFL_FE.test - needs: [ Build, Smart_CI ] + needs: [ Build, Smart_CI, Openvino_tokenizers ] uses: ./.github/workflows/job_tensorflow_hub_models_tests.yml with: runner: ${{ github.event_name == 'schedule' && 'ubuntu-20.04-16-cores' || 'ubuntu-20.04-8-cores' }} @@ -493,7 +493,7 @@ jobs: PyTorch_Models_Tests: name: PyTorch Models tests if: fromJSON(needs.smart_ci.outputs.affected_components).PyTorch_FE.test - needs: [ Build, Smart_CI ] + needs: [ Build, Smart_CI, Openvino_tokenizers ] uses: ./.github/workflows/job_pytorch_models_tests.yml with: runner: ${{ github.event_name == 'schedule' && 'ubuntu-20.04-16-cores' || 'ubuntu-20.04-8-cores' }} diff --git a/tests/model_hub_tests/models_hub_common/test_convert_model.py b/tests/model_hub_tests/models_hub_common/test_convert_model.py index 40b8a56a997ee3..f2456805d2b68e 100644 --- a/tests/model_hub_tests/models_hub_common/test_convert_model.py +++ b/tests/model_hub_tests/models_hub_common/test_convert_model.py @@ -3,18 +3,13 @@ import gc import numpy as np +# noinspection PyUnresolvedReferences +import openvino_tokenizers # do not delete, needed for text models from models_hub_common.multiprocessing_utils import multiprocessing_run from models_hub_common.utils import compare_two_tensors from openvino import convert_model from openvino.runtime import Core -try: - # 129480 - remove try-except when openvino-tokenizers wheel is built in OpenVINO GHA Workflow - # noinspection PyUnresolvedReferences - import openvino_tokenizers # do not delete, needed for text models -except: - pass - # set seed to have deterministic input data generation # to avoid sporadic issues in inference results rng = np.random.default_rng(seed=56190) From f2a5ad0173b3c25a6be6ec90cf62fcda884eda66 Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Sun, 4 Feb 2024 06:49:09 -0800 Subject: [PATCH 02/55] [ONNX] Frontend refactoring (#22643) ### Details: - Renamed Node::get_ng_inputs ### Tickets: - 125501 --- .../onnx/frontend/src/core/graph.cpp | 4 +-- src/frontends/onnx/frontend/src/core/node.cpp | 8 ++--- src/frontends/onnx/frontend/src/core/node.hpp | 2 +- .../onnx/frontend/src/node_context.cpp | 2 +- .../onnx/frontend/src/onnx_framework_node.hpp | 2 +- src/frontends/onnx/frontend/src/op/abs.hpp | 2 +- src/frontends/onnx/frontend/src/op/acos.hpp | 2 +- src/frontends/onnx/frontend/src/op/acosh.hpp | 2 +- .../src/op/adaptive_avg_pooling2d.cpp | 2 +- src/frontends/onnx/frontend/src/op/add.cpp | 2 +- src/frontends/onnx/frontend/src/op/affine.cpp | 2 +- src/frontends/onnx/frontend/src/op/and.hpp | 2 +- src/frontends/onnx/frontend/src/op/asin.hpp | 2 +- src/frontends/onnx/frontend/src/op/asinh.hpp | 2 +- src/frontends/onnx/frontend/src/op/atan.hpp | 2 +- src/frontends/onnx/frontend/src/op/atanh.hpp | 2 +- src/frontends/onnx/frontend/src/op/aten.cpp | 2 +- .../onnx/frontend/src/op/batch_norm.cpp | 4 +-- .../onnx/frontend/src/op/bitshift.cpp | 4 +-- .../onnx/frontend/src/op/bitwise_and.cpp | 2 +- .../onnx/frontend/src/op/bitwise_not.cpp | 2 +- .../onnx/frontend/src/op/bitwise_or.cpp | 2 +- .../onnx/frontend/src/op/bitwise_xor.cpp | 2 +- .../onnx/frontend/src/op/blackmanwindow.cpp | 2 +- src/frontends/onnx/frontend/src/op/cast.cpp | 2 +- .../onnx/frontend/src/op/cast_like.cpp | 2 +- src/frontends/onnx/frontend/src/op/ceil.hpp | 2 +- src/frontends/onnx/frontend/src/op/clip.cpp | 4 +-- .../src/op/com.microsoft/attention.cpp | 2 +- .../src/op/com.microsoft/bias_gelu.cpp | 2 +- .../embed_layer_normalization.cpp | 2 +- .../src/op/com.microsoft/fused_conv.cpp | 4 +-- .../src/op/com.microsoft/fusedgemm.cpp | 2 +- .../skip_layer_normalization.cpp | 2 +- .../onnx/frontend/src/op/compress.cpp | 4 +-- src/frontends/onnx/frontend/src/op/concat.cpp | 2 +- .../onnx/frontend/src/op/constant_fill.cpp | 4 +-- .../frontend/src/op/constant_of_shape.cpp | 2 +- src/frontends/onnx/frontend/src/op/conv.cpp | 2 +- .../onnx/frontend/src/op/conv_integer.cpp | 2 +- .../onnx/frontend/src/op/conv_transpose.cpp | 2 +- src/frontends/onnx/frontend/src/op/cos.cpp | 2 +- src/frontends/onnx/frontend/src/op/cosh.cpp | 2 +- src/frontends/onnx/frontend/src/op/crop.cpp | 2 +- .../onnx/frontend/src/op/cum_sum.cpp | 2 +- .../onnx/frontend/src/op/depth_to_space.cpp | 2 +- .../frontend/src/op/dequantize_linear.cpp | 4 +-- src/frontends/onnx/frontend/src/op/dft.cpp | 2 +- src/frontends/onnx/frontend/src/op/div.hpp | 2 +- .../onnx/frontend/src/op/dropout.cpp | 4 +-- .../src/op/dynamic_quantize_linear.cpp | 2 +- src/frontends/onnx/frontend/src/op/einsum.cpp | 2 +- src/frontends/onnx/frontend/src/op/elu.cpp | 2 +- src/frontends/onnx/frontend/src/op/equal.hpp | 2 +- src/frontends/onnx/frontend/src/op/erf.hpp | 2 +- src/frontends/onnx/frontend/src/op/exp.hpp | 2 +- src/frontends/onnx/frontend/src/op/expand.cpp | 4 +-- .../onnx/frontend/src/op/eye_like.cpp | 2 +- .../onnx/frontend/src/op/flatten.cpp | 2 +- src/frontends/onnx/frontend/src/op/floor.hpp | 2 +- src/frontends/onnx/frontend/src/op/gather.hpp | 2 +- .../onnx/frontend/src/op/gather_elements.hpp | 2 +- .../onnx/frontend/src/op/gather_nd.cpp | 2 +- src/frontends/onnx/frontend/src/op/gelu.cpp | 2 +- src/frontends/onnx/frontend/src/op/gemm.cpp | 4 +-- .../frontend/src/op/global_average_pool.cpp | 2 +- .../onnx/frontend/src/op/global_max_pool.cpp | 2 +- .../onnx/frontend/src/op/greater.hpp | 2 +- .../onnx/frontend/src/op/greater_or_equal.cpp | 8 ++--- .../onnx/frontend/src/op/grid_sample.cpp | 4 +-- .../frontend/src/op/group_normalization.cpp | 2 +- src/frontends/onnx/frontend/src/op/gru.cpp | 2 +- .../onnx/frontend/src/op/hammingwindow.cpp | 2 +- .../onnx/frontend/src/op/hannwindow.cpp | 2 +- .../onnx/frontend/src/op/hard_sigmoid.cpp | 2 +- .../onnx/frontend/src/op/hard_swish.hpp | 2 +- .../onnx/frontend/src/op/hardmax.cpp | 4 +-- .../onnx/frontend/src/op/identity.hpp | 2 +- src/frontends/onnx/frontend/src/op/if.cpp | 2 +- .../onnx/frontend/src/op/image_scaler.cpp | 2 +- .../onnx/frontend/src/op/instance_norm.cpp | 6 ++-- .../onnx/frontend/src/op/is_finite.cpp | 2 +- src/frontends/onnx/frontend/src/op/is_inf.cpp | 2 +- src/frontends/onnx/frontend/src/op/is_nan.cpp | 2 +- .../frontend/src/op/layer_normalization.cpp | 4 +-- .../onnx/frontend/src/op/leaky_relu.cpp | 2 +- src/frontends/onnx/frontend/src/op/less.hpp | 2 +- .../onnx/frontend/src/op/less_or_equal.cpp | 4 +-- src/frontends/onnx/frontend/src/op/log.cpp | 2 +- .../onnx/frontend/src/op/log_softmax.cpp | 4 +-- src/frontends/onnx/frontend/src/op/loop.cpp | 2 +- .../onnx/frontend/src/op/lp_norm.cpp | 4 +-- .../onnx/frontend/src/op/lp_pool.cpp | 2 +- src/frontends/onnx/frontend/src/op/lrn.cpp | 2 +- src/frontends/onnx/frontend/src/op/lstm.cpp | 2 +- src/frontends/onnx/frontend/src/op/matmul.hpp | 2 +- .../onnx/frontend/src/op/matmul_integer.cpp | 2 +- .../onnx/frontend/src/op/max_roi_pool.cpp | 2 +- src/frontends/onnx/frontend/src/op/mean.cpp | 2 +- .../src/op/mean_variance_normalization.cpp | 4 +-- src/frontends/onnx/frontend/src/op/mod.cpp | 4 +-- src/frontends/onnx/frontend/src/op/mul.hpp | 2 +- src/frontends/onnx/frontend/src/op/neg.hpp | 2 +- .../onnx/frontend/src/op/nms_rotated.hpp | 4 +-- .../frontend/src/op/non_max_suppression.cpp | 2 +- .../onnx/frontend/src/op/non_zero.cpp | 2 +- src/frontends/onnx/frontend/src/op/not.hpp | 2 +- src/frontends/onnx/frontend/src/op/onehot.cpp | 2 +- src/frontends/onnx/frontend/src/op/or.hpp | 2 +- .../deformable_conv_2d.cpp | 2 +- .../org.openvinotoolkit/detection_output.cpp | 2 +- .../detection_output.cpp | 2 +- .../generate_proposals_single_image.cpp | 2 +- .../prior_grid_generator.cpp | 2 +- .../roi_feature_extractor.cpp | 2 +- .../experimental_detectron/topk_rios.cpp | 2 +- .../op/org.openvinotoolkit/fake_quantize.cpp | 2 +- .../generate_proposals.cpp | 2 +- .../src/op/org.openvinotoolkit/group_norm.cpp | 2 +- .../src/op/org.openvinotoolkit/normalize.cpp | 2 +- .../src/op/org.openvinotoolkit/prior_box.cpp | 4 +-- .../src/op/org.openvinotoolkit/swish.cpp | 8 ++--- src/frontends/onnx/frontend/src/op/pad.cpp | 6 ++-- src/frontends/onnx/frontend/src/op/pow.cpp | 2 +- src/frontends/onnx/frontend/src/op/prelu.cpp | 6 ++-- .../onnx/frontend/src/op/qlinear_conv.cpp | 2 +- .../onnx/frontend/src/op/qlinear_matmul.cpp | 2 +- .../onnx/frontend/src/op/quantize_linear.cpp | 4 +-- .../frontend/src/op/random_normal_like.cpp | 2 +- .../frontend/src/op/random_uniform_like.cpp | 2 +- src/frontends/onnx/frontend/src/op/range.cpp | 2 +- .../onnx/frontend/src/op/reciprocal.cpp | 2 +- src/frontends/onnx/frontend/src/op/reduce.cpp | 32 +++++++++---------- src/frontends/onnx/frontend/src/op/relu.hpp | 4 +-- .../onnx/frontend/src/op/reshape.cpp | 8 ++--- src/frontends/onnx/frontend/src/op/resize.cpp | 4 +-- .../onnx/frontend/src/op/reverse_sequence.cpp | 6 ++-- .../onnx/frontend/src/op/roi_align.cpp | 4 +-- src/frontends/onnx/frontend/src/op/round.cpp | 2 +- src/frontends/onnx/frontend/src/op/scan.cpp | 4 +-- .../onnx/frontend/src/op/scatter_elements.cpp | 6 ++-- .../onnx/frontend/src/op/scatter_nd.cpp | 8 ++--- src/frontends/onnx/frontend/src/op/selu.cpp | 2 +- src/frontends/onnx/frontend/src/op/shape.cpp | 2 +- src/frontends/onnx/frontend/src/op/shrink.cpp | 2 +- .../onnx/frontend/src/op/sigmoid.hpp | 2 +- src/frontends/onnx/frontend/src/op/sign.hpp | 2 +- src/frontends/onnx/frontend/src/op/sin.hpp | 2 +- src/frontends/onnx/frontend/src/op/sinh.hpp | 2 +- src/frontends/onnx/frontend/src/op/size.cpp | 2 +- src/frontends/onnx/frontend/src/op/slice.cpp | 4 +-- .../onnx/frontend/src/op/softmax.cpp | 6 ++-- .../onnx/frontend/src/op/softplus.cpp | 2 +- .../onnx/frontend/src/op/softsign.cpp | 2 +- .../onnx/frontend/src/op/space_to_depth.cpp | 2 +- src/frontends/onnx/frontend/src/op/split.cpp | 4 +-- src/frontends/onnx/frontend/src/op/sqrt.hpp | 2 +- .../onnx/frontend/src/op/squeeze.cpp | 4 +-- src/frontends/onnx/frontend/src/op/stft.cpp | 26 +++++++-------- src/frontends/onnx/frontend/src/op/sub.hpp | 2 +- src/frontends/onnx/frontend/src/op/tan.hpp | 2 +- src/frontends/onnx/frontend/src/op/tanh.hpp | 2 +- .../onnx/frontend/src/op/thresholded_relu.cpp | 2 +- src/frontends/onnx/frontend/src/op/tile.cpp | 4 +-- src/frontends/onnx/frontend/src/op/topk.cpp | 8 ++--- .../onnx/frontend/src/op/transpose.cpp | 2 +- src/frontends/onnx/frontend/src/op/trilu.cpp | 2 +- src/frontends/onnx/frontend/src/op/unique.cpp | 2 +- .../onnx/frontend/src/op/unsqueeze.cpp | 4 +-- .../onnx/frontend/src/op/upsample.cpp | 6 ++-- src/frontends/onnx/frontend/src/op/where.hpp | 4 +-- src/frontends/onnx/frontend/src/op/xor.hpp | 4 +-- .../src/utils/arg_min_max_factory.cpp | 2 +- .../onnx/frontend/src/utils/common.cpp | 4 +-- .../onnx/frontend/src/utils/convpool.cpp | 6 ++-- .../frontend/src/utils/pooling_factory.cpp | 2 +- .../onnx/frontend/src/utils/recurrent.cpp | 2 +- .../onnx/frontend/src/utils/variadic.hpp | 2 +- 178 files changed, 271 insertions(+), 275 deletions(-) diff --git a/src/frontends/onnx/frontend/src/core/graph.cpp b/src/frontends/onnx/frontend/src/core/graph.cpp index f6d3ba3d9433bf..4807ca248b34bc 100644 --- a/src/frontends/onnx/frontend/src/core/graph.cpp +++ b/src/frontends/onnx/frontend/src/core/graph.cpp @@ -245,7 +245,7 @@ ov::OutputVector Graph::make_framework_nodes(const Node& onnx_node) { std::shared_ptr framework_node; if (onnx_node.has_subgraphs()) { const auto& subgraphs = onnx_node.get_subgraphs(); - auto inputs = onnx_node.get_ng_inputs(); + auto inputs = onnx_node.get_ov_inputs(); std::vector> models; for (const auto& kv : subgraphs) { auto& subgraph = kv.second; @@ -356,7 +356,7 @@ ov::OutputVector Graph::make_ov_nodes(const Node& onnx_node) { } if (ov_subgraph_outputs.empty()) { // translation not possible (not supported op or exception during processing) const auto not_supported_node = - std::make_shared(onnx_node.get_ng_inputs(), + std::make_shared(onnx_node.get_ov_inputs(), onnx_node.get_outputs_size(), onnx_node.domain(), onnx_node.op_type(), diff --git a/src/frontends/onnx/frontend/src/core/node.cpp b/src/frontends/onnx/frontend/src/core/node.cpp index 299c13eaafeec5..ed2195e64d9415 100644 --- a/src/frontends/onnx/frontend/src/core/node.cpp +++ b/src/frontends/onnx/frontend/src/core/node.cpp @@ -49,7 +49,7 @@ class Node::Impl { } const std::vector& attributes() const; - ov::OutputVector get_ng_inputs() const; + ov::OutputVector get_ov_inputs() const; const std::string& domain() const; const std::string& op_type() const; @@ -200,7 +200,7 @@ ov::Any Node::get_attribute_value(const std::string& name) const { return get_attribute(name).get_any(); } -ov::OutputVector Node::Impl::get_ng_inputs() const { +ov::OutputVector Node::Impl::get_ov_inputs() const { ov::OutputVector result; for (const auto& name : m_node_proto->input()) { if (!name.empty()) { @@ -305,8 +305,8 @@ Node::Node(const Node& other) delete impl; }} {} -ov::OutputVector Node::get_ng_inputs() const { - return m_pimpl->get_ng_inputs(); +ov::OutputVector Node::get_ov_inputs() const { + return m_pimpl->get_ov_inputs(); } const std::string& Node::domain() const { return m_pimpl->domain(); diff --git a/src/frontends/onnx/frontend/src/core/node.hpp b/src/frontends/onnx/frontend/src/core/node.hpp index 41ad772863b8b6..c6083900337f23 100644 --- a/src/frontends/onnx/frontend/src/core/node.hpp +++ b/src/frontends/onnx/frontend/src/core/node.hpp @@ -53,7 +53,7 @@ class Node { Node& operator=(Node&&) noexcept = delete; Node& operator=(const Node&) = delete; - ov::OutputVector get_ng_inputs() const; + ov::OutputVector get_ov_inputs() const; const std::string& domain() const; const std::string& op_type() const; const std::string& get_name() const; diff --git a/src/frontends/onnx/frontend/src/node_context.cpp b/src/frontends/onnx/frontend/src/node_context.cpp index 4e6bc7a426f272..91a0d7bdf49b31 100644 --- a/src/frontends/onnx/frontend/src/node_context.cpp +++ b/src/frontends/onnx/frontend/src/node_context.cpp @@ -9,7 +9,7 @@ ov::frontend::onnx::NodeContext::NodeContext(const ov::frontend::onnx::Node& context) : ov::frontend::NodeContext(context.op_type()), m_context(context), - m_inputs(context.get_ng_inputs()) {} + m_inputs(context.get_ov_inputs()) {} ov::Output ov::frontend::onnx::NodeContext::get_input(int port_idx) const { return m_inputs.at(port_idx); diff --git a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp index e3f5f3f2fb4789..f1807abc4e9543 100644 --- a/src/frontends/onnx/frontend/src/onnx_framework_node.hpp +++ b/src/frontends/onnx/frontend/src/onnx_framework_node.hpp @@ -35,7 +35,7 @@ class ONNXFrameworkNode : public ov::op::util::FrameworkNode { public: OPENVINO_OP("ONNXFrameworkNode", "util", ov::op::util::FrameworkNode); - ONNXFrameworkNode(const ov::frontend::onnx::Node& node) : ONNXFrameworkNode(node, node.get_ng_inputs()) {} + ONNXFrameworkNode(const ov::frontend::onnx::Node& node) : ONNXFrameworkNode(node, node.get_ov_inputs()) {} ONNXFrameworkNode(const ov::frontend::onnx::Node& node, const ov::OutputVector& inputs) : ov::op::util::FrameworkNode(inputs, node.get_outputs_size()), diff --git a/src/frontends/onnx/frontend/src/op/abs.hpp b/src/frontends/onnx/frontend/src/op/abs.hpp index 99ff2d2426ecd5..ff6eab7a7fd74d 100644 --- a/src/frontends/onnx/frontend/src/op/abs.hpp +++ b/src/frontends/onnx/frontend/src/op/abs.hpp @@ -17,7 +17,7 @@ inline ov::OutputVector abs(const ov::frontend::onnx::Node& node) { CHECK_VALID_NODE(node, !node.has_attribute("consumed_inputs"), "consumed_inputs legacy attribute of Abs op is not supported"); - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/acos.hpp b/src/frontends/onnx/frontend/src/op/acos.hpp index ab6dcff4c00687..d26956409233a3 100644 --- a/src/frontends/onnx/frontend/src/op/acos.hpp +++ b/src/frontends/onnx/frontend/src/op/acos.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_7 { inline ov::OutputVector acos(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_7 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/acosh.hpp b/src/frontends/onnx/frontend/src/op/acosh.hpp index 4ab7edfc4d0b1c..fe7b07d0ab60c9 100644 --- a/src/frontends/onnx/frontend/src/op/acosh.hpp +++ b/src/frontends/onnx/frontend/src/op/acosh.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_9 { inline ov::OutputVector acosh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_9 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp index 765e57c6a5a191..c7e260e50eafc5 100644 --- a/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp +++ b/src/frontends/onnx/frontend/src/op/adaptive_avg_pooling2d.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector adaptive_avg_pooling2d(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto num_inputs = inputs.size(); CHECK_VALID_NODE(node, num_inputs == 2, "adaptive_avg_pooling2d expects 2 input tensors. Got: ", num_inputs); diff --git a/src/frontends/onnx/frontend/src/op/add.cpp b/src/frontends/onnx/frontend/src/op/add.cpp index 6c48873fc4be96..4b4babda2239b9 100644 --- a/src/frontends/onnx/frontend/src/op/add.cpp +++ b/src/frontends/onnx/frontend/src/op/add.cpp @@ -31,7 +31,7 @@ ov::OutputVector add(const ov::frontend::onnx::Node& node) { namespace set_7 { ov::OutputVector add(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_7 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/affine.cpp b/src/frontends/onnx/frontend/src/op/affine.cpp index a4c9b1e94e6b58..651edea79ce7af 100644 --- a/src/frontends/onnx/frontend/src/op/affine.cpp +++ b/src/frontends/onnx/frontend/src/op/affine.cpp @@ -20,7 +20,7 @@ ov::OutputVector affine(const ov::frontend::onnx::Node& node) { // It takes one input tensor and produces one output tensor where // the affine function, y = alpha * x + beta, is applied to the input // elementwise. - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); CHECK_VALID_NODE(node, inputs.size() == 1, "Affine expects 1 input tensor. Got: ", inputs.size()); CHECK_VALID_NODE(node, node.has_attribute("alpha"), "\"alpha\" attribute is required."); diff --git a/src/frontends/onnx/frontend/src/op/and.hpp b/src/frontends/onnx/frontend/src/op/and.hpp index 41233c4759bfec..b791a797aeb11f 100644 --- a/src/frontends/onnx/frontend/src/op/and.hpp +++ b/src/frontends/onnx/frontend/src/op/and.hpp @@ -19,7 +19,7 @@ inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) { namespace set_7 { inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_7 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/asin.hpp b/src/frontends/onnx/frontend/src/op/asin.hpp index 2e01dbf50836af..e9cb09e322efd1 100644 --- a/src/frontends/onnx/frontend/src/op/asin.hpp +++ b/src/frontends/onnx/frontend/src/op/asin.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector asin(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/asinh.hpp b/src/frontends/onnx/frontend/src/op/asinh.hpp index d7826983b5142c..927d38abb06666 100644 --- a/src/frontends/onnx/frontend/src/op/asinh.hpp +++ b/src/frontends/onnx/frontend/src/op/asinh.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector asinh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/atan.hpp b/src/frontends/onnx/frontend/src/op/atan.hpp index 38eb77db3dc786..42d4b5379bcbb9 100644 --- a/src/frontends/onnx/frontend/src/op/atan.hpp +++ b/src/frontends/onnx/frontend/src/op/atan.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector atan(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/atanh.hpp b/src/frontends/onnx/frontend/src/op/atanh.hpp index 8c04ac1f43ff9c..3de6abe6599e2a 100644 --- a/src/frontends/onnx/frontend/src/op/atanh.hpp +++ b/src/frontends/onnx/frontend/src/op/atanh.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector atanh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/aten.cpp b/src/frontends/onnx/frontend/src/op/aten.cpp index 20830eb174efe1..b357d43fa116e8 100644 --- a/src/frontends/onnx/frontend/src/op/aten.cpp +++ b/src/frontends/onnx/frontend/src/op/aten.cpp @@ -26,7 +26,7 @@ namespace op { namespace set_1 { ov::OutputVector aten(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; const auto operator_name = node.get_attribute_value("operator", ""); CHECK_VALID_NODE(node, diff --git a/src/frontends/onnx/frontend/src/op/batch_norm.cpp b/src/frontends/onnx/frontend/src/op/batch_norm.cpp index 628d74bb782f7c..67daaddf0539c6 100644 --- a/src/frontends/onnx/frontend/src/op/batch_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/batch_norm.cpp @@ -20,7 +20,7 @@ namespace op { namespace set_1 { // This version supports ONNX BatchNormalization-1 and BatchNormalization-6 ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto x = inputs.at(0); auto scale = inputs.at(1); auto bias = inputs.at(2); @@ -56,7 +56,7 @@ ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) { namespace set_7 { // This version supports ONNX BatchNormalization-7 and BatchNormalization-9 ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto x = inputs.at(0); auto scale = inputs.at(1); auto bias = inputs.at(2); diff --git a/src/frontends/onnx/frontend/src/op/bitshift.cpp b/src/frontends/onnx/frontend/src/op/bitshift.cpp index 95846036391f13..63b5b37304d4af 100644 --- a/src/frontends/onnx/frontend/src/op/bitshift.cpp +++ b/src/frontends/onnx/frontend/src/op/bitshift.cpp @@ -18,8 +18,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bitshift(const ov::frontend::onnx::Node& node) { - const ov::Output input_x = node.get_ng_inputs().at(0); - const ov::Output input_y = node.get_ng_inputs().at(1); + const ov::Output input_x = node.get_ov_inputs().at(0); + const ov::Output input_y = node.get_ov_inputs().at(1); std::string direction = node.get_attribute_value("direction", ""); diff --git a/src/frontends/onnx/frontend/src/op/bitwise_and.cpp b/src/frontends/onnx/frontend/src/op/bitwise_and.cpp index bc0db6a6a10ce7..5d88117815121a 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_and.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_and.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bitwise_and(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } diff --git a/src/frontends/onnx/frontend/src/op/bitwise_not.cpp b/src/frontends/onnx/frontend/src/op/bitwise_not.cpp index 3340c453a389e1..4e9dd55052c292 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_not.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_not.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bitwise_not(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); OPENVINO_ASSERT(inputs.size() == 1); return {std::make_shared(inputs[0])}; } diff --git a/src/frontends/onnx/frontend/src/op/bitwise_or.cpp b/src/frontends/onnx/frontend/src/op/bitwise_or.cpp index 33100e35a46949..f0278dde8f3ced 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_or.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_or.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bitwise_or(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } diff --git a/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp b/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp index 5ab5abef662947..0e965aebb081cc 100644 --- a/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp +++ b/src/frontends/onnx/frontend/src/op/bitwise_xor.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bitwise_xor(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); OPENVINO_ASSERT(inputs.size() == 2); return {std::make_shared(inputs[0], inputs[1])}; } diff --git a/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp b/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp index 0d25d674d3062c..7636b79e08d62d 100644 --- a/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/blackmanwindow.cpp @@ -25,7 +25,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector blackmanwindow(const ov::frontend::onnx::Node& node) { - const auto size = node.get_ng_inputs().at(0); + const auto size = node.get_ov_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; diff --git a/src/frontends/onnx/frontend/src/op/cast.cpp b/src/frontends/onnx/frontend/src/op/cast.cpp index 4e67314f1fda38..18edc116f4f511 100644 --- a/src/frontends/onnx/frontend/src/op/cast.cpp +++ b/src/frontends/onnx/frontend/src/op/cast.cpp @@ -16,7 +16,7 @@ namespace op { namespace set_1 { ov::OutputVector cast(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); int64_t target_type = node.get_attribute_value("to"); ov::element::Type elem_type = common::get_ov_element_type(target_type); diff --git a/src/frontends/onnx/frontend/src/op/cast_like.cpp b/src/frontends/onnx/frontend/src/op/cast_like.cpp index b41846537ec190..7eea8c808206d4 100644 --- a/src/frontends/onnx/frontend/src/op/cast_like.cpp +++ b/src/frontends/onnx/frontend/src/op/cast_like.cpp @@ -15,7 +15,7 @@ namespace op { namespace set_1 { ov::OutputVector cast_like(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); return {std::make_shared(inputs.at(0), inputs.at(1))}; } diff --git a/src/frontends/onnx/frontend/src/op/ceil.hpp b/src/frontends/onnx/frontend/src/op/ceil.hpp index cc0b11de7ba068..f7ba5c8c2ca015 100644 --- a/src/frontends/onnx/frontend/src/op/ceil.hpp +++ b/src/frontends/onnx/frontend/src/op/ceil.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector ceil(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/clip.cpp b/src/frontends/onnx/frontend/src/op/clip.cpp index b5afd2f2d4fe85..5442b54465cda8 100644 --- a/src/frontends/onnx/frontend/src/op/clip.cpp +++ b/src/frontends/onnx/frontend/src/op/clip.cpp @@ -20,7 +20,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector clip(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const double max_value = node.get_attribute_value("max", std::numeric_limits::max()); @@ -72,7 +72,7 @@ std::shared_ptr get_constant_max_of_type(ov::element::Type } // namespace ov::OutputVector clip(const ov::frontend::onnx::Node& node) { - const ov::OutputVector inputs{node.get_ng_inputs()}; + const ov::OutputVector inputs{node.get_ov_inputs()}; const ov::Output data = inputs.at(0); const ov::element::Type data_type = data.get_element_type(); ov::Output min; diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp index a6d4f0c397ffeb..375e90f5084c43 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/attention.cpp @@ -72,7 +72,7 @@ std::shared_ptr get_present_state(const std::shared_ptr& K, namespace set_1 { ov::OutputVector attention(const ov::frontend::onnx::Node& node) { - auto nodes = node.get_ng_inputs(); + auto nodes = node.get_ov_inputs(); const auto& input = nodes[0]; const auto& weights = nodes[1]; const auto& bias = nodes[2]; diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp index d4cd878c8b4136..a0eec5fceeaf20 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/bias_gelu.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector bias_gelu(const ov::frontend::onnx::Node& node) { - auto nodes = node.get_ng_inputs(); + auto nodes = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(nodes.size() == 2, "BiasGelu takes 2 inputs. Provided " + std::to_string(nodes.size())); return {std::make_shared(std::make_shared(nodes.at(0), nodes.at(1)))}; } diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp index afcae6453e137e..eae772aaeac2f4 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/embed_layer_normalization.cpp @@ -25,7 +25,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector embed_layer_normalization(const ov::frontend::onnx::Node& node) { - auto nodes = node.get_ng_inputs(); + auto nodes = node.get_ov_inputs(); auto num_nodes = nodes.size(); FRONT_END_GENERAL_CHECK(num_nodes >= 7 && num_nodes <= 9, diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp index 9ec06a638929fa..79badc0d048bf0 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fused_conv.cpp @@ -30,8 +30,8 @@ namespace set_1 { ov::OutputVector fused_conv(const ov::frontend::onnx::Node& node) { auto conv_res = conv(node).at(0); - if (node.get_ng_inputs().size() == 4) { // Z input provided - conv_res = std::make_shared(conv_res, node.get_ng_inputs()[3]); + if (node.get_ov_inputs().size() == 4) { // Z input provided + conv_res = std::make_shared(conv_res, node.get_ov_inputs()[3]); } const auto activation_type = node.get_attribute_value("activation"); diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp index 02a0b1ad3418da..8359d76617b79a 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/fusedgemm.cpp @@ -24,7 +24,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector fusedgemm(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto num_inputs = inputs.size(); FRONT_END_GENERAL_CHECK(num_inputs == 2 || num_inputs == 3, "FusedGemm takes 2/3 inputs. Provided " + std::to_string(num_inputs)); diff --git a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp index 3e2db86ae21a50..f003ace40cdfd2 100644 --- a/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/com.microsoft/skip_layer_normalization.cpp @@ -19,7 +19,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector skip_layer_normalization(const ov::frontend::onnx::Node& node) { - auto nodes = node.get_ng_inputs(); + auto nodes = node.get_ov_inputs(); auto num_nodes = nodes.size(); FRONT_END_GENERAL_CHECK(num_nodes >= 3 && num_nodes <= 5, "SkipLayerNormalization takes 3, 4 or 5 inputs. Provided " + std::to_string(num_nodes)); diff --git a/src/frontends/onnx/frontend/src/op/compress.cpp b/src/frontends/onnx/frontend/src/op/compress.cpp index 0a99032f63659f..84a11c2f17734a 100644 --- a/src/frontends/onnx/frontend/src/op/compress.cpp +++ b/src/frontends/onnx/frontend/src/op/compress.cpp @@ -19,8 +19,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector compress(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); - auto condition = node.get_ng_inputs().at(1); + auto data = node.get_ov_inputs().at(0); + auto condition = node.get_ov_inputs().at(1); int64_t axis = 0; if (node.has_attribute("axis")) { diff --git a/src/frontends/onnx/frontend/src/op/concat.cpp b/src/frontends/onnx/frontend/src/op/concat.cpp index 06f48231466a01..23bbf970657457 100644 --- a/src/frontends/onnx/frontend/src/op/concat.cpp +++ b/src/frontends/onnx/frontend/src/op/concat.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector concat(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; std::int64_t axis = node.get_attribute_value("axis"); ov::OutputVector valid_inputs; std::copy_if(inputs.begin(), inputs.end(), std::back_inserter(valid_inputs), [](ov::Output& in) -> bool { diff --git a/src/frontends/onnx/frontend/src/op/constant_fill.cpp b/src/frontends/onnx/frontend/src/op/constant_fill.cpp index 611a0def8981d8..619891101ba6b3 100644 --- a/src/frontends/onnx/frontend/src/op/constant_fill.cpp +++ b/src/frontends/onnx/frontend/src/op/constant_fill.cpp @@ -30,9 +30,9 @@ ov::OutputVector constant_fill(const ov::frontend::onnx::Node& node) { if (input_as_shape == 1) // use the first input as target shape { CHECK_VALID_NODE(node, - node.get_ng_inputs().size() > 0, + node.get_ov_inputs().size() > 0, "The input which determines output shape was not provided"); - target_shape = node.get_ng_inputs().at(0); + target_shape = node.get_ov_inputs().at(0); if (node.has_attribute("extra_shape")) { const auto extra_shape_const = node.get_attribute_as_constant>("extra_shape", target_shape.get_element_type()); diff --git a/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp b/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp index 353a339fff1771..4e1bf529f6ba0e 100644 --- a/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp +++ b/src/frontends/onnx/frontend/src/op/constant_of_shape.cpp @@ -28,7 +28,7 @@ ov::OutputVector constant_of_shape(const ov::frontend::onnx::Node& node) { } else { constant_value = v0::Constant::create(ov::element::f32, {}, {0}); } - const auto& inputs = node.get_ng_inputs(); + const auto& inputs = node.get_ov_inputs(); if (inputs.size() == 0 || common::is_failsafe_node(inputs[0].get_node_shared_ptr()) || ov::op::util::is_null(inputs[0])) { return {constant_value}; diff --git a/src/frontends/onnx/frontend/src/op/conv.cpp b/src/frontends/onnx/frontend/src/op/conv.cpp index 2dc46ce108f043..24a53af88eeff9 100644 --- a/src/frontends/onnx/frontend/src/op/conv.cpp +++ b/src/frontends/onnx/frontend/src/op/conv.cpp @@ -73,7 +73,7 @@ ov::OutputVector conv(const ov::frontend::onnx::Node& node, } // namespace detail ov::OutputVector conv(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); return detail::conv(node, inputs[0], inputs[1], inputs.size() < 3 ? std::make_shared() : inputs[2]); } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/conv_integer.cpp b/src/frontends/onnx/frontend/src/op/conv_integer.cpp index 9ad85769bbb792..e40453655bf01e 100644 --- a/src/frontends/onnx/frontend/src/op/conv_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_integer.cpp @@ -46,7 +46,7 @@ namespace op { namespace set_1 { ov::OutputVector conv_integer(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); const auto& input = inputs.at(0); const auto& filter = inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp index 9bae7cf2ae299d..2cdc88ba784d22 100644 --- a/src/frontends/onnx/frontend/src/op/conv_transpose.cpp +++ b/src/frontends/onnx/frontend/src/op/conv_transpose.cpp @@ -129,7 +129,7 @@ ov::Output get_prepared_bias(const ov::Output& bias, const o } // namespace ov::OutputVector conv_transpose(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); CHECK_VALID_NODE(node, inputs.size() == 2 || inputs.size() == 3, diff --git a/src/frontends/onnx/frontend/src/op/cos.cpp b/src/frontends/onnx/frontend/src/op/cos.cpp index 3fd7d09cebc5c4..ff55e15c5d0bee 100644 --- a/src/frontends/onnx/frontend/src/op/cos.cpp +++ b/src/frontends/onnx/frontend/src/op/cos.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector cos(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/cosh.cpp b/src/frontends/onnx/frontend/src/op/cosh.cpp index c0bb1ae0dbf08e..cc3d81e32b8dd3 100644 --- a/src/frontends/onnx/frontend/src/op/cosh.cpp +++ b/src/frontends/onnx/frontend/src/op/cosh.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector cosh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/crop.cpp b/src/frontends/onnx/frontend/src/op/crop.cpp index 41540e3de27925..3dad7bb587863b 100644 --- a/src/frontends/onnx/frontend/src/op/crop.cpp +++ b/src/frontends/onnx/frontend/src/op/crop.cpp @@ -22,7 +22,7 @@ ov::OutputVector crop(const ov::frontend::onnx::Node& node) { // Crop is an obsolete experimental ONNX operation. // Crops an image's spatial dimensions. - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto& input_data = inputs.at(0); // Border values: leftBorder, topBorder, rightBorder, bottomBorder. diff --git a/src/frontends/onnx/frontend/src/op/cum_sum.cpp b/src/frontends/onnx/frontend/src/op/cum_sum.cpp index 38ccc631abb4cd..127551c208460e 100644 --- a/src/frontends/onnx/frontend/src/op/cum_sum.cpp +++ b/src/frontends/onnx/frontend/src/op/cum_sum.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector cum_sum(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); auto data = inputs.at(0); bool exclusive = node.get_attribute_value("exclusive", 0); bool reverse = node.get_attribute_value("reverse", 0); diff --git a/src/frontends/onnx/frontend/src/op/depth_to_space.cpp b/src/frontends/onnx/frontend/src/op/depth_to_space.cpp index 23b6210c6f1bc7..d78624ef0c82cf 100644 --- a/src/frontends/onnx/frontend/src/op/depth_to_space.cpp +++ b/src/frontends/onnx/frontend/src/op/depth_to_space.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector depth_to_space(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); const auto& shape = data.get_partial_shape(); FRONT_END_GENERAL_CHECK(shape.rank().is_static() && shape.rank().get_length() == 4, "Input must be 4-dimensional"); diff --git a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp index 7932bbef6cfd5b..4082368fd68163 100644 --- a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp @@ -39,7 +39,7 @@ std::shared_ptr get_zero_point(const ov::OutputVector& inputs) { } // namespace detail namespace set_1 { ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node) { - const ov::OutputVector inputs{node.get_ng_inputs()}; + const ov::OutputVector inputs{node.get_ov_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, "The DequantizeLinear op expects 2 required and one optional input. Got: ", @@ -163,7 +163,7 @@ ov::OutputVector dequantize_linear(const ov::Output& x, } // namespace detail ov::OutputVector dequantize_linear(const ov::frontend::onnx::Node& node) { - const ov::OutputVector inputs{node.get_ng_inputs()}; + const ov::OutputVector inputs{node.get_ov_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, "The DequantizeLinear op expects 2 required and one optional " diff --git a/src/frontends/onnx/frontend/src/op/dft.cpp b/src/frontends/onnx/frontend/src/op/dft.cpp index cce66cecc21c45..5120f0b7e17901 100644 --- a/src/frontends/onnx/frontend/src/op/dft.cpp +++ b/src/frontends/onnx/frontend/src/op/dft.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector dft(const ov::frontend::onnx::Node& node) { - const ov::OutputVector ng_inputs{node.get_ng_inputs()}; + const ov::OutputVector ng_inputs{node.get_ov_inputs()}; const ov::Output data = ng_inputs.at(0); const auto dft_length_provided = ng_inputs.size() > 1 && !ov::op::util::is_null(ng_inputs[1]); diff --git a/src/frontends/onnx/frontend/src/op/div.hpp b/src/frontends/onnx/frontend/src/op/div.hpp index 764995ffbb5bbe..c133d5908a0d44 100644 --- a/src/frontends/onnx/frontend/src/op/div.hpp +++ b/src/frontends/onnx/frontend/src/op/div.hpp @@ -20,7 +20,7 @@ inline ov::OutputVector div(const ov::frontend::onnx::Node& node) { namespace set_7 { inline ov::OutputVector div(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_7 diff --git a/src/frontends/onnx/frontend/src/op/dropout.cpp b/src/frontends/onnx/frontend/src/op/dropout.cpp index 224d00582457fb..636bc9dda486f0 100644 --- a/src/frontends/onnx/frontend/src/op/dropout.cpp +++ b/src/frontends/onnx/frontend/src/op/dropout.cpp @@ -21,7 +21,7 @@ namespace { ov::OutputVector build_dropout(const ov::frontend::onnx::Node& node, bool training_mode) { CHECK_VALID_NODE(node, !training_mode, "Training mode is not supported for Dropout op"); - const auto input_data = node.get_ng_inputs().at(0); + const auto input_data = node.get_ov_inputs().at(0); const bool return_mask = node.get_outputs_size() > 1; if (return_mask) { @@ -37,7 +37,7 @@ ov::OutputVector build_dropout(const ov::frontend::onnx::Node& node, bool traini namespace set_12 { ov::OutputVector dropout(const ov::frontend::onnx::Node& node) { - const auto ng_inputs = node.get_ng_inputs(); + const auto ng_inputs = node.get_ov_inputs(); // seed attribute and ratio input are ignored because traning mode is not // supported anyway bool training_mode = false; // default value diff --git a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp index 6c5f5535e0ba71..1009d05d8d9018 100644 --- a/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dynamic_quantize_linear.cpp @@ -80,7 +80,7 @@ std::shared_ptr quantize_linear(ov::Output x, namespace op { namespace set_1 { ov::OutputVector dynamic_quantize_linear(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); const auto& x = inputs.at(0); // quantization range in case of uint8 is [0, 255] diff --git a/src/frontends/onnx/frontend/src/op/einsum.cpp b/src/frontends/onnx/frontend/src/op/einsum.cpp index 499f6518cbbea0..2cf832a78e1af2 100644 --- a/src/frontends/onnx/frontend/src/op/einsum.cpp +++ b/src/frontends/onnx/frontend/src/op/einsum.cpp @@ -16,7 +16,7 @@ namespace set_1 { ov::OutputVector einsum(const ov::frontend::onnx::Node& node) { const std::string& equation{node.get_attribute_value("equation")}; - return {std::make_shared(node.get_ng_inputs(), equation)}; + return {std::make_shared(node.get_ov_inputs(), equation)}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/elu.cpp b/src/frontends/onnx/frontend/src/op/elu.cpp index 30676ca63fb094..fb45f05a1c53ec 100644 --- a/src/frontends/onnx/frontend/src/op/elu.cpp +++ b/src/frontends/onnx/frontend/src/op/elu.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector elu(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); double alpha = node.get_attribute_value("alpha", 1); return {std::make_shared(data, alpha)}; diff --git a/src/frontends/onnx/frontend/src/op/equal.hpp b/src/frontends/onnx/frontend/src/op/equal.hpp index 4615307ddd5cf6..4591e7da6da44e 100644 --- a/src/frontends/onnx/frontend/src/op/equal.hpp +++ b/src/frontends/onnx/frontend/src/op/equal.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector equal(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/erf.hpp b/src/frontends/onnx/frontend/src/op/erf.hpp index 2b1252df7b4fe6..83a6b19ffccaa8 100644 --- a/src/frontends/onnx/frontend/src/op/erf.hpp +++ b/src/frontends/onnx/frontend/src/op/erf.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector erf(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/exp.hpp b/src/frontends/onnx/frontend/src/op/exp.hpp index 38a69a619c7e4a..44c243670f1594 100644 --- a/src/frontends/onnx/frontend/src/op/exp.hpp +++ b/src/frontends/onnx/frontend/src/op/exp.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector exp(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/expand.cpp b/src/frontends/onnx/frontend/src/op/expand.cpp index 1bc132670806f6..c96331627c43a7 100644 --- a/src/frontends/onnx/frontend/src/op/expand.cpp +++ b/src/frontends/onnx/frontend/src/op/expand.cpp @@ -17,8 +17,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector expand(const ov::frontend::onnx::Node& node) { - const ov::Output data{node.get_ng_inputs().at(0)}; - const ov::Output shape{node.get_ng_inputs().at(1)}; + const ov::Output data{node.get_ov_inputs().at(0)}; + const ov::Output shape{node.get_ov_inputs().at(1)}; if (common::is_failsafe_node(shape.get_node_shared_ptr())) { // in case the "shape" input is connected to a failsafe node created in place of an invalid initializer diff --git a/src/frontends/onnx/frontend/src/op/eye_like.cpp b/src/frontends/onnx/frontend/src/op/eye_like.cpp index 1800613d3dc828..aae1f88edf0b74 100644 --- a/src/frontends/onnx/frontend/src/op/eye_like.cpp +++ b/src/frontends/onnx/frontend/src/op/eye_like.cpp @@ -34,7 +34,7 @@ ov::OutputVector get_shape_width_and_height(const ov::Output& shape) { namespace set_1 { ov::OutputVector eye_like(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const auto& input_rank = input.get_partial_shape().rank(); CHECK_VALID_NODE(node, diff --git a/src/frontends/onnx/frontend/src/op/flatten.cpp b/src/frontends/onnx/frontend/src/op/flatten.cpp index c6f8b822cc865c..2e07903270e051 100644 --- a/src/frontends/onnx/frontend/src/op/flatten.cpp +++ b/src/frontends/onnx/frontend/src/op/flatten.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector flatten(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto data = inputs.at(0); auto axis = node.get_attribute_value("axis", 1); const auto data_rank = data.get_partial_shape().rank(); diff --git a/src/frontends/onnx/frontend/src/op/floor.hpp b/src/frontends/onnx/frontend/src/op/floor.hpp index 98fcf88af49c6b..ce4640bf730b67 100644 --- a/src/frontends/onnx/frontend/src/op/floor.hpp +++ b/src/frontends/onnx/frontend/src/op/floor.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector floor(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/gather.hpp b/src/frontends/onnx/frontend/src/op/gather.hpp index 5664081a10962c..e36f6eecaedd6b 100644 --- a/src/frontends/onnx/frontend/src/op/gather.hpp +++ b/src/frontends/onnx/frontend/src/op/gather.hpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector gather(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; + ov::OutputVector ng_inputs{node.get_ov_inputs()}; auto data = ng_inputs.at(0); auto indices = ng_inputs.at(1); auto axis = node.get_attribute_value("axis", 0); diff --git a/src/frontends/onnx/frontend/src/op/gather_elements.hpp b/src/frontends/onnx/frontend/src/op/gather_elements.hpp index c0c187389083f8..d225fdd7c2911c 100644 --- a/src/frontends/onnx/frontend/src/op/gather_elements.hpp +++ b/src/frontends/onnx/frontend/src/op/gather_elements.hpp @@ -12,7 +12,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector gather_elements(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; + ov::OutputVector ng_inputs{node.get_ov_inputs()}; auto data = ng_inputs.at(0); auto indices = ng_inputs.at(1); auto axis = node.get_attribute_value("axis", 0); diff --git a/src/frontends/onnx/frontend/src/op/gather_nd.cpp b/src/frontends/onnx/frontend/src/op/gather_nd.cpp index faeb2539db1e3b..c9f6d241d8b98a 100644 --- a/src/frontends/onnx/frontend/src/op/gather_nd.cpp +++ b/src/frontends/onnx/frontend/src/op/gather_nd.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector gather_nd(const ov::frontend::onnx::Node& node) { - const ov::OutputVector ng_inputs{node.get_ng_inputs()}; + const ov::OutputVector ng_inputs{node.get_ov_inputs()}; const auto data = ng_inputs.at(0); const auto indices = ng_inputs.at(1); const auto batch_dims = node.get_attribute_value("batch_dims", 0); diff --git a/src/frontends/onnx/frontend/src/op/gelu.cpp b/src/frontends/onnx/frontend/src/op/gelu.cpp index 05bf71f5f4647c..e7950a29ad9967 100644 --- a/src/frontends/onnx/frontend/src/op/gelu.cpp +++ b/src/frontends/onnx/frontend/src/op/gelu.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector gelu(const ov::frontend::onnx::Node& node) { - const auto& inputs = node.get_ng_inputs(); + const auto& inputs = node.get_ov_inputs(); std::string approximate = node.get_attribute_value("approximate", ""); FRONT_END_GENERAL_CHECK(inputs.size() == 1, "Wrong number of inputs, expected 1, found ", inputs.size()); diff --git a/src/frontends/onnx/frontend/src/op/gemm.cpp b/src/frontends/onnx/frontend/src/op/gemm.cpp index 1985d502534e17..b679a407d51707 100644 --- a/src/frontends/onnx/frontend/src/op/gemm.cpp +++ b/src/frontends/onnx/frontend/src/op/gemm.cpp @@ -19,7 +19,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector gemm(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; ov::Output input_a = inputs.at(0); ov::Output input_b = inputs.at(1); ov::Output input_c; @@ -63,7 +63,7 @@ ov::OutputVector gemm(const ov::frontend::onnx::Node& node) { namespace set_6 { ov::OutputVector gemm(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; ov::Output input_a = inputs.at(0); ov::Output input_b = inputs.at(1); ov::Output input_c; diff --git a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp index ddf09f3226fc50..a37c346a7a5118 100644 --- a/src/frontends/onnx/frontend/src/op/global_average_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_average_pool.cpp @@ -28,7 +28,7 @@ ov::OutputVector global_average_pool(const ov::frontend::onnx::Node& node) { // Input shape: [N, C, H, W, D] // Input spatial dimensions are H, W and D // Expected spatial dims indexes: [2, 3, 4] - auto data = node.get_ng_inputs()[0]; + auto data = node.get_ov_inputs()[0]; const auto zero_node = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); const auto one_node = v0::Constant::create(ov::element::i64, ov::Shape{}, {1}); diff --git a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp index 277dea1cc2450b..e975c4fe423e9b 100644 --- a/src/frontends/onnx/frontend/src/op/global_max_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/global_max_pool.cpp @@ -28,7 +28,7 @@ ov::OutputVector global_max_pool(const ov::frontend::onnx::Node& node) { // Input shape: [N, C, H, W, D] // Input spatial dimensions are H, W and D // Expected spatial dims indexes: [2, 3, 4] - auto data = node.get_ng_inputs()[0]; + auto data = node.get_ov_inputs()[0]; const auto zero_node = v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); const auto one_node = v0::Constant::create(ov::element::i64, ov::Shape{}, {1}); diff --git a/src/frontends/onnx/frontend/src/op/greater.hpp b/src/frontends/onnx/frontend/src/op/greater.hpp index 1ac5db2c6c23d4..e9a162a6bcec4c 100644 --- a/src/frontends/onnx/frontend/src/op/greater.hpp +++ b/src/frontends/onnx/frontend/src/op/greater.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector greater(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp b/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp index 5349e4a473a1d6..52c8f798858294 100644 --- a/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp +++ b/src/frontends/onnx/frontend/src/op/greater_or_equal.cpp @@ -16,8 +16,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node) { - const auto A = node.get_ng_inputs().at(0); - const auto B = node.get_ng_inputs().at(1); + const auto A = node.get_ov_inputs().at(0); + const auto B = node.get_ov_inputs().at(1); FRONT_END_GENERAL_CHECK(A.get_element_type() != ov::element::bf16 && B.get_element_type() != ov::element::bf16, "The input data bfloat16 isn't supported in opset 12"); @@ -30,8 +30,8 @@ ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node) { namespace set_16 { ov::OutputVector greater_or_equal(const ov::frontend::onnx::Node& node) { - const auto A = node.get_ng_inputs().at(0); - const auto B = node.get_ng_inputs().at(1); + const auto A = node.get_ov_inputs().at(0); + const auto B = node.get_ov_inputs().at(1); const auto C = std::make_shared(A, B); diff --git a/src/frontends/onnx/frontend/src/op/grid_sample.cpp b/src/frontends/onnx/frontend/src/op/grid_sample.cpp index a059241881f9b7..8a7e6785311055 100644 --- a/src/frontends/onnx/frontend/src/op/grid_sample.cpp +++ b/src/frontends/onnx/frontend/src/op/grid_sample.cpp @@ -14,8 +14,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector grid_sample(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); - const auto grid = node.get_ng_inputs().at(1); + const auto data = node.get_ov_inputs().at(0); + const auto grid = node.get_ov_inputs().at(1); v9::GridSample::Attributes attributes{}; attributes.align_corners = node.get_attribute_value("align_corners", 0); diff --git a/src/frontends/onnx/frontend/src/op/group_normalization.cpp b/src/frontends/onnx/frontend/src/op/group_normalization.cpp index 6a43a328dd8415..5c5339748d4ce3 100644 --- a/src/frontends/onnx/frontend/src/op/group_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/group_normalization.cpp @@ -22,7 +22,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector group_normalization(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); OPENVINO_ASSERT(inputs.size() == 3); const auto& data = inputs[0]; // Shape [N, C, ...] diff --git a/src/frontends/onnx/frontend/src/op/gru.cpp b/src/frontends/onnx/frontend/src/op/gru.cpp index d34f71f7293112..1fa59be80b6d3f 100644 --- a/src/frontends/onnx/frontend/src/op/gru.cpp +++ b/src/frontends/onnx/frontend/src/op/gru.cpp @@ -28,7 +28,7 @@ struct GRUInputMap : public recurrent::OpInputMap { // Override bias, since we need separated W and R biases for `h` gate. if (linear_before_reset) { - const auto& ng_inputs = node.get_ng_inputs(); + const auto& ng_inputs = node.get_ov_inputs(); const auto el_type = ng_inputs.at(0).get_element_type(); if (ng_inputs.size() > 3 && !ov::op::util::is_null(ng_inputs.at(3))) { diff --git a/src/frontends/onnx/frontend/src/op/hammingwindow.cpp b/src/frontends/onnx/frontend/src/op/hammingwindow.cpp index 50fd5b0a2dd90d..e090e30a1ea145 100644 --- a/src/frontends/onnx/frontend/src/op/hammingwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/hammingwindow.cpp @@ -24,7 +24,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector hammingwindow(const ov::frontend::onnx::Node& node) { - const auto size = node.get_ng_inputs().at(0); + const auto size = node.get_ov_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; diff --git a/src/frontends/onnx/frontend/src/op/hannwindow.cpp b/src/frontends/onnx/frontend/src/op/hannwindow.cpp index 8e981529985b20..bf021025474f6a 100644 --- a/src/frontends/onnx/frontend/src/op/hannwindow.cpp +++ b/src/frontends/onnx/frontend/src/op/hannwindow.cpp @@ -24,7 +24,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector hannwindow(const ov::frontend::onnx::Node& node) { - const auto size = node.get_ng_inputs().at(0); + const auto size = node.get_ov_inputs().at(0); const auto output_datatype = common::get_ov_element_type(node.get_attribute_value("output_datatype", 1)); const bool periodic = node.get_attribute_value("periodic", 1) == 1; diff --git a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp index 0908b424feab52..a252ccafc811cd 100644 --- a/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp +++ b/src/frontends/onnx/frontend/src/op/hard_sigmoid.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector hard_sigmoid(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const auto alpha = v0::Constant::create(data.get_element_type(), diff --git a/src/frontends/onnx/frontend/src/op/hard_swish.hpp b/src/frontends/onnx/frontend/src/op/hard_swish.hpp index 435fbf8a818a8e..fc38bfb6a7d8c2 100644 --- a/src/frontends/onnx/frontend/src/op/hard_swish.hpp +++ b/src/frontends/onnx/frontend/src/op/hard_swish.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector hard_swish(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/hardmax.cpp b/src/frontends/onnx/frontend/src/op/hardmax.cpp index 2c2de6e94ce7e9..10a5e254abbdce 100644 --- a/src/frontends/onnx/frontend/src/op/hardmax.cpp +++ b/src/frontends/onnx/frontend/src/op/hardmax.cpp @@ -25,7 +25,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector hardmax(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const auto& input_shape = input.get_partial_shape(); auto axis = node.get_attribute_value("axis", 1); @@ -63,7 +63,7 @@ ov::OutputVector hardmax(const ov::frontend::onnx::Node& node) { } // namespace set_1 namespace set_13 { ov::OutputVector hardmax(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const auto& input_shape = input.get_partial_shape(); auto axis = node.get_attribute_value("axis", -1); diff --git a/src/frontends/onnx/frontend/src/op/identity.hpp b/src/frontends/onnx/frontend/src/op/identity.hpp index 254e4480a29e5d..e70aeb8a04dabe 100644 --- a/src/frontends/onnx/frontend/src/op/identity.hpp +++ b/src/frontends/onnx/frontend/src/op/identity.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector identity(const ov::frontend::onnx::Node& node) { - ov::OutputVector outputs = node.get_ng_inputs(); + ov::OutputVector outputs = node.get_ov_inputs(); for (auto& out : outputs) { common::mark_as_optimized_out(out); } diff --git a/src/frontends/onnx/frontend/src/op/if.cpp b/src/frontends/onnx/frontend/src/op/if.cpp index 4aecf72995184c..f06bf83315a801 100644 --- a/src/frontends/onnx/frontend/src/op/if.cpp +++ b/src/frontends/onnx/frontend/src/op/if.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector if_op(const ov::frontend::onnx::Node& node) { - const auto& ng_inputs = node.get_ng_inputs(); + const auto& ng_inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(ng_inputs.size() == 1, "If operator takes only one input"); const auto& subgraphs = node.get_subgraphs(); diff --git a/src/frontends/onnx/frontend/src/op/image_scaler.cpp b/src/frontends/onnx/frontend/src/op/image_scaler.cpp index 8e4b70d2cf0c02..a17e3d4d9f644f 100644 --- a/src/frontends/onnx/frontend/src/op/image_scaler.cpp +++ b/src/frontends/onnx/frontend/src/op/image_scaler.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector image_scaler(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 1, "ImageScaler 1 input tensor. Got: ", inputs.size()); const auto data = inputs[0]; diff --git a/src/frontends/onnx/frontend/src/op/instance_norm.cpp b/src/frontends/onnx/frontend/src/op/instance_norm.cpp index b9f0849dea44aa..f834bd4efc96d1 100644 --- a/src/frontends/onnx/frontend/src/op/instance_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/instance_norm.cpp @@ -20,9 +20,9 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector instance_norm(const ov::frontend::onnx::Node& node) { - ov::Output data(node.get_ng_inputs().at(0)); - ov::Output scale(node.get_ng_inputs().at(1)); - ov::Output bias(node.get_ng_inputs().at(2)); + ov::Output data(node.get_ov_inputs().at(0)); + ov::Output scale(node.get_ov_inputs().at(1)); + ov::Output bias(node.get_ov_inputs().at(2)); const ov::PartialShape& data_pshape = data.get_partial_shape(); const ov::PartialShape& scale_pshape = scale.get_partial_shape(); const ov::PartialShape& bias_pshape = bias.get_partial_shape(); diff --git a/src/frontends/onnx/frontend/src/op/is_finite.cpp b/src/frontends/onnx/frontend/src/op/is_finite.cpp index cc9fbba820b0b6..89923ac23fb276 100644 --- a/src/frontends/onnx/frontend/src/op/is_finite.cpp +++ b/src/frontends/onnx/frontend/src/op/is_finite.cpp @@ -15,7 +15,7 @@ namespace op { namespace set_1 { ov::OutputVector is_finite(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); return {std::make_shared(data)}; } diff --git a/src/frontends/onnx/frontend/src/op/is_inf.cpp b/src/frontends/onnx/frontend/src/op/is_inf.cpp index 3b7b8ce05b96ca..d9462cbbb0af57 100644 --- a/src/frontends/onnx/frontend/src/op/is_inf.cpp +++ b/src/frontends/onnx/frontend/src/op/is_inf.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector is_inf(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); ov::opset10::IsInf::Attributes attributes{}; attributes.detect_negative = node.get_attribute_value("detect_negative", 1); diff --git a/src/frontends/onnx/frontend/src/op/is_nan.cpp b/src/frontends/onnx/frontend/src/op/is_nan.cpp index f29620ee661ada..74e345e15acf6b 100644 --- a/src/frontends/onnx/frontend/src/op/is_nan.cpp +++ b/src/frontends/onnx/frontend/src/op/is_nan.cpp @@ -15,7 +15,7 @@ namespace op { namespace set_1 { ov::OutputVector is_nan(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); return {std::make_shared(data)}; } diff --git a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp index 27746a2f7b4655..c8d1d6b4c7b798 100644 --- a/src/frontends/onnx/frontend/src/op/layer_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/layer_normalization.cpp @@ -30,7 +30,6 @@ using namespace ov::op::v8; using ::ONNX_NAMESPACE::TensorProto_DataType; using ov::Shape; -OPENVINO_SUPPRESS_DEPRECATED_START namespace ov { namespace frontend { namespace onnx { @@ -38,7 +37,7 @@ namespace op { namespace set_1 { ov::OutputVector layer_normalization(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto num_inputs = inputs.size(); CHECK_VALID_NODE(node, num_inputs == 2 || num_inputs == 3, @@ -103,4 +102,3 @@ ov::OutputVector layer_normalization(const ov::frontend::onnx::Node& node) { } // namespace onnx } // namespace frontend } // namespace ov -OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp index 2d0d8bfdd44e9a..15b108bf5730d7 100644 --- a/src/frontends/onnx/frontend/src/op/leaky_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/leaky_relu.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector leaky_relu(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); double alpha = node.get_attribute_value("alpha", 0.01); std::shared_ptr alpha_node = v0::Constant::create(data.get_element_type(), ov::Shape{1}, {alpha}); diff --git a/src/frontends/onnx/frontend/src/op/less.hpp b/src/frontends/onnx/frontend/src/op/less.hpp index 9fb45922767c47..07d30b80a5fb3e 100644 --- a/src/frontends/onnx/frontend/src/op/less.hpp +++ b/src/frontends/onnx/frontend/src/op/less.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector less(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/less_or_equal.cpp b/src/frontends/onnx/frontend/src/op/less_or_equal.cpp index f888ffdc0b635d..c44d0de6334a69 100644 --- a/src/frontends/onnx/frontend/src/op/less_or_equal.cpp +++ b/src/frontends/onnx/frontend/src/op/less_or_equal.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node) { - const auto& input = node.get_ng_inputs(); + const auto& input = node.get_ov_inputs(); const auto a = input.at(0); const auto b = input.at(1); FRONT_END_GENERAL_CHECK(a.get_element_type() != ov::element::bf16 && b.get_element_type() != ov::element::bf16, @@ -27,7 +27,7 @@ ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node) { namespace set_16 { ov::OutputVector less_or_equal(const ov::frontend::onnx::Node& node) { - const auto& input = node.get_ng_inputs(); + const auto& input = node.get_ov_inputs(); const auto a = input.at(0); const auto b = input.at(1); return {std::make_shared(a, b)}; diff --git a/src/frontends/onnx/frontend/src/op/log.cpp b/src/frontends/onnx/frontend/src/op/log.cpp index 946daec483dc19..294c824ca574ed 100644 --- a/src/frontends/onnx/frontend/src/op/log.cpp +++ b/src/frontends/onnx/frontend/src/op/log.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector log(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/log_softmax.cpp b/src/frontends/onnx/frontend/src/op/log_softmax.cpp index 207a4747b2c2d4..1a660d535f251b 100644 --- a/src/frontends/onnx/frontend/src/op/log_softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/log_softmax.cpp @@ -28,7 +28,7 @@ std::shared_ptr onnx_logsoftmax(const ov::Output data, const } ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node, const int64_t DEFAULT_AXIS) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; const auto data = inputs.at(0); const auto data_rank = data.get_partial_shape().rank(); @@ -70,7 +70,7 @@ ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node) { namespace set_13 { ov::OutputVector log_softmax(const ov::frontend::onnx::Node& node) { const auto axis = node.get_attribute_value("axis", -1); - return {std::make_shared(node.get_ng_inputs()[0], axis)}; + return {std::make_shared(node.get_ov_inputs()[0], axis)}; } } // namespace set_13 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/loop.cpp b/src/frontends/onnx/frontend/src/op/loop.cpp index 98a6801a7337ed..20d1c4f9f0ae57 100644 --- a/src/frontends/onnx/frontend/src/op/loop.cpp +++ b/src/frontends/onnx/frontend/src/op/loop.cpp @@ -40,7 +40,7 @@ bool is_termination_condition_always_true(const ov::Node* cond_in, const ov::Nod } // namespace ov::OutputVector loop(const ov::frontend::onnx::Node& node) { - const auto& ng_inputs = node.get_ng_inputs(); + const auto& ng_inputs = node.get_ov_inputs(); const ov::OutputVector loop_carried_dependencies{std::next(ng_inputs.begin(), 2), ng_inputs.end()}; diff --git a/src/frontends/onnx/frontend/src/op/lp_norm.cpp b/src/frontends/onnx/frontend/src/op/lp_norm.cpp index de2e80c6021241..836be70c76eb83 100644 --- a/src/frontends/onnx/frontend/src/op/lp_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_norm.cpp @@ -18,12 +18,10 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector lp_norm(const ov::frontend::onnx::Node& node) { - const ov::Output data{node.get_ng_inputs().at(0)}; + const ov::Output data{node.get_ov_inputs().at(0)}; const auto data_shape = data.get_partial_shape(); const auto data_rank = data_shape.rank(); - const std::int64_t p_norm{node.get_attribute_value("p", 2)}; - const std::int64_t axis{node.get_attribute_value("axis", -1)}; const size_t normalize_axis = ov::util::normalize_axis(node.get_description(), axis, data_rank); diff --git a/src/frontends/onnx/frontend/src/op/lp_pool.cpp b/src/frontends/onnx/frontend/src/op/lp_pool.cpp index 452909a97a1985..715d1f49d929ef 100644 --- a/src/frontends/onnx/frontend/src/op/lp_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_pool.cpp @@ -22,7 +22,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector global_lp_pool(const ov::frontend::onnx::Node& node) { - const ov::Output data{node.get_ng_inputs().at(0)}; + const ov::Output data{node.get_ov_inputs().at(0)}; const std::size_t channel_axis{1}; const auto data_shape = data.get_partial_shape(); diff --git a/src/frontends/onnx/frontend/src/op/lrn.cpp b/src/frontends/onnx/frontend/src/op/lrn.cpp index c8141e0690bf3a..f389ebfb8c6bb0 100644 --- a/src/frontends/onnx/frontend/src/op/lrn.cpp +++ b/src/frontends/onnx/frontend/src/op/lrn.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector lrn(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); double alpha = node.get_attribute_value("alpha", 1e-4); double beta = node.get_attribute_value("beta", 0.75); double bias = node.get_attribute_value("bias", 1); diff --git a/src/frontends/onnx/frontend/src/op/lstm.cpp b/src/frontends/onnx/frontend/src/op/lstm.cpp index 0070d783cd69a9..907bb881ca0067 100644 --- a/src/frontends/onnx/frontend/src/op/lstm.cpp +++ b/src/frontends/onnx/frontend/src/op/lstm.cpp @@ -41,7 +41,7 @@ enum class LSTMInput { struct LSTMNgInputMap { explicit LSTMNgInputMap(const Node& node) { - const auto& ng_inputs = node.get_ng_inputs(); + const auto& ng_inputs = node.get_ov_inputs(); // We have input, output, forget and cell gates constexpr std::size_t gates_count{4}; constexpr std::size_t P_gates_count{3}; diff --git a/src/frontends/onnx/frontend/src/op/matmul.hpp b/src/frontends/onnx/frontend/src/op/matmul.hpp index ee38f0d41ebf1c..1389daa09bbabf 100644 --- a/src/frontends/onnx/frontend/src/op/matmul.hpp +++ b/src/frontends/onnx/frontend/src/op/matmul.hpp @@ -18,7 +18,7 @@ inline ov::OutputVector matmul(const ov::Output& a, const ov::Output(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp index 3d0b05a68c9703..3faa4f23c5ab8f 100644 --- a/src/frontends/onnx/frontend/src/op/matmul_integer.cpp +++ b/src/frontends/onnx/frontend/src/op/matmul_integer.cpp @@ -18,7 +18,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector matmul_integer(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); const auto& A = inputs.at(0); const auto& B = inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp index 925d0e2619cdf7..c19d3c0fee57e6 100644 --- a/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp +++ b/src/frontends/onnx/frontend/src/op/max_roi_pool.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector max_roi_pool(const ov::frontend::onnx::Node& node) { - const auto& inputs = node.get_ng_inputs(); + const auto& inputs = node.get_ov_inputs(); const auto X = inputs.at(0); const auto rois = inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/mean.cpp b/src/frontends/onnx/frontend/src/op/mean.cpp index 46590daf7d1925..d4ab881bbe34f6 100644 --- a/src/frontends/onnx/frontend/src/op/mean.cpp +++ b/src/frontends/onnx/frontend/src/op/mean.cpp @@ -18,7 +18,7 @@ namespace op { namespace set_1 { ov::OutputVector mean(const ov::frontend::onnx::Node& node) { auto sum = variadic::make_ng_variadic_op(node).front(); - auto count = v0::Constant::create(sum.get_element_type(), ov::Shape{}, {node.get_ng_inputs().size()}); + auto count = v0::Constant::create(sum.get_element_type(), ov::Shape{}, {node.get_ov_inputs().size()}); return {std::make_shared(sum, count)}; } diff --git a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp index 1aae54a0bd1396..b92acbdc1cca8d 100644 --- a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); bool across_channels = node.get_attribute_value("across_channels", 0); bool normalize_variance = node.get_attribute_value("normalize_variance", 1); @@ -27,7 +27,7 @@ ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& nod namespace set_9 { ov::OutputVector mean_variance_normalization(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto axes = node.get_attribute_value>("axes", {0, 2, 3}); const std::vector normalized_axes = ov::util::normalize_axes(node.get_description(), axes, data.get_partial_shape().rank()); diff --git a/src/frontends/onnx/frontend/src/op/mod.cpp b/src/frontends/onnx/frontend/src/op/mod.cpp index 3d10b0916c1574..25891670647d97 100644 --- a/src/frontends/onnx/frontend/src/op/mod.cpp +++ b/src/frontends/onnx/frontend/src/op/mod.cpp @@ -17,8 +17,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector mod(const ov::frontend::onnx::Node& node) { - ov::Output dividend{node.get_ng_inputs().at(0)}; - ov::Output divisor{node.get_ng_inputs().at(1)}; + ov::Output dividend{node.get_ov_inputs().at(0)}; + ov::Output divisor{node.get_ov_inputs().at(1)}; std::int64_t fmod = node.get_attribute_value("fmod", 0); ov::OutputVector output; diff --git a/src/frontends/onnx/frontend/src/op/mul.hpp b/src/frontends/onnx/frontend/src/op/mul.hpp index 01725f752980e2..ef73e65555bbdf 100644 --- a/src/frontends/onnx/frontend/src/op/mul.hpp +++ b/src/frontends/onnx/frontend/src/op/mul.hpp @@ -20,7 +20,7 @@ inline ov::OutputVector mul(const ov::frontend::onnx::Node& node) { namespace set_7 { inline ov::OutputVector mul(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_7 diff --git a/src/frontends/onnx/frontend/src/op/neg.hpp b/src/frontends/onnx/frontend/src/op/neg.hpp index 81a42e5af5f11e..febdb25cdb32d1 100644 --- a/src/frontends/onnx/frontend/src/op/neg.hpp +++ b/src/frontends/onnx/frontend/src/op/neg.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector neg(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp index c2489eff0c1da2..b03b47db50da2b 100644 --- a/src/frontends/onnx/frontend/src/op/nms_rotated.hpp +++ b/src/frontends/onnx/frontend/src/op/nms_rotated.hpp @@ -23,8 +23,8 @@ inline ov::OutputVector nms_rotated(const ov::frontend::onnx::Node& node) { auto iou_threshold_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{}, {iou_threshold}); auto score_threshold_const = ov::op::v0::Constant::create(ov::element::f32, ov::Shape{}, {score_threshold}); - auto nms = std::make_shared(node.get_ng_inputs().at(0), - node.get_ng_inputs().at(1), + auto nms = std::make_shared(node.get_ov_inputs().at(0), + node.get_ov_inputs().at(1), max_output_boxes_per_class, iou_threshold_const, score_threshold_const, diff --git a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp index 0e7f0f94a9afb5..1375d089538a1b 100644 --- a/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp +++ b/src/frontends/onnx/frontend/src/op/non_max_suppression.cpp @@ -22,7 +22,7 @@ ov::OutputVector non_max_suppression(const ov::frontend::onnx::Node& node) { // TODO: this op will not be tested until at least // a reference implementation is added - const auto ng_inputs = node.get_ng_inputs(); + const auto ng_inputs = node.get_ov_inputs(); const ov::Output boxes = ng_inputs.at(0); const ov::Output scores = ng_inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/non_zero.cpp b/src/frontends/onnx/frontend/src/op/non_zero.cpp index 486891e091fd4e..60d04b2d0dcd9a 100644 --- a/src/frontends/onnx/frontend/src/op/non_zero.cpp +++ b/src/frontends/onnx/frontend/src/op/non_zero.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector non_zero(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); return {std::make_shared(data, ov::element::i64)}; } diff --git a/src/frontends/onnx/frontend/src/op/not.hpp b/src/frontends/onnx/frontend/src/op/not.hpp index 1241b250935e80..3002027518a140 100644 --- a/src/frontends/onnx/frontend/src/op/not.hpp +++ b/src/frontends/onnx/frontend/src/op/not.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector logical_not(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/onehot.cpp b/src/frontends/onnx/frontend/src/op/onehot.cpp index 2867761bb3f76b..f545b93f0cb767 100644 --- a/src/frontends/onnx/frontend/src/op/onehot.cpp +++ b/src/frontends/onnx/frontend/src/op/onehot.cpp @@ -18,7 +18,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector onehot(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto indices = std::make_shared(inputs.at(0), ov::element::i64); auto depth = std::make_shared(reshape::interpret_as_scalar(inputs.at(1)), ov::element::i64); // Rank 1 tensor containing exactly two elements: [off_value, on_value] diff --git a/src/frontends/onnx/frontend/src/op/or.hpp b/src/frontends/onnx/frontend/src/op/or.hpp index 34608566cb654c..423b631fdf26df 100644 --- a/src/frontends/onnx/frontend/src/op/or.hpp +++ b/src/frontends/onnx/frontend/src/op/or.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector logical_or(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp index 48cef700a1f5d8..7abb16859b9dcc 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/deformable_conv_2d.cpp @@ -27,7 +27,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector deformable_conv_2d(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); const auto strides = convpool::get_strides(node); const auto dilations = convpool::get_dilations(node); const auto paddings = convpool::get_pads(node); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp index 035c7d21ee7445..a248e79cb30d6c 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/detection_output.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector detection_output(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); auto box_logits = inputs[0]; auto class_preds = inputs[1]; diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp index 5bedbcb8255046..0a825f8defdcfa 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/detection_output.cpp @@ -17,7 +17,7 @@ namespace set_1 { ov::OutputVector experimental_detectron_detection_output(const ov::frontend::onnx::Node& node) { using DetectionOutput = v6::ExperimentalDetectronDetectionOutput; - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); auto rois = inputs[0]; auto deltas = inputs[1]; auto scores = inputs[2]; diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp index 48ddd746a83eb8..f8c1e843d44340 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.cpp @@ -18,7 +18,7 @@ namespace set_1 { ov::OutputVector experimental_detectron_generate_proposals(const ov::frontend::onnx::Node& node) { using GenerateProposalsSingleImage = v6::ExperimentalDetectronGenerateProposalsSingleImage; - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 4, "ExperimentalDetectronGenerateProposalsSingleImage expects 4 " "inputs, received: ", diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp index 0139373411d6fa..691a242128410d 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/prior_grid_generator.cpp @@ -17,7 +17,7 @@ namespace set_1 { ov::OutputVector experimental_detectron_prior_grid_generator(const ov::frontend::onnx::Node& node) { using PriorGridGenerator = v6::ExperimentalDetectronPriorGridGenerator; - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); auto priors = inputs[0]; auto feature_map = inputs[1]; auto im_data = inputs[2]; diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp index 9abd04ba3d0a55..819ffcdf76b636 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.cpp @@ -17,7 +17,7 @@ namespace set_1 { ov::OutputVector experimental_detectron_roi_feature_extractor(const ov::frontend::onnx::Node& node) { using ROIFeatureExtractor = v6::ExperimentalDetectronROIFeatureExtractor; - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); ROIFeatureExtractor::Attributes attrs{}; attrs.output_size = node.get_attribute_value("output_size", 7); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp index 31a5ec05a1a698..34d5cf5ed33fcb 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/experimental_detectron/topk_rios.cpp @@ -17,7 +17,7 @@ namespace set_1 { ov::OutputVector experimental_detectron_topk_rois(const ov::frontend::onnx::Node& node) { using TopKROIs = v6::ExperimentalDetectronTopKROIs; - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); auto input_rois = inputs[0]; auto rois_probs = inputs[1]; auto max_rois = static_cast(node.get_attribute_value("max_rois", 1000)); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp index b0dcf38983194d..2f0ccce704d9ef 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/fake_quantize.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector fake_quantize(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto X = inputs.at(0); const auto input_low = inputs.at(1); const auto input_high = inputs.at(2); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp index 5f833b54b373ff..2099c3ca8aa872 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/generate_proposals.cpp @@ -37,7 +37,7 @@ void validate_generate_proposals_inputs(const ov::OutputVector& inputs) { } // namespace ov::OutputVector generate_proposals(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); validate_generate_proposals_inputs(inputs); const auto& scores = inputs[0]; // shape [N, A, H, W] diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp index 4ac45fe6506b51..dd92b4a6d1bcfc 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/group_norm.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector group_norm(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "Invalid number of inputs. Expected 3, actual " + std::to_string(inputs.size())); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp index 8faacef25e1f80..e556580401a502 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/normalize.cpp @@ -21,7 +21,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector normalize(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); auto data = inputs[0]; diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp index 6106d441194cb4..33987df84bcfbd 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/prior_box.cpp @@ -36,7 +36,7 @@ std::shared_ptr make_slice(std::shared_ptr node, int namespace set_1 { ov::OutputVector prior_box(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); auto output_shape = std::make_shared(inputs[0]); @@ -67,7 +67,7 @@ ov::OutputVector prior_box(const ov::frontend::onnx::Node& node) { } ov::OutputVector prior_box_clustered(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Invalid number of inputs"); auto output_shape_rank = inputs[0].get_partial_shape().rank().get_length(); diff --git a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp index ff4f8f1351ba92..0e90eee634ec68 100644 --- a/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp +++ b/src/frontends/onnx/frontend/src/op/org.openvinotoolkit/swish.cpp @@ -18,16 +18,16 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector swish(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; + ov::OutputVector ov_inputs{node.get_ov_inputs()}; ov::Output beta; - if (ng_inputs.size() > 1) { - beta = ov::frontend::onnx::reshape::interpret_as_scalar(ng_inputs.at(1)); + if (ov_inputs.size() > 1) { + beta = ov::frontend::onnx::reshape::interpret_as_scalar(ov_inputs.at(1)); } else { beta = v0::Constant::create(ov::element::f32, ov::Shape{}, {1.0}); } - return {std::make_shared(ng_inputs.at(0), beta)}; + return {std::make_shared(ov_inputs.at(0), beta)}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/pad.cpp b/src/frontends/onnx/frontend/src/op/pad.cpp index 31604b33bb3e71..ed4cbad656cdbe 100644 --- a/src/frontends/onnx/frontend/src/op/pad.cpp +++ b/src/frontends/onnx/frontend/src/op/pad.cpp @@ -38,9 +38,9 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector pad(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); - const auto data_rank = node.get_ng_inputs().at(0).get_partial_shape().rank(); + const auto data_rank = node.get_ov_inputs().at(0).get_partial_shape().rank(); CHECK_VALID_NODE(node, data_rank.is_static(), "Data rank must be static for pad op"); const auto data_rank_value = data_rank.get_length(); @@ -63,7 +63,7 @@ ov::OutputVector pad(const ov::frontend::onnx::Node& node) { } // namespace set_1 namespace set_11 { ov::OutputVector pad(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto& data = inputs[0]; const auto& pads = inputs[1]; ov::Output values; diff --git a/src/frontends/onnx/frontend/src/op/pow.cpp b/src/frontends/onnx/frontend/src/op/pow.cpp index 1b32e4ac37d97a..d09e378172abee 100644 --- a/src/frontends/onnx/frontend/src/op/pow.cpp +++ b/src/frontends/onnx/frontend/src/op/pow.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector pow(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 2, "Power operation requires 2 inputs. Got: ", inputs.size()); auto base = inputs[0]; diff --git a/src/frontends/onnx/frontend/src/op/prelu.cpp b/src/frontends/onnx/frontend/src/op/prelu.cpp index 74ebd4210c1fc6..6928c85d41c033 100644 --- a/src/frontends/onnx/frontend/src/op/prelu.cpp +++ b/src/frontends/onnx/frontend/src/op/prelu.cpp @@ -14,9 +14,9 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector prelu(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; - const auto& data = ng_inputs.at(0); - const auto& slope = ng_inputs.at(1); + ov::OutputVector ov_inputs{node.get_ov_inputs()}; + const auto& data = ov_inputs.at(0); + const auto& slope = ov_inputs.at(1); return {std::make_shared(data, slope)}; } diff --git a/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp b/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp index 20b2bc06b4faff..4621111d76decd 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_conv.cpp @@ -23,7 +23,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector qlinear_conv(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); auto x = inputs.at(0); auto x_scale = inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp b/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp index 5320dfd9b98b0c..16240b6fc073f4 100644 --- a/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp +++ b/src/frontends/onnx/frontend/src/op/qlinear_matmul.cpp @@ -18,7 +18,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector qlinear_matmul(const ov::frontend::onnx::Node& node) { - const ov::OutputVector& inputs = node.get_ng_inputs(); + const ov::OutputVector& inputs = node.get_ov_inputs(); const auto& a = inputs.at(0); const auto& a_scale = reshape::interpret_as_scalar(inputs.at(1)); diff --git a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp index 7e1635a1620624..b19f78dbcf0255 100644 --- a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp @@ -140,7 +140,7 @@ std::shared_ptr make_fake_quantize(const ov::Output& y_scale namespace set_1 { ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; auto x = inputs.at(0); auto y_scale = inputs.at(1); auto y_zero_point = detail::get_zero_point(inputs); @@ -208,7 +208,7 @@ ov::OutputVector quantize_linear(ov::Output x, } // namespace ov::OutputVector quantize_linear(const ov::frontend::onnx::Node& node) { - const ov::OutputVector inputs{node.get_ng_inputs()}; + const ov::OutputVector inputs{node.get_ov_inputs()}; FRONT_END_GENERAL_CHECK(2 <= inputs.size() && inputs.size() <= 3, "The QuantizeLinear op expects 2 required and one optional " diff --git a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp index d5e70ea3d051fd..b600469ede33da 100644 --- a/src/frontends/onnx/frontend/src/op/random_normal_like.cpp +++ b/src/frontends/onnx/frontend/src/op/random_normal_like.cpp @@ -18,7 +18,7 @@ namespace op { namespace set_1 { ov::OutputVector random_normal_like(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); ov::element::Type target_type; if (node.has_attribute("dtype")) { diff --git a/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp b/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp index df0027b17423ee..d626017b2a185b 100644 --- a/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp +++ b/src/frontends/onnx/frontend/src/op/random_uniform_like.cpp @@ -18,7 +18,7 @@ namespace op { namespace set_1 { ov::OutputVector random_uniform_like(const ov::frontend::onnx::Node& node) { - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; const auto input = inputs.at(0); ov::element::Type target_type; diff --git a/src/frontends/onnx/frontend/src/op/range.cpp b/src/frontends/onnx/frontend/src/op/range.cpp index 1f73d0942b6704..3c61c45672b84b 100644 --- a/src/frontends/onnx/frontend/src/op/range.cpp +++ b/src/frontends/onnx/frontend/src/op/range.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector range(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); CHECK_VALID_NODE(node, inputs.size() >= 3, "Minimum 3 inputs are required. Got: ", inputs.size()); ov::Output start{inputs[0]}; diff --git a/src/frontends/onnx/frontend/src/op/reciprocal.cpp b/src/frontends/onnx/frontend/src/op/reciprocal.cpp index f990550509ae5c..e9d275c72bfa81 100644 --- a/src/frontends/onnx/frontend/src/op/reciprocal.cpp +++ b/src/frontends/onnx/frontend/src/op/reciprocal.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector reciprocal(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto one_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {1}); return {std::make_shared(one_node, data)}; diff --git a/src/frontends/onnx/frontend/src/op/reduce.cpp b/src/frontends/onnx/frontend/src/op/reduce.cpp index 711eee13b6f9da..3322af52e76447 100644 --- a/src/frontends/onnx/frontend/src/op/reduce.cpp +++ b/src/frontends/onnx/frontend/src/op/reduce.cpp @@ -32,7 +32,7 @@ namespace onnx { namespace op { namespace { std::shared_ptr get_dynamic_all_axes_range(const Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const auto shape_of_input = std::make_shared(input); const auto scalar = v0::Constant::create(ov::element::i32, ov::Shape{1}, {0}); const auto rank_of_input = std::make_shared(shape_of_input); @@ -44,9 +44,9 @@ std::shared_ptr get_dynamic_all_axes_range(const Node& node) { std::shared_ptr get_reduction_axes_from_input(const Node& node) { const std::int64_t noop_with_empty_axes = node.get_attribute_value("noop_with_empty_axes", 0); - const auto input = node.get_ng_inputs().at(0); - if (node.get_ng_inputs().size() > 1) { - const auto reduction_axes = node.get_ng_inputs().at(1); + const auto input = node.get_ov_inputs().at(0); + if (node.get_ov_inputs().size() > 1) { + const auto reduction_axes = node.get_ov_inputs().at(1); const auto reduction_axes_rank = reduction_axes.get_partial_shape().rank(); FRONT_END_GENERAL_CHECK(reduction_axes.get_partial_shape().is_static(), "The axes tensor's shape needs to be known(static). Node: ", @@ -67,7 +67,7 @@ std::shared_ptr get_reduction_axes_from_input(const Node& node) { std::shared_ptr get_reduction_axes_from_attr(const Node& node) { auto reduction_axes = node.get_attribute_value>("axes", {}); - const auto input_rank = node.get_ng_inputs().at(0).get_partial_shape().rank(); + const auto input_rank = node.get_ov_inputs().at(0).get_partial_shape().rank(); if (reduction_axes.empty()) { if (input_rank.is_static()) { @@ -107,52 +107,52 @@ std::shared_ptr make_ng_reduction_op(const Node& node, namespace set_13 { ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0), false)}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0), false)}; } } // namespace set_13 namespace set_1 { ov::OutputVector reduce_log_sum(const ov::frontend::onnx::Node& node) { - const ov::Output sum_node = make_ng_reduction_op(node, node.get_ng_inputs().at(0)); + const ov::Output sum_node = make_ng_reduction_op(node, node.get_ov_inputs().at(0)); return {std::make_shared(sum_node)}; } ov::OutputVector reduce_log_sum_exp(const ov::frontend::onnx::Node& node) { - const auto exp_node = std::make_shared(node.get_ng_inputs().at(0)); + const auto exp_node = std::make_shared(node.get_ov_inputs().at(0)); const ov::Output sum_node = make_ng_reduction_op(node, exp_node); return {std::make_shared(sum_node)}; } ov::OutputVector reduce_l1(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_l2(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_max(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_mean(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_min(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_prod(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_sum(const ov::frontend::onnx::Node& node) { - return {make_ng_reduction_op(node, node.get_ng_inputs().at(0))}; + return {make_ng_reduction_op(node, node.get_ov_inputs().at(0))}; } ov::OutputVector reduce_sum_square(const ov::frontend::onnx::Node& node) { - const auto input = ov::Output{node.get_ng_inputs().at(0)}; + const auto input = ov::Output{node.get_ov_inputs().at(0)}; const auto square_node = std::make_shared(input, input); return {make_ng_reduction_op(node, square_node)}; } diff --git a/src/frontends/onnx/frontend/src/op/relu.hpp b/src/frontends/onnx/frontend/src/op/relu.hpp index dd319d5509e3f6..e4afc4f7515fcb 100644 --- a/src/frontends/onnx/frontend/src/op/relu.hpp +++ b/src/frontends/onnx/frontend/src/op/relu.hpp @@ -13,8 +13,8 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector relu(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; - return {std::make_shared(ng_inputs.at(0))}; + ov::OutputVector ov_inputs{node.get_ov_inputs()}; + return {std::make_shared(ov_inputs.at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/reshape.cpp b/src/frontends/onnx/frontend/src/op/reshape.cpp index 4019d4827b8a06..c2abfc0e96630f 100644 --- a/src/frontends/onnx/frontend/src/op/reshape.cpp +++ b/src/frontends/onnx/frontend/src/op/reshape.cpp @@ -16,14 +16,14 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector reshape(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; - const auto data = ng_inputs.at(0); + ov::OutputVector ov_inputs{node.get_ov_inputs()}; + const auto data = ov_inputs.at(0); ov::Output pattern; bool special_zero = true; // Since opset 5 the target shape is provided as input - if (ng_inputs.size() == 2) { - pattern = ng_inputs.at(1); + if (ov_inputs.size() == 2) { + pattern = ov_inputs.at(1); } else { // Added in onnx reshape version 14 special_zero = !node.get_attribute_value("allowzero", 0); diff --git a/src/frontends/onnx/frontend/src/op/resize.cpp b/src/frontends/onnx/frontend/src/op/resize.cpp index d30f5e33a24b01..82f5f0f78c509c 100644 --- a/src/frontends/onnx/frontend/src/op/resize.cpp +++ b/src/frontends/onnx/frontend/src/op/resize.cpp @@ -115,7 +115,7 @@ namespace set_11 { ov::OutputVector resize(const ov::frontend::onnx::Node& node) { // roi input (inputs.at(2)) is ignored because it is used only // in "tf_crop_and_resize" which is not handled now - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto& data = inputs.at(0); auto attrs = get_resize_attrs(node); @@ -134,7 +134,7 @@ ov::OutputVector resize(const ov::frontend::onnx::Node& node) { namespace set_1 { ov::OutputVector resize(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto& data = inputs.at(0); const auto& scales = inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp index 602a534a5e2900..127bab0bc4f148 100644 --- a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp +++ b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp @@ -19,11 +19,11 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector reverse_sequence(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); - const auto sequence_lengths = node.get_ng_inputs().at(1); + const auto sequence_lengths = node.get_ov_inputs().at(1); // OpenVINO supports only int32 type of sequence_lengths - const auto sequence_lengths_i32 = std::make_shared(node.get_ng_inputs().at(1), ov::element::i32); + const auto sequence_lengths_i32 = std::make_shared(node.get_ov_inputs().at(1), ov::element::i32); const auto data_rank = data.get_partial_shape().rank(); const auto batch_axis = node.get_attribute_value("batch_axis", 1); diff --git a/src/frontends/onnx/frontend/src/op/roi_align.cpp b/src/frontends/onnx/frontend/src/op/roi_align.cpp index a32f91c45dedef..3c811defbe0757 100644 --- a/src/frontends/onnx/frontend/src/op/roi_align.cpp +++ b/src/frontends/onnx/frontend/src/op/roi_align.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector roi_align(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "The RoiAlign operator expects 3 inputs. Got: ", inputs.size()); @@ -44,7 +44,7 @@ ov::OutputVector roi_align(const ov::frontend::onnx::Node& node) { } // namespace set_1 namespace set_16 { ov::OutputVector roi_align(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); FRONT_END_GENERAL_CHECK(inputs.size() == 3, "The RoiAlign operator expects 3 inputs. Got: ", inputs.size()); diff --git a/src/frontends/onnx/frontend/src/op/round.cpp b/src/frontends/onnx/frontend/src/op/round.cpp index 379150149cab51..035443b22eb576 100644 --- a/src/frontends/onnx/frontend/src/op/round.cpp +++ b/src/frontends/onnx/frontend/src/op/round.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector round(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), v5::Round::RoundMode::HALF_TO_EVEN)}; + return {std::make_shared(node.get_ov_inputs().at(0), v5::Round::RoundMode::HALF_TO_EVEN)}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/scan.cpp b/src/frontends/onnx/frontend/src/op/scan.cpp index 35a0d0ee6df038..d91c90b047a2ba 100644 --- a/src/frontends/onnx/frontend/src/op/scan.cpp +++ b/src/frontends/onnx/frontend/src/op/scan.cpp @@ -118,7 +118,7 @@ ov::OutputVector import_onnx_scan(const ov::frontend::onnx::Node& node, int64_t default_axis, int64_t in_offset, std::string&& in_directions_attr_name) { - const auto& node_inputs = node.get_ng_inputs(); + const auto& node_inputs = node.get_ov_inputs(); const auto& subgraphs = node.get_subgraphs(); auto body_graph = subgraphs.at("body"); @@ -161,7 +161,7 @@ namespace set_1 { ov::OutputVector scan(const ov::frontend::onnx::Node& node) { // ONNX Scan-8 can have optional `sequence_lens` input, // and sequence scan_input axis is assumed to be always 1. - OPENVINO_ASSERT(ov::op::util::is_null(node.get_ng_inputs().at(0)), + OPENVINO_ASSERT(ov::op::util::is_null(node.get_ov_inputs().at(0)), node.get_description(), " ONNX Scan-8 `sequence_lens` input is not supported. "); return import_onnx_scan(node, 1, 1, "directions"); diff --git a/src/frontends/onnx/frontend/src/op/scatter_elements.cpp b/src/frontends/onnx/frontend/src/op/scatter_elements.cpp index ed53d8357c5003..b7704868049235 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_elements.cpp +++ b/src/frontends/onnx/frontend/src/op/scatter_elements.cpp @@ -15,9 +15,9 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector scatter_elements(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); - const auto indices = node.get_ng_inputs().at(1); - const auto updates = node.get_ng_inputs().at(2); + const auto data = node.get_ov_inputs().at(0); + const auto indices = node.get_ov_inputs().at(1); + const auto updates = node.get_ov_inputs().at(2); const auto axis_node = node.get_attribute_as_constant("axis", 0); v12::ScatterElementsUpdate::Reduction reduction_ov; diff --git a/src/frontends/onnx/frontend/src/op/scatter_nd.cpp b/src/frontends/onnx/frontend/src/op/scatter_nd.cpp index e1563666b10c05..2718ea391d7ed6 100644 --- a/src/frontends/onnx/frontend/src/op/scatter_nd.cpp +++ b/src/frontends/onnx/frontend/src/op/scatter_nd.cpp @@ -18,10 +18,10 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector scatter_nd(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; - auto data = ng_inputs.at(0); - auto indices = ng_inputs.at(1); - auto updates = ng_inputs.at(2); + ov::OutputVector ov_inputs{node.get_ov_inputs()}; + auto data = ov_inputs.at(0); + auto indices = ov_inputs.at(1); + auto updates = ov_inputs.at(2); if (node.has_attribute("reduction")) { const auto reduction = node.get_attribute_value("reduction", "none"); CHECK_VALID_NODE(node, diff --git a/src/frontends/onnx/frontend/src/op/selu.cpp b/src/frontends/onnx/frontend/src/op/selu.cpp index 083b056e41f1cb..3345c7e8c9bcd6 100644 --- a/src/frontends/onnx/frontend/src/op/selu.cpp +++ b/src/frontends/onnx/frontend/src/op/selu.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector selu(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto alpha = node.get_attribute_value("alpha", 1.67326319217681884765625); auto gamma = node.get_attribute_value("gamma", 1.05070102214813232421875); diff --git a/src/frontends/onnx/frontend/src/op/shape.cpp b/src/frontends/onnx/frontend/src/op/shape.cpp index 35ad5d54fcfaeb..e9d87145697b99 100644 --- a/src/frontends/onnx/frontend/src/op/shape.cpp +++ b/src/frontends/onnx/frontend/src/op/shape.cpp @@ -15,7 +15,7 @@ namespace op { namespace set_1 { ov::OutputVector shape(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); return {std::make_shared(data)}; } diff --git a/src/frontends/onnx/frontend/src/op/shrink.cpp b/src/frontends/onnx/frontend/src/op/shrink.cpp index 477c27b683b7aa..61bbd031f41562 100644 --- a/src/frontends/onnx/frontend/src/op/shrink.cpp +++ b/src/frontends/onnx/frontend/src/op/shrink.cpp @@ -21,7 +21,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector shrink(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const float bias = node.get_attribute_value("bias", 0.0f); const float lambd = node.get_attribute_value("lambd", 0.5f); diff --git a/src/frontends/onnx/frontend/src/op/sigmoid.hpp b/src/frontends/onnx/frontend/src/op/sigmoid.hpp index b40398d3110497..4cc334c6034e66 100644 --- a/src/frontends/onnx/frontend/src/op/sigmoid.hpp +++ b/src/frontends/onnx/frontend/src/op/sigmoid.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector sigmoid(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/sign.hpp b/src/frontends/onnx/frontend/src/op/sign.hpp index 88367101dbbf23..4a8ae114b7a30e 100644 --- a/src/frontends/onnx/frontend/src/op/sign.hpp +++ b/src/frontends/onnx/frontend/src/op/sign.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector sign(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/sin.hpp b/src/frontends/onnx/frontend/src/op/sin.hpp index be093dc5e94ad1..741f8a5295018d 100644 --- a/src/frontends/onnx/frontend/src/op/sin.hpp +++ b/src/frontends/onnx/frontend/src/op/sin.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector sin(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/sinh.hpp b/src/frontends/onnx/frontend/src/op/sinh.hpp index 3e0e8fece3c0bb..58c17e38a3021b 100644 --- a/src/frontends/onnx/frontend/src/op/sinh.hpp +++ b/src/frontends/onnx/frontend/src/op/sinh.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector sinh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/size.cpp b/src/frontends/onnx/frontend/src/op/size.cpp index 18c371f1dd2a18..759e7041baa40c 100644 --- a/src/frontends/onnx/frontend/src/op/size.cpp +++ b/src/frontends/onnx/frontend/src/op/size.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector size(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto axes = v0::Constant::create(ov::element::i32, ov::Shape{}, {0}); auto input_shape = std::make_shared(data); return {std::make_shared(input_shape, axes)}; diff --git a/src/frontends/onnx/frontend/src/op/slice.cpp b/src/frontends/onnx/frontend/src/op/slice.cpp index 3b22cfff8d0631..aba0f14b41cbbb 100644 --- a/src/frontends/onnx/frontend/src/op/slice.cpp +++ b/src/frontends/onnx/frontend/src/op/slice.cpp @@ -21,7 +21,7 @@ namespace set_10 { ov::OutputVector slice(const ov::frontend::onnx::Node& node) { using ov::op::util::is_null; - ov::OutputVector inputs{node.get_ng_inputs()}; + ov::OutputVector inputs{node.get_ov_inputs()}; const auto& data = inputs.at(0); const auto& starts = inputs.at(1); const auto& ends = inputs.at(2); @@ -48,7 +48,7 @@ ov::OutputVector slice(const ov::frontend::onnx::Node& node) { namespace set_1 { ov::OutputVector slice(const ov::frontend::onnx::Node& node) { - ov::Output data = node.get_ng_inputs().at(0); + ov::Output data = node.get_ov_inputs().at(0); const auto starts_atr = node.get_attribute_value>("starts"); const auto ends = node.get_attribute_as_constant>("ends"); diff --git a/src/frontends/onnx/frontend/src/op/softmax.cpp b/src/frontends/onnx/frontend/src/op/softmax.cpp index e1b52595677ac1..eb13ca9af0e72e 100644 --- a/src/frontends/onnx/frontend/src/op/softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/softmax.cpp @@ -29,7 +29,7 @@ std::shared_ptr onnx_softmax(const ov::Output data, const in namespace op { namespace set_1 { ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const auto data_rank = data.get_partial_shape().rank(); FRONT_END_GENERAL_CHECK(data_rank.is_static(), "ONNX Softmax data rank needs to be known (static)"); @@ -52,7 +52,7 @@ ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { } // namespace set_1 namespace set_11 { ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const auto data_rank = data.get_partial_shape().rank(); FRONT_END_GENERAL_CHECK(data_rank.is_static(), "ONNX Softmax data rank needs to be known (static)"); @@ -75,7 +75,7 @@ ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { } // namespace set_11 namespace set_13 { ov::OutputVector softmax(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const auto axis = node.get_attribute_value("axis", -1); diff --git a/src/frontends/onnx/frontend/src/op/softplus.cpp b/src/frontends/onnx/frontend/src/op/softplus.cpp index 39175ebe13aecc..3b5d246e6995e7 100644 --- a/src/frontends/onnx/frontend/src/op/softplus.cpp +++ b/src/frontends/onnx/frontend/src/op/softplus.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector softplus(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); return {std::make_shared(data)}; } diff --git a/src/frontends/onnx/frontend/src/op/softsign.cpp b/src/frontends/onnx/frontend/src/op/softsign.cpp index 094ca5c66d39ce..8b7bf672c0daaa 100644 --- a/src/frontends/onnx/frontend/src/op/softsign.cpp +++ b/src/frontends/onnx/frontend/src/op/softsign.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector softsign(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/space_to_depth.cpp b/src/frontends/onnx/frontend/src/op/space_to_depth.cpp index ff7cedbfb60fa2..a286e26355d134 100644 --- a/src/frontends/onnx/frontend/src/op/space_to_depth.cpp +++ b/src/frontends/onnx/frontend/src/op/space_to_depth.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector space_to_depth(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); const auto& shape = data.get_partial_shape(); FRONT_END_GENERAL_CHECK(shape.rank().is_static() && shape.rank().get_length() == 4, "Input must be 4-dimensional"); std::size_t block_size = node.get_attribute_value("blocksize"); diff --git a/src/frontends/onnx/frontend/src/op/split.cpp b/src/frontends/onnx/frontend/src/op/split.cpp index c8349d2ef76e21..e62607bec2c24a 100644 --- a/src/frontends/onnx/frontend/src/op/split.cpp +++ b/src/frontends/onnx/frontend/src/op/split.cpp @@ -16,7 +16,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector split(const ov::frontend::onnx::Node& node) { - const auto input = node.get_ng_inputs().at(0); + const auto input = node.get_ov_inputs().at(0); const auto axis = node.get_attribute_value("axis", 0); if (node.has_attribute("split")) { @@ -32,7 +32,7 @@ ov::OutputVector split(const ov::frontend::onnx::Node& node) { namespace set_13 { ov::OutputVector split(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto axis = node.get_attribute_value("axis", 0); if (inputs.size() < 2) { diff --git a/src/frontends/onnx/frontend/src/op/sqrt.hpp b/src/frontends/onnx/frontend/src/op/sqrt.hpp index 7051a1657613d3..bad982c34059c0 100644 --- a/src/frontends/onnx/frontend/src/op/sqrt.hpp +++ b/src/frontends/onnx/frontend/src/op/sqrt.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector sqrt(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/squeeze.cpp b/src/frontends/onnx/frontend/src/op/squeeze.cpp index ddfb6bcf3456dc..a922c8a98a6596 100644 --- a/src/frontends/onnx/frontend/src/op/squeeze.cpp +++ b/src/frontends/onnx/frontend/src/op/squeeze.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector squeeze(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); const auto axes = node.get_attribute_value>("axes", {}); if (axes.empty()) { @@ -30,7 +30,7 @@ ov::OutputVector squeeze(const ov::frontend::onnx::Node& node) { namespace set_13 { ov::OutputVector squeeze(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); if (inputs.size() < 2) { return {std::make_shared(inputs.at(0))}; } else { diff --git a/src/frontends/onnx/frontend/src/op/stft.cpp b/src/frontends/onnx/frontend/src/op/stft.cpp index 7b3de1d0e209ff..e83feec56c4492 100644 --- a/src/frontends/onnx/frontend/src/op/stft.cpp +++ b/src/frontends/onnx/frontend/src/op/stft.cpp @@ -28,13 +28,13 @@ namespace op { namespace set_17 { ov::OutputVector stft(const ov::frontend::onnx::Node& node) { - const ov::OutputVector ng_inputs{node.get_ng_inputs()}; - auto signal = ng_inputs.at(0); - const auto dft_length_provided = ng_inputs.size() > 3 && !ov::op::util::is_null(ng_inputs[3]); + const ov::OutputVector ov_inputs{node.get_ov_inputs()}; + auto signal = ov_inputs.at(0); + const auto dft_length_provided = ov_inputs.size() > 3 && !ov::op::util::is_null(ov_inputs[3]); const auto onesided = node.get_attribute_value("onesided", 1); const int64_t axis = 1; - const auto& frame_step_node = ng_inputs.at(1); + const auto& frame_step_node = ov_inputs.at(1); CHECK_VALID_NODE(node, ov::op::util::is_constant(frame_step_node.get_node_shared_ptr()) && ov::shape_size(frame_step_node.get_shape()) <= 1, @@ -48,7 +48,7 @@ ov::OutputVector stft(const ov::frontend::onnx::Node& node) { int64_t frame_length = signal_param_shape[axis].get_length() / frame_step; // default value if (dft_length_provided) { - const auto& frame_length_node = ng_inputs[3]; + const auto& frame_length_node = ov_inputs[3]; CHECK_VALID_NODE(node, ov::op::util::is_constant(frame_length_node.get_node_shared_ptr()) && ov::shape_size(frame_length_node.get_shape()) <= 1, @@ -57,15 +57,15 @@ ov::OutputVector stft(const ov::frontend::onnx::Node& node) { ov::as_type_ptr(frame_length_node.get_node_shared_ptr())->cast_vector()[0]; } - const auto window_node_provided = ng_inputs.size() > 2 && !ov::op::util::is_null(ng_inputs[2]); + const auto window_node_provided = ov_inputs.size() > 2 && !ov::op::util::is_null(ov_inputs[2]); if (window_node_provided) { // window input provided - if (ng_inputs[2].get_partial_shape().rank().is_static()) { + if (ov_inputs[2].get_partial_shape().rank().is_static()) { CHECK_VALID_NODE(node, - ng_inputs[2].get_partial_shape().rank().get_length() == 1, + ov_inputs[2].get_partial_shape().rank().get_length() == 1, "The rank of window input must be 1D."); - if (ng_inputs[2].get_partial_shape()[0].is_static()) { + if (ov_inputs[2].get_partial_shape()[0].is_static()) { CHECK_VALID_NODE(node, - ng_inputs[2].get_partial_shape()[0].get_length() == frame_length, + ov_inputs[2].get_partial_shape()[0].get_length() == frame_length, "The length of window input must be equal to frame_length."); } } @@ -106,12 +106,12 @@ ov::OutputVector stft(const ov::frontend::onnx::Node& node) { flatten_slice, is_complex(flatten_slice) ? std::make_shared( // align window shape with signal shape - std::make_shared(ng_inputs[2], + std::make_shared(ov_inputs[2], v0::Constant::create(ov::element::i64, {1}, {1})), std::make_shared(flatten_slice)) - : ng_inputs[2]) + : ov_inputs[2]) : flatten_slice, - dft_length_provided ? ng_inputs[3] : std::make_shared(), + dft_length_provided ? ov_inputs[3] : std::make_shared(), 0, false, onesided == 1); diff --git a/src/frontends/onnx/frontend/src/op/sub.hpp b/src/frontends/onnx/frontend/src/op/sub.hpp index 219e65e649af1e..7118bc47e1e37f 100644 --- a/src/frontends/onnx/frontend/src/op/sub.hpp +++ b/src/frontends/onnx/frontend/src/op/sub.hpp @@ -20,7 +20,7 @@ inline ov::OutputVector sub(const ov::frontend::onnx::Node& node) { namespace set_7 { inline ov::OutputVector sub(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))}; + return {std::make_shared(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))}; } } // namespace set_7 diff --git a/src/frontends/onnx/frontend/src/op/tan.hpp b/src/frontends/onnx/frontend/src/op/tan.hpp index 0ba2456573de66..88e1eceed8f025 100644 --- a/src/frontends/onnx/frontend/src/op/tan.hpp +++ b/src/frontends/onnx/frontend/src/op/tan.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector tan(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/tanh.hpp b/src/frontends/onnx/frontend/src/op/tanh.hpp index eebc01feabc87b..cf28e1baf8c590 100644 --- a/src/frontends/onnx/frontend/src/op/tanh.hpp +++ b/src/frontends/onnx/frontend/src/op/tanh.hpp @@ -13,7 +13,7 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector tanh(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0))}; + return {std::make_shared(node.get_ov_inputs().at(0))}; } } // namespace set_1 diff --git a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp index 25e5ed9049f482..f8e5b0aad60814 100644 --- a/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp +++ b/src/frontends/onnx/frontend/src/op/thresholded_relu.cpp @@ -17,7 +17,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector thresholded_relu(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const double alpha = node.get_attribute_value("alpha", 1.0); const auto alpha_node = v0::Constant::create(data.get_element_type(), ov::Shape{}, {alpha}); diff --git a/src/frontends/onnx/frontend/src/op/tile.cpp b/src/frontends/onnx/frontend/src/op/tile.cpp index 6b6556a1902c5b..0a36d01d862bc1 100644 --- a/src/frontends/onnx/frontend/src/op/tile.cpp +++ b/src/frontends/onnx/frontend/src/op/tile.cpp @@ -16,8 +16,8 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector tile(const ov::frontend::onnx::Node& node) { - auto input = node.get_ng_inputs().at(0); - auto repeats = node.get_ng_inputs().at(1); + auto input = node.get_ov_inputs().at(0); + auto repeats = node.get_ov_inputs().at(1); // Workaround for backends which require repeats to be i64. // Remove the following line when no longer needed. diff --git a/src/frontends/onnx/frontend/src/op/topk.cpp b/src/frontends/onnx/frontend/src/op/topk.cpp index 8104608794d8d3..cc220b49a04086 100644 --- a/src/frontends/onnx/frontend/src/op/topk.cpp +++ b/src/frontends/onnx/frontend/src/op/topk.cpp @@ -11,7 +11,7 @@ namespace { /// \return Return the second input to the TopK node reshaped to a scalar. ov::Output get_k(const ov::frontend::onnx::Node& node) { - auto k_node = node.get_ng_inputs().at(1); + auto k_node = node.get_ov_inputs().at(1); FRONT_END_GENERAL_CHECK(shape_size(k_node.get_shape()) == 1, "ONNX TopK operator: 'K' parameter must contain a single positive value.", node); @@ -30,7 +30,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector topk(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); const auto k_node = node.get_attribute_as_constant("k"); const std::int64_t axis{node.get_attribute_value("axis", -1)}; @@ -47,7 +47,7 @@ ov::OutputVector topk(const ov::frontend::onnx::Node& node) { namespace set_10 { ov::OutputVector topk(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto k = get_k(node); const std::int64_t axis{node.get_attribute_value("axis", -1)}; @@ -65,7 +65,7 @@ ov::OutputVector topk(const ov::frontend::onnx::Node& node) { namespace set_11 { ov::OutputVector topk(const ov::frontend::onnx::Node& node) { // Process inputs - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto k = get_k(node); // Process attributes diff --git a/src/frontends/onnx/frontend/src/op/transpose.cpp b/src/frontends/onnx/frontend/src/op/transpose.cpp index fbf051e7e974bd..9ea28088f884ab 100644 --- a/src/frontends/onnx/frontend/src/op/transpose.cpp +++ b/src/frontends/onnx/frontend/src/op/transpose.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector transpose(const ov::frontend::onnx::Node& node) { - ov::Output data = node.get_ng_inputs().at(0); + ov::Output data = node.get_ov_inputs().at(0); auto permute_axes = node.get_attribute_value>("perm", {}); diff --git a/src/frontends/onnx/frontend/src/op/trilu.cpp b/src/frontends/onnx/frontend/src/op/trilu.cpp index c4207e0f1bb643..30849020945fe9 100644 --- a/src/frontends/onnx/frontend/src/op/trilu.cpp +++ b/src/frontends/onnx/frontend/src/op/trilu.cpp @@ -27,7 +27,7 @@ namespace op { namespace set_1 { ov::OutputVector trilu(const ov::frontend::onnx::Node& node) { - const auto inputs = node.get_ng_inputs(); + const auto inputs = node.get_ov_inputs(); const auto num_inputs = inputs.size(); CHECK_VALID_NODE(node, num_inputs > 0 && num_inputs <= 2, "Trilu expects <= 2 input tensors. Got: ", num_inputs); diff --git a/src/frontends/onnx/frontend/src/op/unique.cpp b/src/frontends/onnx/frontend/src/op/unique.cpp index d3450e41e697ff..035e32940bc102 100644 --- a/src/frontends/onnx/frontend/src/op/unique.cpp +++ b/src/frontends/onnx/frontend/src/op/unique.cpp @@ -14,7 +14,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector unique(const ov::frontend::onnx::Node& node) { - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const bool sorted = node.get_attribute_value("sorted", 1); if (node.has_attribute("axis")) { diff --git a/src/frontends/onnx/frontend/src/op/unsqueeze.cpp b/src/frontends/onnx/frontend/src/op/unsqueeze.cpp index ad2425527834eb..a2a2c53787d0bb 100644 --- a/src/frontends/onnx/frontend/src/op/unsqueeze.cpp +++ b/src/frontends/onnx/frontend/src/op/unsqueeze.cpp @@ -15,7 +15,7 @@ namespace onnx { namespace op { namespace set_1 { ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node) { - auto data = node.get_ng_inputs().at(0); + auto data = node.get_ov_inputs().at(0); auto axes_node = node.get_attribute_as_constant>("axes", {}); return {std::make_shared(data, axes_node)}; } @@ -24,7 +24,7 @@ ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node) { namespace set_13 { ov::OutputVector unsqueeze(const ov::frontend::onnx::Node& node) { - auto inputs = node.get_ng_inputs(); + auto inputs = node.get_ov_inputs(); return {std::make_shared(inputs.at(0), inputs.at(1))}; } diff --git a/src/frontends/onnx/frontend/src/op/upsample.cpp b/src/frontends/onnx/frontend/src/op/upsample.cpp index 5a7f69329c2b34..767d0872cfa859 100644 --- a/src/frontends/onnx/frontend/src/op/upsample.cpp +++ b/src/frontends/onnx/frontend/src/op/upsample.cpp @@ -61,7 +61,7 @@ ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto mode = node.get_attribute_value("mode", "nearest"); check_mode_support(node, mode, version_1); - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); static const std::string expectation{"Input tensor is required to be 4D."}; const auto rank = data.get_partial_shape().rank(); @@ -86,7 +86,7 @@ ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto mode = node.get_attribute_value("mode", "nearest"); check_mode_support(node, mode, version_7); - const auto data = node.get_ng_inputs().at(0); + const auto data = node.get_ov_inputs().at(0); const auto rank = data.get_partial_shape().rank(); CHECK_VALID_NODE(node, @@ -106,7 +106,7 @@ ov::OutputVector upsample(const ov::frontend::onnx::Node& node) { const auto mode = node.get_attribute_value("mode", "nearest"); check_mode_support(node, mode, version_9); - const auto& inputs = node.get_ng_inputs(); + const auto& inputs = node.get_ov_inputs(); return std::make_shared(inputs.at(0), inputs.at(1), get_attributes(mode))->outputs(); } diff --git a/src/frontends/onnx/frontend/src/op/where.hpp b/src/frontends/onnx/frontend/src/op/where.hpp index f867f7ed54266b..57b59f2f95e302 100644 --- a/src/frontends/onnx/frontend/src/op/where.hpp +++ b/src/frontends/onnx/frontend/src/op/where.hpp @@ -13,9 +13,9 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector where(const ov::frontend::onnx::Node& node) { - ov::OutputVector ng_inputs{node.get_ng_inputs()}; + ov::OutputVector ov_inputs{node.get_ov_inputs()}; - return {std::make_shared(ng_inputs.at(0), ng_inputs.at(1), ng_inputs.at(2))}; + return {std::make_shared(ov_inputs.at(0), ov_inputs.at(1), ov_inputs.at(2))}; } } // namespace set_1 } // namespace op diff --git a/src/frontends/onnx/frontend/src/op/xor.hpp b/src/frontends/onnx/frontend/src/op/xor.hpp index 36fc06b7a38cc8..5d40e4e232e948 100644 --- a/src/frontends/onnx/frontend/src/op/xor.hpp +++ b/src/frontends/onnx/frontend/src/op/xor.hpp @@ -13,8 +13,8 @@ namespace onnx { namespace op { namespace set_1 { inline ov::OutputVector logical_xor(const ov::frontend::onnx::Node& node) { - return {std::make_shared(node.get_ng_inputs().at(0), - node.get_ng_inputs().at(1), + return {std::make_shared(node.get_ov_inputs().at(0), + node.get_ov_inputs().at(1), ov::op::AutoBroadcastSpec(ov::op::AutoBroadcastType::NUMPY))}; } diff --git a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp index 0bbcf2dcc22af4..0359e32e02cf59 100644 --- a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp @@ -24,7 +24,7 @@ namespace utils { ArgMinMaxFactory::ArgMinMaxFactory(const Node& node) : m_keep_dims{node.get_attribute_value("keepdims", 1)}, - m_input_node{node.get_ng_inputs().at(0)}, + m_input_node{node.get_ov_inputs().at(0)}, m_axis{node.get_attribute_value("axis", 0)}, m_select_last_index{node.get_attribute_value("select_last_index", 0)} {} diff --git a/src/frontends/onnx/frontend/src/utils/common.cpp b/src/frontends/onnx/frontend/src/utils/common.cpp index a9e9395bedebf4..de997ff168c1cd 100644 --- a/src/frontends/onnx/frontend/src/utils/common.cpp +++ b/src/frontends/onnx/frontend/src/utils/common.cpp @@ -100,8 +100,8 @@ void validate_scalar_input(const char* input_name, template ov::OutputVector handle_opset6_binary_op(const ov::frontend::onnx::Node& node) { - const ov::Output lhs_node = node.get_ng_inputs().at(0); - ov::Output rhs_node = node.get_ng_inputs().at(1); + const ov::Output lhs_node = node.get_ov_inputs().at(0); + ov::Output rhs_node = node.get_ov_inputs().at(1); const bool broadcast = node.get_attribute_value("broadcast", 0); if (broadcast) { if (node.has_attribute("axis")) { diff --git a/src/frontends/onnx/frontend/src/utils/convpool.cpp b/src/frontends/onnx/frontend/src/utils/convpool.cpp index 0458e783ebe2c8..b59fed54385e4f 100644 --- a/src/frontends/onnx/frontend/src/utils/convpool.cpp +++ b/src/frontends/onnx/frontend/src/utils/convpool.cpp @@ -24,7 +24,7 @@ namespace frontend { namespace onnx { namespace convpool { ov::Shape get_kernel_shape(const Node& node) { - const auto& data_shape = node.get_ng_inputs().at(0).get_partial_shape(); + const auto& data_shape = node.get_ov_inputs().at(0).get_partial_shape(); const size_t input_spatial_dims = data_shape.rank().get_length() - 2; return node.get_attribute_value>("kernel_shape", std::vector(input_spatial_dims, 1UL)); } @@ -38,7 +38,7 @@ namespace { /// \return The attribute default value. /// std::vector get_attr_default_value(const Node& node, const std::string& attr_name) { - const auto data_rank = node.get_ng_inputs().at(0).get_partial_shape().rank(); + const auto data_rank = node.get_ov_inputs().at(0).get_partial_shape().rank(); CHECK_VALID_NODE(node, data_rank.is_static(), "If '", attr_name, "' is not provided data rank must be static."); const auto data_spatial_dims = data_rank.get_length() - 2; @@ -126,7 +126,7 @@ std::pair get_pads(const Node& node, const size_ } std::pair get_pads(const Node& node) { - const auto data_rank = node.get_ng_inputs().at(0).get_partial_shape().rank(); + const auto data_rank = node.get_ov_inputs().at(0).get_partial_shape().rank(); CHECK_VALID_NODE(node, data_rank.is_static(), "The rank of node must be static in order to calculate pads"); const auto data_spatial_dims = data_rank.get_length() - 2; diff --git a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp index 13eeedd65c787a..4a0afb5dce8e62 100644 --- a/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/pooling_factory.cpp @@ -39,7 +39,7 @@ std::shared_ptr transposition_axis_order(const ov::Rank& input_ran PoolingFactory::PoolingFactory(const Node& node) : m_onnx_node{node}, - m_inputs{node.get_ng_inputs()}, + m_inputs{node.get_ov_inputs()}, m_kernel_shape(node.get_attribute_value>("kernel_shape")), m_strides{convpool::get_strides(node, m_kernel_shape.size())}, m_dilations{convpool::get_dilations(node, m_kernel_shape.size())}, diff --git a/src/frontends/onnx/frontend/src/utils/recurrent.cpp b/src/frontends/onnx/frontend/src/utils/recurrent.cpp index 0f1f6f1690c0a7..f5c2b6d8098f3b 100644 --- a/src/frontends/onnx/frontend/src/utils/recurrent.cpp +++ b/src/frontends/onnx/frontend/src/utils/recurrent.cpp @@ -29,7 +29,7 @@ namespace frontend { namespace onnx { namespace recurrent { OpInputMap::OpInputMap(const ov::frontend::onnx::Node& node, std::size_t gates_count) { - const auto& ng_inputs = node.get_ng_inputs(); + const auto& ng_inputs = node.get_ov_inputs(); m_map[OpInput::X] = ov::op::util::reorder_axes(ng_inputs.at(0), {1, 0, 2}); m_map[OpInput::W] = ng_inputs.at(1); diff --git a/src/frontends/onnx/frontend/src/utils/variadic.hpp b/src/frontends/onnx/frontend/src/utils/variadic.hpp index 1a6abb0fa02de5..5f5dd373615b52 100644 --- a/src/frontends/onnx/frontend/src/utils/variadic.hpp +++ b/src/frontends/onnx/frontend/src/utils/variadic.hpp @@ -26,7 +26,7 @@ template inline ov::OutputVector make_ng_variadic_op( const Node& node, const ov::op::AutoBroadcastSpec& auto_broadcast = ov::op::AutoBroadcastType::NUMPY) { - const ov::OutputVector ng_inputs{node.get_ng_inputs()}; + const ov::OutputVector ng_inputs{node.get_ov_inputs()}; // Templated binary operation - Creates Add, Minimum, Maximum, etc. const auto binary_operation = [&auto_broadcast](const ov::Output& arg0, From ef16a1a09ae052d37c9a81fbbb5f06f375be915d Mon Sep 17 00:00:00 2001 From: Xuejun Zhai Date: Mon, 5 Feb 2024 05:08:06 +0800 Subject: [PATCH 03/55] [Deprecated API] Remove API set_adding_above() & tensor() with name (#22646) ### Details: - Remove API set_adding_above() - Remove API tensor() with name - *...* ### Tickets: - CVS-106449 Signed-off-by: Zhai, Xuejun --- src/core/include/openvino/core/descriptor/tensor.hpp | 2 -- src/core/include/openvino/op/util/convolution_base.hpp | 4 ---- src/core/include/openvino/op/util/max_pool_base.hpp | 4 ---- src/core/src/descriptor/tensor.cpp | 7 ------- 4 files changed, 17 deletions(-) diff --git a/src/core/include/openvino/core/descriptor/tensor.hpp b/src/core/include/openvino/core/descriptor/tensor.hpp index d7be44f6e025b3..8a37af24710e79 100644 --- a/src/core/include/openvino/core/descriptor/tensor.hpp +++ b/src/core/include/openvino/core/descriptor/tensor.hpp @@ -46,8 +46,6 @@ class OPENVINO_API Tensor { Tensor(const element::Type& element_type, const PartialShape& pshape, const std::unordered_set& names = {}); - OPENVINO_DEPRECATED("This constructor is deprecated. Please use constructor with set of names") - Tensor(const element::Type& element_type, const PartialShape& pshape, const std::string& name); Tensor(const element::Type& element_type, const PartialShape& pshape, Node* node, size_t node_output_number); Tensor(const Tensor&) = delete; diff --git a/src/core/include/openvino/op/util/convolution_base.hpp b/src/core/include/openvino/op/util/convolution_base.hpp index 0681d1a2e8e2b0..920fa17d74b13a 100644 --- a/src/core/include/openvino/op/util/convolution_base.hpp +++ b/src/core/include/openvino/op/util/convolution_base.hpp @@ -65,10 +65,6 @@ class OPENVINO_API ConvolutionBase : public Op { const CoordinateDiff& get_pads_end() const { return m_pads_end; } - OPENVINO_DEPRECATED("This method is deprecated and will be removed soon. Please use set_pads_end instead.") - void set_adding_above(const CoordinateDiff& pads_end) { - set_pads_end(pads_end); - } void set_pads_end(const CoordinateDiff& pads_end) { m_pads_end = pads_end; } diff --git a/src/core/include/openvino/op/util/max_pool_base.hpp b/src/core/include/openvino/op/util/max_pool_base.hpp index 4e8d9937ea57ac..e633c364a0bc3c 100644 --- a/src/core/include/openvino/op/util/max_pool_base.hpp +++ b/src/core/include/openvino/op/util/max_pool_base.hpp @@ -58,10 +58,6 @@ class OPENVINO_API MaxPoolBase : public Op { const Shape& get_pads_end() const { return m_pads_end; } - OPENVINO_DEPRECATED("This method is deprecated and will be removed soon. Please use set_pads_end instead.") - void set_adding_above(const Shape& pads_end) { - m_pads_end = pads_end; - } void set_pads_end(Shape pads_end); /// \return The pad type for pooling. diff --git a/src/core/src/descriptor/tensor.cpp b/src/core/src/descriptor/tensor.cpp index 18c9fd3ff18f96..062a740bbd80b6 100644 --- a/src/core/src/descriptor/tensor.cpp +++ b/src/core/src/descriptor/tensor.cpp @@ -17,13 +17,6 @@ ov::descriptor::Tensor::Tensor(const element::Type& element_type, set_names(names); } -ov::descriptor::Tensor::Tensor(const element::Type& element_type, const PartialShape& pshape, const std::string& name) - : m_element_type(element_type), - m_partial_shape(pshape), - m_shape_changed(true) { - m_name_it = m_names.cend(); -} - ov::descriptor::Tensor::Tensor(const element::Type& element_type, const PartialShape& pshape, ov::Node* node, From a986e255b76220d5a7433242fbacd3620649c8de Mon Sep 17 00:00:00 2001 From: River Li Date: Mon, 5 Feb 2024 05:09:19 +0800 Subject: [PATCH 04/55] Minor update (#22637) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- src/plugins/intel_cpu/src/compiled_model.cpp | 2 -- src/plugins/intel_cpu/src/plugin.cpp | 2 -- .../tests/functional/custom/behavior/ov_plugin/properties.cpp | 2 -- .../include/shared_test_classes/base/layer_test_utils.hpp | 1 - 4 files changed, 7 deletions(-) diff --git a/src/plugins/intel_cpu/src/compiled_model.cpp b/src/plugins/intel_cpu/src/compiled_model.cpp index 7c754a56930cb2..da7798847d03c3 100644 --- a/src/plugins/intel_cpu/src/compiled_model.cpp +++ b/src/plugins/intel_cpu/src/compiled_model.cpp @@ -187,7 +187,6 @@ ov::Any CompiledModel::get_property(const std::string& name) const { }; if (name == ov::supported_properties) { - OPENVINO_SUPPRESS_DEPRECATED_START return std::vector{ RO_property(ov::supported_properties.name()), RO_property(ov::model_name.name()), @@ -208,7 +207,6 @@ ov::Any CompiledModel::get_property(const std::string& name) const { RO_property(ov::log::level.name()), RO_property(ov::intel_cpu::sparse_weights_decompression_rate.name()), }; - OPENVINO_SUPPRESS_DEPRECATED_END } if (name == ov::model_name) { diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index a899f277e73d72..9002ebab4cae30 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -707,7 +707,6 @@ ov::Any Engine::get_ro_property(const std::string& name, const ov::AnyMap& optio RO_property(ov::device::architecture.name()), }; // the whole config is RW before model is loaded. - OPENVINO_SUPPRESS_DEPRECATED_START std::vector rwProperties {RW_property(ov::num_streams.name()), RW_property(ov::affinity.name()), RW_property(ov::inference_num_threads.name()), @@ -724,7 +723,6 @@ ov::Any Engine::get_ro_property(const std::string& name, const ov::AnyMap& optio RW_property(ov::log::level.name()), RW_property(ov::intel_cpu::sparse_weights_decompression_rate.name()), }; - OPENVINO_SUPPRESS_DEPRECATED_END std::vector supportedProperties; supportedProperties.reserve(roProperties.size() + rwProperties.size()); diff --git a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp index 11de096fc0f26f..3b758f928e0871 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/behavior/ov_plugin/properties.cpp @@ -197,12 +197,10 @@ TEST_F(OVClassConfigTestCPU, smoke_PluginSetConfigHintInferencePrecision) { ASSERT_NO_THROW(value = ie.get_property("CPU", ov::hint::inference_precision)); ASSERT_EQ(value, forcedPrecision); - OPENVINO_SUPPRESS_DEPRECATED_START const auto forced_precision_deprecated = ov::element::f32; ASSERT_NO_THROW(ie.set_property("CPU", ov::hint::inference_precision(forced_precision_deprecated))); ASSERT_NO_THROW(value = ie.get_property("CPU", ov::hint::inference_precision)); ASSERT_EQ(value, forced_precision_deprecated); - OPENVINO_SUPPRESS_DEPRECATED_END } TEST_F(OVClassConfigTestCPU, smoke_PluginSetConfigEnableProfiling) { diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp index cb14a2f97467ab..a23e1be0e84943 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp @@ -11,7 +11,6 @@ #include "common_test_utils/test_common.hpp" #include "common_test_utils/data_utils.hpp" #include "functional_test_utils/crash_handler.hpp" -// #include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/skip_tests_config.hpp" #include "functional_test_utils/summary/environment.hpp" #include "functional_test_utils/summary/op_summary.hpp" From be4fb164176a0c956ce0eab28a097cacf5cb5543 Mon Sep 17 00:00:00 2001 From: Andrew Kwangwoong Park Date: Mon, 5 Feb 2024 13:50:00 +0900 Subject: [PATCH 05/55] [GPU] Add SwiGLU internal op, related transformation, primitive, and kernel for SwiGLU decomposition fusion (#22523) ### Details: - The main models of LLMs use `SwiGLU(Swish-Gated Linear Unit)` instead of `ReLU` for FFN. and it's necessary to fuse SwiGLU decomposition with SwiGLU internal op - Add internal SwiGLU op and related transformation which fuse SwiGLU decomposition with SwiGLU activation op - Add primitive, kernel selector, and kernel for SwiGLU activation - Add subgraph func test and unit tests for SwiGLU activation ### Tickets: - 128820 --------- Signed-off-by: Andrew Park --- .../intel_gpu/include/intel_gpu/op/swiglu.hpp | 53 ++++++++ .../intel_gpu/plugin/primitives_list.hpp | 1 + .../include/intel_gpu/primitives/swiglu.hpp | 67 ++++++++++ .../src/graph/impls/ocl/register.cpp | 1 + .../src/graph/impls/ocl/register.hpp | 2 + .../intel_gpu/src/graph/impls/ocl/swiglu.cpp | 79 +++++++++++ .../intel_gpu/src/graph/include/swiglu_inst.h | 42 ++++++ src/plugins/intel_gpu/src/graph/swiglu.cpp | 69 ++++++++++ .../cl_kernels/swiglu_gpu_ref.cl | 43 ++++++ .../src/kernel_selector/common_types.h | 1 + .../kernels/swiglu/swiglu_kernel_ref.cpp | 115 ++++++++++++++++ .../kernels/swiglu/swiglu_kernel_ref.h | 42 ++++++ .../kernels/swiglu/swiglu_kernel_selector.cpp | 14 ++ .../kernels/swiglu/swiglu_kernel_selector.h | 23 ++++ .../intel_gpu/src/plugin/ops/swiglu.cpp | 48 +++++++ .../src/plugin/transformations/op/swiglu.cpp | 64 +++++++++ .../plugin/transformations/swiglu_fusion.cpp | 94 +++++++++++++ .../plugin/transformations/swiglu_fusion.hpp | 19 +++ .../src/plugin/transformations_pipeline.cpp | 2 + .../subgraph_tests/dynamic/swiglu_fusion.cpp | 123 ++++++++++++++++++ .../tests/unit/test_cases/swiglu_gpu_test.cpp | 91 +++++++++++++ .../transformations/swiglu_fusion_test.cpp | 97 ++++++++++++++ 22 files changed, 1090 insertions(+) create mode 100644 src/plugins/intel_gpu/include/intel_gpu/op/swiglu.hpp create mode 100644 src/plugins/intel_gpu/include/intel_gpu/primitives/swiglu.hpp create mode 100644 src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp create mode 100644 src/plugins/intel_gpu/src/graph/include/swiglu_inst.h create mode 100644 src/plugins/intel_gpu/src/graph/swiglu.cpp create mode 100644 src/plugins/intel_gpu/src/kernel_selector/cl_kernels/swiglu_gpu_ref.cl create mode 100644 src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.cpp create mode 100644 src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.h create mode 100644 src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.cpp create mode 100644 src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.h create mode 100644 src/plugins/intel_gpu/src/plugin/ops/swiglu.cpp create mode 100644 src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp create mode 100644 src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.cpp create mode 100644 src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.hpp create mode 100644 src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/swiglu_fusion.cpp create mode 100644 src/plugins/intel_gpu/tests/unit/test_cases/swiglu_gpu_test.cpp create mode 100644 src/plugins/intel_gpu/tests/unit/transformations/swiglu_fusion_test.cpp diff --git a/src/plugins/intel_gpu/include/intel_gpu/op/swiglu.hpp b/src/plugins/intel_gpu/include/intel_gpu/op/swiglu.hpp new file mode 100644 index 00000000000000..249bfff3287184 --- /dev/null +++ b/src/plugins/intel_gpu/include/intel_gpu/op/swiglu.hpp @@ -0,0 +1,53 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/op/op.hpp" + +namespace ov { +namespace intel_gpu { +namespace op { + +/// \brief Operator performing Swish Gated Linear Unit Activation +/// This operation performs gated linear unit activation that combines swish activation function +class SwiGLU : public ov::op::Op { +public: + OPENVINO_OP("SwiGLU", "gpu_opset"); + + SwiGLU() = default; + /// \brief Constructs an SwiGLU operation. + /// + /// \param data Input tensor with data + /// \param axis The index of an axis in "data" along which to perform the split + /// \param split_lenghts A list containing the sizes of each output tensor along the split "axis" + /// \param output_type Output element type + SwiGLU(const Output& data, + int64_t axis, + int64_t split_lengths, + const ov::element::Type output_type = ov::element::undefined); + + bool visit_attributes(ov::AttributeVisitor& visitor) override; + + void validate_and_infer_types() override; + + std::shared_ptr clone_with_new_inputs(const ov::OutputVector& new_args) const override; + + int64_t get_axis() const { return m_axis; } + int64_t get_split_lengths() const { return m_split_lengths; } + + void set_axis(int64_t axis) { m_axis = axis; } + void set_split_lengths(int64_t split_lengths) { m_split_lengths = split_lengths; } + +private: + int64_t m_axis; + int64_t m_split_lengths; + ov::element::Type m_output_type; +}; + +std::vector shape_infer(const SwiGLU* op, std::vector input_shapes); + +} // namespace op +} // namespace intel_gpu +} // namespace ov diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/primitives_list.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/primitives_list.hpp index 75bf7f51c19000..af0497c0e9d5d4 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/plugin/primitives_list.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/primitives_list.hpp @@ -276,3 +276,4 @@ REGISTER_FACTORY(internal, GatherCompressed); REGISTER_FACTORY(internal, KVCache); REGISTER_FACTORY(internal, ReadValue); REGISTER_FACTORY(internal, Gemm); +REGISTER_FACTORY(internal, SwiGLU); diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/swiglu.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/swiglu.hpp new file mode 100644 index 00000000000000..6602f9ddd18aeb --- /dev/null +++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/swiglu.hpp @@ -0,0 +1,67 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once +#include "primitive.hpp" + +namespace cldnn { + +/// @brief Swish Gated Linear Unit Activation primitive +/// @details Performs gated linear unit activation that combines swish activation function +struct swiglu : public primitive_base { + CLDNN_DECLARE_PRIMITIVE(swiglu); + + swiglu() : primitive_base("", {}) {} + + /// @brief Constructs swiglu primitive + /// @param id This primitive id + /// @param input Input primitive id + /// @param axis The index of an axis in data along which to perform the split + /// @param split_lengths A list containing the sizes of each output tensor along the split axis + /// @param output_size Output data size of the primitive + swiglu(const primitive_id& id, + const input_info& input, + const int64_t& axis, + const int64_t& split_lengths, + const tensor output_size, + const padding& output_padding = padding()) + : primitive_base(id, {input}, {output_padding}), + axis(axis), + split_lengths(split_lengths), + output_size(output_size) {} + + int64_t axis; + int64_t split_lengths; + tensor output_size; + + size_t hash() const override { + size_t seed = primitive::hash(); + seed = hash_combine(seed, axis); + seed = hash_combine(seed, split_lengths); + return seed; + } + + bool operator==(const primitive& rhs) const override { + if (!compare_common_params(rhs)) + return false; + + auto rhs_casted = downcast(rhs); + return axis == rhs_casted.axis && split_lengths == rhs_casted.split_lengths; + } + + void save(BinaryOutputBuffer& ob) const override { + primitive_base::save(ob); + ob << axis; + ob << split_lengths; + ob << output_size; + } + + void load(BinaryInputBuffer& ib) override { + primitive_base::load(ib); + ib >> axis; + ib >> split_lengths; + ib >> output_size; + } +}; +} // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/register.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/register.cpp index bb2dba327f15b7..856195f32b43c5 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/register.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/register.cpp @@ -79,6 +79,7 @@ void register_implementations() { REGISTER_OCL(space_to_depth); REGISTER_OCL(slice); REGISTER_OCL(strided_slice); + REGISTER_OCL(swiglu); REGISTER_OCL(tile); REGISTER_OCL(gather_tree); REGISTER_OCL(resample); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/register.hpp b/src/plugins/intel_gpu/src/graph/impls/ocl/register.hpp index 6c27c72dc4caae..e338d638e438f3 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/register.hpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/register.hpp @@ -68,6 +68,7 @@ #include "intel_gpu/primitives/softmax.hpp" #include "intel_gpu/primitives/space_to_batch.hpp" #include "intel_gpu/primitives/strided_slice.hpp" +#include "intel_gpu/primitives/swiglu.hpp" #include "intel_gpu/primitives/tile.hpp" #include "intel_gpu/primitives/non_zero.hpp" #include "intel_gpu/primitives/eye.hpp" @@ -157,6 +158,7 @@ REGISTER_OCL(softmax); REGISTER_OCL(space_to_batch); REGISTER_OCL(space_to_depth); REGISTER_OCL(strided_slice); +REGISTER_OCL(swiglu); REGISTER_OCL(tile); REGISTER_OCL(gather_tree); REGISTER_OCL(resample); diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp new file mode 100644 index 00000000000000..5e628ff50a6656 --- /dev/null +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp @@ -0,0 +1,79 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "primitive_base.hpp" +#include "validation_util.hpp" + +#include "swiglu_inst.h" +#include "swiglu/swiglu_kernel_selector.h" +#include "swiglu/swiglu_kernel_ref.h" + +namespace cldnn { +namespace ocl { + +struct swiglu_impl : typed_primitive_impl_ocl { + using parent = typed_primitive_impl_ocl; + using parent::parent; + using kernel_selector_t = kernel_selector::swiglu_kernel_selector; + using kernel_params_t = std::pair; + + DECLARE_OBJECT_TYPE_SERIALIZATION(cldnn::ocl::swiglu_impl); + + std::unique_ptr clone() const override { + return make_unique(*this); + } + + void load(BinaryInputBuffer& ib) override { + parent::load(ib); + if (is_dynamic()) { + auto& kernel_selector = kernel_selector_t::Instance(); + auto kernel_impl = kernel_selector.GetImplementation(_kernel_data.kernelName); + kernel_impl->GetUpdateDispatchDataFunc(_kernel_data); + } + } + + static kernel_params_t get_kernel_params(const kernel_impl_params& impl_param, bool is_shape_agnostic = false) { + const auto& primitive = impl_param.typed_desc(); + auto params = get_default_params(impl_param, is_shape_agnostic); + auto optional_params = get_default_optional_params(impl_param.get_program()); + + auto rank = impl_param.get_input_layout(0).get_partial_shape().rank(); + params.axis = ov::util::normalize(primitive->axis, rank.get_length()); + params.split_length = primitive->split_lengths; + + return {params, optional_params}; + } + + void update_dispatch_data(const kernel_impl_params& impl_param) override { + auto kernel_params = get_kernel_params(impl_param, true); + (_kernel_data.update_dispatch_data_func)(kernel_params.first, _kernel_data); + } +}; + +namespace detail { + +attach_swiglu_impl::attach_swiglu_impl() { + auto types = { + data_types::f32, + data_types::f16 + }; + + auto formats = { + format::bfyx, + format::bfzyx + }; + + implementation_map::add(impl_types::ocl, + shape_types::any, + typed_primitive_impl_ocl::create, + types, + formats); +} + +} // namespace detail +} // namespace ocl +} // namespace cldnn + +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::swiglu_impl) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::swiglu) diff --git a/src/plugins/intel_gpu/src/graph/include/swiglu_inst.h b/src/plugins/intel_gpu/src/graph/include/swiglu_inst.h new file mode 100644 index 00000000000000..6a5ce08dc54bd2 --- /dev/null +++ b/src/plugins/intel_gpu/src/graph/include/swiglu_inst.h @@ -0,0 +1,42 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once +#include "intel_gpu/primitives/swiglu.hpp" +#include "primitive_inst.h" + +#include + +namespace cldnn { + +template <> +struct typed_program_node : public typed_program_node_base { + using parent = typed_program_node_base; + +public: + using parent::parent; + + program_node& input(size_t index = 0) const { return get_dependency(index); } + std::vector get_shape_infer_dependencies() const override { return {}; } +}; + +using swiglu_node = typed_program_node; + +template <> +class typed_primitive_inst : public typed_primitive_inst_base { + using parent = typed_primitive_inst_base; + using parent::parent; + +public: + template + static std::vector calc_output_layouts(swiglu_node const& /*node*/, const kernel_impl_params& impl_params); + static layout calc_output_layout(swiglu_node const& node, kernel_impl_params const& impl_params); + static std::string to_string(swiglu_node const& node); + + typed_primitive_inst(network& network, swiglu_node const& node); +}; + +using swiglu_inst = typed_primitive_inst; + +} // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/swiglu.cpp b/src/plugins/intel_gpu/src/graph/swiglu.cpp new file mode 100644 index 00000000000000..c3d36e15684610 --- /dev/null +++ b/src/plugins/intel_gpu/src/graph/swiglu.cpp @@ -0,0 +1,69 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "intel_gpu/op/swiglu.hpp" +#include "swiglu_inst.h" + +#include "primitive_type_base.h" +#include "json_object.h" +#include + +namespace cldnn { +GPU_DEFINE_PRIMITIVE_TYPE_ID(swiglu); + +layout swiglu_inst::calc_output_layout(swiglu_node const& node, kernel_impl_params const& impl_param) { + auto desc = impl_param.typed_desc(); + auto input_layout = impl_param.get_input_layout(); + auto output_type = impl_param.desc->output_data_types[0].value_or(input_layout.data_type); + auto output_format = input_layout.format; + + return layout(output_type, output_format, desc->output_size); +} + +template +std::vector swiglu_inst::calc_output_layouts(swiglu_node const& /*node*/, const kernel_impl_params& impl_param) { + auto desc = impl_param.typed_desc(); + auto input_layout = impl_param.get_input_layout(); + auto output_type = impl_param.desc->output_data_types[0].value_or(input_layout.data_type); + auto output_format = input_layout.format; + + ov::intel_gpu::op::SwiGLU op; + op.set_axis(desc->axis); + op.set_split_lengths(desc->split_lengths); + + std::vector input_shapes = { + impl_param.get_input_layout(0).get(), + ShapeType(ov::Shape({})), + ShapeType(ov::Shape{2}) + }; + + std::vector output_shapes = shape_infer(&op, input_shapes); + + return { layout(output_shapes[0], output_type, output_format) }; +} + +template std::vector swiglu_inst::calc_output_layouts(swiglu_node const& node, + const kernel_impl_params& impl_param); + +std::string swiglu_inst::to_string(swiglu_node const& node) { + auto desc = node.get_primitive(); + auto node_info = node.desc_to_json(); + auto& input = node.input(); + + std::stringstream primitive_description; + + json_composite swiglu_info; + swiglu_info.add("input_id", input.id()); + swiglu_info.add("axis", desc->axis); + swiglu_info.add("split_lengths", desc->split_lengths); + + node_info->add("swiglu_info", swiglu_info); + node_info->dump(primitive_description); + + return primitive_description.str(); +} + +swiglu_inst::typed_primitive_inst(network& network, swiglu_node const& node) : parent(network, node) {} + +} // namespace cldnn diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/swiglu_gpu_ref.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/swiglu_gpu_ref.cl new file mode 100644 index 00000000000000..a943a6e101cea1 --- /dev/null +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/swiglu_gpu_ref.cl @@ -0,0 +1,43 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "include/batch_headers/fetch_data.cl" + +KERNEL(swiglu_gpu_ref)( + OPTIONAL_SHAPE_INFO_ARG + const __global INPUT0_TYPE* input, + __global OUTPUT_TYPE* output) +{ +#if OUTPUT_DIMS == 5 + uint data_idx = (uint)get_global_id(GWS_YX); + const uint x = data_idx % OUTPUT_SIZE_X; + data_idx = data_idx / OUTPUT_SIZE_X; + const uint y = data_idx % OUTPUT_SIZE_Y; + data_idx = data_idx / OUTPUT_SIZE_Y; + const uint z = data_idx % OUTPUT_SIZE_Z; +#else // 2D spatial + const uint x = (uint)get_global_id(GWS_YX) % OUTPUT_SIZE_X; + const uint y = (uint)get_global_id(GWS_YX) / OUTPUT_SIZE_X; +#endif + const uint f = (uint)get_global_id(GWS_FEATURE); + const uint b = (uint)get_global_id(GWS_BATCH); + +#if OUTPUT_DIMS == 5 + const uint output_idx = OUTPUT_GET_INDEX(b, f, z, y, x); + const uint gate_idx = INPUT0_GET_INDEX(b, f, z, y, x); + const uint input_idx = INPUT0_GET_INDEX(b, f, z, y, x) + SPLIT_LENGTH; +#else // 2D spatial + const uint output_idx = OUTPUT_GET_INDEX(b, f, y, x); + const uint gate_idx = INPUT0_GET_INDEX(b, f, y, x); + const uint input_idx = INPUT0_GET_INDEX(b, f, y, x) + SPLIT_LENGTH; +#endif + + ACCUMULATOR_TYPE res = ACCUMULATOR_VAL_ZERO; + + res = (ACCUMULATOR_TYPE)input[gate_idx]; + res /= ACCUMULATOR_VAL_ONE + exp(-(ACCUMULATOR_VAL_ONE * res)); + res *= (ACCUMULATOR_TYPE)input[input_idx]; + + output[output_idx] = TO_OUTPUT_TYPE(res); +} diff --git a/src/plugins/intel_gpu/src/kernel_selector/common_types.h b/src/plugins/intel_gpu/src/kernel_selector/common_types.h index 2b6f7be857be8c..0f026a77ae855c 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/common_types.h +++ b/src/plugins/intel_gpu/src/kernel_selector/common_types.h @@ -94,6 +94,7 @@ enum class KernelType { UNIQUE_COUNT, UNIQUE_GATHER, RMS, + SWIGLU, }; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.cpp new file mode 100644 index 00000000000000..fac86e7b2135aa --- /dev/null +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.cpp @@ -0,0 +1,115 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "swiglu_kernel_ref.h" +#include "kernel_selector_utils.h" +#include + +namespace kernel_selector { +ParamsKey SwiGLUKernelRef::GetSupportedKey() const { + ParamsKey k; + k.EnableInputDataType(Datatype::F16); + k.EnableInputDataType(Datatype::F32); + k.EnableOutputDataType(Datatype::F16); + k.EnableOutputDataType(Datatype::F32); + k.EnableInputLayout(DataLayout::bfyx); + k.EnableInputLayout(DataLayout::bfzyx); + k.EnableOutputLayout(DataLayout::bfyx); + k.EnableOutputLayout(DataLayout::bfzyx); + k.EnableTensorOffset(); + k.EnableTensorPitches(); + k.EnableBatching(); + k.EnableDifferentTypes(); + k.EnableDynamicShapesSupport(); + return k; +} + +JitConstants SwiGLUKernelRef::GetJitConstants(const swiglu_params& params) const { + JitConstants jit = MakeBaseParamsJitConstants(params); + + jit.AddConstants({MakeJitConstant("AXIS", params.axis)}); + jit.AddConstants({MakeJitConstant("SPLIT_LENGTH", params.split_length)}); + jit.Merge(MakeTypeJitConstants(GetAccumulatorType(params), "ACCUMULATOR")); + jit.Merge(GetTensorFriendlyWorkGroupsJit(params.outputs[0])); + + return jit; +} + +CommonDispatchData SwiGLUKernelRef::SetDefault(const swiglu_params& params) const { + CommonDispatchData dispatchData; + + dispatchData.gws = GetTensorFriendlyWorkGroups(params.outputs[0]); + dispatchData.lws = GetOptimalLocalWorkGroupSizes(dispatchData.gws, params.engineInfo); + + return dispatchData; +} + +void SwiGLUKernelRef::GetUpdateDispatchDataFunc(KernelData& kd) const { + kd.update_dispatch_data_func = [this](const Params& params, KernelData& kd) { + const auto& prim_params = static_cast(params); + auto dispatchData = SetDefault(prim_params); + OPENVINO_ASSERT(kd.kernels.size() == 1, "[GPU] Invalid kernels size for update dispatch data func"); + kd.kernels[0].params.workGroups.global = dispatchData.gws; + kd.kernels[0].params.workGroups.local = dispatchData.lws; + kd.kernels[0].skip_execution = KernelData::SkipKernelExecution(prim_params); + }; +} + +KernelsData SwiGLUKernelRef::GetKernelsData(const Params& params, const optional_params& options) const { + assert(params.GetType() == KernelType::SWIGLU); + + if (!Validate(params, options)) + return {}; + + const swiglu_params& orgParams = static_cast(params); + auto dispatchData = SetDefault(orgParams); + + KernelData kd = KernelData::Default(params); + + auto cldnn_jit = GetJitConstants(orgParams); + auto entry_point = GetEntryPoint(kernelName, orgParams.layerID, params, options); + auto jit = CreateJit(kernelName, cldnn_jit, entry_point); + + GetUpdateDispatchDataFunc(kd); + + auto& kernel = kd.kernels[0]; + FillCLKernelData(kernel, + dispatchData, + params.engineInfo, + kernelName, + jit, + entry_point, + EXE_MODE_DEFAULT, + false, + false, + 1, + GetFusedPrimitiveInputsCount(params), + 1, + orgParams.has_dynamic_tensors()); + + return {kd}; +} + +KernelsPriority SwiGLUKernelRef::GetKernelsPriority(const Params& /*params*/, const optional_params& /*options*/) const { + return DONT_USE_IF_HAVE_SOMETHING_ELSE; +} + +Datatype SwiGLUKernelRef::GetAccumulatorType(const swiglu_params& params) const { + Datatype types[] = { Datatype::F32, Datatype::F16, Datatype::INT64, Datatype::INT32, Datatype::UINT32}; + + for (Datatype type : types) + for (auto& in : params.inputs) + if (in.GetDType() == type) + return type; + + return Datatype::F32; +} + +bool SwiGLUKernelRef::Validate(const Params& params, const optional_params& options) const { + if (!KernelBaseOpenCL::Validate(params, options)) + return false; + + return true; +} +} // namespace kernel_selector diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.h b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.h new file mode 100644 index 00000000000000..b4b5e4cac87be7 --- /dev/null +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_ref.h @@ -0,0 +1,42 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "kernel_base_opencl.h" + +namespace kernel_selector { +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// swiglu_params +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +struct swiglu_params : public base_params { + swiglu_params() : base_params(KernelType::SWIGLU), axis(0), split_length(0) {} + int32_t axis; + int32_t split_length; +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// swiglu_optional_params +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +struct swiglu_optional_params : optional_params { + swiglu_optional_params() : optional_params(KernelType::SWIGLU) {} +}; + +class SwiGLUKernelRef : public KernelBaseOpenCL { +public: + SwiGLUKernelRef() : KernelBaseOpenCL("swiglu_gpu_ref") {} + virtual ~SwiGLUKernelRef() {} + + virtual JitConstants GetJitConstants(const swiglu_params& params) const; + virtual CommonDispatchData SetDefault(const swiglu_params& params) const; + KernelsData GetKernelsData(const Params& params, const optional_params& options) const override; + KernelsPriority GetKernelsPriority(const Params& params, const optional_params& options) const override; + Datatype GetAccumulatorType(const swiglu_params& params) const; + ParamsKey GetSupportedKey() const override; + +protected: + bool Validate(const Params&, const optional_params&) const override; + void GetUpdateDispatchDataFunc(KernelData& kd) const override; +}; +} // namespace kernel_selector diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.cpp new file mode 100644 index 00000000000000..0287f7c1ae4ddc --- /dev/null +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "swiglu_kernel_selector.h" +#include "swiglu_kernel_ref.h" + +namespace kernel_selector { +swiglu_kernel_selector::swiglu_kernel_selector() { Attach(); } + +KernelsData swiglu_kernel_selector::GetBestKernels(const Params& params, const optional_params& options) const { + return GetNaiveBestKernel(params, options, KernelType::SWIGLU); +} +} // namespace kernel_selector diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.h b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.h new file mode 100644 index 00000000000000..a245a49d11f783 --- /dev/null +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/swiglu/swiglu_kernel_selector.h @@ -0,0 +1,23 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "kernel_selector.h" + +namespace kernel_selector { +class swiglu_kernel_selector : public kernel_selector_base { +public: + static swiglu_kernel_selector& Instance() { + static swiglu_kernel_selector instance_; + return instance_; + } + + swiglu_kernel_selector(); + + virtual ~swiglu_kernel_selector() {} + + KernelsData GetBestKernels(const Params& params, const optional_params& options) const override; +}; +} // namespace kernel_selector diff --git a/src/plugins/intel_gpu/src/plugin/ops/swiglu.cpp b/src/plugins/intel_gpu/src/plugin/ops/swiglu.cpp new file mode 100644 index 00000000000000..def2a52d281de2 --- /dev/null +++ b/src/plugins/intel_gpu/src/plugin/ops/swiglu.cpp @@ -0,0 +1,48 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "intel_gpu/op/swiglu.hpp" +#include "intel_gpu/plugin/program_builder.hpp" +#include "intel_gpu/plugin/common_utils.hpp" +#include "intel_gpu/primitives/swiglu.hpp" + +namespace ov { +namespace op { +namespace internal { +using SwiGLU = ov::intel_gpu::op::SwiGLU; +} // namespace internal +} // namespace op +} // namespace ov + +namespace ov { +namespace intel_gpu { + +static void CreateSwiGLUOp(ProgramBuilder& p, const std::shared_ptr& op) { + validate_inputs_count(op, {1}); + auto inputs = p.GetInputInfo(op); + std::string primitive_name = layer_type_name_ID(op); + + if (p.use_new_shape_infer()) { + auto prim = cldnn::swiglu(primitive_name, + inputs[0], + op->get_axis(), + op->get_split_lengths(), + cldnn::tensor()); + prim.output_data_types = get_output_data_types(op); + p.add_primitive(*op, prim); + } else { + auto prim = cldnn::swiglu(primitive_name, + inputs[0], + op->get_axis(), + op->get_split_lengths(), + tensor_from_dims(op->get_output_shape(0))); + prim.output_data_types = get_output_data_types(op); + p.add_primitive(*op, prim); + } +} + +REGISTER_FACTORY_IMPL(internal, SwiGLU); + +} // namespace intel_gpu +} // namespace ov diff --git a/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp b/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp new file mode 100644 index 00000000000000..e2d87fae0a24ba --- /dev/null +++ b/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp @@ -0,0 +1,64 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "intel_gpu/op/swiglu.hpp" +#include "validation_util.hpp" +#include "variadic_split_shape_inference.hpp" +#include "openvino/core/partial_shape.hpp" +#include "openvino/op/variadic_split.hpp" + +namespace ov { +namespace intel_gpu { +namespace op { + +SwiGLU::SwiGLU(const Output& data, + int64_t axis, + int64_t split_lengths, + const ov::element::Type output_type) + : Op({data}), m_axis(axis), m_split_lengths(split_lengths), m_output_type(output_type) { + validate_and_infer_types(); +} + +bool SwiGLU::visit_attributes(ov::AttributeVisitor& visitor) { + visitor.on_attribute("axis", m_axis); + visitor.on_attribute("split_lengths", m_split_lengths); + visitor.on_attribute("output_type", m_output_type); + return true; +} + +void SwiGLU::validate_and_infer_types() { + auto output_type = m_output_type == ov::element::undefined ? get_input_element_type(0) : m_output_type; + + std::vector input_shapes = { + get_input_partial_shape(0), + ov::PartialShape(ov::Shape{}), + ov::PartialShape(ov::Shape{2}) + }; + + set_output_type(0, output_type, shape_infer(this, input_shapes)[0]); +} + +std::shared_ptr SwiGLU::clone_with_new_inputs(const ov::OutputVector& new_args) const { + check_new_args_count(this, new_args); + return std::make_shared(new_args.at(0), + m_axis, + m_split_lengths, + m_output_type); +} + +std::vector shape_infer(const SwiGLU* op, std::vector input_shapes) { + ov::op::v1::VariadicSplit variadic_split; + std::vector axis = { op->get_axis() }; + std::vector split_lengths = { op->get_split_lengths(), -1 }; + + std::unordered_map const_data; + const_data.emplace(1, ov::Tensor(ov::element::i64, ov::Shape{}, static_cast(axis.data()))); + const_data.emplace(2, ov::Tensor(ov::element::i64, ov::Shape{split_lengths.size()}, static_cast(split_lengths.data()))); + + return ov::op::v1::shape_infer(&variadic_split, input_shapes, ov::make_tensor_accessor(const_data)); +} + +} // namespace op +} // namespace intel_gpu +} // namespace ov diff --git a/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.cpp b/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.cpp new file mode 100644 index 00000000000000..1307cd5f71c1f3 --- /dev/null +++ b/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.cpp @@ -0,0 +1,94 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "swiglu_fusion.hpp" + +#include "intel_gpu/op/swiglu.hpp" + +#include "openvino/core/rt_info.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/swish.hpp" +#include "openvino/op/variadic_split.hpp" +#include "openvino/pass/pattern/op/wrap_type.hpp" +#include "transformations/utils/utils.hpp" + +namespace ov { +namespace intel_gpu { + +SwiGLUFusion::SwiGLUFusion() { + using namespace ov::pass::pattern; + + auto last_dim_static = [](const ov::Output& output) { + auto out_ps = output.get_node()->get_output_partial_shape(0); + return out_ps.rank().is_static() && out_ps[out_ps.rank().get_length() - 1].is_static() && out_ps.size() <= 5; + }; + + // Detect SwiGLU decomposition pattern + // SwiGLU(Xw, Xv, beta) = (Xw * (1.0 + exp(-beta * Xw))) * Xv + auto data_m = any_input(last_dim_static); + + // VariadicSplit(X, axis, split_lengths) = Xw, Xv + auto axis_const_m = wrap_type(); + auto split_lengths_const_m = wrap_type(); + auto variadic_split_m = wrap_type({data_m, axis_const_m, split_lengths_const_m}); + variadic_split_m->set_output_size(2); + + // Swish(Xw) = Xw * (1.0 + exp(-beta * Xw)) + auto swish_m = wrap_type({variadic_split_m->output(0)}); + + // Mul(Xw, Xv) = Swish(Xw) * Xv + auto mul_m = wrap_type({swish_m, variadic_split_m->output(1)}); + + ov::matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { + const auto& pattern_map = m.get_pattern_value_map(); + OPENVINO_ASSERT(pattern_map.count(mul_m)); + OPENVINO_ASSERT(pattern_map.count(swish_m)); + OPENVINO_ASSERT(pattern_map.count(variadic_split_m)); + OPENVINO_ASSERT(pattern_map.count(split_lengths_const_m)); + OPENVINO_ASSERT(pattern_map.count(axis_const_m)); + auto mul = std::dynamic_pointer_cast(pattern_map.at(mul_m).get_node_shared_ptr()); + if (!mul || transformation_callback(mul)) + return false; + if (mul->input_value(1).get_index() != 1) + return false; + + auto variadic_split = std::dynamic_pointer_cast(pattern_map.at(variadic_split_m).get_node_shared_ptr()); + auto variadic_split_in_ps = variadic_split->get_input_partial_shape(0); + auto last_dim = variadic_split_in_ps.rank().get_length() - 1; + + auto axis = std::dynamic_pointer_cast(pattern_map.at(axis_const_m).get_node_shared_ptr()); + bool valid_axis_const_values = ov::op::util::has_constant_value(axis, -1) || + ov::op::util::has_constant_value(axis, last_dim); + if (!valid_axis_const_values) + return false; + auto axis_value = axis->cast_vector()[0]; + + auto split_lengths = std::dynamic_pointer_cast(pattern_map.at(split_lengths_const_m).get_node_shared_ptr()); + auto split_lengths_value = split_lengths->cast_vector()[0]; + // Allow only case that exactly splits in half along the last dimension + auto split_length = variadic_split_in_ps[last_dim].get_length() / 2; + if (split_lengths_value != split_length) + return false; + + auto data = pattern_map.at(data_m); + auto output_type = m.get_match_root()->get_output_element_type(0); + + auto swiglu = std::make_shared(data, + axis_value, + split_lengths_value, + output_type); + swiglu->set_friendly_name(m.get_match_root()->get_friendly_name()); + ov::copy_runtime_info(m.get_matched_nodes(), swiglu); + ov::replace_node(m.get_match_root(), swiglu); + + return true; + }; + + auto m = std::make_shared(mul_m, "SwiGLUFusion"); + this->register_matcher(m, callback); +} + +} // namespace intel_gpu +} // namespace ov diff --git a/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.hpp b/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.hpp new file mode 100644 index 00000000000000..fa0d86e7175490 --- /dev/null +++ b/src/plugins/intel_gpu/src/plugin/transformations/swiglu_fusion.hpp @@ -0,0 +1,19 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#pragma once + +#include "openvino/pass/graph_rewrite.hpp" + +namespace ov { +namespace intel_gpu { + +class SwiGLUFusion : public ov::pass::MatcherPass { +public: + OPENVINO_RTTI("SwiGLUFusion", "0"); + SwiGLUFusion(); +}; + +} // namespace intel_gpu +} // namespace ov diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index 1e90482984d169..f6b3e9ffda7830 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -125,6 +125,7 @@ #include "plugin/transformations/fc_convert_fusion.hpp" #include "plugin/transformations/clamp_fp16_output.hpp" #include "plugin/transformations/transpose_matmul_fusion.hpp" +#include "plugin/transformations/swiglu_fusion.hpp" #include "transformations/low_precision/mark_dequantization_subgraph.hpp" #include "low_precision/pull_reshape_through_dequantization.hpp" @@ -705,6 +706,7 @@ void TransformationsPipeline::apply(std::shared_ptr func) { manager.register_pass(); if (!device_info.supports_immad) manager.register_pass(); + manager.register_pass(); // This is supposed to be the last pass to ensure that we don't have name collisions until // GPU plugin stops using friendly names for program creation diff --git a/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/swiglu_fusion.cpp b/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/swiglu_fusion.cpp new file mode 100644 index 00000000000000..3b209010fe7961 --- /dev/null +++ b/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/swiglu_fusion.cpp @@ -0,0 +1,123 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/ov_tensor_utils.hpp" +#include "common_test_utils/file_utils.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/swish.hpp" +#include "openvino/op/variadic_split.hpp" + +namespace { +using ov::test::InputShape; + +using SwiGLUFusionParams = std::tuple, // input shapes + ov::element::Type>; // input precision + +class SwiGLUFusion : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(testing::TestParamInfo obj) { + std::vector input_shapes; + ov::element::Type input_precision; + + std::tie(input_shapes, input_precision) = obj.param; + + std::ostringstream result; + result << "IS=("; + for (const auto& shape : input_shapes) { + result << ov::test::utils::partialShape2str({shape.first}) << "_"; + } + result << ")_TS="; + for (const auto& shape : input_shapes) { + result << "("; + if (!shape.second.empty()) { + auto itr = shape.second.begin(); + do { + result << ov::test::utils::vec2str(*itr); + } while (++itr != shape.second.end() && result << "_"); + } + result << ")_"; + } + result << "input_precision=" << input_precision; + return result.str(); + } + +protected: + std::shared_ptr init_subgraph(std::vector& input_shapes, + const ov::Shape& target_shape, + const ov::element::Type input_precision) { + ov::ParameterVector params{std::make_shared(input_precision, input_shapes[0])}; + + // VariadicSplit(X, axis, split_lengths) = Xw, Xv + auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {-1}); + auto split_lengths_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {48, -1}); + auto variadic_split = std::make_shared(params[0], axis_const, split_lengths_const); + + // Swish(Xw) = Xw * (1.0 + exp(-beta * Xw)) + auto swish = std::make_shared(variadic_split->output(0)); + + // Mul(Xw, Xv) = Swish(Xw) * Xv + auto mul = std::make_shared(swish, variadic_split->output(1)); + + return std::make_shared(ov::NodeVector{mul}, params, "SwiGLUFusion"); + } + + void SetUp() override { + targetDevice = ov::test::utils::DEVICE_GPU; + + std::vector input_shapes; + ov::element::Type input_precision; + + std::tie(input_shapes, input_precision) = GetParam(); + + init_input_shapes(input_shapes); + + inType = outType = input_precision; + + function = init_subgraph(inputDynamicShapes, targetStaticShapes.front().front(), input_precision); + } +}; + +TEST_P(SwiGLUFusion, Inference) { + run(); +} + +TEST_P(SwiGLUFusion, Inference_cached) { + std::stringstream ss; + ss << "gpu_model_cache_" << std::hash{}( + std::string(::testing::UnitTest::GetInstance()->current_test_info()->test_suite_name()) + + std::string(::testing::UnitTest::GetInstance()->current_test_info()->name())); + std::string cacheDirName = ss.str(); + { + ov::test::utils::removeFilesWithExt(cacheDirName, "blob"); + ov::test::utils::removeFilesWithExt(cacheDirName, "cl_cache"); + ov::test::utils::removeDir(cacheDirName); + core->set_property(ov::cache_dir(cacheDirName)); + compile_model(); + } + { + run(); + ov::test::utils::removeFilesWithExt(cacheDirName, "blob"); + ov::test::utils::removeFilesWithExt(cacheDirName, "cl_cache"); + ov::test::utils::removeDir(cacheDirName); + } +} + +const std::vector input_precisions = {ov::element::f32, ov::element::f16}; + +const std::vector> input_shapes_dyn = { + {{{-1, -1, 96}, {{20, 1, 96}}}}, + {{{-1, -1, -1}, {{1, 1, 96}}}}, +}; + +INSTANTIATE_TEST_SUITE_P(smoke_SwiGLUFusion_basic, + SwiGLUFusion, + ::testing::Combine(::testing::ValuesIn(input_shapes_dyn), + ::testing::ValuesIn(input_precisions)), + SwiGLUFusion::getTestCaseName); +} // namespace diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/swiglu_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/swiglu_gpu_test.cpp new file mode 100644 index 00000000000000..c2ac561127046a --- /dev/null +++ b/src/plugins/intel_gpu/tests/unit/test_cases/swiglu_gpu_test.cpp @@ -0,0 +1,91 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "test_utils.h" + +#include +#include +#include +#include "swiglu_inst.h" + +using namespace cldnn; +using namespace ::tests; + +class swiglu_gpu_test : public ::testing::TestWithParam {}; + +template +void swiglu_ref(const memory::ptr input, memory::ptr output, int32_t split_length) { + auto input_layout = input->get_layout(); + auto output_layout = output->get_layout(); + + uint32_t batch_size = output_layout.batch(); + uint32_t feature_size = output_layout.feature(); + uint32_t y_size = output_layout.spatial(1); + uint32_t x_size = output_layout.spatial(0); + + cldnn::mem_lock src(input, get_test_stream()); + cldnn::mem_lock dst(output, get_test_stream()); + + T res; + for (uint32_t b = 0; b < batch_size; ++b) { + for (uint32_t f = 0; f < feature_size; ++f) { + for (uint32_t y = 0; y < y_size; ++y) { + for (uint32_t x = 0; x < x_size; ++x) { + auto tensor_src = tensor(batch(b), feature(f), spatial(x, y, 0, 0)); + auto tensor_dst = tensor(batch(b), feature(f), spatial(x, y, 0, 0)); + size_t src_offset = input_layout.get_linear_offset(tensor_src); + size_t dst_offset = output_layout.get_linear_offset(tensor_dst); + res = src[src_offset]; + res = (res / (static_cast(1) + (std::exp((-(static_cast(1) * res)))))); + res *= src[src_offset + static_cast(split_length)]; + dst[dst_offset] = res; + } + } + } + } +} + +TEST(swiglu_gpu_test, swiglu_test_bfyx_dyn) { + auto& engine = get_test_engine(); + + auto input_layout_dynamic = layout{ov::PartialShape{ov::Dimension::dynamic(), ov::Dimension::dynamic(), 6}, + data_types::f32, format::bfyx}; + auto input_mem = engine.allocate_memory({ov::PartialShape{2, 1, 6}, data_types::f32, format::bfyx}); + auto output_ref = engine.allocate_memory({ov::PartialShape{2, 1, 3}, data_types::f32, format::bfyx}); + + set_values(input_mem, { + 0.049011f, 0.000260f, -0.176636f, 0.016098f, 0.279297f, 0.036377f, + -0.127686f, 0.066650f, -0.394043f, -0.135620f, 0.040985f, -0.011589f + }); + + swiglu_ref(input_mem, output_ref, 3); + + topology topology; + topology.add(input_layout("input", input_layout_dynamic)); + topology.add(swiglu("swiglu", input_info("input"), -1, 3, tensor())); + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); + + network network(engine, topology, config); + + network.set_input_data("input", input_mem); + + auto inst = network.get_primitive("swiglu"); + auto impl = inst->get_impl(); + ASSERT_TRUE(impl != nullptr); + ASSERT_TRUE(impl->is_dynamic()); + + auto outputs = network.execute(); + ASSERT_EQ(outputs.size(), size_t(1)); + ASSERT_EQ(outputs.begin()->first, "swiglu"); + + auto output = outputs.begin()->second.get_memory(); + cldnn::mem_lock output_ptr(output, get_test_stream()); + cldnn::mem_lock output_ref_ptr(output_ref, get_test_stream()); + + for (unsigned int i = 0; i < output_ref->count(); ++i) { + EXPECT_NEAR(output_ptr[i], output_ref_ptr[i], 1e-3); + } +} diff --git a/src/plugins/intel_gpu/tests/unit/transformations/swiglu_fusion_test.cpp b/src/plugins/intel_gpu/tests/unit/transformations/swiglu_fusion_test.cpp new file mode 100644 index 00000000000000..6b87a791bdf1e3 --- /dev/null +++ b/src/plugins/intel_gpu/tests/unit/transformations/swiglu_fusion_test.cpp @@ -0,0 +1,97 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include +#include + +#include +#include +#include "common_test_utils/ov_test_utils.hpp" +#include + +#include + +#include "openvino/op/constant.hpp" +#include "openvino/op/multiply.hpp" +#include "openvino/op/parameter.hpp" +#include "openvino/op/swish.hpp" +#include "openvino/op/variadic_split.hpp" +#include "intel_gpu/op/swiglu.hpp" + +using namespace testing; +using namespace ov::intel_gpu; + +TEST_F(TransformationTestsF, SwiGLUFusionTest1) { + { + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ 2, 1, 6 }); + auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {-1}); + auto split_lengths_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {3, -1}); + auto variadic_split = std::make_shared(input, axis_const, split_lengths_const); + auto swish = std::make_shared(variadic_split->output(0)); + auto mul = std::make_shared(swish, variadic_split->output(1)); + + model = std::make_shared(ov::NodeVector{mul}, ov::ParameterVector{input}); + manager.register_pass(); + } + { + int64_t axis = -1; + int64_t split_lenghts = 3; + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ 2, 1, 6 });; + auto swiglu = std::make_shared(input, axis, split_lenghts, ov::element::f16); + + model_ref = std::make_shared(ov::NodeVector{swiglu}, ov::ParameterVector{input}); + } +} + +TEST_F(TransformationTestsF, SwiGLUFusionTest2) { + { + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ -1, -1, 6 }); + auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {0}); + auto split_lengths_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {3, 3}); + auto variadic_split = std::make_shared(input, axis_const, split_lengths_const); + auto swish = std::make_shared(variadic_split->output(0)); + auto mul = std::make_shared(swish, variadic_split->output(1)); + + model = std::make_shared(ov::NodeVector{mul}, ov::ParameterVector{input}); + manager.register_pass(); + } +} + +TEST_F(TransformationTestsF, SwiGLUFusionTest3) { + { + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ -1, -1, 6 }); + auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {-1}); + auto split_lengths_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {3, -1}); + auto variadic_split = std::make_shared(input, axis_const, split_lengths_const); + auto swish = std::make_shared(variadic_split->output(0)); + auto mul = std::make_shared(swish, variadic_split->output(1)); + + model = std::make_shared(ov::NodeVector{mul}, ov::ParameterVector{input}); + manager.register_pass(); + } + { + int64_t axis = -1; + int64_t split_lenghts = 3; + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ -1, -1, 6 }); + auto swiglu = std::make_shared(input, axis, split_lenghts, ov::element::f16); + + model_ref = std::make_shared(ov::NodeVector{swiglu}, ov::ParameterVector{input}); + } +} + +TEST_F(TransformationTestsF, SwiGLUFusionTest4) { + { + auto input = std::make_shared(ov::element::f16, ov::PartialShape{ -1, -1, 6 }); + auto axis_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{}, {-1}); + auto split_lengths_const = ov::op::v0::Constant::create(ov::element::i64, ov::Shape{2}, {3, -1}); + auto variadic_split = std::make_shared(input, axis_const, split_lengths_const); + auto swish = std::make_shared(variadic_split->output(0)); + auto mul = std::make_shared(swish, variadic_split->output(0)); + + model = std::make_shared(ov::NodeVector{mul}, ov::ParameterVector{input}); + manager.register_pass(); + } +} From 8129b7e0e3db2dbd025fbf6a4e1b9c120e0e13b7 Mon Sep 17 00:00:00 2001 From: Luo Cheng Date: Mon, 5 Feb 2024 14:25:39 +0800 Subject: [PATCH 06/55] [CPU] SDPA supports Mixtral (#22615) ### Details: - *SDPA supports Mixtral multi-query pattern* - *...* ### Tickets: - *[129812](https://jira.devtools.intel.com/browse/CVS-129812)* --- .../common/pass/stateful_sdpa_fusion.cpp | 45 +++++-------- .../transformations/state_concat_sdpa.cpp | 67 +++++++++++++++++-- 2 files changed, 78 insertions(+), 34 deletions(-) diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.cpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.cpp index be08b6660785d8..6489a2947afa82 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.cpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.cpp @@ -55,16 +55,26 @@ StatefulSDPAFusion::StatefulSDPAFusion() { auto multi_query_bcst = [](std::shared_ptr kv) { auto reshape_kv = wrap_type({kv, any_input()}); - auto unsqueeze_kv = makePattern({kv, -2}); - auto multiply_kv = wrap_type({reshape_kv | unsqueeze_kv, any_input()}); + auto unsqueeze_kv = makePattern({kv, any_input()}); + + auto check_one = [] (Output output) -> bool { + auto node = std::dynamic_pointer_cast(output.get_node_shared_ptr()); + const auto& bcst_arg = node->cast_vector(); + return std::all_of(bcst_arg.begin(), bcst_arg.end(), [](float i) { + return i == 1.0f; + }); + }; + auto constant_bcst = wrap_type(check_one); + + auto computed_bcst = makePattern({wrap_type(check_one), + any_input(), any_input()}, {{"mode", "numpy"}}); + + auto multiply_kv = wrap_type({reshape_kv | unsqueeze_kv, constant_bcst | computed_bcst}); return wrap_type({multiply_kv, any_input()}); }; - auto k_bcst = multi_query_bcst(concat_k); - auto v_bcst = multi_query_bcst(concat_v); - - auto present_k = concat_k | k_bcst; - auto present_v = concat_v | v_bcst; + auto present_k = concat_k | multi_query_bcst(concat_k); + auto present_v = concat_v | multi_query_bcst(concat_v); // canonical q/k/v shape definition: [B,H,...L,S] auto sdp0 = makePattern({cur_q, present_k, present_v}); @@ -98,7 +108,7 @@ StatefulSDPAFusion::StatefulSDPAFusion() { auto find_assign = [&](const ov::Output& out, opset6::Assign*& assign, opset1::Convert*& cvt) { auto present_to = out.get_target_inputs(); - if (present_to.size() != 2) + if (present_to.size() < 2) return false; for (auto& to : present_to) { auto to_node = to.get_node(); @@ -136,25 +146,6 @@ StatefulSDPAFusion::StatefulSDPAFusion() { if (!check_valid_children_type(past_k_node) || !check_valid_children_type(past_v_node)) { return false; } - // check whether multi-query's bcst has valid parameter. - auto check_bcst = [](const std::shared_ptr& ptr) { - const auto multiply = ptr->get_input_node_shared_ptr(0); - const auto constant_node = ov::as_type_ptr(multiply->get_input_node_shared_ptr(1)); - if (!constant_node) - return false; - const auto& bcst_arg = constant_node->cast_vector(); - return std::all_of(bcst_arg.begin(), bcst_arg.end(), [](float i) { - return i == 1.0; - }); - }; - - if (pattern_map.count(k_bcst) && !check_bcst(pattern_map.at(k_bcst).get_node_shared_ptr())) { - return false; - } - - if (pattern_map.count(v_bcst) && !check_bcst(pattern_map.at(v_bcst).get_node_shared_ptr())) { - return false; - } const auto concat_k_node = ov::as_type_ptr(pattern_map.at(concat_k).get_node_shared_ptr()); const auto concat_v_node = ov::as_type_ptr(pattern_map.at(concat_v).get_node_shared_ptr()); diff --git a/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp b/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp index ffa562ba4d86a1..f899ee3191fb0c 100644 --- a/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp +++ b/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp @@ -13,25 +13,33 @@ #include #include #include +#include #include #include "common_test_utils/ov_test_utils.hpp" +#include "utils/gen_pattern.hpp" +#include "utils/print_model.hpp" using namespace testing; -using namespace ov::intel_cpu; using namespace ov; +using namespace ov::intel_cpu; +using namespace ov::gen_pattern; -static std::shared_ptr makeSDPA(const ov::PartialShape& inputShape, bool isRef = false, bool hasConvert = false) { +static std::shared_ptr makeSDPA(const ov::PartialShape& inputShape, bool isRef = false, bool hasConvert = false, bool hasMultiquery = false) { auto q = std::make_shared(element::f32, inputShape); - auto k = std::make_shared(element::f32, inputShape); - auto v = std::make_shared(element::f32, inputShape); + auto kvInputShape = inputShape; + if (hasMultiquery) { + kvInputShape[1] = inputShape[1] / 4; + } + auto k = std::make_shared(element::f32, kvInputShape); + auto v = std::make_shared(element::f32, kvInputShape); auto init = std::make_shared(element::f32, inputShape); auto beam_idx = std::make_shared(element::i32, ov::PartialShape{-1}); auto var_k = std::make_shared( - ov::op::util::VariableInfo{inputShape, element::f32, "pastk"}); + ov::op::util::VariableInfo{kvInputShape, element::f32, "pastk"}); std::shared_ptr pastk = std::make_shared(k, var_k); auto var_v = std::make_shared( - ov::op::util::VariableInfo{inputShape, element::f32, "pastv"}); + ov::op::util::VariableInfo{kvInputShape, element::f32, "pastv"}); std::shared_ptr pastv = std::make_shared(v, var_v); Output concatK, concatV, sdp; if (hasConvert) { @@ -50,7 +58,31 @@ static std::shared_ptr makeSDPA(const ov::PartialShape& inputShape, b pastv = std::make_shared(pastv, beam_idx, op::v0::Constant::create(element::i32, {1}, {0})); concatK = std::make_shared(OutputVector{pastk, k}, 2); concatV = std::make_shared(OutputVector{pastv, v}, 2); - sdp = std::make_shared(q, concatK, concatV, false); + if (hasMultiquery) { + auto make_multi_query = [&] (const Output& conat) { + auto beam_idx_shape = makeOP>({beam_idx}, + {{"type_relax", true}, {"input_data_types", {}}, {"output_data_types", {element::i32}}}); + auto unsqueeze_concat = makeOP({conat, 2}); + auto concat_shape = makeOP>( + {conat}, + {{"type_relax", true}, {"input_data_types", {}}, {"output_data_types", {element::i32}}}); + auto gather_ls = makeOP({concat_shape, {2, 3}, 0}, {{"batch_dims", 0}}); + auto expected_group_shape = makeOP({beam_idx_shape, {inputShape[1] / 4}, {4}, gather_ls}, {{"axis", 0}}); + auto expand_Abs = makeOP({expected_group_shape}); + auto axis_mapping = makeConst(element::u8, ov::Shape({}), 0); + auto expand_ones = makeOP({{1.0f}, + expand_Abs, + axis_mapping}, {{"mode", "numpy"}}); + auto expand_Broadcast = makeOP({unsqueeze_concat, + expand_ones}, {{"auto_broadcast", "numpy"}}); + auto expected_shape = makeOP({beam_idx_shape, {inputShape[1]}, gather_ls}, {{"axis", 0}}); + auto reshape_Reshape = makeOP({expand_Broadcast, expected_shape}, {{"special_zero", false}}); + return reshape_Reshape; + }; + sdp = std::make_shared(q, make_multi_query(concatK), make_multi_query(concatV), false); + } else { + sdp = std::make_shared(q, concatK, concatV, false); + } } if (hasConvert) { concatK = std::make_shared(concatK, element::f32); @@ -106,3 +138,24 @@ TEST(TransformationTests, StateConcatSDPAWithConvert) { ASSERT_TRUE(res.first) << res.second; } } + +TEST(TransformationTests, StateConcatSDPAMixtral) { + std::shared_ptr f(nullptr), f_ref(nullptr); + { + using namespace ov; + auto inputShape = ov::PartialShape{-1, 32, -1, 64}; + { + f = makeSDPA(inputShape, false, false, true); + pass::Manager m; + m.register_pass(); + m.register_pass(); + m.run_passes(f); + } + //construct ref interaction + { + f_ref = makeSDPA(inputShape, true, false, true); + } + auto res = compare_functions(f, f_ref); + ASSERT_TRUE(res.first) << res.second; + } +} From b09026c83d9a8670562006da5d8c596e071ddb43 Mon Sep 17 00:00:00 2001 From: Katarzyna Mitrus Date: Mon, 5 Feb 2024 07:29:53 +0100 Subject: [PATCH 07/55] [Spec] Align order of scaling formula in FakeConvert spec (#22539) ### Details: - Aligned formula of scaling in FakeConvert spec with the [POC](https://github.com/andreyanufr/openvino/blob/57d566070997e6a6194bfa48323f9854327d0def/src/core/src/op/convert_fp8.cpp#L429-L436) by @andreyanufr and reference implementation: https://github.com/openvinotoolkit/openvino/blob/cb679a73c9959c05e2c1ad0e01b12d13d71771a9/src/core/reference/include/openvino/reference/fake_convert.hpp#L43 - Aligned with: https://github.com/openvinotoolkit/openvino/pull/22433 - It was described in the reversed order unintentionally ### Tickets: - N/A --- .../operations_specifications/quantization/FakeConvert_13.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/quantization/FakeConvert_13.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/quantization/FakeConvert_13.rst index d58eefc16f3983..93e56c4b4ce2a2 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/quantization/FakeConvert_13.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/quantization/FakeConvert_13.rst @@ -29,9 +29,9 @@ Each element of the output is defined as the result of the following expression: .. code-block:: py :force: - data = (data + shift) / scale - ConvertLike(Convert(data, destination_type), data) data = data * scale - shift + ConvertLike(Convert(data, destination_type), data) + data = (data + shift) / scale **Attributes** From a13e752042b5658564b958a5facca2321a95681b Mon Sep 17 00:00:00 2001 From: Zhang Yi Date: Mon, 5 Feb 2024 14:30:31 +0800 Subject: [PATCH 08/55] [CPU]protect import model with header check (#22293) ### Details: - *Check model header validity in `ModelDeserializer`* - *Header's data has intra-dependency, if number not match, throw exception* ### Tickets: - *CVS-126392* --- src/plugins/intel_cpu/src/serialize.cpp | 15 +++++++++++++++ .../src/behavior/compiled_model/import_export.cpp | 12 +++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_cpu/src/serialize.cpp b/src/plugins/intel_cpu/src/serialize.cpp index 0b91061684e741..4453854fb0754b 100644 --- a/src/plugins/intel_cpu/src/serialize.cpp +++ b/src/plugins/intel_cpu/src/serialize.cpp @@ -55,9 +55,24 @@ void ModelDeserializer::operator>>(std::shared_ptr& model) { std::string xmlString; ov::Tensor dataBlob; + // get file size before seek content + // blob from cache may have other header, skip it + const size_t _pos = _istream.tellg(); + _istream.seekg(0, _istream.end); + const size_t file_size = _istream.tellg(); + _istream.seekg(_pos, _istream.beg); + StreamSerialize::DataHeader hdr = {}; _istream.read(reinterpret_cast(&hdr), sizeof hdr); + // check if model header contains valid data + bool isValidModel = (hdr.custom_data_offset == sizeof(hdr) + _pos) && + (hdr.custom_data_size == hdr.consts_offset - hdr.custom_data_offset) && + (hdr.consts_size == hdr.model_offset - hdr.consts_offset) && + (hdr.model_size = file_size - hdr.model_offset); + if (!isValidModel) { + OPENVINO_THROW("Failed to read CPU device xml header"); + } // read model input/output precisions _istream.seekg(hdr.custom_data_offset); diff --git a/src/tests/functional/plugin/shared/src/behavior/compiled_model/import_export.cpp b/src/tests/functional/plugin/shared/src/behavior/compiled_model/import_export.cpp index 074100be73cc2b..72be0c6bcbb0b0 100644 --- a/src/tests/functional/plugin/shared/src/behavior/compiled_model/import_export.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/compiled_model/import_export.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifcorer: Apache-2.0 // - +#include #include "behavior/compiled_model/import_export.hpp" #include "common_test_utils/ov_test_utils.hpp" @@ -298,6 +298,16 @@ TEST_P(OVClassCompiledModelImportExportTestP, smoke_ImportNetworkNoThrowWithDevi OV_ASSERT_NO_THROW(executableNetwork.create_infer_request()); } +TEST_P(OVClassCompiledModelImportExportTestP, smoke_ImportNetworkThrowWithDeviceName) { + SKIP_IF_CURRENT_TEST_IS_DISABLED(); + ov::Core ie = createCoreWithTemplate(); + std::stringstream wrongStm; + // Import model with wrong format throws exception + OV_EXPECT_THROW((ie.import_model(wrongStm, target_device)), + ov::Exception, + testing::HasSubstr("device xml header")); +} + // // GetRuntimeModel // From d97525745c5e333fdded345f2dbe80f8e27c9237 Mon Sep 17 00:00:00 2001 From: Sun Xiaoxia Date: Mon, 5 Feb 2024 15:59:51 +0800 Subject: [PATCH 09/55] Change parameters of executor config into private (#22414) ### Details: - Refactor executor config structure: 1.Change some properties into private. Related PR should be changed in [openvino_contrib PR856](https://github.com/openvinotoolkit/openvino_contrib/pull/856) 2.Suggest setting executor config property by `ov::threading::IStreamsExecutor::Config()` constructor. 3.Update make_default_multi_threaded() based on MT 2.0 - Threading property migration to OV API 2.0 ([PR#21487](https://github.com/openvinotoolkit/openvino/pull/21487)) ### Tickets: - *130373* --- .../openvino/runtime/internal_properties.hpp | 20 +- .../runtime/threading/istreams_executor.hpp | 239 ++-- .../dev/threading/cpu_streams_executor.cpp | 236 +--- .../src/dev/threading/executor_manager.cpp | 43 +- .../src/dev/threading/istreams_executor.cpp | 638 +++------ .../src/dev/threading/thread_affinity.cpp | 15 +- .../src/dev/threading/thread_affinity.hpp | 3 +- src/inference/src/os/lin/lin_system_conf.cpp | 16 + src/inference/src/system_conf.cpp | 23 - .../tests/unit/executor_config_test.cpp | 1146 +++++++++++++++++ .../unit/make_default_multi_threaded_test.cpp | 153 +++ .../unit/update_executor_config_test.cpp | 163 --- src/plugins/intel_cpu/src/compiled_model.cpp | 25 +- src/plugins/intel_cpu/src/config.cpp | 85 +- src/plugins/intel_cpu/src/config.h | 6 + .../intel_cpu/src/cpu_streams_calculation.cpp | 45 +- .../intel_cpu/src/cpu_streams_calculation.hpp | 10 - src/plugins/intel_cpu/src/plugin.cpp | 284 +--- src/plugins/intel_cpu/src/plugin.h | 6 +- .../transformation_pipeline.cpp | 2 +- .../single_layer_tests/eltwise.cpp | 2 +- .../unit/streams_info/streams_e2e_test.cpp | 15 +- src/plugins/intel_gpu/src/graph/program.cpp | 25 +- .../intel_gpu/src/plugin/compiled_model.cpp | 5 +- .../tests/unit/passes/kernels_cache_test.cpp | 3 +- .../test_cases/multiple_streams_gpu_test.cpp | 3 +- src/plugins/template/src/compiled_model.cpp | 2 +- src/plugins/template/src/config.cpp | 56 +- src/plugins/template/src/config.hpp | 3 + src/plugins/template/src/plugin.cpp | 14 +- 30 files changed, 1911 insertions(+), 1375 deletions(-) create mode 100644 src/inference/tests/unit/executor_config_test.cpp create mode 100644 src/inference/tests/unit/make_default_multi_threaded_test.cpp delete mode 100644 src/inference/tests/unit/update_executor_config_test.cpp diff --git a/src/inference/dev_api/openvino/runtime/internal_properties.hpp b/src/inference/dev_api/openvino/runtime/internal_properties.hpp index 5250609306a523..a9e42e03fa54e7 100644 --- a/src/inference/dev_api/openvino/runtime/internal_properties.hpp +++ b/src/inference/dev_api/openvino/runtime/internal_properties.hpp @@ -43,29 +43,11 @@ static constexpr Property exclusive_async_requests */ static constexpr Property config_device_id{"CONFIG_DEVICE_ID"}; -/** - * @brief The name for setting CPU affinity per thread option. - * - * It is passed to Core::get_property() - * - * The following options are implemented only for the TBB as a threading option - * ov::threading::IStreamsExecutor::ThreadBindingType::NUMA (pinning threads to NUMA nodes, best for real-life, - * contented cases) on the Windows and MacOS* this option behaves as YES - * ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE (let the runtime to do pinning to the cores types, - * e.g. prefer the "big" cores for latency tasks) on the hybrid CPUs this option is default - * - * Also, the settings are ignored, if the OpenVINO compiled with OpenMP and any affinity-related OpenMP's - * environment variable is set (as affinity is configured explicitly) - * @ingroup ov_dev_api_plugin_api - */ -static constexpr Property cpu_bind_thread{ - "CPU_BIND_THREAD"}; - /** * @brief Limit \#threads that are used by IStreamsExecutor to execute `parallel_for` calls * @ingroup ov_dev_api_plugin_api */ -static constexpr Property threads_per_stream{"THREADS_PER_STREAM"}; +static constexpr Property threads_per_stream{"THREADS_PER_STREAM"}; /** * @brief It contains compiled_model_runtime_properties information to make plugin runtime can check whether it is diff --git a/src/inference/dev_api/openvino/runtime/threading/istreams_executor.hpp b/src/inference/dev_api/openvino/runtime/threading/istreams_executor.hpp index 363b7a912b15f0..43708c94794ae8 100644 --- a/src/inference/dev_api/openvino/runtime/threading/istreams_executor.hpp +++ b/src/inference/dev_api/openvino/runtime/threading/istreams_executor.hpp @@ -21,31 +21,6 @@ namespace ov { namespace threading { -/** - * @brief Number of streams in Performance-core(big core) - */ -static constexpr Property big_core_streams{"BIG_CORE_STREAMS"}; - -/** - * @brief Number of streams in Efficient-core(small core) on hybrid cores machine - */ -static constexpr Property small_core_streams{"SMALL_CORE_STREAMS"}; - -/** - * @brief Number of threads per stream in big cores - */ -static constexpr Property threads_per_stream_big{"THREADS_PER_STREAM_BIG"}; - -/** - * @brief Number of threads per stream in small cores on hybrid cores machine - */ -static constexpr Property threads_per_stream_small{"THREADS_PER_STREAM_SMALL"}; - -/** - * @brief Small core start offset when binding cpu cores - */ -static constexpr Property small_core_offset{"SMALL_CORE_OFFSET"}; - /** * @interface IStreamsExecutor * @ingroup ov_dev_api_threading @@ -80,86 +55,65 @@ class OPENVINO_RUNTIME_API IStreamsExecutor : virtual public ITaskExecutor { * @brief Defines IStreamsExecutor configuration */ struct OPENVINO_RUNTIME_API Config { - /** - * @brief Sets configuration - * @param properties map of properties - */ - void set_property(const ov::AnyMap& properties); - - /** - * @brief Sets configuration - * @param key property name - * @param value property value - */ - void set_property(const std::string& key, const ov::Any& value); - - /** - * @brief Return configuration value - * @param key configuration key - * @return configuration value wrapped into ov::Any - */ - ov::Any get_property(const std::string& key) const; - - /** - * @brief Create appropriate multithreaded configuration - * filing unconfigured values from initial configuration using hardware properties - * @param initial Inital configuration - * @param fp_intesive additional hint for the the (Hybrid) core-types selection logic - * whether the executor should be configured for floating point intensive work (as opposite to int8 - * intensive) - * @return configured values - */ - static Config make_default_multi_threaded(const Config& initial, const bool fp_intesive = true); - static int get_default_num_streams( - const bool enable_hyper_thread = true); // no network specifics considered (only CPU's caps); - static int get_hybrid_num_streams(std::map& config, const int stream_mode); - static void update_hybrid_custom_threads(Config& config); - static Config reserve_cpu_threads(const Config& initial); - - std::string _name; //!< Used by `ITT` to name executor threads - int _streams = 1; //!< Number of streams. - int _threadsPerStream = 0; //!< Number of threads per stream that executes `ov_parallel` calls - ThreadBindingType _threadBindingType = ThreadBindingType::NONE; //!< Thread binding to hardware resource type. - //!< No binding by default - int _threadBindingStep = 1; //!< In case of @ref CORES binding offset type - //!< thread binded to cores with defined step - int _threadBindingOffset = 0; //!< In case of @ref CORES binding offset type thread binded to cores - //!< starting from offset - int _threads = 0; //!< Number of threads distributed between streams. - //!< Reserved. Should not be used. - int _big_core_streams = 0; //!< Number of streams in Performance-core(big core) - int _small_core_streams = 0; //!< Number of streams in Efficient-core(small core) - int _threads_per_stream_big = 0; //!< Threads per stream in big cores - int _threads_per_stream_small = 0; //!< Threads per stream in small cores - int _small_core_offset = 0; //!< Calculate small core start offset when binding cpu cores - bool _enable_hyper_thread = true; //!< enable hyper thread - int _plugin_task = NOT_USED; - enum StreamMode { DEFAULT, AGGRESSIVE, LESSAGGRESSIVE }; + public: enum PreferredCoreType { ANY, LITTLE, BIG, ROUND_ROBIN // used w/multiple streams to populate the Big cores first, then the Little, then wrap around // (for large #streams) - } _threadPreferredCoreType = - PreferredCoreType::ANY; //!< In case of @ref HYBRID_AWARE hints the TBB to affinitize + }; + private: + std::string _name; //!< Used by `ITT` to name executor threads + int _streams = 1; //!< Number of streams. + int _threads_per_stream = 0; //!< Number of threads per stream that executes `ov_parallel` calls + ThreadBindingType _threadBindingType = ThreadBindingType::NONE; //!< Thread binding to hardware resource type. + //!< No binding by default + int _threadBindingStep = 1; //!< In case of @ref CORES binding offset type + //!< thread binded to cores with defined step + int _threadBindingOffset = 0; //!< In case of @ref CORES binding offset type thread binded to cores + //!< starting from offset + int _threads = 0; //!< Number of threads distributed between streams. + //!< Reserved. Should not be used. + PreferredCoreType _thread_preferred_core_type = + PreferredCoreType::ANY; //!< LITTLE and BIG are valid in hybrid core machine, ANY is valid in all machines. + //!< Core type priority: physical PCore, ECore, logical PCore std::vector> _streams_info_table = {}; std::vector> _stream_processor_ids; bool _cpu_reservation = false; - bool _streams_changed = false; + /** + * @brief Get and reserve cpu ids based on configuration and hardware information, + * streams_info_table must be present in the configuration + */ + void reserve_cpu_threads(); + + /** + * @brief Modify _streams_info_table and related configuration according to configuration + */ + void update_executor_config(); + + /** + * @brief Set _streams_info_table and _cpu_reservation in cpu streams executor config when nstreams = 0, + * that is, only create one thread with TBB + */ + void set_config_zero_stream(); + + public: /** * @brief A constructor with arguments * - * @param[in] name The executor name - * @param[in] streams @copybrief Config::_streams - * @param[in] threadsPerStream @copybrief Config::_threadsPerStream - * @param[in] threadBindingType @copybrief Config::_threadBindingType - * @param[in] threadBindingStep @copybrief Config::_threadBindingStep - * @param[in] threadBindingOffset @copybrief Config::_threadBindingOffset - * @param[in] threads @copybrief Config::_threads - * @param[in] threadPreferBigCores @copybrief Config::_threadPreferBigCores + * @param[in] name The executor name + * @param[in] streams @copybrief Config::_streams + * @param[in] threadsPerStream @copybrief Config::_threads_per_stream + * @param[in] threadBindingType @copybrief Config::_threadBindingType + * @param[in] threadBindingStep @copybrief Config::_threadBindingStep + * @param[in] threadBindingOffset @copybrief Config::_threadBindingOffset + * @param[in] threads @copybrief Config::_threads + * @param[in] threadPreferredCoreType @copybrief Config::_thread_preferred_core_type + * @param[in] streamsInfoTable @copybrief Config::_streams_info_table + * @param[in] cpuReservation @copybrief Config::_cpu_reservation */ Config(std::string name = "StreamsExecutor", int streams = 1, @@ -173,32 +127,103 @@ class OPENVINO_RUNTIME_API IStreamsExecutor : virtual public ITaskExecutor { bool cpuReservation = false) : _name{name}, _streams{streams}, - _threadsPerStream{threadsPerStream}, + _threads_per_stream{threadsPerStream}, _threadBindingType{threadBindingType}, _threadBindingStep{threadBindingStep}, _threadBindingOffset{threadBindingOffset}, _threads{threads}, - _threadPreferredCoreType(threadPreferredCoreType), + _thread_preferred_core_type(threadPreferredCoreType), _streams_info_table{streamsInfoTable}, - _cpu_reservation{cpuReservation} {} + _cpu_reservation{cpuReservation} { + update_executor_config(); + } + // These APIs which includes set_property and get_property can not be removed until they will never be called by + // other plugins such as NV plugin. /** - * @brief Modify _streams_info_table and related configuration according to user-specified parameters, bind - * threads to cpu cores if cpu_pinning is true. - * @param stream_nums Number of streams specified by user - * @param threads_per_stream Number of threads per stream specified by user - * @param core_type Cpu type (Big/Little/Any) specified by user - * @param cpu_pinning Whether to bind the threads to cpu cores + * @brief Sets configuration + * @param properties map of properties */ - void update_executor_config(int stream_nums, - int threads_per_stream, - PreferredCoreType core_type, - bool cpu_pinning); + void set_property(const ov::AnyMap& properties); + /** - * @brief Set _streams_info_table and _cpu_reservation in cpu streams executor config when nstreams = 0, - * that is, only create one thread with TBB + * @brief Sets configuration + * @param key property name + * @param value property value */ - void set_config_zero_stream(); + void set_property(const std::string& key, const ov::Any& value); + + /** + * @brief Return configuration value + * @param key configuration key + * @return configuration value wrapped into ov::Any + */ + ov::Any get_property(const std::string& key) const; + + std::string get_name() { + return _name; + } + int get_streams() { + return _streams; + } + int get_streams() const { + return _streams; + } + int get_threads() { + return _threads; + } + int get_threads() const { + return _threads; + } + int get_threads_per_stream() { + return _threads_per_stream; + } + bool get_cpu_reservation() { + return _cpu_reservation; + } + std::vector> get_streams_info_table() { + return _streams_info_table; + } + std::vector> get_stream_processor_ids() { + return _stream_processor_ids; + } + ThreadBindingType get_thread_binding_type() { + return _threadBindingType; + } + int get_thread_binding_step() { + return _threadBindingStep; + } + int get_thread_binding_offset() { + return _threadBindingOffset; + } + bool operator==(const Config& config){ + if (_name == config._name && _streams == config._streams && + _threads_per_stream == config._threads_per_stream && _threadBindingType == config._threadBindingType && + _thread_preferred_core_type == config._thread_preferred_core_type) { + return true; + } else { + return false; + } + } + + /** + * @brief Create appropriate multithreaded configuration + * filing unconfigured values from initial configuration using hardware properties + * @param initial Inital configuration + * @return configured values + */ + static Config make_default_multi_threaded(const Config& initial); + + static int get_default_num_streams(); // no network specifics considered (only CPU's caps); + + /** + * @brief Get and reserve cpu ids based on configuration and hardware information + * streams_info_table must be present in the configuration + * @param initial Inital configuration + * @return configured values + */ + // It will be removed when other plugins will no longer call it. + static Config reserve_cpu_threads(const Config& initial); }; /** diff --git a/src/inference/src/dev/threading/cpu_streams_executor.cpp b/src/inference/src/dev/threading/cpu_streams_executor.cpp index e3eeafe85930ad..3d4b71f0505535 100644 --- a/src/inference/src/dev/threading/cpu_streams_executor.cpp +++ b/src/inference/src/dev/threading/cpu_streams_executor.cpp @@ -30,32 +30,18 @@ struct CPUStreamsExecutor::Impl { CpuSet _mask; int _ncpus = 0; int _threadBindingStep = 0; - int _offset = 0; - int _cpuIdxOffset = 0; std::vector _cpu_ids; - Observer(custom::task_arena& arena, - CpuSet mask, - int ncpus, - const int streamId, - const int threadsPerStream, - const int threadBindingStep, - const int threadBindingOffset, - const int cpuIdxOffset = 0, - const std::vector cpu_ids = {}) + Observer(custom::task_arena& arena, CpuSet mask, int ncpus, const std::vector cpu_ids = {}) : custom::task_scheduler_observer(arena), _mask{std::move(mask)}, _ncpus(ncpus), - _threadBindingStep(threadBindingStep), - _offset{streamId * threadsPerStream + threadBindingOffset}, - _cpuIdxOffset(cpuIdxOffset), _cpu_ids(cpu_ids) {} void on_scheduler_entry(bool) override { - pin_thread_to_vacant_core(_offset + tbb::this_task_arena::current_thread_index(), + pin_thread_to_vacant_core(tbb::this_task_arena::current_thread_index(), _threadBindingStep, _ncpus, _mask, - _cpu_ids, - _cpuIdxOffset); + _cpu_ids); } void on_scheduler_exit(bool) override { pin_current_thread_by_mask(_ncpus, _mask); @@ -73,41 +59,41 @@ struct CPUStreamsExecutor::Impl { _impl->_streamIdQueue.pop(); } } - _numaNodeId = _impl->_config._streams - ? _impl->_usedNumaNodes.at((_streamId % _impl->_config._streams) / - ((_impl->_config._streams + _impl->_usedNumaNodes.size() - 1) / - _impl->_usedNumaNodes.size())) - : _impl->_usedNumaNodes.at(_streamId % _impl->_usedNumaNodes.size()); + _numaNodeId = + _impl->_config.get_streams() + ? _impl->_usedNumaNodes.at((_streamId % _impl->_config.get_streams()) / + ((_impl->_config.get_streams() + _impl->_usedNumaNodes.size() - 1) / + _impl->_usedNumaNodes.size())) + : _impl->_usedNumaNodes.at(_streamId % _impl->_usedNumaNodes.size()); #if OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO - if (is_cpu_map_available() && _impl->_config._streams_info_table.size() > 0) { + if (is_cpu_map_available() && _impl->_config.get_streams_info_table().size() > 0) { init_stream(); - } else { - init_stream_legacy(); } #elif OV_THREAD == OV_THREAD_OMP - omp_set_num_threads(_impl->_config._threadsPerStream); - if (!check_open_mp_env_vars(false) && (ThreadBindingType::NONE != _impl->_config._threadBindingType)) { + omp_set_num_threads(_impl->_config.get_threads_per_stream()); + if (!check_open_mp_env_vars(false) && + (ThreadBindingType::NONE != _impl->_config.get_thread_binding_type())) { CpuSet processMask; int ncpus = 0; std::tie(processMask, ncpus) = get_process_mask(); if (nullptr != processMask) { - parallel_nt(_impl->_config._threadsPerStream, [&](int threadIndex, int threadsPerStream) { - int thrIdx = _streamId * _impl->_config._threadsPerStream + threadIndex + - _impl->_config._threadBindingOffset; - pin_thread_to_vacant_core(thrIdx, _impl->_config._threadBindingStep, ncpus, processMask); + parallel_nt(_impl->_config.get_threads_per_stream(), [&](int threadIndex, int threadsPerStream) { + int thrIdx = _streamId * _impl->_config.get_threads_per_stream() + threadIndex + + _impl->_config.get_thread_binding_offset(); + pin_thread_to_vacant_core(thrIdx, _impl->_config.get_thread_binding_step(), ncpus, processMask); }); } } #elif OV_THREAD == OV_THREAD_SEQ - if (ThreadBindingType::NUMA == _impl->_config._threadBindingType) { + if (ThreadBindingType::NUMA == _impl->_config.get_thread_binding_type()) { pin_current_thread_to_socket(_numaNodeId); - } else if (ThreadBindingType::CORES == _impl->_config._threadBindingType) { + } else if (ThreadBindingType::CORES == _impl->_config.get_thread_binding_type()) { CpuSet processMask; int ncpus = 0; std::tie(processMask, ncpus) = get_process_mask(); if (nullptr != processMask) { - pin_thread_to_vacant_core(_streamId + _impl->_config._threadBindingOffset, - _impl->_config._threadBindingStep, + pin_thread_to_vacant_core(_streamId + _impl->_config.get_thread_binding_offset(), + _impl->_config.get_thread_binding_step(), ncpus, processMask); } @@ -120,7 +106,7 @@ struct CPUStreamsExecutor::Impl { _impl->_streamIdQueue.push(_streamId); } #if OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO - if (_impl->_config._name.find("StreamsExecutor") == std::string::npos) { + if (_impl->_config.get_name().find("StreamsExecutor") == std::string::npos) { set_cpu_used(_cpu_ids, NOT_USED); } if (nullptr != _observer) { @@ -136,6 +122,7 @@ struct CPUStreamsExecutor::Impl { const int core_type, const int numa_node_id, const int max_threads_per_core) { + auto stream_processors = _impl->_config.get_stream_processor_ids(); _numaNodeId = std::max(0, numa_node_id); _socketId = get_socket_by_numa_node(_numaNodeId); if (stream_type == STREAM_WITHOUT_PARAM) { @@ -157,23 +144,15 @@ struct CPUStreamsExecutor::Impl { .set_max_threads_per_core(max_threads_per_core)}); } else { _taskArena.reset(new custom::task_arena{concurrency}); - _cpu_ids = static_cast(_impl->_config._stream_processor_ids.size()) == _impl->_config._streams - ? _impl->_config._stream_processor_ids[stream_id] + _cpu_ids = static_cast(stream_processors.size()) == _impl->_config.get_streams() + ? stream_processors[stream_id] : _cpu_ids; if (_cpu_ids.size() > 0) { CpuSet processMask; int ncpus = 0; std::tie(processMask, ncpus) = get_process_mask(); if (nullptr != processMask) { - _observer.reset(new Observer{*_taskArena, - std::move(processMask), - ncpus, - 0, - concurrency, - 0, - 0, - 0, - _cpu_ids}); + _observer.reset(new Observer{*_taskArena, std::move(processMask), ncpus, _cpu_ids}); _observer->observe(true); } } @@ -186,11 +165,12 @@ struct CPUStreamsExecutor::Impl { int max_threads_per_core; StreamCreateType stream_type; const auto org_proc_type_table = get_org_proc_type_table(); - const auto stream_id = _impl->_config._streams == 0 ? 0 : _streamId % _impl->_config._streams; + int streams_num = _impl->_config.get_streams(); + const auto stream_id = streams_num == 0 ? 0 : _streamId % streams_num; get_cur_stream_info(stream_id, - _impl->_config._cpu_reservation, + _impl->_config.get_cpu_reservation(), org_proc_type_table, - _impl->_config._streams_info_table, + _impl->_config.get_streams_info_table(), stream_type, concurrency, cpu_core_type, @@ -206,112 +186,6 @@ struct CPUStreamsExecutor::Impl { numa_node_id, max_threads_per_core); } - - void init_stream_legacy() { - const auto concurrency = (0 == _impl->_config._threadsPerStream) ? custom::task_arena::automatic - : _impl->_config._threadsPerStream; - if (ThreadBindingType::HYBRID_AWARE == _impl->_config._threadBindingType) { - if (Config::PreferredCoreType::ROUND_ROBIN != _impl->_config._threadPreferredCoreType) { - if (Config::PreferredCoreType::ANY == _impl->_config._threadPreferredCoreType) { - _taskArena.reset(new custom::task_arena{concurrency}); - } else { - const auto selected_core_type = - Config::PreferredCoreType::BIG == _impl->_config._threadPreferredCoreType - ? custom::info::core_types().back() // running on Big cores only - : custom::info::core_types().front(); // running on Little cores only - _taskArena.reset(new custom::task_arena{custom::task_arena::constraints{} - .set_core_type(selected_core_type) - .set_max_concurrency(concurrency)}); - } - } else { - // assigning the stream to the core type in the round-robin fashion - // wrapping around total_streams (i.e. how many streams all different core types can handle - // together). Binding priority: Big core, Logical big core, Small core - const auto total_streams = _impl->total_streams_on_core_types.back().second; - const auto big_core_streams = _impl->total_streams_on_core_types.front().second; - const auto hybrid_core = _impl->total_streams_on_core_types.size() > 1; - const auto phy_core_streams = - _impl->_config._big_core_streams == 0 - ? 0 - : _impl->num_big_core_phys / _impl->_config._threads_per_stream_big; - const auto streamId_wrapped = _streamId % total_streams; - const auto& selected_core_type = - std::find_if( - _impl->total_streams_on_core_types.cbegin(), - _impl->total_streams_on_core_types.cend(), - [streamId_wrapped](const decltype(_impl->total_streams_on_core_types)::value_type& p) { - return p.second > streamId_wrapped; - }) - ->first; - const auto small_core = hybrid_core && selected_core_type == 0; - const auto logic_core = !small_core && streamId_wrapped >= phy_core_streams; - const auto small_core_skip = small_core && _impl->_config._threads_per_stream_small == 3 && - _impl->_config._small_core_streams > 1; - const auto max_concurrency = - small_core ? _impl->_config._threads_per_stream_small : _impl->_config._threads_per_stream_big; - // Special handling of _threads_per_stream_small == 3 - const auto small_core_id = small_core_skip ? 0 : streamId_wrapped - big_core_streams; - const auto stream_id = - hybrid_core - ? (small_core ? small_core_id - : (logic_core ? streamId_wrapped - phy_core_streams : streamId_wrapped)) - : streamId_wrapped; - const auto thread_binding_step = hybrid_core ? (small_core ? _impl->_config._threadBindingStep : 2) - : _impl->_config._threadBindingStep; - // Special handling of _threads_per_stream_small == 3, need to skip 4 (Four cores share one L2 - // cache on the small core), stream_id = 0, cpu_idx_offset cumulative plus 4 - const auto small_core_offset = - small_core_skip ? _impl->_config._small_core_offset + (streamId_wrapped - big_core_streams) * 4 - : _impl->_config._small_core_offset; - const auto cpu_idx_offset = - hybrid_core - // Prevent conflicts with system scheduling, so default cpu id on big core starts from 1 - ? (small_core ? small_core_offset : (logic_core ? 0 : 1)) - : 0; -# ifdef _WIN32 - _taskArena.reset(new custom::task_arena{custom::task_arena::constraints{} - .set_core_type(selected_core_type) - .set_max_concurrency(max_concurrency)}); -# else - _taskArena.reset(new custom::task_arena{max_concurrency}); -# endif - CpuSet processMask; - int ncpus = 0; - std::tie(processMask, ncpus) = get_process_mask(); - if (nullptr != processMask) { - _observer.reset(new Observer{*_taskArena, - std::move(processMask), - ncpus, - stream_id, - max_concurrency, - thread_binding_step, - _impl->_config._threadBindingOffset, - cpu_idx_offset}); - _observer->observe(true); - } - } - } else if (ThreadBindingType::NUMA == _impl->_config._threadBindingType) { - _taskArena.reset(new custom::task_arena{custom::task_arena::constraints{_numaNodeId, concurrency}}); - } else if ((0 != _impl->_config._threadsPerStream) || - (ThreadBindingType::CORES == _impl->_config._threadBindingType)) { - _taskArena.reset(new custom::task_arena{concurrency}); - if (ThreadBindingType::CORES == _impl->_config._threadBindingType) { - CpuSet processMask; - int ncpus = 0; - std::tie(processMask, ncpus) = get_process_mask(); - if (nullptr != processMask) { - _observer.reset(new Observer{*_taskArena, - std::move(processMask), - ncpus, - _streamId, - _impl->_config._threadsPerStream, - _impl->_config._threadBindingStep, - _impl->_config._threadBindingOffset}); - _observer->observe(true); - } - } - } - } #endif Impl* _impl = nullptr; @@ -439,46 +313,17 @@ struct CPUStreamsExecutor::Impl { this) { _exectorMgr = executor_manager(); auto numaNodes = get_available_numa_nodes(); - if (_config._streams != 0) { + int streams_num = _config.get_streams(); + if (streams_num != 0) { std::copy_n(std::begin(numaNodes), - std::min(_config._streams, numaNodes.size()), + std::min(streams_num, numaNodes.size()), std::back_inserter(_usedNumaNodes)); } else { _usedNumaNodes = numaNodes; } -#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO) - if (!is_cpu_map_available() && ThreadBindingType::HYBRID_AWARE == config._threadBindingType) { - const auto core_types = custom::info::core_types(); - const auto num_core_phys = get_number_of_cpu_cores(); - num_big_core_phys = get_number_of_cpu_cores(true); - const auto num_small_core_phys = num_core_phys - num_big_core_phys; - int sum = 0; - // reversed order, so BIG cores are first - for (auto iter = core_types.rbegin(); iter < core_types.rend(); iter++) { - const auto& type = *iter; - // calculating the #streams per core type - const int num_streams_for_core_type = - type == 0 ? std::max(1, - std::min(config._small_core_streams, - config._threads_per_stream_small == 0 - ? 0 - : num_small_core_phys / config._threads_per_stream_small)) - : std::max(1, - std::min(config._big_core_streams, - config._threads_per_stream_big == 0 - ? 0 - : num_big_core_phys / config._threads_per_stream_big * 2)); - sum += num_streams_for_core_type; - // prefix sum, so the core type for a given stream id will be deduced just as a upper_bound - // (notice that the map keeps the elements in the descending order, so the big cores are populated - // first) - total_streams_on_core_types.push_back({type, sum}); - } - } -#endif - for (auto streamId = 0; streamId < _config._streams; ++streamId) { + for (auto streamId = 0; streamId < streams_num; ++streamId) { _threads.emplace_back([this, streamId] { - openvino::itt::threadName(_config._name + "_" + std::to_string(streamId)); + openvino::itt::threadName(_config.get_name() + "_" + std::to_string(streamId)); for (bool stopped = false; !stopped;) { Task task; { @@ -548,15 +393,6 @@ struct CPUStreamsExecutor::Impl { bool _isStopped = false; std::vector _usedNumaNodes; CustomThreadLocal _streams; -#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO) - // stream id mapping to the core type - // stored in the reversed order (so the big cores, with the highest core_type_id value, are populated first) - // every entry is the core type and #streams that this AND ALL EARLIER entries can handle (prefix sum) - // (so mapping is actually just an upper_bound: core type is deduced from the entry for which the id < #streams) - using StreamIdToCoreTypes = std::vector>; - StreamIdToCoreTypes total_streams_on_core_types; - int num_big_core_phys; -#endif std::shared_ptr _exectorMgr; }; @@ -595,7 +431,7 @@ void CPUStreamsExecutor::execute(Task task) { } void CPUStreamsExecutor::run(Task task) { - if (0 == _impl->_config._streams) { + if (0 == _impl->_config.get_streams()) { _impl->Defer(std::move(task)); } else { _impl->Enqueue(std::move(task)); diff --git a/src/inference/src/dev/threading/executor_manager.cpp b/src/inference/src/dev/threading/executor_manager.cpp index f540f79f27d6ac..d0c639f35b7982 100644 --- a/src/inference/src/dev/threading/executor_manager.cpp +++ b/src/inference/src/dev/threading/executor_manager.cpp @@ -128,20 +128,14 @@ std::shared_ptr ExecutorManagerImpl::get_executor( std::shared_ptr ExecutorManagerImpl::get_idle_cpu_streams_executor( const ov::threading::IStreamsExecutor::Config& config) { std::lock_guard guard(streamExecutorMutex); - for (const auto& it : cpuStreamsExecutors) { + for (auto& it : cpuStreamsExecutors) { const auto& executor = it.second; if (executor.use_count() != 1) continue; - const auto& executorConfig = it.first; - if (executorConfig._name == config._name && executorConfig._streams == config._streams && - executorConfig._threadsPerStream == config._threadsPerStream && - executorConfig._threadBindingType == config._threadBindingType && - executorConfig._threadBindingStep == config._threadBindingStep && - executorConfig._threadBindingOffset == config._threadBindingOffset) - if (executorConfig._threadBindingType != ov::threading::IStreamsExecutor::ThreadBindingType::HYBRID_AWARE || - executorConfig._threadPreferredCoreType == config._threadPreferredCoreType) - return executor; + auto& executorConfig = it.first; + if (executorConfig == config) + return executor; } auto newExec = std::make_shared(config); tbbThreadsCreated = true; @@ -167,23 +161,30 @@ void ExecutorManagerImpl::clear(const std::string& id) { cpuStreamsExecutors.clear(); } else { executors.erase(id); - cpuStreamsExecutors.erase( - std::remove_if(cpuStreamsExecutors.begin(), - cpuStreamsExecutors.end(), - [&](const std::pair>& it) { - return it.first._name == id; - }), - cpuStreamsExecutors.end()); + cpuStreamsExecutors.erase(std::remove_if(cpuStreamsExecutors.begin(), + cpuStreamsExecutors.end(), + [&](std::pair>& it) { + return it.first.get_name() == id; + }), + cpuStreamsExecutors.end()); } } void ExecutorManagerImpl::execute_task_by_streams_executor( ov::threading::IStreamsExecutor::Config::PreferredCoreType core_type, ov::threading::Task task) { - ov::threading::IStreamsExecutor::Config streamsConfig("StreamsExecutor"); - streamsConfig.update_executor_config(1, 1, core_type, false); - if (!streamsConfig._streams_info_table.empty()) { + ov::threading::IStreamsExecutor::Config streamsConfig("StreamsExecutor", + 1, + 1, + ov::threading::IStreamsExecutor::ThreadBindingType::NONE, + 1, + 0, + 0, + core_type, + {}, + false); + if (!streamsConfig.get_streams_info_table().empty()) { auto taskExecutor = std::make_shared(streamsConfig); std::vector tasks{std::move(task)}; taskExecutor->run_and_wait(tasks); diff --git a/src/inference/src/dev/threading/istreams_executor.cpp b/src/inference/src/dev/threading/istreams_executor.cpp index cf52e22cdc2ecf..b7151e15b74e5e 100644 --- a/src/inference/src/dev/threading/istreams_executor.cpp +++ b/src/inference/src/dev/threading/istreams_executor.cpp @@ -29,61 +29,15 @@ void IStreamsExecutor::Config::set_property(const ov::AnyMap& property) { for (const auto& it : property) { const auto& key = it.first; const auto value = it.second; - OPENVINO_SUPPRESS_DEPRECATED_START - if (key == ov::internal::cpu_bind_thread.name()) { - if (value.as() == "YES" || value.as() == "NUMA") { -#if (defined(__APPLE__) || defined(_WIN32)) - _threadBindingType = IStreamsExecutor::ThreadBindingType::NUMA; -#else - _threadBindingType = (value.as() == "YES") ? IStreamsExecutor::ThreadBindingType::CORES - : IStreamsExecutor::ThreadBindingType::NUMA; -#endif - } else if (value.as() == "HYBRID_AWARE") { - _threadBindingType = IStreamsExecutor::ThreadBindingType::HYBRID_AWARE; - } else if (value.as() == "NO") { - _threadBindingType = IStreamsExecutor::ThreadBindingType::NONE; - } else { - OPENVINO_THROW("Wrong value for property key ", - ov::internal::cpu_bind_thread.name(), - ". Expected only YES(binds to cores) / NO(no binding) / NUMA(binds to NUMA nodes) / " - "HYBRID_AWARE (let the runtime recognize and use the hybrid cores)"); - } - } else if (key == ov::affinity) { - ov::Affinity affinity; - std::stringstream{value.as()} >> affinity; - switch (affinity) { - case ov::Affinity::NONE: - _threadBindingType = ThreadBindingType::NONE; - break; - case ov::Affinity::CORE: { -#if (defined(__APPLE__) || defined(_WIN32)) - _threadBindingType = ThreadBindingType::NUMA; -#else - _threadBindingType = ThreadBindingType::CORES; -#endif - } break; - case ov::Affinity::NUMA: - _threadBindingType = ThreadBindingType::NUMA; - break; - case ov::Affinity::HYBRID_AWARE: - _threadBindingType = ThreadBindingType::HYBRID_AWARE; - break; - default: - OPENVINO_THROW("Unsupported affinity type"); - } - } else if (key == ov::num_streams) { + if (key == ov::num_streams) { auto streams = value.as(); if (streams == ov::streams::NUMA) { - _streams = static_cast(get_available_numa_nodes().size()); - _streams_changed = true; + _streams = 1; } else if (streams == ov::streams::AUTO) { // bare minimum of streams (that evenly divides available number of cores) - if (!is_cpu_map_available()) { - _streams = get_default_num_streams(); - } + _streams = get_default_num_streams(); } else if (streams.num >= 0) { _streams = streams.num; - _streams_changed = true; } else { OPENVINO_THROW("Wrong value for property key ", ov::num_streams.name(), @@ -107,163 +61,40 @@ void IStreamsExecutor::Config::set_property(const ov::AnyMap& property) { } _threads = val_i; } else if (key == ov::internal::threads_per_stream) { - _threadsPerStream = static_cast(value.as()); - } else if (key == ov::threading::big_core_streams) { - int val_i; - try { - val_i = value.as(); - } catch (const std::exception&) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::big_core_streams.name(), - ". Expected only non negative numbers (#streams)"); - } - if (val_i < 0) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::big_core_streams.name(), - ". Expected only non negative numbers (#streams)"); - } - _big_core_streams = val_i; - } else if (key == ov::threading::small_core_streams) { - int val_i; - try { - val_i = value.as(); - } catch (const std::exception&) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::small_core_streams.name(), - ". Expected only non negative numbers (#streams)"); - } - if (val_i < 0) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::small_core_streams.name(), - ". Expected only non negative numbers (#streams)"); - } - _small_core_streams = val_i; - } else if (key == ov::threading::threads_per_stream_big) { - int val_i; - try { - val_i = value.as(); - } catch (const std::exception&) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::threads_per_stream_big.name(), - ". Expected only non negative numbers (#threads)"); - } - if (val_i < 0) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::threads_per_stream_big.name(), - ". Expected only non negative numbers (#threads)"); - } - _threads_per_stream_big = val_i; - } else if (key == ov::threading::threads_per_stream_small) { - int val_i; - try { - val_i = value.as(); - } catch (const std::exception&) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::threads_per_stream_small.name(), - ". Expected only non negative numbers (#threads)"); - } - if (val_i < 0) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::threads_per_stream_small.name(), - ". Expected only non negative numbers (#threads)"); - } - _threads_per_stream_small = val_i; - } else if (key == ov::threading::small_core_offset) { - int val_i; - try { - val_i = value.as(); - } catch (const std::exception&) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::small_core_offset.name(), - ". Expected only non negative numbers"); - } - if (val_i < 0) { - OPENVINO_THROW("Wrong value for HYBRID_AWARE key ", - ov::threading::small_core_offset.name(), - ". Expected only non negative numbers"); - } - _small_core_offset = val_i; + _threads_per_stream = static_cast(value.as()); } else { OPENVINO_THROW("Wrong value for property key ", key); } - OPENVINO_SUPPRESS_DEPRECATED_END } } ov::Any IStreamsExecutor::Config::get_property(const std::string& key) const { if (key == ov::supported_properties) { - OPENVINO_SUPPRESS_DEPRECATED_START std::vector properties{ ov::num_streams.name(), - ov::internal::cpu_bind_thread.name(), ov::inference_num_threads.name(), - ov::threading::big_core_streams.name(), - ov::threading::small_core_streams.name(), - ov::threading::threads_per_stream_big.name(), - ov::threading::threads_per_stream_small.name(), - ov::threading::small_core_offset.name(), ov::internal::threads_per_stream.name(), - ov::affinity.name(), }; - OPENVINO_SUPPRESS_DEPRECATED_END return properties; - OPENVINO_SUPPRESS_DEPRECATED_START - } else if (key == ov::affinity) { - switch (_threadBindingType) { - case IStreamsExecutor::ThreadBindingType::NONE: - return ov::Affinity::NONE; - case IStreamsExecutor::ThreadBindingType::CORES: - return ov::Affinity::CORE; - case IStreamsExecutor::ThreadBindingType::NUMA: - return ov::Affinity::NUMA; - case IStreamsExecutor::ThreadBindingType::HYBRID_AWARE: - return ov::Affinity::HYBRID_AWARE; - } - OPENVINO_SUPPRESS_DEPRECATED_END } else if (key == ov::num_streams) { return decltype(ov::num_streams)::value_type{_streams}; - OPENVINO_SUPPRESS_DEPRECATED_START - } else if (key == ov::internal::cpu_bind_thread) { - switch (_threadBindingType) { - case IStreamsExecutor::ThreadBindingType::NONE: - return {"NO"}; - case IStreamsExecutor::ThreadBindingType::CORES: - return {"YES"}; - case IStreamsExecutor::ThreadBindingType::NUMA: - return {"NUMA"}; - case IStreamsExecutor::ThreadBindingType::HYBRID_AWARE: - return {"HYBRID_AWARE"}; - } - } else if (key == ov::num_streams) { - return {std::to_string(_streams)}; } else if (key == ov::inference_num_threads) { return decltype(ov::inference_num_threads)::value_type{_threads}; } else if (key == ov::internal::threads_per_stream) { - return {std::to_string(_threadsPerStream)}; - } else if (key == ov::threading::big_core_streams) { - return {std::to_string(_big_core_streams)}; - } else if (key == ov::threading::small_core_streams) { - return {std::to_string(_small_core_streams)}; - } else if (key == ov::threading::threads_per_stream_big) { - return {std::to_string(_threads_per_stream_big)}; - } else if (key == ov::threading::threads_per_stream_small) { - return {std::to_string(_threads_per_stream_small)}; - } else if (key == ov::threading::small_core_offset) { - return {std::to_string(_small_core_offset)}; - } else if (key == ov::hint::enable_hyper_threading) { - return _enable_hyper_thread; - OPENVINO_SUPPRESS_DEPRECATED_END + return decltype(ov::internal::threads_per_stream)::value_type{_threads_per_stream}; } else { OPENVINO_THROW("Wrong value for property key ", key); } return {}; } -int IStreamsExecutor::Config::get_default_num_streams(const bool enable_hyper_thread) { - const int sockets = static_cast(get_available_numa_nodes().size()); +int IStreamsExecutor::Config::get_default_num_streams() { // bare minimum of streams (that evenly divides available number of core) - const int num_cores = sockets == 1 ? (enable_hyper_thread ? parallel_get_max_threads() : get_number_of_cpu_cores()) - : get_number_of_cpu_cores(); + const auto proc_type_table = get_proc_type_table(); + if (proc_type_table.empty()) { + return 1; + } + const auto num_cores = proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][EFFICIENT_CORE_PROC]; if (0 == num_cores % 4) return std::max(4, num_cores / 4); else if (0 == num_cores % 5) @@ -274,202 +105,81 @@ int IStreamsExecutor::Config::get_default_num_streams(const bool enable_hyper_th return 1; } -int IStreamsExecutor::Config::get_hybrid_num_streams(std::map& config, - const int stream_mode) { - const int num_cores = parallel_get_max_threads(); - const int num_cores_phy = get_number_of_cpu_cores(); - const int num_big_cores_phy = get_number_of_cpu_cores(true); - const int num_small_cores = num_cores_phy - num_big_cores_phy; - const int num_big_cores = num_cores > num_cores_phy ? num_big_cores_phy * 2 : num_big_cores_phy; - int big_core_streams = 0; - int small_core_streams = 0; - int threads_per_stream_big = 0; - int threads_per_stream_small = 0; - - if (stream_mode == DEFAULT) { - // bare minimum of streams (that evenly divides available number of core) - if (0 == num_big_cores_phy % 4) { - threads_per_stream_big = 4; - } else if (0 == num_big_cores_phy % 5) { - threads_per_stream_big = 5; - } else if (0 == num_big_cores_phy % 3) { - threads_per_stream_big = 3; - } else { // if user disables some cores say in BIOS, so we got weird #cores which is not easy to divide - threads_per_stream_big = num_big_cores_phy; - } +IStreamsExecutor::Config IStreamsExecutor::Config::make_default_multi_threaded( + const IStreamsExecutor::Config& initial) { + const auto proc_type_table = get_proc_type_table(); + auto streamConfig = initial; - big_core_streams = num_big_cores / threads_per_stream_big; - threads_per_stream_small = threads_per_stream_big; - if (num_small_cores == 0) { - threads_per_stream_small = 0; - } else if (num_small_cores < threads_per_stream_small) { - small_core_streams = 1; - threads_per_stream_small = num_small_cores; - threads_per_stream_big = threads_per_stream_small; - // Balance the computation of physical core and logical core, the number of threads on the physical core and - // logical core should be equal - big_core_streams = num_big_cores_phy / threads_per_stream_big * 2; - } else { - small_core_streams = num_small_cores / threads_per_stream_small; - } - } else if (stream_mode == AGGRESSIVE) { - big_core_streams = num_big_cores; - small_core_streams = num_small_cores; - threads_per_stream_big = num_big_cores / big_core_streams; - threads_per_stream_small = num_small_cores == 0 ? 0 : num_small_cores / small_core_streams; - } else if (stream_mode == LESSAGGRESSIVE) { - big_core_streams = num_big_cores / 2; - small_core_streams = num_small_cores / 2; - threads_per_stream_big = num_big_cores / big_core_streams; - threads_per_stream_small = num_small_cores == 0 ? 0 : num_small_cores / small_core_streams; - } else { - OPENVINO_THROW("Wrong stream mode to get num of streams: ", stream_mode); + if (proc_type_table.empty()) { + return streamConfig; } - OPENVINO_SUPPRESS_DEPRECATED_START - config[ov::threading::big_core_streams.name()] = std::to_string(big_core_streams); - config[ov::threading::small_core_streams.name()] = std::to_string(small_core_streams); - config[ov::threading::threads_per_stream_big.name()] = std::to_string(threads_per_stream_big); - config[ov::threading::threads_per_stream_small.name()] = std::to_string(threads_per_stream_small); - // This is default setting for specific CPU which Pcore is in front and Ecore is in the back. - config[ov::threading::small_core_offset.name()] = std::to_string(num_small_cores == 0 ? 0 : num_big_cores); - OPENVINO_SUPPRESS_DEPRECATED_END - return big_core_streams + small_core_streams; -} -void IStreamsExecutor::Config::update_hybrid_custom_threads(Config& config) { - const auto num_cores = parallel_get_max_threads(); - const auto num_cores_phys = get_number_of_cpu_cores(); - const auto num_big_cores_phys = get_number_of_cpu_cores(true); - const auto num_big_cores = num_cores > num_cores_phys ? num_big_cores_phys * 2 : num_big_cores_phys; - const auto num_small_cores_phys = num_cores_phys - num_big_cores_phys; - const auto threads = config._threads ? config._threads : num_cores; - const auto streams = config._streams > 0 ? config._streams : 1; - - config._small_core_offset = num_big_cores; - int threads_per_stream = std::max(1, threads / streams); - - if ((num_big_cores_phys / threads_per_stream >= streams) && (1 < threads_per_stream)) { - config._big_core_streams = streams; - config._threads_per_stream_big = threads_per_stream; - config._small_core_streams = 0; - config._threads_per_stream_small = 0; - } else if ((num_small_cores_phys / threads_per_stream >= streams) && (num_big_cores_phys < threads_per_stream)) { - config._big_core_streams = 0; - config._threads_per_stream_big = 0; - config._small_core_streams = streams; - config._threads_per_stream_small = threads_per_stream; - } else { - const int threads_per_stream_big = std::min(num_big_cores_phys, threads_per_stream); - const int threads_per_stream_small = std::min(num_small_cores_phys, threads_per_stream); - - threads_per_stream = std::min(threads_per_stream_big, threads_per_stream_small); - while (threads_per_stream > 1) { - const int base_big_streams = num_big_cores_phys / threads_per_stream; - const int base_small_streams = num_small_cores_phys > 0 ? num_small_cores_phys / threads_per_stream : 0; - if (base_big_streams + base_small_streams >= streams) { - config._big_core_streams = base_big_streams; - config._small_core_streams = streams - base_big_streams; - break; - } else if (base_big_streams * 2 + base_small_streams >= streams) { - config._big_core_streams = streams - base_small_streams; - config._small_core_streams = base_small_streams; - break; - } else { - threads_per_stream = threads_per_stream > 1 ? threads_per_stream - 1 : 1; + const auto numa_nodes = proc_type_table.size() > 1 ? proc_type_table.size() - 1 : proc_type_table.size(); + const bool latency_case = static_cast(streamConfig._streams) <= numa_nodes; + + // by default, do not use the hyper-threading (to minimize threads synch overheads) + int num_cores = !latency_case && numa_nodes == 1 + ? proc_type_table[0][ALL_PROC] + : proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][EFFICIENT_CORE_PROC]; + + // additional latency-case logic for hybrid processors: + if (proc_type_table[0][EFFICIENT_CORE_PROC] > 0 && proc_type_table[0][MAIN_CORE_PROC] > 0) { + if (streamConfig._thread_preferred_core_type == IStreamsExecutor::Config::ANY) { + // by default the latency case uses (faster) Big cores only, depending on the compute ratio + const bool big_only = proc_type_table[0][MAIN_CORE_PROC] > (proc_type_table[0][EFFICIENT_CORE_PROC] / 2); + // selecting the preferred core type + if (big_only) { + streamConfig._thread_preferred_core_type = IStreamsExecutor::Config::PreferredCoreType::BIG; + const int hyper_threading_threshold = + 2; // min #cores, for which the hyper-threading becomes useful for the latency case + // additionally selecting the #cores to use in the "Big-only" case + num_cores = (proc_type_table[0][MAIN_CORE_PROC] <= hyper_threading_threshold) + ? proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][HYPER_THREADING_PROC] + : proc_type_table[0][MAIN_CORE_PROC]; } + } else if (streamConfig._thread_preferred_core_type == IStreamsExecutor::Config::BIG) { + num_cores = proc_type_table[0][MAIN_CORE_PROC]; + } else if (streamConfig._thread_preferred_core_type == IStreamsExecutor::Config::LITTLE) { + num_cores = proc_type_table[0][EFFICIENT_CORE_PROC]; } + } - if (threads_per_stream == 1) { - const int stream_loops = streams / num_cores; - const int remain_streams = streams - stream_loops * num_cores; - if (num_big_cores_phys >= remain_streams) { - config._big_core_streams = remain_streams + num_big_cores * stream_loops; - config._small_core_streams = num_small_cores_phys * stream_loops; - } else if (num_big_cores_phys + num_small_cores_phys >= remain_streams) { - config._big_core_streams = num_big_cores_phys + num_big_cores * stream_loops; - config._small_core_streams = remain_streams - num_big_cores_phys + num_small_cores_phys * stream_loops; - } else { - config._big_core_streams = remain_streams - num_small_cores_phys + num_big_cores * stream_loops; - config._small_core_streams = num_small_cores_phys * (stream_loops + 1); + const auto threads = streamConfig._threads ? streamConfig._threads : num_cores; + int threads_per_stream = streamConfig._streams ? std::max(1, threads / streamConfig._streams) : threads; + if (proc_type_table[0][EFFICIENT_CORE_PROC] > 0 && proc_type_table[0][MAIN_CORE_PROC] > 0 && + streamConfig._thread_preferred_core_type == IStreamsExecutor::Config::ANY) { + if (streamConfig._streams > 1) { + threads_per_stream = + std::min(std::min(proc_type_table[0][MAIN_CORE_PROC], proc_type_table[0][EFFICIENT_CORE_PROC]), + threads_per_stream); + while (1) { + int streams_num = proc_type_table[0][MAIN_CORE_PROC] / threads_per_stream + + proc_type_table[0][HYPER_THREADING_PROC] / threads_per_stream + + proc_type_table[0][EFFICIENT_CORE_PROC] / threads_per_stream; + if (streams_num >= streamConfig._streams) { + break; + } else { + if (threads_per_stream > 1) { + threads_per_stream--; + } + } } } - - config._threads_per_stream_big = threads_per_stream; - config._threads_per_stream_small = threads_per_stream; } + streamConfig._threads_per_stream = threads_per_stream; + streamConfig._threads = streamConfig._threads_per_stream * streamConfig._streams; + streamConfig.update_executor_config(); + return streamConfig; } -IStreamsExecutor::Config IStreamsExecutor::Config::make_default_multi_threaded(const IStreamsExecutor::Config& initial, - const bool fp_intesive) { - const auto envThreads = parallel_get_env_threads(); - const auto& numaNodes = get_available_numa_nodes(); - const int numaNodesNum = static_cast(numaNodes.size()); - auto streamExecutorConfig = initial; - const bool bLatencyCase = streamExecutorConfig._streams <= numaNodesNum; +void IStreamsExecutor::Config::reserve_cpu_threads() { + int status = _name.find("StreamsExecutor") != std::string::npos ? NOT_USED : CPU_USED; - // by default, do not use the hyper-threading (to minimize threads synch overheads) - int num_cores_default = get_number_of_cpu_cores(); -#if (OV_THREAD == OV_THREAD_TBB || OV_THREAD == OV_THREAD_TBB_AUTO) - // additional latency-case logic for hybrid processors: - if (ThreadBindingType::HYBRID_AWARE == streamExecutorConfig._threadBindingType) { - const auto core_types = custom::info::core_types(); - const auto num_little_cores = - custom::info::default_concurrency(custom::task_arena::constraints{}.set_core_type(core_types.front())); - const auto num_big_cores_phys = get_number_of_cpu_cores(true); - const int int8_threshold = 4; // ~relative efficiency of the VNNI-intensive code for Big vs Little cores; - const int fp32_threshold = 2; // ~relative efficiency of the AVX2 fp32 code for Big vs Little cores; - // by default the latency case uses (faster) Big cores only, depending on the compute ratio - const bool bLatencyCaseBigOnly = - num_big_cores_phys > (num_little_cores / (fp_intesive ? fp32_threshold : int8_threshold)); - // selecting the preferred core type - streamExecutorConfig._threadPreferredCoreType = - bLatencyCase ? (bLatencyCaseBigOnly ? IStreamsExecutor::Config::PreferredCoreType::BIG - : IStreamsExecutor::Config::PreferredCoreType::ANY) - : IStreamsExecutor::Config::PreferredCoreType::ROUND_ROBIN; - // additionally selecting the #cores to use in the "Big-only" case - if (bLatencyCaseBigOnly) { - const int hyper_threading_threshold = - 2; // min #cores, for which the hyper-threading becomes useful for the latency case - const auto num_big_cores = - custom::info::default_concurrency(custom::task_arena::constraints{}.set_core_type(core_types.back())); - num_cores_default = (num_big_cores_phys <= hyper_threading_threshold) ? num_big_cores : num_big_cores_phys; - } - // if nstreams or nthreads are set, need to calculate the Hybrid aware parameters here - if (!bLatencyCase && (streamExecutorConfig._big_core_streams == 0 || streamExecutorConfig._threads)) { - update_hybrid_custom_threads(streamExecutorConfig); - } - OPENVINO_DEBUG << "[ p_e_core_info ] streams (threads): " << streamExecutorConfig._streams << "(" - << streamExecutorConfig._threads_per_stream_big * streamExecutorConfig._big_core_streams + - streamExecutorConfig._threads_per_stream_small * streamExecutorConfig._small_core_streams - << ") -- PCore: " << streamExecutorConfig._big_core_streams << "(" - << streamExecutorConfig._threads_per_stream_big - << ") ECore: " << streamExecutorConfig._small_core_streams << "(" - << streamExecutorConfig._threads_per_stream_small << ")"; + if (_streams_info_table.size() == 0 || (status == CPU_USED && !_cpu_reservation)) { + return; } -#endif - const auto hwCores = - !bLatencyCase && numaNodesNum == 1 - // throughput case on a single-NUMA node machine uses all available cores - ? (streamExecutorConfig._enable_hyper_thread ? parallel_get_max_threads() : num_cores_default) - // in the rest of cases: - // multi-node machine - // or - // latency case, single-node yet hybrid case that uses - // all core types - // or - // big-cores only, but the #cores is "enough" (pls see the logic above) - // it is usually beneficial not to use the hyper-threading (which is default) - : num_cores_default; - const auto threads = - streamExecutorConfig._threads ? streamExecutorConfig._threads : (envThreads ? envThreads : hwCores); - streamExecutorConfig._threadsPerStream = - streamExecutorConfig._streams ? std::max(1, threads / streamExecutorConfig._streams) : threads; - streamExecutorConfig._threads = - (!bLatencyCase && ThreadBindingType::HYBRID_AWARE == streamExecutorConfig._threadBindingType) - ? streamExecutorConfig._big_core_streams * streamExecutorConfig._threads_per_stream_big + - streamExecutorConfig._small_core_streams * streamExecutorConfig._threads_per_stream_small - : streamExecutorConfig._threadsPerStream * streamExecutorConfig._streams; - return streamExecutorConfig; + + reserve_available_cpus(_streams_info_table, _stream_processor_ids, status); } IStreamsExecutor::Config IStreamsExecutor::Config::reserve_cpu_threads(const IStreamsExecutor::Config& initial) { @@ -491,120 +201,150 @@ IStreamsExecutor::Config IStreamsExecutor::Config::reserve_cpu_threads(const ISt config._streams_info_table[i][NUMBER_OF_STREAMS] * config._streams_info_table[i][THREADS_PER_STREAM]; } } + config._threads_per_stream = config._streams_info_table[0][THREADS_PER_STREAM]; OPENVINO_DEBUG << "[ threading ] " << config._name << " reserve_cpu_threads " << config._streams << "(" << config._threads << ")"; return config; } -void IStreamsExecutor::Config::update_executor_config(int stream_nums, - int threads_per_stream, - IStreamsExecutor::Config::PreferredCoreType core_type, - bool cpu_pinning) { - const auto proc_type_table = ov::get_proc_type_table(); +void IStreamsExecutor::Config::update_executor_config() { + const auto proc_type_table = get_proc_type_table(); + bool streams_info_available = false; if (proc_type_table.empty()) { return; } - if (proc_type_table.size() > 1) { - core_type = ov::threading::IStreamsExecutor::Config::ANY; + if (!_streams_info_table.empty()) { + streams_info_available = true; + std::vector threads_proc_type(HYPER_THREADING_PROC + 1, 0); + for (size_t i = 0; i < _streams_info_table.size(); i++) { + if (_streams_info_table[i][NUMBER_OF_STREAMS] > 0) { + threads_proc_type[_streams_info_table[i][PROC_TYPE]] += + _streams_info_table[i][THREADS_PER_STREAM] * _streams_info_table[i][NUMBER_OF_STREAMS]; + } + } + for (size_t i = ALL_PROC; i < threads_proc_type.size(); i++) { + if (threads_proc_type[i] > proc_type_table[0][i]) { + streams_info_available = false; + break; + } + } } - // IStreamsExecutor::Config config = initial; - const auto total_num_cores = proc_type_table[0][ALL_PROC]; - const auto total_num_big_cores = proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][HYPER_THREADING_PROC]; - const auto total_num_little_cores = proc_type_table[0][EFFICIENT_CORE_PROC]; + if (!streams_info_available) { + _streams_info_table.clear(); - int num_cores = total_num_cores; - if (core_type == ov::threading::IStreamsExecutor::Config::BIG) { - num_cores = total_num_big_cores; - } else if (core_type == ov::threading::IStreamsExecutor::Config::LITTLE) { - num_cores = total_num_little_cores; - } + const auto total_num_cores = proc_type_table[0][ALL_PROC]; + const auto total_num_big_cores = proc_type_table[0][MAIN_CORE_PROC] + proc_type_table[0][HYPER_THREADING_PROC]; + const auto total_num_little_cores = proc_type_table[0][EFFICIENT_CORE_PROC]; - int streams = std::min(stream_nums, num_cores); + if ((total_num_little_cores == 0 && _thread_preferred_core_type == IStreamsExecutor::Config::LITTLE) || + (total_num_big_cores == 0 && _thread_preferred_core_type == IStreamsExecutor::Config::BIG) || + (proc_type_table.size() > 1 && _thread_preferred_core_type == IStreamsExecutor::Config::BIG)) { + _thread_preferred_core_type = IStreamsExecutor::Config::ANY; + } - if (streams == 0) { - return; - } + int num_cores = total_num_cores; + if (_thread_preferred_core_type == IStreamsExecutor::Config::BIG) { + num_cores = total_num_big_cores; + } else if (_thread_preferred_core_type == IStreamsExecutor::Config::LITTLE) { + num_cores = total_num_little_cores; + } - _streams = streams; - _threadPreferredCoreType = core_type; - _threadsPerStream = threads_per_stream; - - // create stream_info_table based on core type - std::vector stream_info(ov::CPU_STREAMS_TABLE_SIZE, 0); - stream_info[ov::THREADS_PER_STREAM] = _threadsPerStream; - stream_info[ov::STREAM_NUMA_NODE_ID] = 0; - stream_info[ov::STREAM_SOCKET_ID] = 0; - if (core_type == ov::threading::IStreamsExecutor::Config::BIG) { - if (proc_type_table[0][ov::MAIN_CORE_PROC] < _streams) { - if (proc_type_table[0][ov::MAIN_CORE_PROC] > 0) { - stream_info[ov::NUMBER_OF_STREAMS] = proc_type_table[0][ov::MAIN_CORE_PROC]; - stream_info[ov::PROC_TYPE] = ov::MAIN_CORE_PROC; - _streams_info_table.push_back(stream_info); - } - if (proc_type_table[0][ov::HYPER_THREADING_PROC] > 0) { - stream_info[ov::NUMBER_OF_STREAMS] = proc_type_table[0][ov::HYPER_THREADING_PROC]; - stream_info[ov::PROC_TYPE] = ov::HYPER_THREADING_PROC; + _streams = _streams > 0 ? std::min(_streams, num_cores) : _streams; + if (_streams == 0) { + set_config_zero_stream(); + return; + } + + _threads_per_stream = + _threads_per_stream > 0 ? std::min(num_cores, _streams * _threads_per_stream) / _streams : 0; + if (_threads_per_stream == 0) { + return; + } + + // create stream_info_table based on core type + std::vector stream_info(CPU_STREAMS_TABLE_SIZE, 0); + stream_info[THREADS_PER_STREAM] = _threads_per_stream; + stream_info[STREAM_NUMA_NODE_ID] = 0; + stream_info[STREAM_SOCKET_ID] = 0; + int cur_threads = _streams * _threads_per_stream; + if (_thread_preferred_core_type == IStreamsExecutor::Config::LITTLE) { + stream_info[PROC_TYPE] = EFFICIENT_CORE_PROC; + stream_info[NUMBER_OF_STREAMS] = _streams; + _streams_info_table.push_back(stream_info); + } else { + int start = proc_type_table.size() > 1 ? 1 : 0; + std::vector core_types; + // Using cores crossed sockets or hyper threads when streams = 1 + if (_streams == 1 && _threads_per_stream > proc_type_table[start][ov::MAIN_CORE_PROC]) { + stream_info[NUMBER_OF_STREAMS] = _streams; + stream_info[PROC_TYPE] = ALL_PROC; + stream_info[STREAM_NUMA_NODE_ID] = proc_type_table.size() > 1 ? -1 : 0; + stream_info[STREAM_SOCKET_ID] = proc_type_table.size() > 1 ? -1 : 0; _streams_info_table.push_back(stream_info); + stream_info[NUMBER_OF_STREAMS] = 0; } - } else { - stream_info[ov::PROC_TYPE] = ov::MAIN_CORE_PROC; - stream_info[ov::NUMBER_OF_STREAMS] = _streams; - _streams_info_table.push_back(stream_info); - } - } else if (core_type == ov::threading::IStreamsExecutor::Config::LITTLE) { - stream_info[ov::PROC_TYPE] = ov::EFFICIENT_CORE_PROC; - stream_info[ov::NUMBER_OF_STREAMS] = _streams; - _streams_info_table.push_back(stream_info); - } else { - int total_streams = 0; - if (proc_type_table.size() == 1) { - for (int i = ov::MAIN_CORE_PROC; i <= ov::HYPER_THREADING_PROC; i++) { - if (proc_type_table[0][i] > 0) { - stream_info[ov::NUMBER_OF_STREAMS] = - (total_streams + proc_type_table[0][i] > _streams ? _streams - total_streams - : proc_type_table[0][i]); - stream_info[ov::PROC_TYPE] = i; - stream_info[ov::STREAM_NUMA_NODE_ID] = proc_type_table[0][PROC_NUMA_NODE_ID]; - stream_info[ov::STREAM_SOCKET_ID] = proc_type_table[0][PROC_SOCKET_ID]; - _streams_info_table.push_back(stream_info); - total_streams += stream_info[ov::NUMBER_OF_STREAMS]; - } - if (total_streams >= _streams) - break; + if (_thread_preferred_core_type == IStreamsExecutor::Config::BIG && + proc_type_table[0][EFFICIENT_CORE_PROC] > 0) { + core_types = {MAIN_CORE_PROC, HYPER_THREADING_PROC}; + } else { + core_types = {MAIN_CORE_PROC, EFFICIENT_CORE_PROC, HYPER_THREADING_PROC}; } - } else { - for (size_t i = 1; i < proc_type_table.size(); i++) { - for (int j = ov::MAIN_CORE_PROC; j < ov::HYPER_THREADING_PROC; j++) { - if (proc_type_table[i][j] > 0) { - stream_info[ov::NUMBER_OF_STREAMS] = - (total_streams + proc_type_table[i][j] > _streams ? _streams - total_streams - : proc_type_table[i][j]); - stream_info[ov::PROC_TYPE] = j; - stream_info[ov::STREAM_NUMA_NODE_ID] = proc_type_table[i][PROC_NUMA_NODE_ID]; - stream_info[ov::STREAM_SOCKET_ID] = proc_type_table[i][PROC_SOCKET_ID]; + for (int j : core_types) { + for (size_t i = start; i < proc_type_table.size(); i++) { + if (proc_type_table[i][j] > 0 && cur_threads > 0) { + if (_threads_per_stream > proc_type_table[i][j]) { + stream_info[THREADS_PER_STREAM] = std::min(proc_type_table[i][j], cur_threads); + cur_threads -= stream_info[THREADS_PER_STREAM]; + } else { + stream_info[NUMBER_OF_STREAMS] = + std::min(proc_type_table[i][j], cur_threads) / _threads_per_stream; + cur_threads -= stream_info[NUMBER_OF_STREAMS] * _threads_per_stream; + } + stream_info[PROC_TYPE] = j; + stream_info[STREAM_NUMA_NODE_ID] = proc_type_table[i][PROC_NUMA_NODE_ID]; + stream_info[STREAM_SOCKET_ID] = proc_type_table[i][PROC_SOCKET_ID]; _streams_info_table.push_back(stream_info); - total_streams += stream_info[ov::NUMBER_OF_STREAMS]; } - if (total_streams >= _streams) - break; } - if (total_streams >= _streams) - break; } } } - if (cpu_pinning) { - _cpu_reservation = cpu_pinning; - auto new_config = reserve_cpu_threads(*this); - _stream_processor_ids = new_config._stream_processor_ids; - _streams = new_config._streams; - _threads = new_config._threads; + if (_cpu_reservation) { + reserve_cpu_threads(); + } + + // Recaculate _streams, _threads and _threads_per_stream by _streams_info_table + int num_streams = 0; + _threads = 0; + for (size_t i = 0; i < _streams_info_table.size(); i++) { + if (_streams_info_table[i][NUMBER_OF_STREAMS] > 0) { + num_streams += _streams_info_table[i][NUMBER_OF_STREAMS]; + _threads += _streams_info_table[i][NUMBER_OF_STREAMS] * _streams_info_table[i][THREADS_PER_STREAM]; + } + } + _threads_per_stream = _streams_info_table[0][THREADS_PER_STREAM]; + _streams = _streams > 0 ? num_streams : _streams; + + OPENVINO_DEBUG << "[ threading ] proc_type_table:"; + for (size_t i = 0; i < proc_type_table.size(); i++) { + OPENVINO_DEBUG << proc_type_table[i][ALL_PROC] << " " << proc_type_table[i][MAIN_CORE_PROC] << " " + << proc_type_table[i][EFFICIENT_CORE_PROC] << " " << proc_type_table[i][HYPER_THREADING_PROC] + << " " << proc_type_table[i][PROC_NUMA_NODE_ID] << " " << proc_type_table[i][PROC_SOCKET_ID]; + } + + OPENVINO_DEBUG << "[ threading ] streams_info_table:"; + for (size_t i = 0; i < _streams_info_table.size(); i++) { + OPENVINO_DEBUG << _streams_info_table[i][NUMBER_OF_STREAMS] << " " << _streams_info_table[i][PROC_TYPE] << " " + << _streams_info_table[i][THREADS_PER_STREAM] << " " + << _streams_info_table[i][STREAM_NUMA_NODE_ID] << " " + << _streams_info_table[i][STREAM_SOCKET_ID]; } + OPENVINO_DEBUG << "[ threading ] " << _name << ": " << _streams << "(" << _threads << ")"; } void IStreamsExecutor::Config::set_config_zero_stream() { diff --git a/src/inference/src/dev/threading/thread_affinity.cpp b/src/inference/src/dev/threading/thread_affinity.cpp index a91052f893858b..f1cd0958d5427b 100644 --- a/src/inference/src/dev/threading/thread_affinity.cpp +++ b/src/inference/src/dev/threading/thread_affinity.cpp @@ -51,8 +51,7 @@ bool pin_thread_to_vacant_core(int thrIdx, int hyperthreads, int ncores, const CpuSet& procMask, - const std::vector& cpu_ids, - int cpuIdxOffset) { + const std::vector& cpu_ids) { if (procMask == nullptr) return false; const size_t size = CPU_ALLOC_SIZE(ncores); @@ -64,7 +63,7 @@ bool pin_thread_to_vacant_core(int thrIdx, mapped_idx = cpu_ids[thrIdx]; } else { // Place threads with specified step - int cpu_idx = cpuIdxOffset; + int cpu_idx = 0; for (int i = 0, offset = 0; i < thrIdx; ++i) { cpu_idx += hyperthreads; if (cpu_idx >= num_cpus) @@ -72,8 +71,8 @@ bool pin_thread_to_vacant_core(int thrIdx, } // Find index of 'cpu_idx'-th bit that equals to 1 - mapped_idx = cpuIdxOffset - 1; - while (cpu_idx >= cpuIdxOffset) { + mapped_idx = -1; + while (cpu_idx >= 0) { mapped_idx++; if (CPU_ISSET_S(mapped_idx, size, procMask.get())) --cpu_idx; @@ -125,8 +124,7 @@ bool pin_thread_to_vacant_core(int thrIdx, int hyperthreads, int ncores, const CpuSet& procMask, - const std::vector& cpu_ids, - int cpuIdxOffset) { + const std::vector& cpu_ids) { return 0 != SetThreadAffinityMask(GetCurrentThread(), DWORD_PTR(1) << cpu_ids[thrIdx]); } bool pin_current_thread_by_mask(int ncores, const CpuSet& procMask) { @@ -146,8 +144,7 @@ bool pin_thread_to_vacant_core(int thrIdx, int hyperthreads, int ncores, const CpuSet& procMask, - const std::vector& cpu_ids, - int cpuIdxOffset) { + const std::vector& cpu_ids) { return false; } bool pin_current_thread_by_mask(int ncores, const CpuSet& procMask) { diff --git a/src/inference/src/dev/threading/thread_affinity.hpp b/src/inference/src/dev/threading/thread_affinity.hpp index 6d31989148de92..5428825b1ff6d7 100644 --- a/src/inference/src/dev/threading/thread_affinity.hpp +++ b/src/inference/src/dev/threading/thread_affinity.hpp @@ -80,8 +80,7 @@ bool pin_thread_to_vacant_core(int thrIdx, int hyperThreads, int ncores, const CpuSet& processMask, - const std::vector& cpu_ids = {}, - int cpuIdxOffset = 0); + const std::vector& cpu_ids = {}); /** * @brief Pins thread to a spare core in the round-robin scheme, while respecting the given process mask. diff --git a/src/inference/src/os/lin/lin_system_conf.cpp b/src/inference/src/os/lin/lin_system_conf.cpp index 1cb25f90004df0..988fdab3baeba5 100644 --- a/src/inference/src/os/lin/lin_system_conf.cpp +++ b/src/inference/src/os/lin/lin_system_conf.cpp @@ -15,6 +15,7 @@ #include "ie_common.h" #include "openvino/core/except.hpp" #include "openvino/runtime/system_conf.hpp" +#include "openvino/util/log.hpp" #include "os/cpu_map_info.hpp" namespace ov { @@ -278,6 +279,21 @@ CPU::CPU() { }; _org_proc_type_table = _proc_type_table; + + OPENVINO_DEBUG << "[ threading ] cpu_mapping_table:"; + for (size_t i = 0; i < _cpu_mapping_table.size(); i++) { + OPENVINO_DEBUG << _cpu_mapping_table[i][CPU_MAP_PROCESSOR_ID] << " " + << _cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] << " " << _cpu_mapping_table[i][CPU_MAP_SOCKET_ID] + << " " << _cpu_mapping_table[i][CPU_MAP_CORE_ID] << " " + << _cpu_mapping_table[i][CPU_MAP_CORE_TYPE] << " " << _cpu_mapping_table[i][CPU_MAP_GROUP_ID] + << " " << _cpu_mapping_table[i][CPU_MAP_USED_FLAG]; + } + OPENVINO_DEBUG << "[ threading ] org_proc_type_table:"; + for (size_t i = 0; i < _proc_type_table.size(); i++) { + OPENVINO_DEBUG << _proc_type_table[i][ALL_PROC] << " " << _proc_type_table[i][MAIN_CORE_PROC] << " " + << _proc_type_table[i][EFFICIENT_CORE_PROC] << " " << _proc_type_table[i][HYPER_THREADING_PROC] + << " " << _proc_type_table[i][PROC_NUMA_NODE_ID] << " " << _proc_type_table[i][PROC_SOCKET_ID]; + } } void parse_node_info_linux(const std::vector node_info_table, diff --git a/src/inference/src/system_conf.cpp b/src/inference/src/system_conf.cpp index 72b073dd8fde1c..4dd6b1db499028 100644 --- a/src/inference/src/system_conf.cpp +++ b/src/inference/src/system_conf.cpp @@ -413,29 +413,6 @@ void reserve_available_cpus(const std::vector> streams_info_tab stream_processors, cpu_status); - OPENVINO_DEBUG << "[ threading ] cpu_mapping_table:"; - for (size_t i = 0; i < cpu._cpu_mapping_table.size(); i++) { - OPENVINO_DEBUG << cpu._cpu_mapping_table[i][CPU_MAP_PROCESSOR_ID] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_NUMA_NODE_ID] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_SOCKET_ID] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_CORE_ID] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_CORE_TYPE] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_GROUP_ID] << " " - << cpu._cpu_mapping_table[i][CPU_MAP_USED_FLAG]; - } - OPENVINO_DEBUG << "[ threading ] proc_type_table:"; - for (size_t i = 0; i < cpu._proc_type_table.size(); i++) { - OPENVINO_DEBUG << cpu._proc_type_table[i][ALL_PROC] << " " << cpu._proc_type_table[i][MAIN_CORE_PROC] << " " - << cpu._proc_type_table[i][EFFICIENT_CORE_PROC] << " " - << cpu._proc_type_table[i][HYPER_THREADING_PROC] << " " - << cpu._proc_type_table[i][PROC_NUMA_NODE_ID] << " " << cpu._proc_type_table[i][PROC_SOCKET_ID]; - } - OPENVINO_DEBUG << "[ threading ] streams_info_table:"; - for (size_t i = 0; i < streams_info_table.size(); i++) { - OPENVINO_DEBUG << streams_info_table[i][NUMBER_OF_STREAMS] << " " << streams_info_table[i][PROC_TYPE] << " " - << streams_info_table[i][THREADS_PER_STREAM] << " " << streams_info_table[i][STREAM_NUMA_NODE_ID] - << " " << streams_info_table[i][STREAM_SOCKET_ID]; - } OPENVINO_DEBUG << "[ threading ] stream_processors:"; for (size_t i = 0; i < stream_processors.size(); i++) { OPENVINO_DEBUG << "{"; diff --git a/src/inference/tests/unit/executor_config_test.cpp b/src/inference/tests/unit/executor_config_test.cpp new file mode 100644 index 00000000000000..6a02b35241a686 --- /dev/null +++ b/src/inference/tests/unit/executor_config_test.cpp @@ -0,0 +1,1146 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include "common_test_utils/test_common.hpp" +#include "openvino/runtime/threading/istreams_executor.hpp" +#include "os/cpu_map_info.hpp" + +using namespace testing; +using namespace ov; +using namespace threading; + +namespace { + +#if defined(__linux__) || defined(_WIN32) + +struct ExecutorConfigTestCase { + std::vector> _proc_type_table; + std::vector> _cpu_mapping_table; + int _num_streams; + int _threads_per_stream; + ov::threading::IStreamsExecutor::Config::PreferredCoreType _core_type; + bool _cpu_pinning; + std::vector> _streams_info_table_in; + std::vector> _streams_info_table; + std::vector> _stream_processors; +}; + +class ExecutorConfigTest : public ov::test::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + auto test_data = std::get<0>(GetParam()); + + CPU& cpu = cpu_info(); + cpu._org_proc_type_table = test_data._proc_type_table; + cpu._proc_type_table = test_data._proc_type_table; + cpu._cpu_mapping_table = test_data._cpu_mapping_table; + cpu._numa_nodes = cpu._proc_type_table.size() > 1 ? static_cast(cpu._proc_type_table.size()) - 1 : 1; + cpu._sockets = cpu._numa_nodes; + + ov::threading::IStreamsExecutor::Config config{"config test", + test_data._num_streams, + test_data._threads_per_stream, + ov::threading::IStreamsExecutor::ThreadBindingType::NONE, + 1, + 0, + 0, + test_data._core_type, + test_data._streams_info_table_in, + test_data._cpu_pinning}; + + ASSERT_EQ(test_data._cpu_pinning, config.get_cpu_reservation()); + ASSERT_EQ(test_data._streams_info_table, config.get_streams_info_table()); + ASSERT_EQ(test_data._stream_processors, config.get_stream_processor_ids()); + } +}; + +ExecutorConfigTestCase _1sockets_streams_4_threads_1 = { + // param[in]: proc_type_table, {total processors, number of physical processors, number of Efficient processors, + // number of hyper threading processors} + { + {12, 6, 0, 6, 0, 0}, + }, + // param[in]: cpu_mapping_table, {PROCESSOR_ID, NUMA_ID, SOCKET_ID, CORE_ID, CORE_TYPE, GROUP_ID, Used} + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 4, // param[in]: the number of streams + 1, // param[in]: the number of threads per stream + ov::threading::IStreamsExecutor::Config::ANY, // param[in]: specified cpu core type + false, // param[in]: specified cpu pinning + {}, // param[in]: streams info table + // param[out]: streams_info_table, {NUMBER_OF_STREAMS, PROC_TYPE, THREADS_PER_STREAM, STREAM_NUMA_NODE_ID, + // STREAM_SOCKET_ID} + { + {4, MAIN_CORE_PROC, 1, 0, 0}, + }, + // param[out]: stream_processors, the list of processor ids on each stream. + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_4_threads_0 = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 4, + 0, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + {}, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_1_threads_12 = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 1, + 12, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {1, ALL_PROC, 12, 0, 0}, + {0, MAIN_CORE_PROC, 6, 0, 0}, + {0, HYPER_THREADING_PROC, 6, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_1_threads_10 = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 1, + 10, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {1, ALL_PROC, 10, 0, 0}, + {0, MAIN_CORE_PROC, 6, 0, 0}, + {0, HYPER_THREADING_PROC, 4, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_12_threads_1 = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 12, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {6, MAIN_CORE_PROC, 1, 0, 0}, + {6, HYPER_THREADING_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_13_threads_1 = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 13, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {6, MAIN_CORE_PROC, 1, 0, 0}, + {6, HYPER_THREADING_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_6_threads_1_core_e = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 7, + 1, + ov::threading::IStreamsExecutor::Config::LITTLE, + false, + {}, + { + {6, MAIN_CORE_PROC, 1, 0, 0}, + {1, HYPER_THREADING_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _1sockets_streams_5_threads_1_binding = { + { + {12, 6, 0, 6, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, + {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, + {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, + {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, + {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, + {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, + {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + }, + 5, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + true, + {}, + { + {5, MAIN_CORE_PROC, 1, 0, 0}, + }, + {{0}, {2}, {4}, {6}, {8}}, +}; + +ExecutorConfigTestCase _2sockets_streams_36_threads_1 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {40, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {41, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {42, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {43, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {44, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {45, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {46, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {47, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {48, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {49, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {50, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {51, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {52, 0, 0, 52, MAIN_CORE_PROC, 52, -1}, {53, 0, 0, 53, MAIN_CORE_PROC, 53, -1}, + {54, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, {55, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {56, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {57, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {58, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {59, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {60, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {61, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {62, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {63, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {64, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {65, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {66, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {67, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {68, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {69, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {70, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {71, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + }, + 36, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {18, MAIN_CORE_PROC, 1, 0, 0}, + {18, MAIN_CORE_PROC, 1, 1, 1}, + }, + {}, +}; + +ExecutorConfigTestCase _2sockets_streams_4_threads_5 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {40, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {41, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {42, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {43, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {44, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {45, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {46, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {47, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {48, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {49, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {50, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {51, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {52, 0, 0, 52, MAIN_CORE_PROC, 52, -1}, {53, 0, 0, 53, MAIN_CORE_PROC, 53, -1}, + {54, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, {55, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {56, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {57, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {58, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {59, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {60, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {61, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {62, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {63, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {64, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {65, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {66, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {67, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {68, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {69, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {70, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {71, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + }, + 4, + 5, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {3, MAIN_CORE_PROC, 5, 0, 0}, + {1, MAIN_CORE_PROC, 5, 1, 1}, + }, + {}, +}; + +ExecutorConfigTestCase _2sockets_streams_1_threads_36 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {40, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {41, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {42, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {43, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {44, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {45, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {46, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {47, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {48, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {49, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {50, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {51, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {52, 0, 0, 52, MAIN_CORE_PROC, 52, -1}, {53, 0, 0, 53, MAIN_CORE_PROC, 53, -1}, + {54, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, {55, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {56, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {57, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {58, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {59, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {60, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {61, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {62, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {63, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {64, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {65, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {66, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {67, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {68, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {69, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {70, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {71, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + }, + 1, + 36, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {1, ALL_PROC, 36, -1, -1}, + {0, MAIN_CORE_PROC, 18, 0, 0}, + {0, MAIN_CORE_PROC, 18, 1, 1}, + }, + {}, +}; + +ExecutorConfigTestCase _2sockets_streams_1_threads_30 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + { + {0, 0, 0, 0, HYPER_THREADING_PROC, 0, -1}, {1, 0, 0, 1, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 2, HYPER_THREADING_PROC, 2, -1}, {3, 0, 0, 3, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 4, HYPER_THREADING_PROC, 4, -1}, {5, 0, 0, 5, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 6, HYPER_THREADING_PROC, 6, -1}, {7, 0, 0, 7, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 8, HYPER_THREADING_PROC, 8, -1}, {9, 0, 0, 9, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 10, HYPER_THREADING_PROC, 10, -1}, {11, 0, 0, 11, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 12, HYPER_THREADING_PROC, 12, -1}, {13, 0, 0, 13, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 14, HYPER_THREADING_PROC, 14, -1}, {15, 0, 0, 15, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 16, HYPER_THREADING_PROC, 16, -1}, {17, 0, 0, 17, HYPER_THREADING_PROC, 17, -1}, + {18, 1, 1, 18, HYPER_THREADING_PROC, 18, -1}, {19, 1, 1, 19, HYPER_THREADING_PROC, 19, -1}, + {20, 1, 1, 20, HYPER_THREADING_PROC, 20, -1}, {21, 1, 1, 21, HYPER_THREADING_PROC, 21, -1}, + {22, 1, 1, 22, HYPER_THREADING_PROC, 22, -1}, {23, 1, 1, 23, HYPER_THREADING_PROC, 23, -1}, + {24, 1, 1, 24, HYPER_THREADING_PROC, 24, -1}, {25, 1, 1, 25, HYPER_THREADING_PROC, 25, -1}, + {26, 1, 1, 26, HYPER_THREADING_PROC, 26, -1}, {27, 1, 1, 27, HYPER_THREADING_PROC, 27, -1}, + {28, 1, 1, 28, HYPER_THREADING_PROC, 28, -1}, {29, 1, 1, 29, HYPER_THREADING_PROC, 29, -1}, + {30, 1, 1, 30, HYPER_THREADING_PROC, 30, -1}, {31, 1, 1, 31, HYPER_THREADING_PROC, 31, -1}, + {32, 1, 1, 32, HYPER_THREADING_PROC, 32, -1}, {33, 1, 1, 33, HYPER_THREADING_PROC, 33, -1}, + {34, 1, 1, 34, HYPER_THREADING_PROC, 34, -1}, {35, 1, 1, 35, HYPER_THREADING_PROC, 35, -1}, + {36, 0, 0, 36, MAIN_CORE_PROC, 36, -1}, {37, 0, 0, 37, MAIN_CORE_PROC, 37, -1}, + {38, 0, 0, 38, MAIN_CORE_PROC, 38, -1}, {39, 0, 0, 39, MAIN_CORE_PROC, 39, -1}, + {40, 0, 0, 40, MAIN_CORE_PROC, 40, -1}, {41, 0, 0, 41, MAIN_CORE_PROC, 41, -1}, + {42, 0, 0, 42, MAIN_CORE_PROC, 42, -1}, {43, 0, 0, 43, MAIN_CORE_PROC, 43, -1}, + {44, 0, 0, 44, MAIN_CORE_PROC, 44, -1}, {45, 0, 0, 45, MAIN_CORE_PROC, 45, -1}, + {46, 0, 0, 46, MAIN_CORE_PROC, 46, -1}, {47, 0, 0, 47, MAIN_CORE_PROC, 47, -1}, + {48, 0, 0, 48, MAIN_CORE_PROC, 48, -1}, {49, 0, 0, 49, MAIN_CORE_PROC, 49, -1}, + {50, 0, 0, 50, MAIN_CORE_PROC, 50, -1}, {51, 0, 0, 51, MAIN_CORE_PROC, 51, -1}, + {52, 0, 0, 52, MAIN_CORE_PROC, 52, -1}, {53, 0, 0, 53, MAIN_CORE_PROC, 53, -1}, + {54, 1, 1, 54, MAIN_CORE_PROC, 54, -1}, {55, 1, 1, 55, MAIN_CORE_PROC, 55, -1}, + {56, 1, 1, 56, MAIN_CORE_PROC, 56, -1}, {57, 1, 1, 57, MAIN_CORE_PROC, 57, -1}, + {58, 1, 1, 58, MAIN_CORE_PROC, 58, -1}, {59, 1, 1, 59, MAIN_CORE_PROC, 59, -1}, + {60, 1, 1, 60, MAIN_CORE_PROC, 60, -1}, {61, 1, 1, 61, MAIN_CORE_PROC, 61, -1}, + {62, 1, 1, 62, MAIN_CORE_PROC, 62, -1}, {63, 1, 1, 63, MAIN_CORE_PROC, 63, -1}, + {64, 1, 1, 64, MAIN_CORE_PROC, 64, -1}, {65, 1, 1, 65, MAIN_CORE_PROC, 65, -1}, + {66, 1, 1, 66, MAIN_CORE_PROC, 66, -1}, {67, 1, 1, 67, MAIN_CORE_PROC, 67, -1}, + {68, 1, 1, 68, MAIN_CORE_PROC, 68, -1}, {69, 1, 1, 69, MAIN_CORE_PROC, 69, -1}, + {70, 1, 1, 70, MAIN_CORE_PROC, 70, -1}, {71, 1, 1, 71, MAIN_CORE_PROC, 71, -1}, + }, + 1, + 30, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {1, ALL_PROC, 30, -1, -1}, + {0, MAIN_CORE_PROC, 18, 0, 0}, + {0, MAIN_CORE_PROC, 12, 1, 1}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_5_threads_2 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 5, + 2, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {4, MAIN_CORE_PROC, 2, 0, 0}, + {1, EFFICIENT_CORE_PROC, 2, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_5_threads_5 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 5, + 5, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {2, MAIN_CORE_PROC, 4, 0, 0}, + {2, EFFICIENT_CORE_PROC, 4, 0, 0}, + {1, HYPER_THREADING_PROC, 4, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_4_threads_5 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 4, + 5, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {1, MAIN_CORE_PROC, 5, 0, 0}, + {1, EFFICIENT_CORE_PROC, 5, 0, 0}, + {1, HYPER_THREADING_PROC, 5, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_4_threads_1 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 4, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {4, MAIN_CORE_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_5_threads_10 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 5, + 10, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {2, MAIN_CORE_PROC, 4, 0, 0}, + {2, EFFICIENT_CORE_PROC, 4, 0, 0}, + {1, HYPER_THREADING_PROC, 4, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_26_threads_1 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 26, + 1, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + { + {8, MAIN_CORE_PROC, 1, 0, 0}, + {8, EFFICIENT_CORE_PROC, 1, 0, 0}, + {8, HYPER_THREADING_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_26_threads_1_p = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 26, + 1, + ov::threading::IStreamsExecutor::Config::BIG, + false, + {}, + { + {8, MAIN_CORE_PROC, 1, 0, 0}, + {8, HYPER_THREADING_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_26_threads_1_e = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 26, + 1, + ov::threading::IStreamsExecutor::Config::LITTLE, + false, + {}, + { + {8, EFFICIENT_CORE_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_0 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 0, + ov::threading::IStreamsExecutor::Config::ANY, + false, + {}, + {}, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_1_p = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 1, + ov::threading::IStreamsExecutor::Config::BIG, + false, + {}, + { + {1, MAIN_CORE_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_1_e = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 1, + ov::threading::IStreamsExecutor::Config::LITTLE, + false, + {}, + { + {1, EFFICIENT_CORE_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_16_p = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 16, + ov::threading::IStreamsExecutor::Config::BIG, + false, + {}, + { + {1, ALL_PROC, 16, 0, 0}, + {0, MAIN_CORE_PROC, 8, 0, 0}, + {0, HYPER_THREADING_PROC, 8, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_18_p = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 18, + ov::threading::IStreamsExecutor::Config::BIG, + false, + {}, + { + {1, ALL_PROC, 16, 0, 0}, + {0, MAIN_CORE_PROC, 8, 0, 0}, + {0, HYPER_THREADING_PROC, 8, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_1_threads_10_p = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 10, + ov::threading::IStreamsExecutor::Config::BIG, + false, + {}, + { + {1, ALL_PROC, 10, 0, 0}, + {0, MAIN_CORE_PROC, 8, 0, 0}, + {0, HYPER_THREADING_PROC, 2, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_10_threads_1_e = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 10, + 1, + ov::threading::IStreamsExecutor::Config::LITTLE, + false, + {}, + { + {8, EFFICIENT_CORE_PROC, 1, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_10_threads_1_binding = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 10, + 2, + ov::threading::IStreamsExecutor::Config::ANY, + true, + {}, + { + {4, MAIN_CORE_PROC, 2, 0, 0}, + {4, EFFICIENT_CORE_PROC, 2, 0, 0}, + {2, HYPER_THREADING_PROC, 2, 0, 0}, + }, + {{0, 2}, {4, 6}, {8, 10}, {12, 14}, {16, 17}, {18, 19}, {20, 21}, {22, 23}, {1, 3}, {5, 7}}, +}; + +ExecutorConfigTestCase _pecore_streams_info_table_1 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 8, + ov::threading::IStreamsExecutor::Config::BIG, + false, + { + {2, MAIN_CORE_PROC, 2, 0, 0}, + {2, EFFICIENT_CORE_PROC, 2, 0, 0}, + }, + { + {2, MAIN_CORE_PROC, 2, 0, 0}, + {2, EFFICIENT_CORE_PROC, 2, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_info_table_2 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 8, + ov::threading::IStreamsExecutor::Config::BIG, + false, + { + {5, MAIN_CORE_PROC, 2, 0, 0}, + {2, EFFICIENT_CORE_PROC, 2, 0, 0}, + }, + { + {1, MAIN_CORE_PROC, 8, 0, 0}, + }, + {}, +}; + +ExecutorConfigTestCase _pecore_streams_info_table_3 = { + { + {24, 8, 8, 8, 0, 0}, + }, + { + {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, + {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, + {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, + {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, + {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, + {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, + {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, + {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, + {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, + {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, + {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, + {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, + }, + 1, + 8, + ov::threading::IStreamsExecutor::Config::BIG, + true, + { + {2, MAIN_CORE_PROC, 2, 0, 0}, + {2, EFFICIENT_CORE_PROC, 2, 0, 0}, + {2, HYPER_THREADING_PROC, 2, 0, 0}, + }, + { + {2, MAIN_CORE_PROC, 2, 0, 0}, + {2, EFFICIENT_CORE_PROC, 2, 0, 0}, + {2, HYPER_THREADING_PROC, 2, 0, 0}, + }, + {{0, 2}, {4, 6}, {16, 17}, {18, 19}, {1, 3}, {5, 7}}, +}; + +TEST_P(ExecutorConfigTest, ExecutorConfig) {} + +INSTANTIATE_TEST_SUITE_P(smoke_ExecutorConfig, + ExecutorConfigTest, + testing::Values(_1sockets_streams_4_threads_1, + _1sockets_streams_4_threads_0, + _1sockets_streams_1_threads_12, + _1sockets_streams_1_threads_10, + _1sockets_streams_12_threads_1, + _1sockets_streams_13_threads_1, + _1sockets_streams_6_threads_1_core_e, + _1sockets_streams_5_threads_1_binding, + _2sockets_streams_36_threads_1, + _2sockets_streams_4_threads_5, + _2sockets_streams_1_threads_36, + _2sockets_streams_1_threads_30, + _pecore_streams_5_threads_2, + _pecore_streams_5_threads_5, + _pecore_streams_4_threads_5, + _pecore_streams_4_threads_1, + _pecore_streams_5_threads_10, + _pecore_streams_26_threads_1, + _pecore_streams_26_threads_1_p, + _pecore_streams_26_threads_1_e, + _pecore_streams_1_threads_0, + _pecore_streams_1_threads_1_p, + _pecore_streams_1_threads_1_e, + _pecore_streams_1_threads_16_p, + _pecore_streams_1_threads_18_p, + _pecore_streams_1_threads_10_p, + _pecore_streams_10_threads_1_e, + _pecore_streams_10_threads_1_binding, + _pecore_streams_info_table_1, + _pecore_streams_info_table_2, + _pecore_streams_info_table_3)); +#endif +} // namespace \ No newline at end of file diff --git a/src/inference/tests/unit/make_default_multi_threaded_test.cpp b/src/inference/tests/unit/make_default_multi_threaded_test.cpp new file mode 100644 index 00000000000000..e1917394507045 --- /dev/null +++ b/src/inference/tests/unit/make_default_multi_threaded_test.cpp @@ -0,0 +1,153 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include + +#include "openvino/runtime/threading/istreams_executor.hpp" +#include "os/cpu_map_info.hpp" + +using namespace testing; +using namespace ov; +using namespace threading; + +namespace { + +#if defined(__linux__) || defined(_WIN32) + +struct MakeDefaultMultiThreadsTestCase { + std::vector> _proc_type_table; + int _num_streams; + std::vector> _streams_info_table; +}; + +class MakeDefaultMultiThreadsTest : public ov::test::TestsCommon, + public testing::WithParamInterface> { +public: + void SetUp() override { + auto test_data = std::get<0>(GetParam()); + + CPU& cpu = cpu_info(); + cpu._org_proc_type_table = test_data._proc_type_table; + cpu._proc_type_table = test_data._proc_type_table; + cpu._numa_nodes = + test_data._proc_type_table.size() > 1 ? static_cast(test_data._proc_type_table.size()) - 1 : 1; + + ov::threading::IStreamsExecutor::Config config{"make default multi threads test", test_data._num_streams}; + auto streamsConfig = ov::threading::IStreamsExecutor::Config::make_default_multi_threaded(config); + + ASSERT_EQ(streamsConfig.get_streams_info_table(), test_data._streams_info_table); + } +}; + +MakeDefaultMultiThreadsTestCase _1sockets_streams_1 = { + // param[in]: proc_type_table, {total processors, number of physical processors, number of Efficient processors, + // number of hyper threading processors} + { + {12, 6, 0, 6, 0, 0}, + }, + 1, // param[in]: the number of streams + // param[out]: streams info table + { + {1, 1, 6, 0, 0}, + }, +}; + +MakeDefaultMultiThreadsTestCase _1sockets_streams_2 = { + { + {12, 6, 0, 6, 0, 0}, + }, + 2, + { + {1, 1, 6, 0, 0}, + {1, 3, 6, 0, 0}, + }, +}; + +MakeDefaultMultiThreadsTestCase _2sockets_streams_1 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + 1, + { + {1, 0, 36, -1, -1}, + {0, 1, 18, 0, 0}, + {0, 1, 18, 1, 1}, + }, +}; + +MakeDefaultMultiThreadsTestCase _2sockets_streams_4 = { + { + {72, 36, 0, 36, -1, -1}, + {36, 18, 0, 18, 0, 0}, + {36, 18, 0, 18, 1, 1}, + }, + 4, + { + {2, 1, 9, 0, 0}, + {2, 1, 9, 1, 1}, + }, +}; + +MakeDefaultMultiThreadsTestCase _pecore24_streams_1 = { + { + {24, 8, 8, 8, 0, 0}, + }, + 1, + { + {1, 1, 8, 0, 0}, + }, +}; + +MakeDefaultMultiThreadsTestCase _pecore24_streams_3 = { + { + {24, 8, 8, 8, 0, 0}, + }, + 3, + { + {3, 1, 2, 0, 0}, + }, +}; + +MakeDefaultMultiThreadsTestCase _pecore32_streams_1 = { + { + {32, 8, 16, 8, 0, 0}, + }, + 1, + { + {1, 0, 24, 0, 0}, + {0, 1, 8, 0, 0}, + {0, 2, 16, 0, 0}, + }, +}; + +MakeDefaultMultiThreadsTestCase _pecore32_streams_5 = { + { + {32, 8, 16, 8, 0, 0}, + }, + 5, + { + {1, 1, 5, 0, 0}, + {3, 2, 5, 0, 0}, + {1, 3, 5, 0, 0}, + }, +}; + +TEST_P(MakeDefaultMultiThreadsTest, MakeDefaultMultiThreads) {} + +INSTANTIATE_TEST_SUITE_P(smoke_MakeDefaultMultiThreads, + MakeDefaultMultiThreadsTest, + testing::Values(_1sockets_streams_1, + _1sockets_streams_2, + _2sockets_streams_1, + _2sockets_streams_4, + _pecore24_streams_1, + _pecore24_streams_3, + _pecore32_streams_1, + _pecore32_streams_5)); +#endif +} // namespace diff --git a/src/inference/tests/unit/update_executor_config_test.cpp b/src/inference/tests/unit/update_executor_config_test.cpp deleted file mode 100644 index abb3612eb8750d..00000000000000 --- a/src/inference/tests/unit/update_executor_config_test.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "common_test_utils/test_common.hpp" -#include "openvino/runtime/threading/istreams_executor.hpp" -#include "os/cpu_map_info.hpp" - -using namespace testing; -using namespace ov; -using namespace threading; - -namespace { - -#if defined(__linux__) || defined(_WIN32) - -struct UpdateExecutorConfigTestCase { - ov::threading::IStreamsExecutor::Config _config; - std::vector> _proc_type_table; - std::vector> _cpu_mapping_table; - int _num_streams; - int _threads_per_stream; - ov::threading::IStreamsExecutor::Config::PreferredCoreType _core_type; - bool _cpu_pinning; - std::vector> _streams_info_table; - std::vector> _stream_processors; -}; - -class UpdateExecutorConfigTest : public ov::test::TestsCommon, - public testing::WithParamInterface> { -public: - void SetUp() override { - auto test_data = std::get<0>(GetParam()); - - CPU& cpu = cpu_info(); - cpu._org_proc_type_table = test_data._proc_type_table; - cpu._proc_type_table = test_data._proc_type_table; - cpu._cpu_mapping_table = test_data._cpu_mapping_table; - cpu._numa_nodes = 1; - - test_data._config.update_executor_config(test_data._num_streams, - test_data._threads_per_stream, - test_data._core_type, - test_data._cpu_pinning); - - ASSERT_EQ(test_data._num_streams, test_data._config._streams); - ASSERT_EQ(test_data._threads_per_stream, test_data._config._threadsPerStream); - ASSERT_EQ(test_data._core_type, test_data._config._threadPreferredCoreType); - ASSERT_EQ(test_data._cpu_pinning, test_data._config._cpu_reservation); - ASSERT_EQ(test_data._num_streams, test_data._config._streams); - ASSERT_EQ(test_data._streams_info_table, test_data._config._streams_info_table); - ASSERT_EQ(test_data._stream_processors, test_data._config._stream_processor_ids); - } -}; - -UpdateExecutorConfigTestCase _update_num_streams = { - ov::threading::IStreamsExecutor::Config{"update num streams test"}, // param[in]: initial configuration - // param[in]: proc_type_table, {total processors, number of physical processors, number of Efficient processors, - // number of hyper threading processors} - { - {12, 6, 0, 6, 0, 0}, - }, - // param[in]: cpu_mapping_table, {PROCESSOR_ID, NUMA_ID, SOCKET_ID, CORE_ID, CORE_TYPE, GROUP_ID, Used} - { - {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, - {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, - {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, - {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, - {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, - {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, - }, - 4, // param[in]: the number of streams - 1, // param[in]: the number of threads per stream - ov::threading::IStreamsExecutor::Config::ANY, // param[in]: specified cpu core type - false, // param[in]: specified cpu pinning - // param[out]: streams_info_table, {NUMBER_OF_STREAMS, PROC_TYPE, THREADS_PER_STREAM, STREAM_NUMA_NODE_ID, - // STREAM_SOCKET_ID} - { - {4, MAIN_CORE_PROC, 1, 0, 0}, - }, - // param[out]: stream_processors, the list of processor ids on each stream. - {}, -}; - -UpdateExecutorConfigTestCase _update_core_type = { - ov::threading::IStreamsExecutor::Config{"update core type test"}, - { - {24, 8, 8, 8, 0, 0}, - }, - { - {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, - {8, 0, 0, 4, MAIN_CORE_PROC, 8, -1}, {9, 0, 0, 4, HYPER_THREADING_PROC, 9, -1}, - {10, 0, 0, 5, MAIN_CORE_PROC, 10, -1}, {11, 0, 0, 5, HYPER_THREADING_PROC, 11, -1}, - {12, 0, 0, 6, MAIN_CORE_PROC, 12, -1}, {13, 0, 0, 6, HYPER_THREADING_PROC, 13, -1}, - {14, 0, 0, 7, MAIN_CORE_PROC, 14, -1}, {15, 0, 0, 7, HYPER_THREADING_PROC, 15, -1}, - {16, 0, 0, 8, EFFICIENT_CORE_PROC, 16, -1}, {17, 0, 0, 9, EFFICIENT_CORE_PROC, 17, -1}, - {18, 0, 0, 10, EFFICIENT_CORE_PROC, 18, -1}, {19, 0, 0, 11, EFFICIENT_CORE_PROC, 19, -1}, - {20, 0, 0, 12, EFFICIENT_CORE_PROC, 20, -1}, {21, 0, 0, 13, EFFICIENT_CORE_PROC, 21, -1}, - {22, 0, 0, 14, EFFICIENT_CORE_PROC, 22, -1}, {23, 0, 0, 15, EFFICIENT_CORE_PROC, 23, -1}, - }, - 8, - 1, - ov::threading::IStreamsExecutor::Config::LITTLE, - false, - { - {8, EFFICIENT_CORE_PROC, 1, 0, 0}, - }, - {}, -}; - -UpdateExecutorConfigTestCase _update_cpu_pinning = { - ov::threading::IStreamsExecutor::Config{"update cpu pinning test"}, - { - {8, 4, 0, 4, 0, 0}, - }, - { - {0, 0, 0, 0, MAIN_CORE_PROC, 0, -1}, - {1, 0, 0, 0, HYPER_THREADING_PROC, 1, -1}, - {2, 0, 0, 1, MAIN_CORE_PROC, 2, -1}, - {3, 0, 0, 1, HYPER_THREADING_PROC, 3, -1}, - {4, 0, 0, 2, MAIN_CORE_PROC, 4, -1}, - {5, 0, 0, 2, HYPER_THREADING_PROC, 5, -1}, - {6, 0, 0, 3, MAIN_CORE_PROC, 6, -1}, - {7, 0, 0, 3, HYPER_THREADING_PROC, 7, -1}, - }, - 8, - 1, - ov::threading::IStreamsExecutor::Config::ANY, - true, - { - {4, MAIN_CORE_PROC, 1, 0, 0}, - {4, HYPER_THREADING_PROC, 1, 0, 0}, - }, - { - {0}, - {2}, - {4}, - {6}, - {1}, - {3}, - {5}, - {7}, - }, -}; - -TEST_P(UpdateExecutorConfigTest, UpdateExecutorConfig) {} - -INSTANTIATE_TEST_SUITE_P(smoke_UpdateExecutorConfig, - UpdateExecutorConfigTest, - testing::Values(_update_num_streams, _update_core_type, _update_cpu_pinning)); -#endif -} // namespace diff --git a/src/plugins/intel_cpu/src/compiled_model.cpp b/src/plugins/intel_cpu/src/compiled_model.cpp index da7798847d03c3..6e755ce01824a0 100644 --- a/src/plugins/intel_cpu/src/compiled_model.cpp +++ b/src/plugins/intel_cpu/src/compiled_model.cpp @@ -46,7 +46,6 @@ CompiledModel::CompiledModel(const std::shared_ptr& model, m_cfg{cfg}, m_name{model->get_name()}, m_loaded_from_cache(loaded_from_cache) { - bool isFloatModel = !ov::op::util::has_op_with_type(m_model); m_mutex = std::make_shared(); const auto& core = m_plugin->get_core(); if (!core) @@ -57,15 +56,9 @@ CompiledModel::CompiledModel(const std::shared_ptr& model, // special case when all InferRequests are muxed into a single queue m_task_executor = m_plugin->get_executor_manager()->get_executor("CPU"); } else { - auto streamsExecutorConfig = - is_cpu_map_available() - ? m_cfg.streamExecutorConfig - : IStreamsExecutor::Config::make_default_multi_threaded(m_cfg.streamExecutorConfig, isFloatModel); - streamsExecutorConfig._name = "CPUStreamsExecutor"; - m_cfg.streamExecutorConfig._threads = streamsExecutorConfig._threads; - m_task_executor = m_plugin->get_executor_manager()->get_idle_cpu_streams_executor(streamsExecutorConfig); + m_task_executor = m_plugin->get_executor_manager()->get_idle_cpu_streams_executor(m_cfg.streamExecutorConfig); } - if (0 != cfg.streamExecutorConfig._streams) { + if (0 != cfg.streams) { m_callback_executor = m_plugin->get_executor_manager()->get_idle_cpu_streams_executor( IStreamsExecutor::Config{"CPUCallbackExecutor", 1, 0, IStreamsExecutor::ThreadBindingType::NONE}); } else { @@ -77,11 +70,11 @@ CompiledModel::CompiledModel(const std::shared_ptr& model, if (m_callback_executor) set_callback_executor(m_callback_executor); - int streams = std::max(1, m_cfg.streamExecutorConfig._streams); + int streams = std::max(1, m_cfg.streamExecutorConfig.get_streams()); std::vector tasks; tasks.resize(streams); m_graphs.resize(streams); - if (m_cfg.streamExecutorConfig._streams != 0) { + if (m_cfg.streams != 0) { auto all_graphs_ready = [&] { return std::all_of(m_graphs.begin(), m_graphs.end(), [&](Graph& graph) { return graph.IsReady(); @@ -117,7 +110,7 @@ CompiledModel::GraphGuard::Lock CompiledModel::get_graph() const { { std::lock_guard lock{*m_mutex.get()}; // disable weights caching if graph was created only once - auto weightsCache = m_cfg.streamExecutorConfig._streams != 1 ? m_socketWeights[socketId] : nullptr; + auto weightsCache = m_cfg.streams != 1 ? m_socketWeights[socketId] : nullptr; auto isQuantizedFlag = (m_cfg.lpTransformsMode == Config::On) && ov::pass::low_precision::LowPrecision::isFunctionQuantized(m_model); @@ -214,16 +207,16 @@ ov::Any CompiledModel::get_property(const std::string& name) const { const std::string modelName = graph.dump()->get_friendly_name(); return decltype(ov::model_name)::value_type(modelName); } else if (name == ov::optimal_number_of_infer_requests) { - const auto streams = config.streamExecutorConfig._streams; + const auto streams = config.streamExecutorConfig.get_streams(); return decltype(ov::optimal_number_of_infer_requests)::value_type( streams > 0 ? streams : 1); // ov::optimal_number_of_infer_requests has no negative values } else if (name == ov::num_streams) { - const auto streams = config.streamExecutorConfig._streams; + const auto streams = config.streamExecutorConfig.get_streams(); return decltype(ov::num_streams)::value_type( streams); // ov::num_streams has special negative values (AUTO = -1, NUMA = -2) OPENVINO_SUPPRESS_DEPRECATED_START } else if (name == ov::affinity) { - const auto affinity = config.streamExecutorConfig._threadBindingType; + const auto affinity = config.threadBindingType; switch (affinity) { case IStreamsExecutor::ThreadBindingType::NONE: return ov::Affinity::NONE; @@ -237,7 +230,7 @@ ov::Any CompiledModel::get_property(const std::string& name) const { return ov::Affinity::NONE; OPENVINO_SUPPRESS_DEPRECATED_END } else if (name == ov::inference_num_threads) { - const auto num_threads = config.streamExecutorConfig._threads; + const auto num_threads = config.streamExecutorConfig.get_threads(); return decltype(ov::inference_num_threads)::value_type(num_threads); } else if (name == ov::enable_profiling.name()) { const bool perfCount = config.collectPerfCounters; diff --git a/src/plugins/intel_cpu/src/config.cpp b/src/plugins/intel_cpu/src/config.cpp index a5ab2a3385b8a3..0bb7e80ea32895 100644 --- a/src/plugins/intel_cpu/src/config.cpp +++ b/src/plugins/intel_cpu/src/config.cpp @@ -26,9 +26,9 @@ using namespace dnnl::impl::cpu::x64; Config::Config() { // this is default mode #if defined(__APPLE__) || defined(_WIN32) - streamExecutorConfig._threadBindingType = IStreamsExecutor::NONE; + threadBindingType = IStreamsExecutor::NONE; #else - streamExecutorConfig._threadBindingType = IStreamsExecutor::CORES; + threadBindingType = IStreamsExecutor::CORES; #endif // for the TBB code-path, additional configuration depending on the OS and CPU types @@ -37,14 +37,14 @@ Config::Config() { // 'CORES' is not implemented for Win/MacOS; so the 'NONE' or 'NUMA' is default auto numaNodes = get_available_numa_nodes(); if (numaNodes.size() > 1) { - streamExecutorConfig._threadBindingType = IStreamsExecutor::NUMA; + threadBindingType = IStreamsExecutor::NUMA; } else { - streamExecutorConfig._threadBindingType = IStreamsExecutor::NONE; + threadBindingType = IStreamsExecutor::NONE; } # endif if (get_available_cores_types().size() > 1 /*Hybrid CPU*/) { - streamExecutorConfig._threadBindingType = IStreamsExecutor::HYBRID_AWARE; + threadBindingType = IStreamsExecutor::HYBRID_AWARE; } #endif CPU_DEBUG_CAP_ENABLE(applyDebugCapsProperties()); @@ -74,26 +74,63 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) { if (streamExecutorConfigKeys.end() != std::find(std::begin(streamExecutorConfigKeys), std::end(streamExecutorConfigKeys), key)) { streamExecutorConfig.set_property(key, val.as()); + streams = streamExecutorConfig.get_streams(); + threads = streamExecutorConfig.get_threads(); + threadsPerStream = streamExecutorConfig.get_threads_per_stream(); + if (key == ov::num_streams.name()) { + ov::Any value = val.as(); + auto streams_value = value.as(); + if (streams_value == ov::streams::NUMA) { + latencyThreadingMode = Config::LatencyThreadingMode::PER_NUMA_NODE; + } else if (streams_value == ov::streams::AUTO) { + hintPerfMode = ov::hint::PerformanceMode::THROUGHPUT; + changedHintPerfMode = true; + } else { + streamsChanged = true; + } + } OPENVINO_SUPPRESS_DEPRECATED_START - if (key == ov::affinity.name()) { + } else if (key == ov::affinity.name()) { + try { + ov::Affinity affinity = val.as(); changedCpuPinning = true; - try { - const auto affinity_val = val.as(); - enableCpuPinning = - (affinity_val == ov::Affinity::CORE || affinity_val == ov::Affinity::HYBRID_AWARE) ? true - : false; - } catch (const ov::Exception&) { + enableCpuPinning = + (affinity == ov::Affinity::CORE || affinity == ov::Affinity::HYBRID_AWARE) ? true : false; + switch (affinity) { + case ov::Affinity::NONE: + threadBindingType = IStreamsExecutor::ThreadBindingType::NONE; + break; + case ov::Affinity::CORE: { +#if (defined(__APPLE__) || defined(_WIN32)) + threadBindingType = IStreamsExecutor::ThreadBindingType::NUMA; +#else + threadBindingType = IStreamsExecutor::ThreadBindingType::CORES; +#endif + } break; + case ov::Affinity::NUMA: + threadBindingType = IStreamsExecutor::ThreadBindingType::NUMA; + break; + case ov::Affinity::HYBRID_AWARE: + threadBindingType = IStreamsExecutor::ThreadBindingType::HYBRID_AWARE; + break; + default: OPENVINO_THROW("Wrong value ", val.as(), "for property key ", key, ". Expected only ov::Affinity::CORE/NUMA/HYBRID_AWARE."); } + } catch (const ov::Exception&) { + OPENVINO_THROW("Wrong value ", + val.as(), + "for property key ", + key, + ". Expected only ov::Affinity::CORE/NUMA/HYBRID_AWARE."); } OPENVINO_SUPPRESS_DEPRECATED_END } else if (key == ov::hint::performance_mode.name()) { try { - hintPerfMode = val.as(); + hintPerfMode = !changedHintPerfMode ? val.as() : hintPerfMode; } catch (const ov::Exception&) { OPENVINO_THROW("Wrong value ", val.as(), @@ -306,8 +343,8 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) { if (executionMode == ov::hint::ExecutionMode::PERFORMANCE) { inferencePrecision = ov::element::f32; #if defined(OV_CPU_ARM_ENABLE_FP16) - //fp16 precision is used as default precision on ARM for non-convolution networks - //fp16 ACL convolution is slower than fp32 + // fp16 precision is used as default precision on ARM for non-convolution networks + // fp16 ACL convolution is slower than fp32 if (modelType != ModelType::CNN) inferencePrecision = ov::element::f16; #else @@ -323,8 +360,8 @@ void Config::readProperties(const ov::AnyMap& prop, const ModelType modelType) { _config.clear(); if (exclusiveAsyncRequests) { // Exclusive request feature disables the streams - streamExecutorConfig._streams = 1; - streamExecutorConfig._streams_changed = true; + streams = 1; + streamsChanged = true; } this->modelType = modelType; @@ -337,20 +374,6 @@ void Config::updateProperties() { if (!_config.empty()) return; - switch (streamExecutorConfig._threadBindingType) { - case IStreamsExecutor::ThreadBindingType::NONE: - _config.insert({ov::internal::cpu_bind_thread.name(), "NO"}); - break; - case IStreamsExecutor::ThreadBindingType::CORES: - _config.insert({ov::internal::cpu_bind_thread.name(), "YES"}); - break; - case IStreamsExecutor::ThreadBindingType::NUMA: - _config.insert({ov::internal::cpu_bind_thread.name(), ov::util::to_string(ov::Affinity::NUMA)}); - break; - case IStreamsExecutor::ThreadBindingType::HYBRID_AWARE: - _config.insert({ov::internal::cpu_bind_thread.name(), ov::util::to_string(ov::Affinity::HYBRID_AWARE)}); - break; - } if (collectPerfCounters == true) _config.insert({ov::enable_profiling.name(), "YES"}); else diff --git a/src/plugins/intel_cpu/src/config.h b/src/plugins/intel_cpu/src/config.h index 3a5d7a7c486388..8c4910eb02aa32 100644 --- a/src/plugins/intel_cpu/src/config.h +++ b/src/plugins/intel_cpu/src/config.h @@ -62,7 +62,13 @@ struct Config { size_t rtCacheCapacity = 0ul; #endif ov::threading::IStreamsExecutor::Config streamExecutorConfig; + int streams = 1; + bool streamsChanged = false; + int threads = 0; + int threadsPerStream = 0; + ov::threading::IStreamsExecutor::ThreadBindingType threadBindingType = ov::threading::IStreamsExecutor::ThreadBindingType::NONE; ov::hint::PerformanceMode hintPerfMode = ov::hint::PerformanceMode::LATENCY; + bool changedHintPerfMode = false; ov::log::Level logLevel = ov::log::Level::NO; uint32_t hintNumRequests = 0; bool enableCpuPinning = true; diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp index 3e47254e324a92..704894b24448ef 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.cpp @@ -528,42 +528,49 @@ std::vector> generate_stream_info(const int streams, std::vector>& proc_type_table, int preferred_nthreads_per_stream) { int model_prefer_threads = preferred_nthreads_per_stream; - IStreamsExecutor::Config& executor_config = config.streamExecutorConfig; proc_type_table = apply_scheduling_core_type(config.schedulingCoreType, proc_type_table); proc_type_table = apply_hyper_threading(config.enableHyperThreading, config.changedHyperThreading, ov::util::to_string(config.hintPerfMode), proc_type_table); - executor_config._cpu_reservation = get_cpu_pinning(config.enableCpuPinning, - config.changedCpuPinning, - streams, - config.latencyThreadingMode, - proc_type_table); + auto cpu_reservation = get_cpu_pinning(config.enableCpuPinning, + config.changedCpuPinning, + streams, + config.latencyThreadingMode, + proc_type_table); if (-1 == preferred_nthreads_per_stream) { model_prefer_threads = get_model_prefer_threads(streams, proc_type_table, model, config); } - executor_config._streams_info_table = get_streams_info_table(executor_config._streams, - executor_config._streams_changed, - executor_config._threads, - config.hintNumRequests, - model_prefer_threads, - input_current_socket_id, - ov::util::to_string(config.hintPerfMode), - config.latencyThreadingMode, - proc_type_table); + auto streams_info_table = get_streams_info_table(config.streams, + config.streamsChanged, + config.threads, + config.hintNumRequests, + model_prefer_threads, + input_current_socket_id, + ov::util::to_string(config.hintPerfMode), + config.latencyThreadingMode, + proc_type_table); + + config.streamExecutorConfig = IStreamsExecutor::Config{"CPUStreamsExecutor", + config.streams, + config.threadsPerStream, + config.threadBindingType, + 1, + 0, + config.threads, + IStreamsExecutor::Config::PreferredCoreType::ANY, + streams_info_table, + cpu_reservation}; + return proc_type_table; } void get_num_streams(const int streams, const std::shared_ptr& model, Config& config) { - IStreamsExecutor::Config& executor_config = config.streamExecutorConfig; std::vector> proc_type_table = get_proc_type_table(); generate_stream_info(streams, -1, model, config, proc_type_table); - - executor_config = IStreamsExecutor::Config::reserve_cpu_threads(executor_config); - executor_config._threadsPerStream = executor_config._streams_info_table[0][THREADS_PER_STREAM]; } int get_default_latency_streams(Config::LatencyThreadingMode latency_threading_mode) { diff --git a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp index 5b4e325134074d..a33cdd1b2ce942 100644 --- a/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp +++ b/src/plugins/intel_cpu/src/cpu_streams_calculation.hpp @@ -89,16 +89,6 @@ std::vector> generate_stream_info(const int streams, std::vector>& proc_type_table, int preferred_nthreads_per_stream = -1); -struct StreamCfg { - int num_streams; // Number of streams - int num_threads; // Number of threads - int big_core_streams; // Number of streams in Performance-core(big core) - int small_core_streams; // Number of streams in Efficient-core(small core) - int threads_per_stream_big; // Threads per stream in big cores - int threads_per_stream_small; // Threads per stream in small cores - int small_core_offset; -}; - /** * @brief Get information about number of streams, threads and pinning threads on different processors * @param[in] streams number of streams diff --git a/src/plugins/intel_cpu/src/plugin.cpp b/src/plugins/intel_cpu/src/plugin.cpp index 9002ebab4cae30..4b18b1b391ae13 100644 --- a/src/plugins/intel_cpu/src/plugin.cpp +++ b/src/plugins/intel_cpu/src/plugin.cpp @@ -8,7 +8,6 @@ #include "itt.h" #include "openvino/runtime/intel_cpu/properties.hpp" #include "openvino/runtime/internal_properties.hpp" -#include "openvino/runtime/performance_heuristics.hpp" #include "openvino/runtime/properties.hpp" #include "openvino/runtime/threading/cpu_streams_info.hpp" #include "openvino/runtime/threading/executor_manager.hpp" @@ -185,272 +184,49 @@ static bool streamsSet(const ov::AnyMap& config) { return config.count(ov::num_streams.name()); } -void Engine::apply_performance_hints(ov::AnyMap& config, const std::shared_ptr& model) const { - auto getNumStreamsThroughput = [&]() { - const auto isa = dnnl::get_effective_cpu_isa(); - float isaSpecificThreshold = 1.0f; - switch (isa) { - case dnnl::cpu_isa::sse41: - isaSpecificThreshold = 0.5f; - break; - case dnnl::cpu_isa::avx2: - case dnnl::cpu_isa::avx512_core: - isaSpecificThreshold = 1.0f; - break; - case dnnl::cpu_isa::avx512_core_vnni: - case dnnl::cpu_isa::avx2_vnni: - isaSpecificThreshold = 2.0f; - break; - case dnnl::cpu_isa::avx512_core_amx: - isaSpecificThreshold = 4.0f; - break; - default: - isaSpecificThreshold = 1.0f; - } - // the more "capable" the CPU in general, the more streams we may want to keep to keep it utilized - const float memThresholdAssumeLimitedForISA = ov::MemBandwidthPressure::LIMITED / isaSpecificThreshold; - const float L2_cache_size = dnnl::utils::get_cache_size(2 /*level*/, true /*per core */); - ov::MemBandwidthPressure networkToleranceForLowCache = - ov::mem_bandwidth_pressure_tolerance(model, L2_cache_size, memThresholdAssumeLimitedForISA); - const auto default_streams = get_streams_num(engConfig.streamExecutorConfig._threadBindingType, - ov::threading::IStreamsExecutor::Config::StreamMode::DEFAULT, - engConfig.streamExecutorConfig._enable_hyper_thread); - auto streams_info = default_streams; - if (networkToleranceForLowCache.max_mem_tolerance == ov::MemBandwidthPressure::UNKNOWN) { - if ((networkToleranceForLowCache.ratio_compute_convs == ov::MemBandwidthPressure::ALL) || - (networkToleranceForLowCache.ratio_compute_deconvs == ov::MemBandwidthPressure::ALL)) { - // all relevant layers (convs, etc) are compute-limited, the most aggressive val for #streams - streams_info = get_streams_num(engConfig.streamExecutorConfig._threadBindingType, - ov::threading::IStreamsExecutor::Config::StreamMode::AGGRESSIVE, - engConfig.streamExecutorConfig._enable_hyper_thread); - } // otherwise (no recognized layers) falling back to the default value - } else if (networkToleranceForLowCache.max_mem_tolerance > memThresholdAssumeLimitedForISA) { - // network is below the ISA-specific threshold - streams_info = get_streams_num(engConfig.streamExecutorConfig._threadBindingType, - ov::threading::IStreamsExecutor::Config::StreamMode::AGGRESSIVE, - engConfig.streamExecutorConfig._enable_hyper_thread); - } else if (networkToleranceForLowCache.max_mem_tolerance > ov::MemBandwidthPressure::LIMITED) { - // network is below general threshold - streams_info = get_streams_num(engConfig.streamExecutorConfig._threadBindingType, - ov::threading::IStreamsExecutor::Config::StreamMode::LESSAGGRESSIVE, - engConfig.streamExecutorConfig._enable_hyper_thread); - streams_info.num_streams = std::max(default_streams.num_streams, streams_info.num_streams); - } - - auto num_requests = config.find(ov::hint::num_requests.name()); - if (num_requests != config.end()) { // arrived with config to the LoadNetwork (and thus higher pri) - int val = -1; - try { - ov::Any value = num_requests->second.as(); - val = value.as(); - if (val < 0) - OPENVINO_THROW("invalid value!"); - } catch (const ov::Exception&) { - OPENVINO_THROW("Wrong value of ", - num_requests->second.as(), - " for property key ", - ov::hint::num_requests.name(), - ". Expected only positive integer numbers"); - } - if (val > 0) - streams_info.num_streams = std::min(streams_info.num_streams, val); - } else if (engConfig.hintNumRequests > 0) { // set thru SetConfig to the plugin, 2nd priority - streams_info.num_streams = std::min(streams_info.num_streams, static_cast(engConfig.hintNumRequests)); - } - return std::pair(std::to_string(streams_info.num_streams), streams_info); - }; - - auto getPerfHintName = [&]() { - const bool streamsExplicitlySetForModel = streamsSet(config); - // checking streams (to avoid overriding what user might explicitly set in the incoming config or previously via - // SetConfig) - if (streamsExplicitlySetForModel || streamsExplicitlySetForEngine) - return std::string(); - - const auto& perf_hint = config.find(ov::hint::performance_mode.name()); - /* performance hints set for network has higher pririty than engine ones. - * This applies for all the configuration parameters */ - const auto& perf_hint_name = (perf_hint != config.end()) ? perf_hint->second.as() - : ov::util::to_string(engConfig.hintPerfMode); - return perf_hint_name; - }; - - // We compute both hints values because the optimal number of streams are computed based on ov::Model - // while we export model in cpu internal opset so we need to save precomputed optimal # streams for both hint modes - const auto latency_hints = ov::util::to_string(ov::streams::NUMA); - const auto tput_hints = getNumStreamsThroughput(); - - // save hints parameters to model rt_info - ov::AnyMap hints_props; - const auto latency_name = - ov::util::to_string(ov::hint::PerformanceMode::LATENCY) + "_" + std::string(ov::num_streams.name()); - const auto tput_name = - ov::util::to_string(ov::hint::PerformanceMode::THROUGHPUT) + "_" + std::string(ov::num_streams.name()); - hints_props.insert({latency_name, latency_hints}); - hints_props.insert({tput_name, std::to_string(tput_hints.second.num_streams)}); - model->set_rt_info(hints_props, "intel_cpu_hints_config"); - - const auto perf_hint_name = getPerfHintName(); - if (perf_hint_name == ov::util::to_string(ov::hint::PerformanceMode::LATENCY)) { - config[ov::num_streams.name()] = latency_hints; - } else if (perf_hint_name == ov::util::to_string(ov::hint::PerformanceMode::THROUGHPUT)) { - config[ov::num_streams.name()] = tput_hints.first; - config[ov::threading::big_core_streams.name()] = std::to_string(tput_hints.second.big_core_streams); - config[ov::threading::small_core_streams.name()] = std::to_string(tput_hints.second.small_core_streams); - config[ov::threading::threads_per_stream_big.name()] = std::to_string(tput_hints.second.threads_per_stream_big); - config[ov::threading::threads_per_stream_small.name()] = - std::to_string(tput_hints.second.threads_per_stream_small); - config[ov::threading::small_core_offset.name()] = std::to_string(tput_hints.second.small_core_offset); - } -} - void Engine::get_performance_streams(Config& config, const std::shared_ptr& model) const{ const int latency_streams = get_default_latency_streams(config.latencyThreadingMode); + int streams_set = config.streams; int streams; - if (config.streamExecutorConfig._streams_changed) { - streams = config.streamExecutorConfig._streams; + if (config.streamsChanged) { + streams = streams_set; } else if (config.hintPerfMode == ov::hint::PerformanceMode::LATENCY) { streams = latency_streams; } else if (config.hintPerfMode == ov::hint::PerformanceMode::THROUGHPUT) { streams = 0; } else { - streams = config.streamExecutorConfig._streams == 1 ? 0 : config.streamExecutorConfig._streams; + streams = streams_set == 1 ? 0 : streams_set; } - if (!((0 == config.streamExecutorConfig._streams) && config.streamExecutorConfig._streams_changed)) { + if (!((0 == streams_set) && config.streamsChanged)) { get_num_streams(streams, model, config); - } else { - config.streamExecutorConfig.set_config_zero_stream(); } } void Engine::calculate_streams(Config& conf, const std::shared_ptr& model, bool imported) const { - // import config props from caching model - if (imported && !is_cpu_map_available()) { - if (model->has_rt_info("intel_cpu_hints_config")) { - const auto perf_mode = conf.hintPerfMode; - if (perf_mode == ov::hint::PerformanceMode::LATENCY || perf_mode == ov::hint::PerformanceMode::THROUGHPUT) { - const auto& hints_config = model->get_rt_info("intel_cpu_hints_config"); - const auto hints_param_name = - ov::util::to_string(perf_mode) + "_" + std::string(ov::num_streams.name()); - const auto it = hints_config.find(hints_param_name); - if (it != hints_config.end()) { - conf.readProperties({{std::string(ov::num_streams.name()), it->second.as()}}); - } else { - OPENVINO_THROW("Cache file doesn't contain precalculated number of streams for mode ", - ov::util::to_string(perf_mode)); - } + const auto model_prefer_name = std::string("MODEL_PREFER_THREADS"); + if (imported && model->has_rt_info("intel_cpu_hints_config")) { + // load model_prefer_threads from cache + int cache_model_prefer; + const auto& hints_config = model->get_rt_info("intel_cpu_hints_config"); + const auto it_model_prefer = hints_config.find(model_prefer_name); + if (it_model_prefer != hints_config.end()) { + try { + cache_model_prefer = it_model_prefer->second.as(); + } catch (const ov::Exception&) { + OPENVINO_THROW("Cache file doesn't have valid value for " + model_prefer_name); } - } - } - - if (is_cpu_map_available()) { - const auto model_prefer_name = std::string("MODEL_PREFER_THREADS"); - if (imported && model->has_rt_info("intel_cpu_hints_config")) { - // load model_prefer_threads from cache - int cache_model_prefer; - const auto& hints_config = model->get_rt_info("intel_cpu_hints_config"); - const auto it_model_prefer = hints_config.find(model_prefer_name); - if (it_model_prefer != hints_config.end()) { - try { - cache_model_prefer = it_model_prefer->second.as(); - } catch (const ov::Exception&) { - OPENVINO_THROW("Cache file doesn't have valid value for " + model_prefer_name); - } - conf.modelPreferThreads = cache_model_prefer; - } - } - get_performance_streams(conf, model); - // save model_prefer_threads to model rt_info when loading network - if (!imported) { - ov::AnyMap hints_props; - hints_props.insert({model_prefer_name, std::to_string(conf.modelPreferThreads)}); - model->set_rt_info(hints_props, "intel_cpu_hints_config"); + conf.modelPreferThreads = cache_model_prefer; } } -} - -StreamCfg Engine::get_streams_num(ov::threading::IStreamsExecutor::ThreadBindingType thread_binding_type, - int stream_mode, - const bool enable_hyper_thread) const { - const int sockets = static_cast(get_available_numa_nodes().size()); - const int num_cores = - thread_binding_type == IStreamsExecutor::ThreadBindingType::HYBRID_AWARE - ? parallel_get_max_threads() - : (sockets == 1 ? (enable_hyper_thread ? parallel_get_max_threads() : get_number_of_cpu_cores()) - : get_number_of_cpu_cores()); - const int num_cores_phy = get_number_of_cpu_cores(); - const int num_big_cores_phy = get_number_of_cpu_cores(true); - const int num_small_cores = num_cores_phy - num_big_cores_phy; - const int num_big_cores = num_cores > num_cores_phy ? num_big_cores_phy * 2 : num_big_cores_phy; - StreamCfg stream_cfg = {0}; - - if (stream_mode == IStreamsExecutor::Config::StreamMode::DEFAULT) { - // bare minimum of streams (that evenly divides available number of core) - if (thread_binding_type == IStreamsExecutor::ThreadBindingType::HYBRID_AWARE) { - if (0 == num_big_cores_phy % 4) { - stream_cfg.threads_per_stream_big = 4; - } else if (0 == num_big_cores_phy % 5) { - stream_cfg.threads_per_stream_big = 5; - } else if (0 == num_big_cores_phy % 3) { - stream_cfg.threads_per_stream_big = 3; - } else { // if user disables some cores say in BIOS, so we got weird #cores which is not easy to divide - stream_cfg.threads_per_stream_big = num_big_cores_phy; - } - - stream_cfg.big_core_streams = num_big_cores / stream_cfg.threads_per_stream_big; - stream_cfg.threads_per_stream_small = stream_cfg.threads_per_stream_big; - if (num_small_cores == 0) { - stream_cfg.threads_per_stream_small = 0; - } else if (num_small_cores < stream_cfg.threads_per_stream_small) { - stream_cfg.small_core_streams = 1; - stream_cfg.threads_per_stream_small = num_small_cores; - stream_cfg.threads_per_stream_big = stream_cfg.threads_per_stream_small; - // Balance the computation of physical core and logical core, the number of threads on the physical core - // and logical core should be equal - stream_cfg.big_core_streams = num_big_cores_phy / stream_cfg.threads_per_stream_big * 2; - } else { - stream_cfg.small_core_streams = num_small_cores / stream_cfg.threads_per_stream_small; - } - } else { - if (0 == num_cores % 4) - stream_cfg.num_streams = std::max(4, num_cores / 4); - else if (0 == num_cores % 5) - stream_cfg.num_streams = std::max(5, num_cores / 5); - else if (0 == num_cores % 3) - stream_cfg.num_streams = std::max(3, num_cores / 3); - else // if user disables some cores say in BIOS, so we got weird #cores which is not easy to divide - stream_cfg.num_streams = 1; - } - } else if (stream_mode == IStreamsExecutor::Config::StreamMode::AGGRESSIVE) { - if (thread_binding_type == IStreamsExecutor::ThreadBindingType::HYBRID_AWARE) { - stream_cfg.big_core_streams = num_big_cores; - stream_cfg.small_core_streams = num_small_cores; - stream_cfg.threads_per_stream_big = num_big_cores / stream_cfg.big_core_streams; - stream_cfg.threads_per_stream_small = - num_small_cores == 0 ? 0 : num_small_cores / stream_cfg.small_core_streams; - } else { - stream_cfg.num_streams = num_cores_phy; - } - } else if (stream_mode == IStreamsExecutor::Config::StreamMode::LESSAGGRESSIVE) { - if (thread_binding_type == IStreamsExecutor::ThreadBindingType::HYBRID_AWARE) { - stream_cfg.big_core_streams = num_big_cores / 2; - stream_cfg.small_core_streams = num_small_cores / 2; - stream_cfg.threads_per_stream_big = num_big_cores / stream_cfg.big_core_streams; - stream_cfg.threads_per_stream_small = - num_small_cores == 0 ? 0 : num_small_cores / stream_cfg.small_core_streams; - } else { - stream_cfg.num_streams = num_cores_phy / 2; - } - } else { - OPENVINO_THROW("Wrong stream mode to get num of streams: ", stream_mode); + get_performance_streams(conf, model); + // save model_prefer_threads to model rt_info when loading network + if (!imported) { + ov::AnyMap hints_props; + hints_props.insert({model_prefer_name, std::to_string(conf.modelPreferThreads)}); + model->set_rt_info(hints_props, "intel_cpu_hints_config"); } - stream_cfg.num_streams = stream_cfg.num_streams > 0 - ? stream_cfg.num_streams - : stream_cfg.big_core_streams + stream_cfg.small_core_streams; - stream_cfg.small_core_offset = num_small_cores == 0 ? 0 : num_big_cores; - return stream_cfg; } static bool shouldEnableLPT(const ov::AnyMap& modelConfig, const Config& engineConfig) { @@ -543,10 +319,6 @@ Engine::compile_model(const std::shared_ptr& model, const ov::A transformations.UpToLpt(); - if (!is_cpu_map_available()) { - apply_performance_hints(config, cloned_model); - } - conf.readProperties(config, modelType); calculate_streams(conf, cloned_model); @@ -612,16 +384,16 @@ bool Engine::is_legacy_api() const { ov::Any Engine::get_property(const std::string& name, const ov::AnyMap& options) const { if (name == ov::optimal_number_of_infer_requests) { - const auto streams = engConfig.streamExecutorConfig._streams; + const auto streams = engConfig.streamExecutorConfig.get_streams(); return decltype(ov::optimal_number_of_infer_requests)::value_type( streams); // ov::optimal_number_of_infer_requests has no negative values } else if (name == ov::num_streams) { - const auto streams = engConfig.streamExecutorConfig._streams; + const auto streams = engConfig.streamExecutorConfig.get_streams(); return decltype(ov::num_streams)::value_type( streams); // ov::num_streams has special negative values (AUTO = -1, NUMA = -2) OPENVINO_SUPPRESS_DEPRECATED_START } else if (name == ov::affinity) { - const auto affinity = engConfig.streamExecutorConfig._threadBindingType; + const auto affinity = engConfig.threadBindingType; switch (affinity) { case IStreamsExecutor::ThreadBindingType::NONE: return ov::Affinity::NONE; @@ -637,8 +409,8 @@ ov::Any Engine::get_property(const std::string& name, const ov::AnyMap& options) } else if (name == ov::device::id.name()) { return decltype(ov::device::id)::value_type{engConfig.device_id}; } else if (name == ov::inference_num_threads) { - const auto num_threads = engConfig.streamExecutorConfig._threads; - return decltype(ov::inference_num_threads)::value_type(num_threads); + const auto threads = engConfig.streamExecutorConfig.get_threads(); + return decltype(ov::inference_num_threads)::value_type(threads); } else if (name == ov::enable_profiling.name()) { const bool perfCount = engConfig.collectPerfCounters; return decltype(ov::enable_profiling)::value_type(perfCount); diff --git a/src/plugins/intel_cpu/src/plugin.h b/src/plugins/intel_cpu/src/plugin.h index 53f52706f3c0fd..5f33c05a9ba8f9 100644 --- a/src/plugins/intel_cpu/src/plugin.h +++ b/src/plugins/intel_cpu/src/plugin.h @@ -48,11 +48,7 @@ class Engine : public ov::IPlugin { ov::Any get_ro_property(const std::string& name, const ov::AnyMap& options) const; - void apply_performance_hints(ov::AnyMap &config, const std::shared_ptr& model) const; - void get_performance_streams(Config &config, const std::shared_ptr& model) const; - StreamCfg get_streams_num(ov::threading::IStreamsExecutor::ThreadBindingType thread_binding_type, - int stream_mode, - const bool enable_hyper_thread = true) const; + void get_performance_streams(Config& config, const std::shared_ptr& model) const; void calculate_streams(Config& conf, const std::shared_ptr& model, bool imported = false) const; Config engConfig; diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index 51f5623d4e749f..17c2574affb081 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -700,7 +700,7 @@ void Transformations::MainSnippets(void) { // To avoid sitations when Transpose is not alone node between MatMul and Result, // Plugin disables Transpose tokenization on output tokenization_config.mha_token_enable_transpose_on_output = (inferencePrecision == ov::element::f32); - tokenization_config.concurrency = config.streamExecutorConfig._threadsPerStream; + tokenization_config.concurrency = config.threadsPerStream; if (tokenization_config.concurrency == 0) tokenization_config.concurrency = parallel_get_max_threads(); // The optimization "SplitDimensionM" depends on target machine (thread count). diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/eltwise.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/eltwise.cpp index c2956f69dc73e7..3abe82596cb61b 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/eltwise.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/eltwise.cpp @@ -156,7 +156,7 @@ std::vector eltwise_op_typesSingleThread = { }; ov::AnyMap additional_config_single_thread = { - ov::inference_num_threads(1), + ov::inference_num_threads(1), }; const auto single_thread_params = ::testing::Combine( diff --git a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp index 65387645967012..a24762782d6d0f 100644 --- a/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/streams_info/streams_e2e_test.cpp @@ -8,6 +8,7 @@ #include "cpu_map_scheduling.hpp" #include "cpu_streams_calculation.hpp" #include "openvino/runtime/system_conf.hpp" +#include "os/cpu_map_info.hpp" using namespace testing; using namespace ov; @@ -46,9 +47,10 @@ void make_config(StreamGenerateionTestCase& test_data, ov::intel_cpu::Config& co config.hintPerfMode = test_data.input_pm_hint; config.latencyThreadingMode = test_data.input_latency_threading_mode; config.hintNumRequests = test_data.input_request; - config.streamExecutorConfig._streams = test_data.input_stream; - config.streamExecutorConfig._streams_changed = test_data.input_stream_changed; - config.streamExecutorConfig._threads = test_data.input_thread; + config.streams = test_data.input_stream_changed ? test_data.input_stream + : (test_data.input_stream == 0 ? 1 : test_data.input_stream); + config.streamsChanged = test_data.input_stream_changed; + config.threads = test_data.input_thread; } class StreamGenerationTests : public ov::test::TestsCommon, @@ -59,6 +61,9 @@ class StreamGenerationTests : public ov::test::TestsCommon, ov::intel_cpu::Config config; make_config(test_data, config); + CPU& cpu = cpu_info(); + cpu._proc_type_table = test_data.input_proc_type_table; + auto proc_type_table = ov::intel_cpu::generate_stream_info(test_data.input_stream, test_data.input_socket_id, nullptr, @@ -66,9 +71,9 @@ class StreamGenerationTests : public ov::test::TestsCommon, test_data.input_proc_type_table, test_data.input_model_prefer); - ASSERT_EQ(test_data.output_stream_info_table, config.streamExecutorConfig._streams_info_table); + ASSERT_EQ(test_data.output_stream_info_table, config.streamExecutorConfig.get_streams_info_table()); ASSERT_EQ(test_data.output_proc_type_table, proc_type_table); - ASSERT_EQ(test_data.output_cpu_value, config.streamExecutorConfig._cpu_reservation); + ASSERT_EQ(test_data.output_cpu_value, config.streamExecutorConfig.get_cpu_reservation()); ASSERT_EQ(test_data.output_ht_value, config.enableHyperThreading); ASSERT_EQ(test_data.output_type, config.schedulingCoreType); ASSERT_EQ(test_data.output_pm_hint, config.hintPerfMode); diff --git a/src/plugins/intel_gpu/src/graph/program.cpp b/src/plugins/intel_gpu/src/graph/program.cpp index 36e2cda3ab345b..08f7c5a5060a2a 100644 --- a/src/plugins/intel_gpu/src/graph/program.cpp +++ b/src/plugins/intel_gpu/src/graph/program.cpp @@ -101,21 +101,28 @@ using namespace cldnn; using namespace ov::intel_gpu; static ov::threading::IStreamsExecutor::Config make_task_executor_config(const ExecutionConfig& config, std::string tags, int num_streams = 0) { - ov::threading::IStreamsExecutor::Config task_executor_config(tags, 1); - task_executor_config._streams = (num_streams > 0) ? num_streams : config.get_property(ov::compilation_num_threads); + int streams = (num_streams > 0) ? num_streams : config.get_property(ov::compilation_num_threads); auto priority = config.get_property(ov::intel_gpu::hint::host_task_priority); + auto core_type = ov::threading::IStreamsExecutor::Config::ANY; switch (priority) { - case ov::hint::Priority::LOW: task_executor_config._threadPreferredCoreType = ov::threading::IStreamsExecutor::Config::LITTLE; break; - case ov::hint::Priority::MEDIUM: task_executor_config._threadPreferredCoreType = ov::threading::IStreamsExecutor::Config::ANY; break; - case ov::hint::Priority::HIGH: task_executor_config._threadPreferredCoreType = ov::threading::IStreamsExecutor::Config::BIG; break; + case ov::hint::Priority::LOW: core_type = ov::threading::IStreamsExecutor::Config::LITTLE; break; + case ov::hint::Priority::MEDIUM: core_type = ov::threading::IStreamsExecutor::Config::ANY; break; + case ov::hint::Priority::HIGH: core_type = ov::threading::IStreamsExecutor::Config::BIG; break; default: OPENVINO_ASSERT(false, "[GPU] Can't create task executor: invalid host task priority value: ", priority); } bool enable_cpu_pinning = config.get_property(ov::hint::enable_cpu_pinning); - task_executor_config.update_executor_config(task_executor_config._streams, - 1, - task_executor_config._threadPreferredCoreType, - enable_cpu_pinning); + ov::threading::IStreamsExecutor::Config task_executor_config( + tags, + streams, + 1, + ov::threading::IStreamsExecutor::ThreadBindingType::NONE, + 1, + 0, + 0, + core_type, + {}, + enable_cpu_pinning); return task_executor_config; } diff --git a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp index 2bed086a94ca8f..543c77734cc492 100644 --- a/src/plugins/intel_gpu/src/plugin/compiled_model.cpp +++ b/src/plugins/intel_gpu/src/plugin/compiled_model.cpp @@ -36,7 +36,7 @@ std::shared_ptr create_task_executor(const std::sh } else if (config.get_property(ov::hint::enable_cpu_pinning)) { auto executor_config = ov::threading::IStreamsExecutor::Config{"Intel GPU plugin executor", - 0, + config.get_property(ov::num_streams), 0, ov::threading::IStreamsExecutor::ThreadBindingType::CORES, 1, @@ -45,8 +45,7 @@ std::shared_ptr create_task_executor(const std::sh ov::threading::IStreamsExecutor::Config::PreferredCoreType::BIG, {{config.get_property(ov::num_streams), MAIN_CORE_PROC, 1, 0, 0}}, true}; - auto post_config = ov::threading::IStreamsExecutor::Config::reserve_cpu_threads(executor_config); - return std::make_shared(post_config); + return std::make_shared(executor_config); } else { return std::make_shared( ov::threading::IStreamsExecutor::Config{"Intel GPU plugin executor", config.get_property(ov::num_streams)}); diff --git a/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp b/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp index bbdb553d6098a8..66788a16f149bf 100644 --- a/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/passes/kernels_cache_test.cpp @@ -94,8 +94,7 @@ TEST(kernels_cache, reuse_kernel_for_static_model_01) { TEST(kernels_cache, sub_kernel_ordering_test) { auto& engine = get_test_engine(); ExecutionConfig config = get_test_default_config(engine); - ov::threading::IStreamsExecutor::Config task_executor_config("sub_kernel_ordering_test", 1); - task_executor_config._streams = 2; + ov::threading::IStreamsExecutor::Config task_executor_config("sub_kernel_ordering_test", 2); auto executor = std::make_shared(task_executor_config); const size_t num_kernels = 9; auto _kernels_cache = std::unique_ptr(new kernels_cache(engine, config, 0, executor)); diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/multiple_streams_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/multiple_streams_gpu_test.cpp index 7717fa2b925b64..2fb0a6518dd941 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/multiple_streams_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/multiple_streams_gpu_test.cpp @@ -21,8 +21,7 @@ using namespace ::tests; TEST(multistream_gpu, basic) { const int num_streams = 2; - auto task_config = ov::threading::IStreamsExecutor::Config(); - task_config._streams = num_streams; + auto task_config = ov::threading::IStreamsExecutor::Config{"gpu_test", num_streams}; auto task_executor = std::make_shared(task_config); auto& engine = get_test_engine(); diff --git a/src/plugins/template/src/compiled_model.cpp b/src/plugins/template/src/compiled_model.cpp index 02fa9ec36e485a..4f79900fb2c950 100644 --- a/src/plugins/template/src/compiled_model.cpp +++ b/src/plugins/template/src/compiled_model.cpp @@ -147,7 +147,7 @@ ov::Any ov::template_plugin::CompiledModel::get_property(const std::string& name return decltype(ov::execution_devices)::value_type{get_plugin()->get_device_name() + "." + std::to_string(m_cfg.device_id)}; } else if (ov::optimal_number_of_infer_requests == name) { - unsigned int value = m_cfg.streams_executor_config._streams; + unsigned int value = m_cfg.streams; return decltype(ov::optimal_number_of_infer_requests)::value_type(value); } else if (ov::supported_properties == name) { auto ro_properties = default_ro_properties(); diff --git a/src/plugins/template/src/config.cpp b/src/plugins/template/src/config.cpp index 39e51ad262b465..f83690e6b9fe0c 100644 --- a/src/plugins/template/src/config.cpp +++ b/src/plugins/template/src/config.cpp @@ -14,9 +14,6 @@ Configuration::Configuration() {} Configuration::Configuration(const ov::AnyMap& config, const Configuration& defaultCfg, bool throwOnUnsupported) { *this = defaultCfg; - // If plugin needs to use ov::threading::StreamsExecutor it should be able to process its configuration - auto streamExecutorConfigKeys = - streams_executor_config.get_property(ov::supported_properties.name()).as>(); for (auto&& c : config) { const auto& key = c.first; const auto& value = c.second; @@ -25,9 +22,39 @@ Configuration::Configuration(const ov::AnyMap& config, const Configuration& defa disable_transformations = value.as(); } else if (ov::internal::exclusive_async_requests == key) { exclusive_async_requests = value.as(); - } else if (streamExecutorConfigKeys.end() != - std::find(std::begin(streamExecutorConfigKeys), std::end(streamExecutorConfigKeys), key)) { - streams_executor_config.set_property(key, value); + } else if (ov::num_streams.name() == key) { + ov::Any val = value.as(); + auto streams_value = val.as(); + if (streams_value.num >= 0) { + streams = streams_value.num; + } else if (streams_value == ov::streams::NUMA) { + streams = 1; + } else if (streams_value == ov::streams::AUTO) { + streams = ov::threading::IStreamsExecutor::Config::get_default_num_streams(); + } else { + OPENVINO_THROW("Wrong value for property key ", + key, + ". Expected non negative numbers (#streams) or ", + "ov::streams::NUMA|ov::streams::AUTO, Got: ", + value.as()); + } + } else if (ov::inference_num_threads.name() == key) { + int val; + try { + val = value.as(); + } catch (const std::exception&) { + OPENVINO_THROW("Wrong value for property key ", key, ". Expected only positive numbers (#threads)"); + } + if (val < 0) { + OPENVINO_THROW("Wrong value for property key ", key, ". Expected only positive numbers (#threads)"); + } + threads = val; + } else if (ov::internal::threads_per_stream.name() == key) { + try { + threads_per_stream = value.as(); + } catch (const std::exception&) { + OPENVINO_THROW("Wrong value ", value.as(), "for property key ", key); + } } else if (ov::device::id == key) { device_id = std::stoi(value.as()); OPENVINO_ASSERT(device_id <= 0, "Device ID ", device_id, " is not supported"); @@ -45,8 +72,6 @@ Configuration::Configuration(const ov::AnyMap& config, const Configuration& defa OPENVINO_THROW("Unsupported execution mode, should be ACCURACY or PERFORMANCE, but was: ", value.as()); } - } else if (ov::num_streams == key) { - streams_executor_config.set_property(key, value); } else if (ov::hint::num_requests == key) { auto tmp_val = value.as(); int tmp_i = std::stoi(tmp_val); @@ -65,12 +90,7 @@ Configuration::Configuration(const ov::AnyMap& config, const Configuration& defa } ov::Any Configuration::Get(const std::string& name) const { - auto streamExecutorConfigKeys = - streams_executor_config.get_property(ov::supported_properties.name()).as>(); - if ((streamExecutorConfigKeys.end() != - std::find(std::begin(streamExecutorConfigKeys), std::end(streamExecutorConfigKeys), name))) { - return streams_executor_config.get_property(name); - } else if (name == ov::device::id) { + if (name == ov::device::id) { return {std::to_string(device_id)}; } else if (name == ov::enable_profiling) { return {perf_count}; @@ -79,13 +99,11 @@ ov::Any Configuration::Get(const std::string& name) const { } else if (name == ov::template_plugin::disable_transformations) { return {disable_transformations}; } else if (name == ov::num_streams) { - return {std::to_string(streams_executor_config._streams)}; - } else if (name == ov::internal::cpu_bind_thread) { - return streams_executor_config.get_property(name); + return {std::to_string(streams)}; } else if (name == ov::inference_num_threads) { - return {std::to_string(streams_executor_config._threads)}; + return {std::to_string(threads)}; } else if (name == ov::internal::threads_per_stream) { - return {std::to_string(streams_executor_config._threadsPerStream)}; + return {std::to_string(threads_per_stream)}; } else if (name == ov::hint::performance_mode) { return performance_mode; } else if (name == ov::hint::inference_precision) { diff --git a/src/plugins/template/src/config.hpp b/src/plugins/template/src/config.hpp index 918e2b514f724a..ada22f8835d8bd 100644 --- a/src/plugins/template/src/config.hpp +++ b/src/plugins/template/src/config.hpp @@ -33,6 +33,9 @@ struct Configuration { int device_id = 0; bool perf_count = false; ov::threading::IStreamsExecutor::Config streams_executor_config; + int streams = 1; + int threads = 0; + int threads_per_stream = 0; ov::hint::PerformanceMode performance_mode = ov::hint::PerformanceMode::LATENCY; uint32_t num_requests = 1; bool disable_transformations = false; diff --git a/src/plugins/template/src/plugin.cpp b/src/plugins/template/src/plugin.cpp index 941fd8d2d115a4..ad98e81aec2c09 100644 --- a/src/plugins/template/src/plugin.cpp +++ b/src/plugins/template/src/plugin.cpp @@ -99,9 +99,14 @@ std::shared_ptr ov::template_plugin::Plugin::compile_model( OV_ITT_SCOPED_TASK(itt::domains::TemplatePlugin, "Plugin::compile_model"); auto fullConfig = Configuration{properties, m_cfg}; + fullConfig.streams_executor_config = ov::threading::IStreamsExecutor::Config{stream_executor_name, + fullConfig.streams, + fullConfig.threads_per_stream}; auto streamsExecutorConfig = ov::threading::IStreamsExecutor::Config::make_default_multi_threaded(fullConfig.streams_executor_config); - streamsExecutorConfig._name = stream_executor_name; + fullConfig.streams = streamsExecutorConfig.get_streams(); + fullConfig.threads = streamsExecutorConfig.get_threads(); + fullConfig.threads_per_stream = streamsExecutorConfig.get_threads_per_stream(); auto compiled_model = std::make_shared( model->clone(), shared_from_this(), @@ -138,6 +143,9 @@ std::shared_ptr ov::template_plugin::Plugin::import_model( } auto fullConfig = Configuration{_properties, m_cfg}; + fullConfig.streams_executor_config = ov::threading::IStreamsExecutor::Config{stream_executor_name, + fullConfig.streams, + fullConfig.threads_per_stream}; // read XML content std::string xmlString; std::uint64_t dataSize = 0; @@ -156,7 +164,9 @@ std::shared_ptr ov::template_plugin::Plugin::import_model( auto ov_model = get_core()->read_model(xmlString, weights); auto streamsExecutorConfig = ov::threading::IStreamsExecutor::Config::make_default_multi_threaded(fullConfig.streams_executor_config); - streamsExecutorConfig._name = stream_executor_name; + fullConfig.streams = streamsExecutorConfig.get_streams(); + fullConfig.threads = streamsExecutorConfig.get_threads(); + fullConfig.threads_per_stream = streamsExecutorConfig.get_threads_per_stream(); auto compiled_model = std::make_shared(ov_model, shared_from_this(), From abc2899df84884a42cca4f7c64c6063d4af8290c Mon Sep 17 00:00:00 2001 From: Oleg Pipikin Date: Mon, 5 Feb 2024 09:31:34 +0100 Subject: [PATCH 10/55] Add test instantiations for template plugin (#22627) ### Details: - Add test instantiations for template plugin ### Tickets: - [CVS-130342](https://jira.devtools.intel.com/browse/CVS-130342) --- .../ov_infer_request/memory_states.cpp | 20 ++++ .../ov_infer_request/properties_tests.cpp | 21 ++++ .../behavior/ov_plugin/hetero_synthetic.cpp | 107 ++++++++++++++++++ .../behavior/ov_plugin/hetero_synthetic.hpp | 5 + .../behavior/ov_plugin/hetero_synthetic.cpp | 8 ++ 5 files changed, 161 insertions(+) create mode 100644 src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp create mode 100644 src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp create mode 100644 src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/hetero_synthetic.cpp diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp new file mode 100644 index 00000000000000..6d8fd09d192786 --- /dev/null +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/memory_states.cpp @@ -0,0 +1,20 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_infer_request/memory_states.hpp" + +namespace { +using ov::test::behavior::memoryStateParams; +using ov::test::behavior::OVInferRequestVariableStateTest; + +std::vector memoryStateTestCases = {memoryStateParams(OVInferRequestVariableStateTest::get_network(), + {"c_1-3", "r_1-3"}, + ov::test::utils::DEVICE_TEMPLATE, + {})}; + +INSTANTIATE_TEST_SUITE_P(smoke_Template_BehaviorTests, + OVInferRequestVariableStateTest, + ::testing::ValuesIn(memoryStateTestCases), + OVInferRequestVariableStateTest::getTestCaseName); +} // namespace diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp new file mode 100644 index 00000000000000..8aae5e01116c62 --- /dev/null +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_infer_request/properties_tests.cpp @@ -0,0 +1,21 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_infer_request/properties_tests.hpp" + +#include + +namespace { +using ov::test::behavior::InferRequestPropertiesTest; + +const std::vector configs = {{}}; + +INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests, + InferRequestPropertiesTest, + ::testing::Combine(::testing::Values(1u), + ::testing::Values(ov::test::utils::DEVICE_TEMPLATE), + ::testing::ValuesIn(configs)), + InferRequestPropertiesTest::getTestCaseName); + +} // namespace diff --git a/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/hetero_synthetic.cpp b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/hetero_synthetic.cpp new file mode 100644 index 00000000000000..090ce0e32f1917 --- /dev/null +++ b/src/plugins/template/tests/functional/shared_tests_instances/behavior/ov_plugin/hetero_synthetic.cpp @@ -0,0 +1,107 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "behavior/ov_plugin/hetero_synthetic.hpp" + +#include + +#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" +#include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp" + +namespace { +using ov::test::behavior::OVHeteroSyntheticTest; +using ov::test::behavior::PluginParameter; + +// this tests load plugin by library name: this is not available during static linkage +#ifndef OPENVINO_STATIC_LIBRARY + +INSTANTIATE_TEST_SUITE_P(smoke_manyTargetInputs, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{ + {"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions( + [] { + return ov::test::utils::make_conv_pool2_relu2(); + }, + {"Conv_1"}, + true))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_SingleMajorNode, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{ + {"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::_singleMajorNodeFunctions)), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(nightly_RandomMajorNodes, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{ + {"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::_randomMajorNodeFunctions)), + OVHeteroSyntheticTest::getTestCaseName); + +static std::vector()>> dynamicBuilders = { + [] { + return ov::test::utils::make_conv_pool_relu_non_zero(); + }, +}; + +INSTANTIATE_TEST_SUITE_P( + smoke_NonZeroMajorNode_dynamic, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions(dynamicBuilders.front(), + {"nonZero_1"}))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_NonZeroMajorNode_dynamic_batch, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::withMajorNodesFunctions(dynamicBuilders.front(), + {"nonZero_1"}, + true))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_SingleMajorNode_dynamic, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::singleMajorNodeFunctions(dynamicBuilders))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + nightly_RandomMajorNodes_dynamic, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::randomMajorNodeFunctions(dynamicBuilders))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + smoke_SingleMajorNode_dynamic_batch, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::singleMajorNodeFunctions(dynamicBuilders, true))), + OVHeteroSyntheticTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P( + nightly_RandomMajorNodes_dynamic_batch, + OVHeteroSyntheticTest, + ::testing::Combine(::testing::Values(std::vector{{"TEMPLATE0", "openvino_template_plugin"}, + {"TEMPLATE1", "openvino_template_plugin"}}), + ::testing::ValuesIn(OVHeteroSyntheticTest::randomMajorNodeFunctions(dynamicBuilders, true))), + OVHeteroSyntheticTest::getTestCaseName); + +#endif // !OPENVINO_STATIC_LIBRARY + +} // namespace diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/hetero_synthetic.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/hetero_synthetic.hpp index 53eac08ca97ded..3d9141df798c09 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/hetero_synthetic.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/hetero_synthetic.hpp @@ -55,6 +55,11 @@ class OVHeteroSyntheticTest : public testing::WithParamInterface randomMajorNodeFunctions( const std::vector()>>& builders, bool dynamic_batch = false, uint32_t seed = 0); + static std::vector withMajorNodesFunctions( + const std::function()>& builder, + const std::unordered_set& majorNodes, + bool dynamic_batch = false); + static std::vector _singleMajorNodeFunctions; static std::vector _randomMajorNodeFunctions; }; diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/hetero_synthetic.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/hetero_synthetic.cpp index 125735eb476fd1..232146386fe254 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_plugin/hetero_synthetic.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_plugin/hetero_synthetic.cpp @@ -184,6 +184,14 @@ std::vector OVHeteroSyntheticTest::randomMajorNodeFunctions( return results; } +std::vector OVHeteroSyntheticTest::withMajorNodesFunctions(const std::function()>& builder, + const std::unordered_set& majorNodes, + bool dynamic_batch) { + auto function = builder(); + std::vector result; + result.push_back(FunctionParameter{majorNodes, function, dynamic_batch, 0}); + return result; +} std::vector OVHeteroSyntheticTest::_singleMajorNodeFunctions = OVHeteroSyntheticTest::singleMajorNodeFunctions(builders); From a6fd315e02170b4e596e1d4edec70d4743cae5a1 Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Mon, 5 Feb 2024 21:31:50 +0400 Subject: [PATCH 11/55] [TF Hub] Update test for MUSE model (#22647) **Details:** Update test for MUSE model **Ticket:** TBD --------- Signed-off-by: Kazantsev, Roman --- tests/model_hub_tests/tf_hub_tests/precommit_models | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/model_hub_tests/tf_hub_tests/precommit_models b/tests/model_hub_tests/tf_hub_tests/precommit_models index 4a5ab7f5a2ec70..e59d678d605e48 100644 --- a/tests/model_hub_tests/tf_hub_tests/precommit_models +++ b/tests/model_hub_tests/tf_hub_tests/precommit_models @@ -24,4 +24,4 @@ planet/vision/classifier/planet_v2,https://www.kaggle.com/models/google/planet-v # TF1 models in .pb format i3d-rgb,https://storage.openvinotoolkit.org/repositories/open_model_zoo/public/2022.1/i3d-rgb-tf/rgb.frozen.pb # Model with SentencePiece tokenizer, use openvino-tokenizers package -universal-sentence-encoder-multilingual,https://www.kaggle.com/models/google/universal-sentence-encoder/frameworks/tensorFlow2/variations/multilingual/versions/2,skip, 129480 - Add openvino-tokenizers wheel build to OpenVINO GHA Workflow \ No newline at end of file +universal-sentence-encoder-multilingual,https://www.kaggle.com/models/google/universal-sentence-encoder/frameworks/tensorFlow2/variations/multilingual/versions/2,skip,131659 - UnicodeDecodeError utf-8 codec cannot decode byte for SentencePieceOp attribute sp_model \ No newline at end of file From a4cdec36cf42ece8228b4fccbd1b7160bca581aa Mon Sep 17 00:00:00 2001 From: Vitaliy Urusovskij Date: Mon, 5 Feb 2024 12:12:50 -0800 Subject: [PATCH 12/55] Remove `ie_*` includes (#22657) ### Tickets: - [CVS-130747](https://jira.devtools.intel.com/browse/CVS-130747) --- .../eltwise_transformation_is_broadcasted_test.cpp | 2 -- .../tests/precision_details_test.cpp | 2 -- .../tests/unit/calclulate_levels_test.cpp | 1 - .../tests/unit/data_precision_check.cpp | 1 - .../layer_transformation_get_data_precision.cpp | 1 - .../tests/unit/reshape_test.cpp | 1 - .../tests/unit/update_reshape_values.cpp | 1 - src/core/tests/type_relaxed_copy.cpp | 1 - .../paddle/tests/read_paddle_model_test.cpp | 2 -- src/inference/tests/functional/matmul_sr_tests.cpp | 1 - .../tests/unit/async_infer_request_test.cpp | 2 +- .../tests/unit/nodes/eltwise_node_test.cpp | 1 - .../tests/unit/nodes/reorder_node_test.cpp | 1 - .../unit/transformations/state_concat_sdpa.cpp | 1 - .../transformations/x64/convert_to_interaction.cpp | 1 - .../dynamic/ctc_greedy_decoder_seq_len.cpp | 1 - .../template/tests/functional/op_reference/if.cpp | 1 - .../disable_lowering_precision.cpp | 1 - .../depth_to_space_transformation.cpp | 1 - .../mat_mul_transformation.cpp | 1 - .../mat_mul_with_constant_transformation.cpp | 1 - .../squeeze_transformation.cpp | 1 - .../unsqueeze_transformation.cpp | 1 - .../base/utils/compare_results.hpp | 1 - .../layer_transformation.cpp | 1 - .../shared_test_classes/src/base/ov_subgraph.cpp | 14 +++++++------- .../quantized_convolution_backprop_data.cpp | 3 +-- .../src/subgraph/split_conv_concat.cpp | 1 - .../common_test_utils/src/graph_comparator.cpp | 5 ++--- .../include/functional_test_utils/blob_utils.hpp | 1 - .../mocks/mock_engine/mock_plugin.cpp | 1 - .../mocks/openvino/runtime/mock_icore.hpp | 2 +- 32 files changed, 12 insertions(+), 44 deletions(-) diff --git a/src/common/low_precision_transformations/tests/eltwise_transformation_is_broadcasted_test.cpp b/src/common/low_precision_transformations/tests/eltwise_transformation_is_broadcasted_test.cpp index b953ea7b14c9e5..0a3c75649376b0 100644 --- a/src/common/low_precision_transformations/tests/eltwise_transformation_is_broadcasted_test.cpp +++ b/src/common/low_precision_transformations/tests/eltwise_transformation_is_broadcasted_test.cpp @@ -5,8 +5,6 @@ #include #include "low_precision/eltwise_base_transformation.hpp" -#include - using namespace ::testing; using namespace std; diff --git a/src/common/low_precision_transformations/tests/precision_details_test.cpp b/src/common/low_precision_transformations/tests/precision_details_test.cpp index f0c158f4d00c64..e8a81f200cd1fa 100644 --- a/src/common/low_precision_transformations/tests/precision_details_test.cpp +++ b/src/common/low_precision_transformations/tests/precision_details_test.cpp @@ -7,8 +7,6 @@ #include "low_precision/layer_transformation.hpp" #include "low_precision/fake_quantize.hpp" -#include - using namespace ::testing; using namespace std; using namespace ov::pass::low_precision; diff --git a/src/common/low_precision_transformations/tests/unit/calclulate_levels_test.cpp b/src/common/low_precision_transformations/tests/unit/calclulate_levels_test.cpp index 6344f22f359796..35917c62491015 100644 --- a/src/common/low_precision_transformations/tests/unit/calclulate_levels_test.cpp +++ b/src/common/low_precision_transformations/tests/unit/calclulate_levels_test.cpp @@ -3,7 +3,6 @@ // #include -#include #include "low_precision/network_helper.hpp" diff --git a/src/common/low_precision_transformations/tests/unit/data_precision_check.cpp b/src/common/low_precision_transformations/tests/unit/data_precision_check.cpp index f9f447a6222e24..4d6b83c9908046 100644 --- a/src/common/low_precision_transformations/tests/unit/data_precision_check.cpp +++ b/src/common/low_precision_transformations/tests/unit/data_precision_check.cpp @@ -4,7 +4,6 @@ #include #include -#include #include "low_precision/layer_transformation.hpp" #include "low_precision/network_helper.hpp" diff --git a/src/common/low_precision_transformations/tests/unit/layer_transformation_get_data_precision.cpp b/src/common/low_precision_transformations/tests/unit/layer_transformation_get_data_precision.cpp index a9d353c7440610..2002a5fa5327f3 100644 --- a/src/common/low_precision_transformations/tests/unit/layer_transformation_get_data_precision.cpp +++ b/src/common/low_precision_transformations/tests/unit/layer_transformation_get_data_precision.cpp @@ -4,7 +4,6 @@ #include #include -#include #include "low_precision/layer_transformation.hpp" #include "low_precision/network_helper.hpp" diff --git a/src/common/low_precision_transformations/tests/unit/reshape_test.cpp b/src/common/low_precision_transformations/tests/unit/reshape_test.cpp index 74e0e8224d75b8..045e9714166226 100644 --- a/src/common/low_precision_transformations/tests/unit/reshape_test.cpp +++ b/src/common/low_precision_transformations/tests/unit/reshape_test.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include "low_precision/reshape.hpp" diff --git a/src/common/low_precision_transformations/tests/unit/update_reshape_values.cpp b/src/common/low_precision_transformations/tests/unit/update_reshape_values.cpp index 1b29f8f18a8c6f..56c605fda53ed4 100644 --- a/src/common/low_precision_transformations/tests/unit/update_reshape_values.cpp +++ b/src/common/low_precision_transformations/tests/unit/update_reshape_values.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include "low_precision/network_helper.hpp" diff --git a/src/core/tests/type_relaxed_copy.cpp b/src/core/tests/type_relaxed_copy.cpp index bbda062e23271c..a6796ff5a466c2 100644 --- a/src/core/tests/type_relaxed_copy.cpp +++ b/src/core/tests/type_relaxed_copy.cpp @@ -7,7 +7,6 @@ #include #include -#include "ie_common.h" #include "openvino/op/matmul.hpp" #include "ov_ops/type_relaxed.hpp" diff --git a/src/frontends/paddle/tests/read_paddle_model_test.cpp b/src/frontends/paddle/tests/read_paddle_model_test.cpp index 521e14b79e7408..d321e1e0e820c3 100644 --- a/src/frontends/paddle/tests/read_paddle_model_test.cpp +++ b/src/frontends/paddle/tests/read_paddle_model_test.cpp @@ -3,10 +3,8 @@ // #include -#include #include -#include #include #include #include diff --git a/src/inference/tests/functional/matmul_sr_tests.cpp b/src/inference/tests/functional/matmul_sr_tests.cpp index 3d17cfd915fa58..9e073ed17185c4 100644 --- a/src/inference/tests/functional/matmul_sr_tests.cpp +++ b/src/inference/tests/functional/matmul_sr_tests.cpp @@ -12,7 +12,6 @@ #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "common_test_utils/test_common.hpp" -#include "ie_common.h" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/matmul.hpp" diff --git a/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp b/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp index e7c337a10d5648..a78d71f79b4c58 100644 --- a/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp +++ b/src/plugins/auto_batch/tests/unit/async_infer_request_test.cpp @@ -207,7 +207,7 @@ class AutoBatchAsyncInferRequestTest : public ::testing::TestWithParam t; for (int n = 0; n < sz; n++) { - IE_ASSERT(workerRequestPtr->_tasks.try_pop(t)); + OPENVINO_ASSERT(workerRequestPtr->_tasks.try_pop(t)); t.first->m_sync_request->m_batched_request_status = SyncInferRequest::eExecutionFlavor::TIMEOUT_EXECUTED; t.first->m_request_without_batch->start_async(); diff --git a/src/plugins/intel_cpu/tests/unit/nodes/eltwise_node_test.cpp b/src/plugins/intel_cpu/tests/unit/nodes/eltwise_node_test.cpp index f95ac227f96636..7acd73a4999ad3 100644 --- a/src/plugins/intel_cpu/tests/unit/nodes/eltwise_node_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/nodes/eltwise_node_test.cpp @@ -4,7 +4,6 @@ #include #include -#include "ie_common.h" #include "nodes/eltwise.h" using namespace ov::intel_cpu; diff --git a/src/plugins/intel_cpu/tests/unit/nodes/reorder_node_test.cpp b/src/plugins/intel_cpu/tests/unit/nodes/reorder_node_test.cpp index 12927158aec087..bc87c69cd84281 100644 --- a/src/plugins/intel_cpu/tests/unit/nodes/reorder_node_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/nodes/reorder_node_test.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp b/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp index f899ee3191fb0c..df38e268068deb 100644 --- a/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp +++ b/src/plugins/intel_cpu/tests/unit/transformations/state_concat_sdpa.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include "common_test_utils/ov_test_utils.hpp" #include "utils/gen_pattern.hpp" diff --git a/src/plugins/intel_cpu/tests/unit/transformations/x64/convert_to_interaction.cpp b/src/plugins/intel_cpu/tests/unit/transformations/x64/convert_to_interaction.cpp index 13b8bba7f848f8..9aab52c866c1f1 100644 --- a/src/plugins/intel_cpu/tests/unit/transformations/x64/convert_to_interaction.cpp +++ b/src/plugins/intel_cpu/tests/unit/transformations/x64/convert_to_interaction.cpp @@ -17,7 +17,6 @@ #include #include #include "ov_ops/type_relaxed.hpp" -#include #include "common_test_utils/ov_test_utils.hpp" diff --git a/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/ctc_greedy_decoder_seq_len.cpp b/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/ctc_greedy_decoder_seq_len.cpp index 1e164c42fda131..213464a594c795 100644 --- a/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/ctc_greedy_decoder_seq_len.cpp +++ b/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/ctc_greedy_decoder_seq_len.cpp @@ -14,7 +14,6 @@ #include "common_test_utils/test_constants.hpp" #include "common_test_utils/ov_tensor_utils.hpp" -using namespace InferenceEngine; using namespace ov::test; namespace GPULayerTestsDefinitions { diff --git a/src/plugins/template/tests/functional/op_reference/if.cpp b/src/plugins/template/tests/functional/op_reference/if.cpp index 5f51a03f02d427..fe05f18c27f50d 100644 --- a/src/plugins/template/tests/functional/op_reference/if.cpp +++ b/src/plugins/template/tests/functional/op_reference/if.cpp @@ -8,7 +8,6 @@ #include #include "base_reference_test.hpp" -#include "ie_core.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" using namespace reference_tests; diff --git a/src/tests/functional/plugin/shared/src/execution_graph_tests/disable_lowering_precision.cpp b/src/tests/functional/plugin/shared/src/execution_graph_tests/disable_lowering_precision.cpp index 5b5feb5c470689..45ba0e98259c75 100644 --- a/src/tests/functional/plugin/shared/src/execution_graph_tests/disable_lowering_precision.cpp +++ b/src/tests/functional/plugin/shared/src/execution_graph_tests/disable_lowering_precision.cpp @@ -9,7 +9,6 @@ #include #include -#include #include "openvino/runtime/exec_model_info.hpp" #include "openvino/core/model.hpp" #include "common_test_utils/common_utils.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp index 713bc7d8439867..31270f5180f684 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include #include diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp index b4262c9b14001f..8151bc84410211 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include #include diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_constant_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_constant_transformation.cpp index 52fe187d7e5f86..7c1dd15d3657d1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_constant_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_constant_transformation.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include #include diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/squeeze_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/squeeze_transformation.cpp index 7eaf42e6421504..1b5200db978d5a 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/squeeze_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/squeeze_transformation.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include #include diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/unsqueeze_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/unsqueeze_transformation.cpp index dd7575a4ff22a2..20a17137abad17 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/unsqueeze_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/unsqueeze_transformation.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include #include #include diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/compare_results.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/compare_results.hpp index 0db366b4e7b034..985ba1e8bbc660 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/compare_results.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/utils/compare_results.hpp @@ -4,7 +4,6 @@ #pragma once -#include "ie_core.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp b/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp index 845874a8a6bb49..6ff1d2a6e23a2b 100644 --- a/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp +++ b/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp @@ -7,7 +7,6 @@ #include #include -#include #include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" diff --git a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp index c826e5ffcfc9b8..33b00c0a69e3af 100644 --- a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp +++ b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp @@ -96,10 +96,10 @@ void SubgraphBaseTest::run() { GTEST_FATAL_FAILURE_(errorMessage.c_str()); } } else if (jmpRes == ov::test::utils::JMP_STATUS::anyError) { - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } else if (jmpRes == ov::test::utils::JMP_STATUS::alarmErr) { summary.updateOPsStats(function, ov::test::utils::PassRate::Statuses::HANGED, rel_influence_coef); - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } } @@ -170,7 +170,7 @@ void SubgraphBaseTest::query_model() { actual.insert(res.first); } if (expected != actual) { - IE_THROW() << "Expected and actual are different"; + OPENVINO_THROW("Expected and actual are different"); } status = ov::test::utils::PassRate::Statuses::PASSED; } catch (const std::exception& ex) { @@ -185,10 +185,10 @@ void SubgraphBaseTest::query_model() { GTEST_FATAL_FAILURE_(errorMessage.c_str()); } } else if (jmpRes == ov::test::utils::JMP_STATUS::anyError) { - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } else if (jmpRes == ov::test::utils::JMP_STATUS::alarmErr) { summary.updateOPsStats(function, ov::test::utils::PassRate::Statuses::HANGED, rel_influence_coef); - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } } @@ -247,10 +247,10 @@ void SubgraphBaseTest::import_export() { GTEST_FATAL_FAILURE_(errorMessage.c_str()); } } else if (jmpRes == ov::test::utils::JMP_STATUS::anyError) { - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } else if (jmpRes == ov::test::utils::JMP_STATUS::alarmErr) { summary.updateOPsStats(function, ov::test::utils::PassRate::Statuses::HANGED, rel_influence_coef); - IE_THROW() << "Crash happens"; + OPENVINO_THROW("Crash happens"); } } diff --git a/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_backprop_data.cpp b/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_backprop_data.cpp index 0d3593478e38c0..c300689016458d 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_backprop_data.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_backprop_data.cpp @@ -6,7 +6,6 @@ #include "common_test_utils/node_builders/convolution_backprop_data.hpp" #include "common_test_utils/node_builders/constant.hpp" #include "ov_models/utils/ov_helpers.hpp" -#include "ie_common.h" #include "common_test_utils/node_builders/fake_quantize.hpp" namespace ov { @@ -48,7 +47,7 @@ void QuantConvBackpropDataLayerTest::SetUp() { ov::element::Type element_type = ov::element::undefined; std::tie(groupConvBackpropDataParams, element_type, inputShape, targetDevice) = this->GetParam(); ov::op::PadType padType; - InferenceEngine::SizeVector kernel, stride, dilation; + std::vector kernel, stride, dilation; std::vector padBegin, padEnd; size_t convOutChannels; size_t quantLevels; diff --git a/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp b/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp index 35c59647712f5e..3fecea21d1208a 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/split_conv_concat.cpp @@ -5,7 +5,6 @@ #include "shared_test_classes/subgraph/split_conv_concat.hpp" #include "common_test_utils/data_utils.hpp" -#include "ie_common.h" #include "shared_test_classes/base/layer_test_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" #include "common_test_utils/node_builders/convolution.hpp" diff --git a/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp b/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp index 5b4fa456fb7e5c..b5e4c2d116b528 100644 --- a/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp +++ b/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp @@ -6,7 +6,6 @@ #include "common_test_utils/ov_tensor_utils.hpp" #include "gtest/gtest.h" -#include "ie_common.h" #include "openvino/op/constant.hpp" #include "openvino/op/loop.hpp" #include "openvino/op/result.hpp" @@ -1024,7 +1023,7 @@ AccuracyCheckResult accuracy_check(const std::shared_ptr& ref_functio return AccuracyCheckResult{true, ""}; } try { - IE_ASSERT(ref_function->get_parameters().size() == cur_function->get_parameters().size()); + OPENVINO_ASSERT(ref_function->get_parameters().size() == cur_function->get_parameters().size()); std::map, ov::Tensor> ref_input_data; std::map, ov::Tensor> cur_input_data; @@ -1038,7 +1037,7 @@ AccuracyCheckResult accuracy_check(const std::shared_ptr& ref_functio auto ref_outputs = ngraph::helpers::interpretFunction(ref_function, ref_input_data); auto outputs = ngraph::helpers::interpretFunction(cur_function, cur_input_data); - IE_ASSERT(ref_outputs.size() == outputs.size()); + OPENVINO_ASSERT(ref_outputs.size() == outputs.size()); for (int i = 0; i < ref_outputs.size(); i++) { ov::test::utils::compare(ref_outputs[i], outputs[i], abs_threshold, rel_threshold); diff --git a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp index 2bf8fa2285d649..ed45a216537072 100644 --- a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp +++ b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp @@ -15,7 +15,6 @@ #include "blob_factory.hpp" #include "common_test_utils/data_utils.hpp" #include "common_test_utils/test_constants.hpp" -#include "ie_ngraph_utils.hpp" #include "openvino/runtime/common.hpp" namespace FuncTestUtils { diff --git a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp index 6ca6a9e5caab65..a528596a468884 100644 --- a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp +++ b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp @@ -14,7 +14,6 @@ #include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "description_buffer.hpp" -#include "ie_icore.hpp" #include "openvino/core/except.hpp" #include "openvino/runtime/common.hpp" #include "openvino/runtime/icore.hpp" diff --git a/src/tests/test_utils/unit_test_utils/mocks/openvino/runtime/mock_icore.hpp b/src/tests/test_utils/unit_test_utils/mocks/openvino/runtime/mock_icore.hpp index 013fb91ae791b5..7c73a9f4bd017b 100644 --- a/src/tests/test_utils/unit_test_utils/mocks/openvino/runtime/mock_icore.hpp +++ b/src/tests/test_utils/unit_test_utils/mocks/openvino/runtime/mock_icore.hpp @@ -6,8 +6,8 @@ #include -#include "ie_icore.hpp" #include "openvino/runtime/icompiled_model.hpp" +#include "openvino/runtime/icore.hpp" namespace ov { From bc0e0d244135f54fed593168b45a22d64b63e804 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 5 Feb 2024 22:24:18 +0100 Subject: [PATCH 13/55] [GHA] Reset Linux riscv cache (#22664) ### Details: - w/a to cleanup the cache ### Tickets: - *ticket-id* --- .github/workflows/linux_riscv.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux_riscv.yml b/.github/workflows/linux_riscv.yml index 179020a218f0c6..2f1ca29890fc47 100644 --- a/.github/workflows/linux_riscv.yml +++ b/.github/workflows/linux_riscv.yml @@ -60,8 +60,8 @@ jobs: OPENVINO_REPO: /__w/openvino/openvino/openvino OPENVINO_BUILD_DIR: /__w/openvino/openvino/openvino_build INSTALL_DIR: /__w/openvino/openvino/openvino_install - CONAN_USER_HOME: /mount/caches/ccache/ubuntu22_riscv64_master_release/.conan - CCACHE_DIR: /mount/caches/ccache/ubuntu22_riscv64_master_release + CONAN_USER_HOME: /mount/caches/ccache/ubuntu22_riscv64_master/.conan + CCACHE_DIR: /mount/caches/ccache/ubuntu22_riscv64_master CCACHE_TEMPDIR: /__w/openvino/openvino/ccache_temp CCACHE_MAXSIZE: 50G if: ${{ !needs.smart_ci.outputs.skip_workflow && github.event_name != 'merge_group' }} @@ -220,7 +220,7 @@ jobs: - name: Check status of all jobs if: >- ${{ - contains(needs.*.result, 'failure') || + contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} run: exit 1 From 0fa8f498847fdea9dae9c4668fb5c703c8116137 Mon Sep 17 00:00:00 2001 From: Sergey Shlyapnikov Date: Tue, 6 Feb 2024 09:41:03 +0400 Subject: [PATCH 14/55] [GPU] Fix kv_cache optimization for negative concat axis (#22660) ### Details: - Fix kv_cache optimization for negative concat axis ### Tickets: - 131241 Co-authored-by: Ilya Lavrenov --- src/plugins/intel_gpu/src/graph/primitive_inst.cpp | 8 +++++--- .../intel_gpu/tests/common/subgraphs_builders.hpp | 3 ++- .../functional/subgraph_tests/dynamic/kv_cache.cpp | 11 +++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp index cd2800f0138614..0ff2eb2c57c34a 100644 --- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp +++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp @@ -608,13 +608,15 @@ event::ptr primitive_inst::realloc_if_needed() { auto desc = _node->as().get_primitive(); auto& variable = get_network().get_variable(desc->variable_info.variable_id); auto present_layout = _impl_params->output_layouts[0]; - const auto& sequence_axis = desc->concat_axis; + auto present_layout_rank = present_layout.get_partial_shape().size(); + const auto sequence_axis = desc->concat_axis >= 0 ? desc->concat_axis + : present_layout_rank + desc->concat_axis; auto sequence_axis_legacy = - kv_cache_inst::get_sequence_axis_legacy(sequence_axis, present_layout.get_partial_shape().size()); + kv_cache_inst::get_sequence_axis_legacy(sequence_axis, present_layout_rank); GPU_DEBUG_TRACE_DETAIL << id() << " is kv_cache => set the variable with newly allocated output memory" << std::endl; bool axis_is_outer_most = true; - for (int64_t dim = 0; dim < sequence_axis; ++dim) { + for (size_t dim = 0; dim < sequence_axis; ++dim) { if (present_layout.get_shape()[dim] > 1) { axis_is_outer_most = false; break; diff --git a/src/plugins/intel_gpu/tests/common/subgraphs_builders.hpp b/src/plugins/intel_gpu/tests/common/subgraphs_builders.hpp index 7696d547ea1c22..dacdcc29fbd74b 100644 --- a/src/plugins/intel_gpu/tests/common/subgraphs_builders.hpp +++ b/src/plugins/intel_gpu/tests/common/subgraphs_builders.hpp @@ -29,6 +29,7 @@ inline std::shared_ptr make_llm_kv_cache_pattern(ov::Dimension batch ov::Dimension n_heads = ov::Dimension::dynamic(), ov::Dimension n_features = ov::Dimension::dynamic(), ov::element::Type_t element_type = ov::element::f32, + int64_t concat_axis = 2, bool stateful = false, bool fuse_cache_reorder = false, bool build_state_initializer = false) { @@ -73,7 +74,7 @@ inline std::shared_ptr make_llm_kv_cache_pattern(ov::Dimension batch auto transpose_const = ov::op::v0::Constant::create(ov::element::i32, {new_token_size.size()}, {0, 2, 1, 3}); auto transpose = std::make_shared(in_new_token, transpose_const); - auto concat = std::make_shared(ov::OutputVector{concat_input, transpose}, 2); + auto concat = std::make_shared(ov::OutputVector{concat_input, transpose}, concat_axis); auto convert = std::make_shared(concat, element_type); auto kv_present = std::make_shared(convert); kv_present->set_friendly_name("present_key_values"); diff --git a/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/kv_cache.cpp b/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/kv_cache.cpp index 59da844cab2856..e3eb1cec066082 100644 --- a/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/kv_cache.cpp +++ b/src/plugins/intel_gpu/tests/functional/subgraph_tests/dynamic/kv_cache.cpp @@ -255,6 +255,7 @@ class KVCacheTests: public ::testing::Test { bool fuse_cache_reorder, bool build_state_initializer, size_t batch = 1, + int64_t concat_axis = 2, ov::element::Type model_element_type = ov::element::f16, size_t num_iter = 10) { #if defined(ANDROID) @@ -291,6 +292,7 @@ class KVCacheTests: public ::testing::Test { n_heads, n_features, element_type, + concat_axis, stateful, fuse_cache_reorder, build_state_initializer && stateful); @@ -298,6 +300,7 @@ class KVCacheTests: public ::testing::Test { n_heads, n_features, element_type, + concat_axis, !stateful, fuse_cache_reorder, build_state_initializer && !stateful); @@ -458,8 +461,8 @@ TEST_F(KVCacheTests, smoke_multipleIterations_cached) { this->test_smoke_multipleIterations(true); } -TEST_F(KVCacheTests, smoke_multipleIterations_stateful_no_gather_no_initializer) { - this->test_smoke_multipleIterations_stateful(false, false, false); +TEST_F(KVCacheTests, smoke_multipleIterations_stateful_no_gather_no_initializer_concat_neg_axis) { + this->test_smoke_multipleIterations_stateful(false, false, false, 1, -2); } TEST_F(KVCacheTests, smoke_multipleIterations_stateful_no_gather_no_initializer_cached) { @@ -475,7 +478,7 @@ TEST_F(KVCacheTests, smoke_multipleIterations_stateful_gather_with_initializer_c } TEST_F(KVCacheTests, smoke_multipleIterations_stateful_gather_with_initializer_f32) { - this->test_smoke_multipleIterations_stateful(false, true, true, 1, ov::element::f32); + this->test_smoke_multipleIterations_stateful(false, true, true, 1, 2, ov::element::f32); } TEST_F(KVCacheTests, smoke_multipleIterations_stateful_gather_with_initializer_batch_3) { @@ -483,7 +486,7 @@ TEST_F(KVCacheTests, smoke_multipleIterations_stateful_gather_with_initializer_b } TEST_F(KVCacheTests, smoke_multipleIterations_stateful_same_shape_after_reset) { - this->test_smoke_multipleIterations_stateful(false, false, false, 1, ov::element::f16, 0); + this->test_smoke_multipleIterations_stateful(false, false, false, 1, 2, ov::element::f16, 0); } } // namespace From a2818110cc6cf942e725fe833cb6a12d3467d252 Mon Sep 17 00:00:00 2001 From: Katarzyna Mitrus Date: Tue, 6 Feb 2024 07:00:39 +0100 Subject: [PATCH 15/55] [Op][Ref][CPU] Extend Gather op with String support (#22465) ### Details: - Extend Gather op with String support for data input (agreed to do it within the same op version, existing reference implementation is common for GatherBase and ready to handle strings, ref changes are not needed, just evaluate supported types updated) - Enable fallback to the reference implementation from CPU plugin - Extend Template and CPU plugin operator tests with string validation (most of the changes are tests related) ### Tickets: - 130688 --- .../python/tests/test_graph/test_gather.py | 25 ++++++- src/core/include/openvino/op/gather.hpp | 2 +- src/core/src/op/gather.cpp | 10 +++ src/core/src/op/util/gather_base.cpp | 2 +- src/core/tests/eval.cpp | 26 +++++++ src/plugins/intel_cpu/src/nodes/gather.cpp | 3 + .../single_layer_tests/gather.cpp | 59 +++++++++++++++ .../op_reference/base_reference_test.cpp | 7 ++ .../op_reference/base_reference_test.hpp | 13 ++-- .../tests/functional/op_reference/gather.cpp | 58 +++++++++++++++ .../shared/include/single_op_tests/gather.hpp | 5 ++ .../shared_test_classes/single_op/gather.hpp | 23 ++++++ .../src/single_op/gather.cpp | 72 +++++++++++++++++++ .../common_test_utils/ov_tensor_utils.hpp | 2 + .../common_test_utils/src/ov_tensor_utils.cpp | 14 ++++ 15 files changed, 313 insertions(+), 8 deletions(-) diff --git a/src/bindings/python/tests/test_graph/test_gather.py b/src/bindings/python/tests/test_graph/test_gather.py index 3431bcb540e7a7..c1da1c36fff15a 100644 --- a/src/bindings/python/tests/test_graph/test_gather.py +++ b/src/bindings/python/tests/test_graph/test_gather.py @@ -2,7 +2,7 @@ # Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -from openvino import Type +from openvino import Tensor, Type import openvino.runtime.opset8 as ov import numpy as np import pytest @@ -24,3 +24,26 @@ def test_gather(input_shape, indices, axis, expected_shape, batch_dims): assert node.get_output_size() == 1 assert list(node.get_output_shape(0)) == expected_shape assert node.get_output_element_type(0) == Type.f32 + + +@pytest.mark.parametrize(("data_str", "input_shape", "indices", "axis", "expected_shape", "batch_dims"), [ + (["Abc", " C de, Fghi.."], [2], [0], [0], [1], 0), + (["Abc", " C de, Fghi.."], [1, 2], [1], [1], [1], 1), +]) +def test_gather_string(data_str, input_shape, indices, axis, expected_shape, batch_dims): + input_data = np.array(data_str).reshape(input_shape) + input_param = ov.parameter(input_shape, name="input_data", dtype=Type.string) + + input_indices = np.array(indices, np.int32) + input_axis = np.array(axis, np.int32) + + node = ov.gather(input_param, input_indices, input_axis, batch_dims) + out_tensor = Tensor(Type.string, input_shape) + + assert node.get_type_name() == "Gather" + assert node.get_output_size() == 1 + assert list(node.get_output_shape(0)) == expected_shape + assert node.get_output_element_type(0) == Type.string + + node.evaluate([out_tensor], [Tensor(input_data), Tensor(input_indices), Tensor(input_axis)]) + assert np.array(data_str[indices[0]]) == out_tensor.str_data diff --git a/src/core/include/openvino/op/gather.hpp b/src/core/include/openvino/op/gather.hpp index dcc53a465bf718..56cb602c453ed9 100644 --- a/src/core/include/openvino/op/gather.hpp +++ b/src/core/include/openvino/op/gather.hpp @@ -74,7 +74,7 @@ class OPENVINO_API Gather : public op::util::GatherBase { bool visit_attributes(AttributeVisitor& visitor) override; void validate_and_infer_types() override; int64_t get_batch_dims() const; - + bool has_evaluate() const override; std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; }; } // namespace v8 diff --git a/src/core/src/op/gather.cpp b/src/core/src/op/gather.cpp index e53f290f1633c1..941637781b0ba6 100644 --- a/src/core/src/op/gather.cpp +++ b/src/core/src/op/gather.cpp @@ -108,6 +108,16 @@ std::shared_ptr Gather::clone_with_new_inputs(const OutputVector& new_args check_new_args_count(this, new_args); return std::make_shared(new_args.at(0), new_args.at(1), new_args.at(2), m_batch_dims); } + +bool Gather::has_evaluate() const { + OV_OP_SCOPE(v8_Gather_has_evaluate); + switch (get_output_element_type(0)) { + case element::string: + return true; + default: + return false; + } +} } // namespace v8 } // namespace op } // namespace ov diff --git a/src/core/src/op/util/gather_base.cpp b/src/core/src/op/util/gather_base.cpp index a05bcdf1c55087..2366acebc98bbe 100644 --- a/src/core/src/op/util/gather_base.cpp +++ b/src/core/src/op/util/gather_base.cpp @@ -204,7 +204,7 @@ bool GatherBase::evaluate(TensorVector& outputs, const TensorVector& inputs) con using namespace ov::element; return IF_TYPE_OF(util_GatherBase_evaluate, - OV_PP_ET_LIST(boolean, f16, f32, i8, i32, i64, u8, u32, u64), + OV_PP_ET_LIST(boolean, f16, f32, i8, i32, i64, u8, u32, u64, string), gather::Evaluate, data.get_element_type(), data, diff --git a/src/core/tests/eval.cpp b/src/core/tests/eval.cpp index 4962e5db4ef7c7..b74859ae0cd04f 100644 --- a/src/core/tests/eval.cpp +++ b/src/core/tests/eval.cpp @@ -4111,3 +4111,29 @@ TEST(eval, invalid_shape) { make_tensor({1, 3}, {7.0f, 6.0f, 1.0f})}; ASSERT_THROW(model->evaluate(out_vector, in_vector), ov::Exception); } + +TEST(eval, evaluate_gather_string_basic) { + std::vector input_values = {"Abc", "x", "1234", "...."}; + std::vector out_expected{"x", "...."}; + std::vector indices_val{1, 3}; + + const auto data_shape = Shape{input_values.size()}; + const auto exp_out_shape = Shape{out_expected.size()}; + auto data = make_shared(element::string, data_shape); + auto indices = ov::op::v0::Constant::create(element::i32, Shape{indices_val.size()}, indices_val); + auto axis = ov::op::v0::Constant::create(element::i32, Shape{1}, {0}); + auto op = make_shared(data, indices, axis, 0); + auto model = make_shared(OutputVector{op}, ParameterVector{data}); + + auto result = ov::Tensor(element::string, exp_out_shape); + auto out_vector = ov::TensorVector{result}; + auto in_tensor = ov::Tensor(element::string, data_shape, input_values.data()); + auto in_vector = ov::TensorVector{in_tensor}; + + ASSERT_TRUE(model->evaluate(out_vector, in_vector)); + EXPECT_EQ(result.get_element_type(), element::string); + EXPECT_EQ(result.get_shape(), exp_out_shape); + + const auto result_const = ov::op::v0::Constant(out_vector.at(0)); + EXPECT_EQ(out_expected, result_const.get_value_strings()); +} diff --git a/src/plugins/intel_cpu/src/nodes/gather.cpp b/src/plugins/intel_cpu/src/nodes/gather.cpp index a800dbafdcc694..7ada726aeaa38e 100644 --- a/src/plugins/intel_cpu/src/nodes/gather.cpp +++ b/src/plugins/intel_cpu/src/nodes/gather.cpp @@ -34,6 +34,9 @@ namespace node { bool Gather::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { try { + if (op->get_output_element_type(0) == element::string) { + return false; + } if (!one_of(op->get_type_info(), ov::op::v7::Gather::get_type_info_static(), ov::op::v8::Gather::get_type_info_static())) { diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp index 68a16954a19a85..b0e1c92f3f2ec4 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/gather.cpp @@ -10,6 +10,7 @@ namespace { using ov::test::Gather7LayerTest; using ov::test::Gather8LayerTest; using ov::test::Gather8withIndicesDataLayerTest; +using ov::test::GatherStringWithIndicesDataLayerTest; const std::vector model_types = { ov::element::f32, @@ -229,4 +230,62 @@ const auto gatherWithIndicesParams = testing::Combine( INSTANTIATE_TEST_CASE_P(smoke, Gather8withIndicesDataLayerTest, gatherWithIndicesParams, Gather8withIndicesDataLayerTest::getTestCaseName); +std::vector string_cases_params{ + {ov::test::static_shapes_to_test_representation(std::vector{{3}}), // input shape + ov::Shape{1}, // indices shape + std::tuple{0, 0}, // axis, batch + ov::element::string, // model type + ov::test::utils::DEVICE_CPU, // device + std::vector{0}, // indices value + std::vector{"Abc", "xyz", "..."}}, // data str value + {ov::test::static_shapes_to_test_representation(std::vector{{3}}), + ov::Shape{1}, + std::tuple{0, 0}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{1}, + std::vector{"Abc", "xyz", "..."}}, + {ov::test::static_shapes_to_test_representation(std::vector{{3}}), + ov::Shape{2}, + std::tuple{0, 0}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{0, 2}, + std::vector{"Abc", "xyz", "..."}}, + {ov::test::static_shapes_to_test_representation(std::vector{{3}}), + ov::Shape{2}, + std::tuple{0, 0}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{0, 1}, + std::vector{"Ab", "1345", "xyz"}}, + {ov::test::static_shapes_to_test_representation(std::vector{{2, 2}}), + ov::Shape{1}, + std::tuple{0, 0}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{1}, + std::vector{"A", "B c", "d.Ef", " G h,i;"}}, + {ov::test::static_shapes_to_test_representation(std::vector{{2, 2, 2}}), + ov::Shape{1}, + std::tuple{0, 0}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{1}, + std::vector{"A", "B c", "d.Ef", " G h,i;", "JK ", "l,m,n,", " ", " \0"}}, + {ov::test::static_shapes_to_test_representation(std::vector{{2, 1, 2}}), + ov::Shape{2, 1, 2}, + std::tuple{2, 2}, + ov::element::string, + ov::test::utils::DEVICE_CPU, + std::vector{0, 1, 1, 0}, + std::vector{"A", "B c", "d.Ef", " G h,i;"}}}; + +const auto gatherWithStringParams = testing::ValuesIn(string_cases_params); + +INSTANTIATE_TEST_CASE_P(smoke_gather_string, + GatherStringWithIndicesDataLayerTest, + gatherWithStringParams, + GatherStringWithIndicesDataLayerTest::getTestCaseName); + } // namespace diff --git a/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp b/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp index 845c5c0b15b1c8..54aa3d750fb7e5 100644 --- a/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp +++ b/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp @@ -5,6 +5,7 @@ #include +#include "common_test_utils/include/common_test_utils/ov_tensor_utils.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/runtime/allocator.hpp" @@ -38,6 +39,9 @@ void CommonReferenceTest::FillInputs() { for (size_t i = 0; i < functionParams.size(); i++) { const auto& param = functionParams[i]; + if (param->get_element_type() == ov::element::string) { + continue; + } ov::Tensor blob; if (param->get_partial_shape().is_static()) { @@ -211,6 +215,9 @@ void CommonReferenceTest::ValidateBlobs(const ov::Tensor& refBlob, threshold, abs_threshold); break; + case ov::element::string: + ov::test::utils::compare_str(refBlob, outBlob); + break; default: FAIL() << "Comparator for " << element_type << " element type isn't supported"; } diff --git a/src/plugins/template/tests/functional/op_reference/base_reference_test.hpp b/src/plugins/template/tests/functional/op_reference/base_reference_test.hpp index 4c2c6711d0ae63..439736101b1cfd 100644 --- a/src/plugins/template/tests/functional/op_reference/base_reference_test.hpp +++ b/src/plugins/template/tests/functional/op_reference/base_reference_test.hpp @@ -58,11 +58,14 @@ ov::Tensor CreateTensor(const ov::element::Type& element_type, const std::vector template ov::Tensor CreateTensor(const ov::Shape& shape, const ov::element::Type& element_type, const std::vector& values) { ov::Tensor tensor{element_type, shape}; - size_t size = sizeof(T) * values.size(); - if (tensor.get_byte_size() < size) - size = tensor.get_byte_size(); - std::memcpy(tensor.data(), values.data(), size); - + if (element_type == ov::element::string) { + std::copy_n(values.data(), shape_size(shape), tensor.data()); + } else { + size_t size = sizeof(T) * values.size(); + if (tensor.get_byte_size() < size) + size = tensor.get_byte_size(); + std::memcpy(tensor.data(), values.data(), size); + } return tensor; } diff --git a/src/plugins/template/tests/functional/op_reference/gather.cpp b/src/plugins/template/tests/functional/op_reference/gather.cpp index 99b1c82a8d91d8..409a66223c4d5e 100644 --- a/src/plugins/template/tests/functional/op_reference/gather.cpp +++ b/src/plugins/template/tests/functional/op_reference/gather.cpp @@ -441,6 +441,62 @@ std::vector generateParamsV7 +std::vector generateParamsStringValue() { + using T = typename element_type_traits::value_type; + using T_I = typename element_type_traits::value_type; + using T_A = typename element_type_traits::value_type; + std::vector params{ + {reference_tests::Tensor(ET, {2}, std::vector{"A", "B c"}), + reference_tests::Tensor(ET_I, {1}, std::vector{1}), + reference_tests::Tensor(ET_A, {1}, std::vector{0}), + 0, + reference_tests::Tensor(ET, {1}, std::vector{"B c"}), + "gather_string_1D_data"}, + {reference_tests::Tensor(ET, {2, 2}, std::vector{"A", "B c", "d.Ef", " G h,i;"}), + reference_tests::Tensor(ET_I, {1}, std::vector{1}), + reference_tests::Tensor(ET_A, {1}, std::vector{0}), + 0, + reference_tests::Tensor(ET, {1, 2}, std::vector{"d.Ef", " G h,i;"}), + "gather_string_2D_data"}, + {reference_tests::Tensor(ET, {2, 2}, std::vector{"A", "B c", "d.Ef", " G h,i;"}), + reference_tests::Tensor(ET_I, {2, 1}, std::vector{0, 1}), + reference_tests::Tensor(ET_A, {1}, std::vector{1}), + 1, + reference_tests::Tensor(ET, {2, 1}, std::vector{"A", " G h,i;"}), + "gather_string_2D_data_batch_dims_1"}, + {reference_tests::Tensor(ET, {2, 2}, std::vector{"A", "B c", "d.Ef", " G h,i;"}), + reference_tests::Tensor(ET_I, {2, 1}, std::vector{1, 0}), + reference_tests::Tensor(ET_A, {1}, std::vector{1}), + 1, + reference_tests::Tensor(ET, {2, 1}, std::vector{"B c", "d.Ef"}), + "gather_string_2D_data_batch_dims_1_reversed"}, + {reference_tests::Tensor(ET, {2, 1, 2}, std::vector{"A", "B c", "d.Ef", " G h,i;"}), + reference_tests::Tensor(ET_I, {2, 1, 2}, std::vector{0, 1, 1, 0}), + reference_tests::Tensor(ET_A, {1}, std::vector{2}), + 2, + reference_tests::Tensor(ET, {2, 1, 2}, std::vector{"A", "B c", " G h,i;", "d.Ef"}), + "gather_string_3D_data_batch_dims_2"}, + {reference_tests::Tensor(ET, + {2, 2, 2}, + std::vector{"A", "B c", "d.Ef", " G h,i;", "JK ", "l,m,n,", " ", " \0"}), + reference_tests::Tensor(ET_I, {1}, std::vector{1}), + reference_tests::Tensor(ET_A, {1}, std::vector{1}), + 0, + reference_tests::Tensor(ET, {2, 1, 2}, std::vector{"d.Ef", " G h,i;", " ", " \0"}), + "gather_string_3D_data_axis_1"}, + {reference_tests::Tensor(ET, + {2, 2, 2}, + std::vector{"A", "B c", "d.Ef", " G h,i;", "JK ", "l,m,n,", " ", " \0"}), + reference_tests::Tensor(ET_I, {1}, std::vector{1}), + reference_tests::Tensor(ET_A, {1}, std::vector{0}), + 0, + reference_tests::Tensor(ET, {1, 2, 2}, std::vector{"JK ", "l,m,n,", " ", " \0"}), + "gather_string_3D_data_axis_0"}, + }; + return params; +} + template std::vector generateParamsFloatValueV7() { using T = typename element_type_traits::value_type; @@ -633,6 +689,7 @@ std::vector generateCombinedParamsV7() { generateParamsFloatValueV7(), generateParamsFloatValueV7(), generateParamsFloatValueV7(), + generateParamsStringValue(), }; std::vector combinedParams; @@ -717,6 +774,7 @@ std::vector generateCombinedParamsV8() { generateParamsV8(), generateParamsV8(), generateParamsV8(), + generateParamsStringValue(), }; std::vector combinedParams; diff --git a/src/tests/functional/plugin/shared/include/single_op_tests/gather.hpp b/src/tests/functional/plugin/shared/include/single_op_tests/gather.hpp index be9aa74077694e..e6b29a28ad9844 100644 --- a/src/tests/functional/plugin/shared/include/single_op_tests/gather.hpp +++ b/src/tests/functional/plugin/shared/include/single_op_tests/gather.hpp @@ -27,5 +27,10 @@ TEST_P(Gather8IndiceScalarLayerTest, Inference) { TEST_P(Gather8withIndicesDataLayerTest, Inference) { run(); }; + +TEST_P(GatherStringWithIndicesDataLayerTest, Inference) { + run(); +}; + } // namespace test } // namespace ov diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/gather.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/gather.hpp index a41a13ce962eb7..29398ba28a336d 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/gather.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/gather.hpp @@ -78,5 +78,28 @@ class Gather8withIndicesDataLayerTest : public testing::WithParamInterface, // Input shapes + ov::Shape, // Indices shape + std::tuple, // Gather axis and batch + ov::element::Type, // Model type + std::string, // Device name + std::vector, // indices data + std::vector // String data + > + GatherStringParamsTuple; + +class GatherStringWithIndicesDataLayerTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj); + +protected: + void SetUp() override; + void generate_inputs(const std::vector& target_shapes) override; + +private: + std::vector string_data; +}; + } // namespace test } // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/single_op/gather.cpp b/src/tests/functional/shared_test_classes/src/single_op/gather.cpp index d320aa16806b23..d88d6ca64d512c 100644 --- a/src/tests/functional/shared_test_classes/src/single_op/gather.cpp +++ b/src/tests/functional/shared_test_classes/src/single_op/gather.cpp @@ -244,5 +244,77 @@ void Gather8withIndicesDataLayerTest::SetUp() { function = std::make_shared(result, ov::ParameterVector{param}, "gather"); } +// Gather String support +std::string GatherStringWithIndicesDataLayerTest::getTestCaseName(const testing::TestParamInfo& obj) { + const GatherStringParamsTuple& basicParams = obj.param; + std::vector indicesData; + std::vector str_data; + + std::tuple axis_batch_idx; + std::vector indices; + ov::Shape indices_shape; + std::vector shapes; + ov::element::Type model_type; + std::string device_name; + std::tie(shapes, indices_shape, axis_batch_idx, model_type, device_name, indicesData, str_data) = basicParams; + + std::ostringstream result; + result << "IS=("; + for (size_t i = 0lu; i < shapes.size(); i++) { + result << ov::test::utils::partialShape2str({shapes[i].first}) << (i < shapes.size() - 1lu ? "_" : ""); + } + result << ")_TS="; + for (size_t i = 0lu; i < shapes.front().second.size(); i++) { + result << "{"; + for (size_t j = 0lu; j < shapes.size(); j++) { + result << ov::test::utils::vec2str(shapes[j].second[i]) << (j < shapes.size() - 1lu ? "_" : ""); + } + result << "}_"; + } + result << "axis=" << std::get<0>(axis_batch_idx) << "_"; + result << "batch_idx=" << std::get<1>(axis_batch_idx) << "_"; + result << "indices_shape=" << ov::test::utils::vec2str(indices_shape) << "_"; + result << "netPRC=" << model_type.get_type_name() << "_"; + result << "trgDev=" << device_name << "_"; + result << "indicesData=" << ov::test::utils::vec2str(indicesData) << "_"; + + return result.str(); +} + +void GatherStringWithIndicesDataLayerTest::SetUp() { + const GatherStringParamsTuple& basicParams = GetParam(); + std::vector indicesData; + std::tuple axis_batch_idx; + ov::Shape indices_shape; + std::vector shapes; + ov::element::Type model_type; + std::tie(shapes, indices_shape, axis_batch_idx, model_type, targetDevice, indicesData, string_data) = basicParams; + init_input_shapes(shapes); + + int axis = std::get<0>(axis_batch_idx); + int batch_idx = std::get<1>(axis_batch_idx); + auto param = std::make_shared(model_type, inputDynamicShapes.front()); + + // create indices tensor and fill data + ov::Tensor indices_node_tensor{ov::element::i64, indices_shape}; + auto indices_tensor_data = indices_node_tensor.data(); + for (size_t i = 0; i < shape_size(indices_shape); ++i) { + indices_tensor_data[i] = indicesData[i]; + } + + auto indices_node = std::make_shared(indices_node_tensor); + auto axis_node = ov::op::v0::Constant::create(ov::element::i64, ov::Shape(), {axis}); + auto gather = std::make_shared(param, indices_node, axis_node, batch_idx); + auto result = std::make_shared(gather); + function = std::make_shared(result, ov::ParameterVector{param}, "gather"); +} + +void GatherStringWithIndicesDataLayerTest::generate_inputs(const std::vector& target_shapes) { + inputs.clear(); + const auto& func_inputs = function->inputs(); + auto& data_input = func_inputs[0]; + inputs.insert({data_input.get_node_shared_ptr(), ov::Tensor(element::string, data_input.get_shape(), string_data.data())}); +} + } // namespace test } // namespace ov diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp index 0bd6140e2133ad..ade6aac7aee97a 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/ov_tensor_utils.hpp @@ -81,6 +81,8 @@ void compare(const ov::Tensor& expected, const ov::Tensor& actual, const double abs_threshold = std::numeric_limits::max(), const double rel_threshold = std::numeric_limits::max()); + +void compare_str(const ov::Tensor& expected, const ov::Tensor& actual); } // namespace utils } // namespace test } // namespace ov diff --git a/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp b/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp index ee85e0c88cebad..832bb6b618f5f7 100644 --- a/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp +++ b/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp @@ -6,6 +6,7 @@ #include "common_test_utils/data_utils.hpp" #include "openvino/core/type/element_type_traits.hpp" +#include "openvino/op/constant.hpp" #include "precomp.hpp" namespace ov { @@ -470,6 +471,16 @@ void compare(const ov::Tensor& expected, } } +void compare_str(const ov::Tensor& expected, const ov::Tensor& actual) { + ASSERT_EQ(expected.get_element_type(), ov::element::string); + ASSERT_EQ(actual.get_element_type(), ov::element::string); + EXPECT_EQ(expected.get_shape(), actual.get_shape()); + + const auto expected_const = ov::op::v0::Constant(expected); + const auto result_const = ov::op::v0::Constant(actual); + EXPECT_EQ(expected_const.get_value_strings(), result_const.get_value_strings()); +} + void compare(const ov::Tensor& expected, const ov::Tensor& actual, const double abs_threshold, @@ -527,6 +538,9 @@ void compare(const ov::Tensor& expected, CASE(ov::element::Type_t::u16) CASE(ov::element::Type_t::u32) CASE(ov::element::Type_t::u64) + case ov::element::Type_t::string: + compare_str(expected, actual); + break; default: OPENVINO_THROW("Unsupported element type: ", expected.get_element_type()); } From ba610e67a609702d89ba9529e35d9ba4cd7c0c2f Mon Sep 17 00:00:00 2001 From: Taylor Yeonbok Lee Date: Tue, 6 Feb 2024 15:40:34 +0900 Subject: [PATCH 16/55] [GPU] Distributed kv cache allocatio to prevent memory peak (#22665) ### Details: - If kv caches are reallocated and copied at one time, there will be a memory peak at that inference. - Distributed kv cahce allocation period to prevent that issue as a temporal quick solution ### Tickets: - 128982 --- src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp | 2 ++ src/plugins/intel_gpu/src/graph/include/kv_cache_inst.h | 8 +++++--- src/plugins/intel_gpu/src/graph/include/primitive_inst.h | 2 ++ src/plugins/intel_gpu/src/graph/kv_cache.cpp | 4 ++++ src/plugins/intel_gpu/src/graph/network.cpp | 4 ++++ src/plugins/intel_gpu/src/graph/primitive_inst.cpp | 2 +- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp index 3080853d437b3d..07927abe52a107 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp @@ -220,6 +220,7 @@ struct network { const ov::intel_gpu::VariableStateInfo& get_variable_info(const std::string &variable_id) const; const ov::intel_gpu::VariablesMap& get_variables() const; const ov::intel_gpu::VariablesInfoMap& get_variables_info() const; + std::vector get_kv_cache_ids() const { return kv_cache_ids; } const ExecutionConfig& get_config() const { return _config; } @@ -255,6 +256,7 @@ struct network { ov::intel_gpu::VariablesMap _variables_states; ov::intel_gpu::VariablesInfoMap _variables_state_info; + std::vector kv_cache_ids; program::primitives_info _prims_info; std::map _ext_id_mapping; diff --git a/src/plugins/intel_gpu/src/graph/include/kv_cache_inst.h b/src/plugins/intel_gpu/src/graph/include/kv_cache_inst.h index 34c4ccf555008b..2c9e34efd30792 100644 --- a/src/plugins/intel_gpu/src/graph/include/kv_cache_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/kv_cache_inst.h @@ -36,9 +36,8 @@ class typed_primitive_inst : public typed_primitive_inst_base : public typed_primitive_inst_base; diff --git a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h index 62840e2b9bbb1f..99805e947081c0 100644 --- a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h @@ -299,6 +299,8 @@ class primitive_inst { virtual void update_output_memory() {} + virtual int32_t get_prealloc_iter_num() { return -1; } + protected: primitive_inst(network& network, program_node const& node, bool allocate_memory); diff --git a/src/plugins/intel_gpu/src/graph/kv_cache.cpp b/src/plugins/intel_gpu/src/graph/kv_cache.cpp index 0e44de3fc2fb9c..aaf4a1cbfd4cc9 100644 --- a/src/plugins/intel_gpu/src/graph/kv_cache.cpp +++ b/src/plugins/intel_gpu/src/graph/kv_cache.cpp @@ -16,6 +16,7 @@ GPU_DEFINE_PRIMITIVE_TYPE_ID(kv_cache) kv_cache_inst::typed_primitive_inst(network& network, const kv_cache_node& node) : parent{network, node, false}, memory_state::variable{node.get_primitive()->variable_info.variable_id} { + kv_cache_id = network.get_kv_cache_ids().size(); } layout kv_cache_inst::calc_output_layout(const kv_cache_node& node, kernel_impl_params const& impl_param) { @@ -55,4 +56,7 @@ std::string kv_cache_inst::to_string(const kv_cache_node& node) { return primitive_description.str(); } +int32_t kv_cache_inst::get_prealloc_iter_num() { + return 128 + kv_cache_id % 64; +} } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/network.cpp b/src/plugins/intel_gpu/src/graph/network.cpp index 80b077e740c99b..3fe7d3b483b59f 100644 --- a/src/plugins/intel_gpu/src/graph/network.cpp +++ b/src/plugins/intel_gpu/src/graph/network.cpp @@ -34,6 +34,7 @@ #include "assign_inst.h" #include "read_value_inst.h" #include "reshape_inst.h" +#include "kv_cache_inst.h" #include "program_helpers.h" #include "to_string_utils.h" #include "kernels_cache.hpp" @@ -1329,6 +1330,9 @@ void network::allocate_primitive_instance(program_node const& node) { if (node.is_type()) _data_outputs.push_back(inst); } + if (node.is_type()) { + kv_cache_ids.push_back(node.id()); + } if (auto state_prim = std::dynamic_pointer_cast(inst)) { set_variables_state_info(state_prim->variable_id(), node.get_output_layout(0), state_prim->get_user_specified_type()); } diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp index 0ff2eb2c57c34a..30dbb7a4246dcd 100644 --- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp +++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp @@ -568,7 +568,7 @@ event::ptr primitive_inst::realloc_if_needed() { auto current_shape = updated_layout.get_shape(); std::pair prealloc_info; - int32_t tmp_prealloc_count = _node->is_type() ? kv_cache_inst::get_prealloc_iter_num() : -1; + int32_t tmp_prealloc_count = get_prealloc_iter_num(); GPU_DEBUG_IF(debug_config->mem_preallocation_params.is_initialized) { // If debug config is set, repsect the config most tmp_prealloc_count = -1; From 776968d08ff756f7bcbd51cec501235921631596 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Tue, 6 Feb 2024 09:03:48 +0100 Subject: [PATCH 17/55] [Core] Remove deprecated leftovers (#22658) ### Details: - Cleans up `src/core` from unneeded suppression switches, comments and such remains of legacy API drop. ### Tickets: - CVS-131716 --------- Co-authored-by: Ilya Lavrenov --- src/core/docs/api_details.md | 1 - src/core/include/openvino/core/core.hpp | 1 - src/core/include/openvino/core/node.hpp | 1 - src/core/include/openvino/core/type.hpp | 3 --- src/core/include/openvino/op/interpolate.hpp | 11 +---------- src/core/include/openvino/op/util/variable_value.hpp | 7 ------- src/core/include/openvino/opsets/opset.hpp | 1 - src/core/include/openvino/pass/pass.hpp | 1 - src/core/include/openvino/pass/pass_config.hpp | 1 - src/core/include/openvino/pass/serialize.hpp | 3 --- .../include/pooling_shape_inference_util.hpp | 2 -- src/core/shape_inference/include/utils.hpp | 1 - src/core/src/op/experimental_detectron_topkrois.cpp | 2 -- src/core/src/op/max_pool.cpp | 4 ---- src/core/src/op/non_max_suppression.cpp | 12 ------------ src/core/src/op/proposal.cpp | 2 -- src/core/src/op/reduce_logical_and.cpp | 1 - src/core/src/op/util/gather_base.cpp | 2 -- src/core/src/op/util/variable_value.cpp | 1 - src/core/src/pass/manager.cpp | 8 ++------ src/core/src/pass/serialize.cpp | 1 - src/core/src/pass/visualize_tree.cpp | 6 ++---- src/core/src/pattern/matcher.cpp | 2 -- src/core/tests/type_prop/batch_to_space.cpp | 1 - src/core/tests/type_prop/depth_to_space.cpp | 2 -- src/core/tests/type_prop/variadic_split.cpp | 1 - src/core/tests/visitors/visitors.hpp | 1 - 27 files changed, 5 insertions(+), 74 deletions(-) diff --git a/src/core/docs/api_details.md b/src/core/docs/api_details.md index 99b1397525bfb5..87383f1a15b7e3 100644 --- a/src/core/docs/api_details.md +++ b/src/core/docs/api_details.md @@ -1,7 +1,6 @@ # OpenVINO Core API OpenVINO Core API contains two folders: - * [ngraph](../include/ngraph/) - is a legacy API, this API is no longer being developed. Only aliases to new operations and operation sets extend this API. * [openvino](../include/openvino/) - current public API, this part is described below. ## Structure of Core API diff --git a/src/core/include/openvino/core/core.hpp b/src/core/include/openvino/core/core.hpp index 0239a7970de6ab..823218666f2ffa 100644 --- a/src/core/include/openvino/core/core.hpp +++ b/src/core/include/openvino/core/core.hpp @@ -13,7 +13,6 @@ #include "openvino/core/coordinate.hpp" #include "openvino/core/coordinate_diff.hpp" #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/dimension.hpp" #include "openvino/core/enum_mask.hpp" #include "openvino/core/enum_names.hpp" diff --git a/src/core/include/openvino/core/node.hpp b/src/core/include/openvino/core/node.hpp index 393dc2be32d226..9006ab57a3a2a8 100644 --- a/src/core/include/openvino/core/node.hpp +++ b/src/core/include/openvino/core/node.hpp @@ -21,7 +21,6 @@ #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/descriptor/input.hpp" #include "openvino/core/descriptor/output.hpp" #include "openvino/core/descriptor/tensor.hpp" diff --git a/src/core/include/openvino/core/type.hpp b/src/core/include/openvino/core/type.hpp index 6ceaa39cbe08e0..ca4435c47c32ea 100644 --- a/src/core/include/openvino/core/type.hpp +++ b/src/core/include/openvino/core/type.hpp @@ -14,7 +14,6 @@ #include #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" namespace ov { @@ -115,9 +114,7 @@ struct AsTypePtr> { /// Type, nullptr otherwise template auto as_type_ptr(const U& value) -> decltype(::ov::util::AsTypePtr::template call(value)) { - OPENVINO_SUPPRESS_DEPRECATED_START return ::ov::util::AsTypePtr::template call(value); - OPENVINO_SUPPRESS_DEPRECATED_END } } // namespace ov diff --git a/src/core/include/openvino/op/interpolate.hpp b/src/core/include/openvino/op/interpolate.hpp index ac6876e1286cc6..f48297e7257c8c 100644 --- a/src/core/include/openvino/op/interpolate.hpp +++ b/src/core/include/openvino/op/interpolate.hpp @@ -44,16 +44,7 @@ class OPENVINO_API Interpolate : public Op { std::vector pads_end; }; - enum class InterpolateMode { - NEAREST, - LINEAR, - CUBIC, - AREA, - nearest OPENVINO_ENUM_DEPRECATED("Please use NEAREST instead") = NEAREST, - linear OPENVINO_ENUM_DEPRECATED("Please use LINEAR instead") = LINEAR, - cubic OPENVINO_ENUM_DEPRECATED("Please use CUBIC instead") = CUBIC, - area OPENVINO_ENUM_DEPRECATED("Please use AREA instead") = AREA - }; + enum class InterpolateMode { NEAREST, LINEAR, CUBIC, AREA }; Interpolate() = default; /// \brief Constructs a Interpolate operation diff --git a/src/core/include/openvino/op/util/variable_value.hpp b/src/core/include/openvino/op/util/variable_value.hpp index 574a180882949c..57e25e893e2174 100644 --- a/src/core/include/openvino/op/util/variable_value.hpp +++ b/src/core/include/openvino/op/util/variable_value.hpp @@ -8,7 +8,6 @@ #include #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/runtime/tensor.hpp" namespace ov { @@ -32,20 +31,14 @@ class OPENVINO_API VariableValue { explicit VariableValue(const ov::Tensor& value); /// \brief Constructor for VariableValue. - /// \deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor - /// instead /// \param value Data for Variable. /// \param reset The current state of the reset flag. VariableValue(const ov::Tensor& value, bool reset); /// \brief Returns the current stored data. - /// \deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor - /// instead const ov::Tensor& get_state() const; /// \brief Sets new values for Variable. - /// \deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor - /// instead /// \param value New data for Variable. void set_state(const ov::Tensor& value); diff --git a/src/core/include/openvino/opsets/opset.hpp b/src/core/include/openvino/opsets/opset.hpp index c393eeeb581d2d..f14fc6feb85d7f 100644 --- a/src/core/include/openvino/opsets/opset.hpp +++ b/src/core/include/openvino/opsets/opset.hpp @@ -10,7 +10,6 @@ #include #include -#include "openvino/core/deprecated.hpp" #include "openvino/core/node.hpp" namespace ov { diff --git a/src/core/include/openvino/pass/pass.hpp b/src/core/include/openvino/pass/pass.hpp index 9cbbce52ba8b50..7f5ee620bfeb41 100644 --- a/src/core/include/openvino/pass/pass.hpp +++ b/src/core/include/openvino/pass/pass.hpp @@ -9,7 +9,6 @@ #include #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/enum_mask.hpp" #include "openvino/core/model.hpp" #include "openvino/core/node.hpp" diff --git a/src/core/include/openvino/pass/pass_config.hpp b/src/core/include/openvino/pass/pass_config.hpp index 04f020d3a2bdd6..67821abd8e1ec9 100644 --- a/src/core/include/openvino/pass/pass_config.hpp +++ b/src/core/include/openvino/pass/pass_config.hpp @@ -9,7 +9,6 @@ #include #include "openvino/core/core_visibility.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/model.hpp" #include "openvino/core/node.hpp" diff --git a/src/core/include/openvino/pass/serialize.hpp b/src/core/include/openvino/pass/serialize.hpp index 759bc3e7973adb..332b8d76b90e6d 100644 --- a/src/core/include/openvino/pass/serialize.hpp +++ b/src/core/include/openvino/pass/serialize.hpp @@ -14,7 +14,6 @@ namespace ov { namespace pass { -OPENVINO_SUPPRESS_DEPRECATED_START /** * @brief Serialize transformation converts ov::Model into IR files * @attention @@ -75,7 +74,5 @@ class OPENVINO_API StreamSerialize : public ov::pass::ModelPass { std::function m_custom_data_serializer; const Serialize::Version m_version; }; -OPENVINO_SUPPRESS_DEPRECATED_END - } // namespace pass } // namespace ov diff --git a/src/core/shape_inference/include/pooling_shape_inference_util.hpp b/src/core/shape_inference/include/pooling_shape_inference_util.hpp index 36c3eef787fe89..f53ef153580b4c 100644 --- a/src/core/shape_inference/include/pooling_shape_inference_util.hpp +++ b/src/core/shape_inference/include/pooling_shape_inference_util.hpp @@ -248,12 +248,10 @@ TRShape out_shape_infer(const TOp* op, const std::vector& input_shapes, const auto& data_rank = data_shape.rank(); - OPENVINO_SUPPRESS_DEPRECATED_START NODE_VALIDATION_CHECK(op, ov::util::is_rank_compatible_any_of(data_rank, {3, 4, 5}), "Expected a 3D, 4D or 5D tensor for the input. Got: ", data_shape); - OPENVINO_SUPPRESS_DEPRECATED_END TRShape output_shape; if (data_rank.is_static()) { diff --git a/src/core/shape_inference/include/utils.hpp b/src/core/shape_inference/include/utils.hpp index b0a7c508619d83..18d6158b41675e 100644 --- a/src/core/shape_inference/include/utils.hpp +++ b/src/core/shape_inference/include/utils.hpp @@ -8,7 +8,6 @@ #include "element_visitor.hpp" #include "openvino/core/bound_evaluation_util.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/opsets/opset1.hpp" #include "ov_optional.hpp" #include "shape_infer_type_utils.hpp" diff --git a/src/core/src/op/experimental_detectron_topkrois.cpp b/src/core/src/op/experimental_detectron_topkrois.cpp index 5aa1d1cf5b2cc2..3ef507c29542f5 100644 --- a/src/core/src/op/experimental_detectron_topkrois.cpp +++ b/src/core/src/op/experimental_detectron_topkrois.cpp @@ -38,9 +38,7 @@ void op::v6::ExperimentalDetectronTopKROIs::validate_and_infer_types() { (out_et.is_dynamic() || out_et.is_real()), "ROIs and probabilities of ROIs must same floating-point type."); - OPENVINO_SUPPRESS_DEPRECATED_START const auto input_shapes = ov::util::get_node_input_partial_shapes(*this); - OPENVINO_SUPPRESS_DEPRECATED_START const auto output_shapes = shape_infer(this, input_shapes); set_output_type(0, out_et, output_shapes[0]); diff --git a/src/core/src/op/max_pool.cpp b/src/core/src/op/max_pool.cpp index f07980ce75af22..204e72a6cbf962 100644 --- a/src/core/src/op/max_pool.cpp +++ b/src/core/src/op/max_pool.cpp @@ -39,10 +39,8 @@ bool MaxPool::visit_attributes(AttributeVisitor& visitor) { void MaxPool::validate_and_infer_types() { OV_OP_SCOPE(v1_MaxPool_validate_and_infer_types); - OPENVINO_SUPPRESS_DEPRECATED_START const auto output_shapes = shape_infer(this, ov::util::get_node_input_partial_shapes(*this), m_pads_begin, m_pads_end); - OPENVINO_SUPPRESS_DEPRECATED_END set_output_type(0, get_input_element_type(0), output_shapes.front()); } @@ -169,10 +167,8 @@ void MaxPool::validate_and_infer_types() { m_axis = ov::util::normalize_axis(this, m_axis, input_shape.rank()); } - OPENVINO_SUPPRESS_DEPRECATED_START const auto output_shapes = shape_infer(this, ov::util::get_node_input_partial_shapes(*this), m_pads_begin, m_pads_end); - OPENVINO_SUPPRESS_DEPRECATED_END set_output_type(0, get_input_element_type(0), output_shapes[0]); set_output_type(1, m_index_element_type, output_shapes[1]); } diff --git a/src/core/src/op/non_max_suppression.cpp b/src/core/src/op/non_max_suppression.cpp index 09f4cd2174194f..ead5205593b17d 100644 --- a/src/core/src/op/non_max_suppression.cpp +++ b/src/core/src/op/non_max_suppression.cpp @@ -473,9 +473,7 @@ float op::v5::NonMaxSuppression::score_threshold_from_input() const { return score_threshold; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto score_threshold_input = ov::util::get_constant_from_source(input_value(score_threshold_port)); - OPENVINO_SUPPRESS_DEPRECATED_END score_threshold = score_threshold_input->cast_vector().at(0); return score_threshold; @@ -488,9 +486,7 @@ float op::v5::NonMaxSuppression::soft_nms_sigma_from_input() const { return soft_nms_sigma; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto soft_nms_sigma_input = ov::util::get_constant_from_source(input_value(soft_nms_sigma_port)); - OPENVINO_SUPPRESS_DEPRECATED_END soft_nms_sigma = soft_nms_sigma_input->cast_vector().at(0); return soft_nms_sigma; @@ -678,9 +674,7 @@ int64_t op::v9::NonMaxSuppression::max_boxes_output_from_input() const { return 0; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto max_output_boxes_input = ov::util::get_constant_from_source(input_value(max_output_boxes_port)); - OPENVINO_SUPPRESS_DEPRECATED_END max_output_boxes = max_output_boxes_input->cast_vector().at(0); return max_output_boxes; @@ -693,9 +687,7 @@ float op::v9::NonMaxSuppression::iou_threshold_from_input() const { return iou_threshold; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto iou_threshold_input = ov::util::get_constant_from_source(input_value(iou_threshold_port)); - OPENVINO_SUPPRESS_DEPRECATED_END iou_threshold = iou_threshold_input->cast_vector().at(0); return iou_threshold; @@ -708,9 +700,7 @@ float op::v9::NonMaxSuppression::score_threshold_from_input() const { return score_threshold; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto score_threshold_input = ov::util::get_constant_from_source(input_value(score_threshold_port)); - OPENVINO_SUPPRESS_DEPRECATED_END score_threshold = score_threshold_input->cast_vector().at(0); return score_threshold; @@ -723,9 +713,7 @@ float op::v9::NonMaxSuppression::soft_nms_sigma_from_input() const { return soft_nms_sigma; } - OPENVINO_SUPPRESS_DEPRECATED_START const auto soft_nms_sigma_input = ov::util::get_constant_from_source(input_value(soft_nms_sigma_port)); - OPENVINO_SUPPRESS_DEPRECATED_END soft_nms_sigma = soft_nms_sigma_input->cast_vector().at(0); return soft_nms_sigma; diff --git a/src/core/src/op/proposal.cpp b/src/core/src/op/proposal.cpp index 1a6354680221f5..14a996e23739bf 100644 --- a/src/core/src/op/proposal.cpp +++ b/src/core/src/op/proposal.cpp @@ -91,9 +91,7 @@ void op::v4::Proposal::validate_and_infer_types() { OV_OP_SCOPE(v4_Proposal_validate_and_infer_types); validate_element_types(); - OPENVINO_SUPPRESS_DEPRECATED_START const auto intput_shapes = ov::util::get_node_input_partial_shapes(*this); - OPENVINO_SUPPRESS_DEPRECATED_END const auto output_shapes = shape_infer(this, intput_shapes); const auto& out_et = get_input_element_type(0); diff --git a/src/core/src/op/reduce_logical_and.cpp b/src/core/src/op/reduce_logical_and.cpp index 0178917aae3665..1d2cce23211bf5 100644 --- a/src/core/src/op/reduce_logical_and.cpp +++ b/src/core/src/op/reduce_logical_and.cpp @@ -39,7 +39,6 @@ std::shared_ptr ReduceLogicalAnd::clone_with_new_inputs(const OutputVector bool ReduceLogicalAnd::evaluate(TensorVector& outputs, const TensorVector& inputs) const { OV_OP_SCOPE(v1_ReduceLogicalAnd_evaluate); - OPENVINO_SUPPRESS_DEPRECATED_START OPENVINO_ASSERT(inputs.size() == 2); OPENVINO_ASSERT(outputs.size() == 1); diff --git a/src/core/src/op/util/gather_base.cpp b/src/core/src/op/util/gather_base.cpp index 2366acebc98bbe..dcfac60c659eb7 100644 --- a/src/core/src/op/util/gather_base.cpp +++ b/src/core/src/op/util/gather_base.cpp @@ -226,9 +226,7 @@ bool GatherBase::evaluate_upper(TensorVector& output_values) const { } bool GatherBase::evaluate_label(TensorLabelVector& output_labels) const { - OPENVINO_SUPPRESS_DEPRECATED_START return gather::have_indices_and_axis_bound_set(this) && ov::util::default_label_evaluator(this, output_labels); - OPENVINO_SUPPRESS_DEPRECATED_END } bool GatherBase::constant_fold(OutputVector& output_values, const OutputVector& input_values) { diff --git a/src/core/src/op/util/variable_value.cpp b/src/core/src/op/util/variable_value.cpp index 86ea10a87e9021..4d3662ecfda994 100644 --- a/src/core/src/op/util/variable_value.cpp +++ b/src/core/src/op/util/variable_value.cpp @@ -6,7 +6,6 @@ #include -#include "openvino/core/deprecated.hpp" #include "openvino/core/shape.hpp" #include "openvino/core/shape_util.hpp" #include "openvino/runtime/allocator.hpp" diff --git a/src/core/src/pass/manager.cpp b/src/core/src/pass/manager.cpp index 69363fe72f7c18..a6bee008ca99d4 100644 --- a/src/core/src/pass/manager.cpp +++ b/src/core/src/pass/manager.cpp @@ -37,8 +37,7 @@ PerfCounters& perf_counters() { namespace { bool getenv_visualize_tracing() { - return ov::util::getenv_bool("NGRAPH_ENABLE_VISUALIZE_TRACING") || - ov::util::getenv_bool("OV_ENABLE_VISUALIZE_TRACING"); + return ov::util::getenv_bool("OV_ENABLE_VISUALIZE_TRACING"); } } // namespace @@ -93,11 +92,9 @@ class stopwatch { } // namespace bool ov::pass::Manager::run_passes(shared_ptr func) { - OPENVINO_SUPPRESS_DEPRECATED_START OV_ITT_SCOPED_TASK(ov::itt::domains::core, "pass::Manager::run_passes"); - static bool profile_enabled = - ov::util::getenv_bool("NGRAPH_PROFILE_PASS_ENABLE") || ov::util::getenv_bool("OV_PROFILE_PASS_ENABLE"); + static bool profile_enabled = ov::util::getenv_bool("OV_PROFILE_PASS_ENABLE"); size_t index = 0; stopwatch pass_timer; @@ -171,7 +168,6 @@ bool ov::pass::Manager::run_passes(shared_ptr func) { if (profile_enabled) { cout << "passes done in " << overall_timer.get_milliseconds() << "ms\n"; } - OPENVINO_SUPPRESS_DEPRECATED_END return function_changed; } diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index 0da8c27ea83db6..e3d133ee545d05 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -28,7 +28,6 @@ #include "transformations/rt_info/disable_fp16_compression.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" -OPENVINO_SUPPRESS_DEPRECATED_START namespace { // helpers template std::string join(const Container& c, const char* glue = ", ") { diff --git a/src/core/src/pass/visualize_tree.cpp b/src/core/src/pass/visualize_tree.cpp index bcd3bcd1713390..5c433671f06472 100644 --- a/src/core/src/pass/visualize_tree.cpp +++ b/src/core/src/pass/visualize_tree.cpp @@ -461,10 +461,8 @@ std::string ov::pass::VisualizeTree::get_attributes(std::shared_ptr node) std::stringstream label; label << "label=\"" << get_node_name(node); - static const bool nvtos = ov::util::getenv_bool("NGRAPH_VISUALIZE_TREE_OUTPUT_SHAPES") || - ov::util::getenv_bool("OV_VISUALIZE_TREE_OUTPUT_SHAPES"); - static const bool nvtot = ov::util::getenv_bool("NGRAPH_VISUALIZE_TREE_OUTPUT_TYPES") || - ov::util::getenv_bool("OV_VISUALIZE_TREE_OUTPUT_TYPES"); + static const bool nvtos = ov::util::getenv_bool("OV_VISUALIZE_TREE_OUTPUT_SHAPES"); + static const bool nvtot = ov::util::getenv_bool("OV_VISUALIZE_TREE_OUTPUT_TYPES"); static const bool nvtio = ov::util::getenv_bool("OV_VISUALIZE_TREE_IO"); static const bool nvtrti = ov::util::getenv_bool("OV_VISUALIZE_TREE_RUNTIME_INFO"); static const bool ovpvl = ov::util::getenv_bool("OV_VISUALIZE_PARTIAL_VALUES_AND_LABELS"); diff --git a/src/core/src/pattern/matcher.cpp b/src/core/src/pattern/matcher.cpp index ab14a875a37168..063da2bdbe7c45 100644 --- a/src/core/src/pattern/matcher.cpp +++ b/src/core/src/pattern/matcher.cpp @@ -140,7 +140,6 @@ bool Matcher::match_permutation(const OutputVector& pattern_args, const OutputVe } bool Matcher::match_arguments(Node* pattern_node, const std::shared_ptr& graph_node) { - OPENVINO_SUPPRESS_DEPRECATED_START OPENVINO_DEBUG << "[MATCHER] Match arguments at " << *graph_node << " for pattern " << *pattern_node; auto args = graph_node->input_values(); @@ -174,7 +173,6 @@ bool Matcher::match_arguments(Node* pattern_node, const std::shared_ptr& g } OPENVINO_DEBUG << "[MATCHER] Aborting at " << *graph_node << " for pattern " << *pattern_node; - OPENVINO_SUPPRESS_DEPRECATED_END return false; } diff --git a/src/core/tests/type_prop/batch_to_space.cpp b/src/core/tests/type_prop/batch_to_space.cpp index 443831579968c0..66d992e08ec68a 100644 --- a/src/core/tests/type_prop/batch_to_space.cpp +++ b/src/core/tests/type_prop/batch_to_space.cpp @@ -363,7 +363,6 @@ TEST(type_prop, batch_to_space_output_dynamic_shape_5D_when_batch_is_static) { {100, 150}, {10 * 16, 20 * 16}})); } -OPENVINO_SUPPRESS_DEPRECATED_START TEST(type_prop, batch_to_space_output_dynamic_shape_5D_when_batch_is_dynamic) { auto data_shape = ov::PartialShape{{959, 962}, {2, 34}, {9, 21}, {100, 162}, {1, 1999}}; diff --git a/src/core/tests/type_prop/depth_to_space.cpp b/src/core/tests/type_prop/depth_to_space.cpp index e656bbe0a9be89..138d384aa643f7 100644 --- a/src/core/tests/type_prop/depth_to_space.cpp +++ b/src/core/tests/type_prop/depth_to_space.cpp @@ -39,8 +39,6 @@ TEST(type_prop, depth_to_space_input_interval_shape_default_block_size) { EXPECT_THAT(get_shape_labels(depth_to_space->get_output_partial_shape(0)), ElementsAre(10, 11, 12, 13, 14)); } -OPENVINO_SUPPRESS_DEPRECATED_START - TEST(type_prop, depth_to_space_output_dynamicshape_block_first_5D_when_depth_is_dynamic) { auto A = make_shared(element::f32, PartialShape{{2, 10}, {81, 82}, {3, 7}, {423, 3000}, {235, 1345}}); diff --git a/src/core/tests/type_prop/variadic_split.cpp b/src/core/tests/type_prop/variadic_split.cpp index c053d272fc0c68..84d3463ef78f53 100644 --- a/src/core/tests/type_prop/variadic_split.cpp +++ b/src/core/tests/type_prop/variadic_split.cpp @@ -6,7 +6,6 @@ #include "common_test_utils/test_assertions.hpp" #include "common_test_utils/type_prop.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/core/dimension_tracker.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/shape_of.hpp" diff --git a/src/core/tests/visitors/visitors.hpp b/src/core/tests/visitors/visitors.hpp index ce5884e2aff9fd..7fb6d1999f66d3 100644 --- a/src/core/tests/visitors/visitors.hpp +++ b/src/core/tests/visitors/visitors.hpp @@ -10,7 +10,6 @@ #include #include "openvino/core/attribute_visitor.hpp" -#include "openvino/core/deprecated.hpp" #include "openvino/op/util/framework_node.hpp" #include "openvino/op/util/sub_graph_base.hpp" #include "openvino/op/util/variable.hpp" From 7013df77c03878a79cfae7d7c4eedf1ecf91e08c Mon Sep 17 00:00:00 2001 From: River Li Date: Tue, 6 Feb 2024 17:10:41 +0800 Subject: [PATCH 18/55] [Core] fix user plugins.xml path issue (#22525) ### Details: - Fixed user rename plugins.xml cannot be found issue ### Tickets: - CVS-131048 --- src/inference/src/core.cpp | 45 +++++++---- .../tests/functional/ov_core_test.cpp | 81 +++++++++++++++++++ 2 files changed, 110 insertions(+), 16 deletions(-) create mode 100644 src/inference/tests/functional/ov_core_test.cpp diff --git a/src/inference/src/core.cpp b/src/inference/src/core.cpp index 75a68a2c75723d..618c795de14382 100644 --- a/src/inference/src/core.cpp +++ b/src/inference/src/core.cpp @@ -11,31 +11,44 @@ #include "openvino/core/so_extension.hpp" #include "openvino/runtime/device_id_parser.hpp" #include "openvino/runtime/iremote_context.hpp" +#include "openvino/util/common_util.hpp" #include "openvino/util/file_util.hpp" namespace ov { std::string find_plugins_xml(const std::string& xml_file) { - if (xml_file.empty()) { - const auto ov_library_path = ov::util::get_ov_lib_path(); + std::string xml_file_name = xml_file; + if (xml_file_name.empty()) { + // Default plugin xml file name, will search in OV folder. + xml_file_name = "plugins.xml"; + } else { + // User can set any path for plugins xml file but need guarantee security issue if apply file path out of OV + // folder. + // If the xml file exists or file path contains file separator, return file path; + // Else search it in OV folder with no restriction on file name and extension. + if (ov::util::file_exists(xml_file_name) || + xml_file_name.find(util::FileTraits().file_separator) != xml_file_name.npos) { + return xml_file_name; + } + } + const auto ov_library_path = ov::util::get_ov_lib_path(); - // plugins.xml can be found in either: + // plugins xml can be found in either: + // 1. openvino-X.Y.Z relative to libopenvino.so folder + std::ostringstream str; + str << "openvino-" << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH; + const auto sub_folder = str.str(); - // 1. openvino-X.Y.Z relative to libopenvino.so folder - std::ostringstream str; - str << "openvino-" << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH; - const auto sub_folder = str.str(); + // register plugins from default openvino-/plugins.xml config + auto xmlConfigFileDefault = ov::util::path_join({ov_library_path, sub_folder, xml_file_name}); + if (ov::util::file_exists(xmlConfigFileDefault)) + return xmlConfigFileDefault; - // register plugins from default openvino-/plugins.xml config - auto xmlConfigFileDefault = ov::util::path_join({ov_library_path, sub_folder, "plugins.xml"}); - if (ov::util::file_exists(xmlConfigFileDefault)) - return xmlConfigFileDefault; + // 2. in folder with libopenvino.so + xmlConfigFileDefault = ov::util::path_join({ov_library_path, xml_file_name}); + if (ov::util::file_exists(xmlConfigFileDefault)) + return xmlConfigFileDefault; - // 2. in folder with libopenvino.so - xmlConfigFileDefault = ov::util::path_join({ov_library_path, "plugins.xml"}); - if (ov::util::file_exists(xmlConfigFileDefault)) - return xmlConfigFileDefault; - } return xml_file; } diff --git a/src/inference/tests/functional/ov_core_test.cpp b/src/inference/tests/functional/ov_core_test.cpp new file mode 100644 index 00000000000000..a7fb627cff4884 --- /dev/null +++ b/src/inference/tests/functional/ov_core_test.cpp @@ -0,0 +1,81 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include + +#include + +#include "common_test_utils/common_utils.hpp" +#include "common_test_utils/file_utils.hpp" +#include "openvino/runtime/core.hpp" +#include "openvino/util/file_util.hpp" + +#ifndef OPENVINO_STATIC_LIBRARY + +static void create_plugin_xml(const std::string& file_name) { + std::ofstream file(file_name); + + file << "::file_separator; + file << ov::util::FileTraits::library_prefix(); + file << "mock_engine"; + file << OV_BUILD_POSTFIX; + file << ov::util::FileTraits::dot_symbol; + file << ov::util::FileTraits::library_ext(); + file << "\" name=\"1\">"; + file.flush(); + file.close(); +} + +static void remove_plugin_xml(const std::string& file_name) { + ov::test::utils::removeFile(file_name); +} + +TEST(CoreBaseTest, LoadPluginXML) { + std::string xml_file_name = "test_plugin.xml"; + std::string xml_file_path = + ov::test::utils::getOpenvinoLibDirectory() + ov::util::FileTraits::file_separator + xml_file_name; + create_plugin_xml(xml_file_path); + EXPECT_NO_THROW(ov::Core core(xml_file_name)); + remove_plugin_xml(xml_file_path); +} + +TEST(CoreBaseTest, LoadPluginDifferentXMLExtension) { + std::string xml_file_name = "test_plugin.test"; + std::string xml_file_path = + ov::test::utils::getOpenvinoLibDirectory() + ov::util::FileTraits::file_separator + xml_file_name; + create_plugin_xml(xml_file_path); + EXPECT_NO_THROW(ov::Core core(xml_file_name)); + remove_plugin_xml(xml_file_path); +} + +TEST(CoreBaseTest, LoadAbsoluteOVPathPluginXML) { + std::string xml_file_name = "test_plugin.xml"; + std::string xml_file_path = + ov::test::utils::getOpenvinoLibDirectory() + ov::util::FileTraits::file_separator + xml_file_name; + create_plugin_xml(xml_file_path); + EXPECT_NO_THROW(ov::Core core(xml_file_path)); + remove_plugin_xml(xml_file_path); +} + +TEST(CoreBaseTest, LoadAbsoluteCWPathPluginXML) { + std::string xml_file_name = "test_plugin.xml"; + std::string xml_file_path = + ov::test::utils::getCurrentWorkingDir() + ov::util::FileTraits::file_separator + xml_file_name; + create_plugin_xml(xml_file_path); + EXPECT_NO_THROW(ov::Core core(xml_file_path)); + remove_plugin_xml(xml_file_path); +} + +TEST(CoreBaseTest, LoadRelativeCWPathPluginXML) { + std::string xml_file_name = "test_plugin.xml"; + std::string xml_file_path = + ov::test::utils::getCurrentWorkingDir() + ov::util::FileTraits::file_separator + xml_file_name; + create_plugin_xml(xml_file_path); + EXPECT_NO_THROW(ov::Core core(xml_file_name)); + remove_plugin_xml(xml_file_path); +} + +#endif \ No newline at end of file From 7e32f79cf9277a7ca12ac3cea38f8963d5114bd9 Mon Sep 17 00:00:00 2001 From: Maciej Smyk Date: Tue, 6 Feb 2024 11:19:21 +0100 Subject: [PATCH 19/55] [DOCS] Adding PowerShell version of the setupvars and build_samples scripts for master (#22631) Added information on PowerShell version of the setupvars and build_samples script in docs. --------- Co-authored-by: Karol Blaszczak --- ...stalling-openvino-from-archive-windows.rst | 26 ++++++++++++--- .../openvino_samples/get_started_demos.rst | 32 ++++++++++++++++--- .../integrate_with_your_application.rst | 2 +- docs/dev/installing.md | 17 +++++++--- src/bindings/c/docs/api_overview.md | 7 ++-- src/frontends/onnx/docs/tests.md | 2 +- 6 files changed, 69 insertions(+), 17 deletions(-) diff --git a/docs/articles_en/get_started/installing-openvino-overview/installing-openvino-windows-header/installing-openvino-from-archive-windows.rst b/docs/articles_en/get_started/installing-openvino-overview/installing-openvino-windows-header/installing-openvino-from-archive-windows.rst index c92e716f888d58..92683e866d6448 100644 --- a/docs/articles_en/get_started/installing-openvino-overview/installing-openvino-windows-header/installing-openvino-from-archive-windows.rst +++ b/docs/articles_en/get_started/installing-openvino-overview/installing-openvino-windows-header/installing-openvino-from-archive-windows.rst @@ -148,16 +148,32 @@ throughout the OpenVINO documentation. Step 2: Configure the Environment +++++++++++++++++++++++++++++++++ -You must update several environment variables before you can compile and run OpenVINO™ applications. Open the Command Prompt, and run the ``setupvars.bat`` batch file to temporarily set your environment variables. If your ```` is not ``C:\Program Files (x86)\Intel\openvino_2023``, use the correct directory instead. +You must update several environment variables before you can compile and run OpenVINO™ applications. -.. code-block:: sh +.. tab-set:: + + .. tab-item:: PowerShell + :sync: powershell + + Open the PowerShell, and run the ``setupvars.ps1`` file to temporarily set your environment variables. + + .. code-block:: sh - "C:\Program Files (x86)\Intel\openvino_2023\setupvars.bat" + . /setupvars.ps1 + .. tab-item:: Command Prompt + :sync: cmd -.. important:: + Open the Command Prompt, and run the ``setupvars.bat`` batch file to temporarily set your environment variables. + If your ```` is not ``C:\Program Files (x86)\Intel\openvino_2023``, use the correct directory instead. + + .. code-block:: sh + + "C:\Program Files (x86)\Intel\openvino_2023\setupvars.bat" + + .. important:: - The above command must be re-run every time a new Command Prompt window is opened. + You need to run the command for each new Command Prompt window. .. note:: diff --git a/docs/articles_en/learn_openvino/openvino_samples/get_started_demos.rst b/docs/articles_en/learn_openvino/openvino_samples/get_started_demos.rst index 4d05da628df4fb..0725be596117d4 100644 --- a/docs/articles_en/learn_openvino/openvino_samples/get_started_demos.rst +++ b/docs/articles_en/learn_openvino/openvino_samples/get_started_demos.rst @@ -139,13 +139,29 @@ Instructions below show how to build sample applications with CMake. If you are If you want to use Microsoft Visual Studio 2019, you are required to install CMake 3.14 or higher. - To build the C or C++ sample applications on Windows, go to the ``\samples\c`` or ``\samples\cpp`` directory, respectively, and run the ``build_samples_msvc.bat`` batch file: + You can build the C or C++ sample applications on Windows with either PowerShell or Command Prompt. - .. code-block:: sh + .. tab-set:: + + .. tab-item:: PowerShell + :sync: powershell + + To build Samples with PowerShell, run the following command: + + .. code-block:: sh + + & /build_samples.ps1 + + .. tab-item:: Command Prompt + :sync: cmd + + To build Samples with CMD, go to the ``\samples\c`` or ``\samples\cpp`` directory, respectively, and run the ``build_samples_msvc.bat`` batch file: - build_samples_msvc.bat + .. code-block:: sh - By default, the script automatically detects the highest Microsoft Visual Studio version installed on the machine and uses it to create and build a solution for a sample code + build_samples_msvc.bat + + By default, the script automatically detects the highest Microsoft Visual Studio version installed on the system and uses it to create and build a solution for a sample code Once the build is completed, you can find sample binaries in the following folders: @@ -295,6 +311,14 @@ To run the code sample with an input image using the IR model: source /setupvars.sh +.. note:: + + OpenVINO environment variables can be set up by running the following command in PowerShell: + + .. code-block:: sh + + . /setupvars.ps1 + 2. Go to the code samples release directory created when you built the samples earlier: .. tab-set:: diff --git a/docs/articles_en/openvino_workflow/running_inference_with_openvino/integrate_with_your_application.rst b/docs/articles_en/openvino_workflow/running_inference_with_openvino/integrate_with_your_application.rst index 3d60fa22e0c512..7859f12d75d330 100644 --- a/docs/articles_en/openvino_workflow/running_inference_with_openvino/integrate_with_your_application.rst +++ b/docs/articles_en/openvino_workflow/running_inference_with_openvino/integrate_with_your_application.rst @@ -21,7 +21,7 @@ Integrate OpenVINO™ with Your Application Following these steps, you can implement a typical OpenVINO™ Runtime inference pipeline in your application. Before proceeding, make sure you have -:doc:`installed OpenVINO Runtime ` and set environment variables (run ``/setupvars.sh`` for Linux or ``setupvars.bat`` for Windows, otherwise, the ``OpenVINO_DIR`` variable won't be configured properly to pass ``find_package`` calls). +:doc:`installed OpenVINO Runtime ` and set environment variables (run ``/setupvars.sh`` for Linux, ``setupvars.ps1`` for Windows PowerShell, or ``setupvars.bat`` for Windows CMD), otherwise, the ``OpenVINO_DIR`` variable won't be configured properly to pass ``find_package`` calls). .. image:: _static/images/IMPLEMENT_PIPELINE_with_API_C.svg diff --git a/docs/dev/installing.md b/docs/dev/installing.md index b1be0f2345ca82..a85fc68d44fa5d 100644 --- a/docs/dev/installing.md +++ b/docs/dev/installing.md @@ -1,7 +1,7 @@ # Installing Once the project is built you can install OpenVINO™ Runtime into custom location: - + ``` cmake --install --prefix ``` @@ -93,12 +93,17 @@ cd /samples/cpp ./build_samples.sh ``` -Windows: +Windows Command Prompt: ```sh cd \samples\cpp build_samples_msvc.bat ``` +Windows PowerShell: +```sh +& /build_samples.ps1 +``` + 2. Install OpenVINO Development Tools > **NOTE**: To build OpenVINO Development Tools (Model Optimizer, Post-Training Optimization Tool, Model Downloader, and Open Model Zoo tools) wheel package locally you are required to use the CMake option: `-DENABLE_WHEEL=ON`. @@ -165,11 +170,16 @@ Linux and macOS: source /setupvars.sh ``` -Windows: +Windows Command Prompt: ```bat \setupvars.bat ``` +Windows PowerShell: +```bat +. /setupvars.ps1 +``` + The following commands run the Image Classification Code Sample using the [`dog.bmp`](https://storage.openvinotoolkit.org/data/test_data/images/224x224/dog.bmp) file as an input image, the model in IR format from the `ir` directory, and on different hardware devices: Linux and macOS: @@ -265,4 +275,3 @@ target_link_libraries(ov_c_app PRIVATE openvino::runtime::c) * [OpenVINO Developer Documentation](index.md) * [OpenVINO How to Build](build.md) - \ No newline at end of file diff --git a/src/bindings/c/docs/api_overview.md b/src/bindings/c/docs/api_overview.md index 88f04b455a79ee..e0bbc5108cf769 100644 --- a/src/bindings/c/docs/api_overview.md +++ b/src/bindings/c/docs/api_overview.md @@ -27,7 +27,10 @@ Supported Python* versions: To configure the environment for the OpenVINO C* API, run: - On Ubuntu 20.04/22.04: `source /setupvars.sh .` -- On Windows 10/11: `\setupvars.bat ` +- On Windows 10/11: + + * `. /setupvars.ps1` in PowerShell + * `\setupvars.bat ` in Command Prompt The script automatically detects latest installed C* version and configures required environment if the version is supported. @@ -78,7 +81,7 @@ typedef struct { typedef struct ov_dimension { int64_t min; - + int64_t max; } ov_dimension_t; diff --git a/src/frontends/onnx/docs/tests.md b/src/frontends/onnx/docs/tests.md index 6dc6068b2fc2b2..b1a8b7100e2883 100644 --- a/src/frontends/onnx/docs/tests.md +++ b/src/frontends/onnx/docs/tests.md @@ -25,7 +25,7 @@ For example: ## Pre-steps for all Python tests 1. Build OpenVINO with `-DENABLE_PYTHON=ON`, preferably in a `Python` virtual environment. To avoid problems with too many Python interpreters installed on the host, you can also set the `-DPython3_EXECUTABLE=` build option (requires cmake 3.16 and higher). > **NOTE**: If you want to run the tests from the installation directory (like in the CI), add the `-P cmake_install.cmake` and `-DCOMPONENT=tests` CMake build options, and install OpenVINO via `cmake --build . --target install` as additional steps. -2. Set up Python paths via `source /setupvars.sh` for Linux, or `sh \setupvars.bat` for Windows. +2. Set up Python paths via `source /setupvars.sh` for Linux, `. /setupvars.ps1` for Windows PowerShell, or `sh \setupvars.bat` for Windows Command Prompt. 3. Install Python dependencies: ``` pip install -r /src/bindings/python/requirements.txt From e86671bbedf736fd6237533a69f6e0a27c08d8ae Mon Sep 17 00:00:00 2001 From: Alina Kladieva Date: Tue, 6 Feb 2024 13:46:08 +0100 Subject: [PATCH 20/55] [GHA] Remove push trigger from workflows running in full scope in merge queue (#22634) To remove duplication while we don't need post-commit artifacts. Will need to notify people who are monitoring & reporting sporadic --- .github/workflows/android_arm64.yml | 2 +- .github/workflows/fedora.yml | 2 +- .github/workflows/linux_arm64.yml | 2 +- .github/workflows/webassembly.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android_arm64.yml b/.github/workflows/android_arm64.yml index 3b52ba7e72cc11..6e60051cd0c0ab 100644 --- a/.github/workflows/android_arm64.yml +++ b/.github/workflows/android_arm64.yml @@ -5,7 +5,7 @@ on: merge_group: push: branches: - - master + # - master - 'releases/**' concurrency: diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 0a8298e5a17497..04e7e36fd63b86 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -5,7 +5,7 @@ on: merge_group: push: branches: - - master + # - master - 'releases/**' concurrency: diff --git a/.github/workflows/linux_arm64.yml b/.github/workflows/linux_arm64.yml index 362c36a50504e3..7f6ec8a70f7590 100644 --- a/.github/workflows/linux_arm64.yml +++ b/.github/workflows/linux_arm64.yml @@ -5,7 +5,7 @@ on: merge_group: push: branches: - - master + # - master - 'releases/**' concurrency: diff --git a/.github/workflows/webassembly.yml b/.github/workflows/webassembly.yml index f7ba021b2472d8..250b9f549a6ec2 100644 --- a/.github/workflows/webassembly.yml +++ b/.github/workflows/webassembly.yml @@ -5,7 +5,7 @@ on: merge_group: push: branches: - - master + # - master - 'releases/**' concurrency: From 6c52c18d1b5c23d4179ac8ea1b4daea5352c7386 Mon Sep 17 00:00:00 2001 From: Maciej Smyk Date: Tue, 6 Feb 2024 14:06:58 +0100 Subject: [PATCH 21/55] [DOCS] Fix for xml comments + ScatterUpdate Inputs for master (#22623) * Fixed xml comments throughout the docs. * Fixed ScatterUpdate Inputs paragraph. --- .../activation/Swish_4.rst | 4 +- .../arithmetic/CumSum_3.rst | 32 +-- .../arithmetic/Sqrt_1.rst | 10 +- .../comparison/IsFinite_10.rst | 6 +- .../condition/Select_1.rst | 10 +- .../convolution/ConvolutionBackpropData_1.rst | 20 +- .../detection/PriorBoxClustered_1.rst | 8 +- .../detection/PriorBox_1.rst | 48 ++--- .../detection/PriorBox_8.rst | 36 ++-- .../detection/RegionYolo_1.rst | 10 +- .../generation/Eye_9.rst | 44 ++-- .../generation/Multinomial_13.rst | 34 +-- .../generation/RandomUniform_8.rst | 40 ++-- .../generation/Range_1.rst | 20 +- .../generation/Range_4.rst | 26 +-- .../image/I420toBGR_8.rst | 8 +- .../image/I420toRGB_8.rst | 8 +- .../image/Interpolate_1.rst | 4 +- .../image/Interpolate_11.rst | 8 +- .../image/Interpolate_4.rst | 198 +++++++++--------- .../image/NV12toBGR_8.rst | 6 +- .../image/NV12toRGB_8.rst | 6 +- .../movement/BatchToSpace_2.rst | 58 ++--- .../movement/Broadcast_1.rst | 20 +- .../movement/Broadcast_3.rst | 26 +-- .../movement/Concat_1.rst | 22 +- .../movement/DepthToSpace_1.rst | 16 +- .../movement/Gather_1.rst | 26 +-- .../movement/Gather_7.rst | 52 ++--- .../movement/Gather_8.rst | 54 ++--- .../movement/Pad_1.rst | 38 ++-- .../movement/Pad_12.rst | 58 ++--- .../movement/ReverseSequence_1.rst | 10 +- .../movement/Reverse_1.rst | 4 +- .../movement/Roll_7.rst | 6 +- .../movement/ScatterElementsUpdate_12.rst | 82 ++++---- .../movement/ScatterElementsUpdate_3.rst | 4 +- .../movement/ScatterUpdate_3.rst | 54 ++--- .../movement/Slice_8.rst | 148 ++++++------- .../movement/SpaceToBatch_2.rst | 30 +-- .../movement/Split_1.rst | 6 +- .../movement/StridedSlice_1.rst | 8 +- .../movement/Tile_1.rst | 14 +- .../movement/Transpose_1.rst | 6 +- .../movement/VariadicSplit_1.rst | 18 +- .../normalization/BatchNormInference_1.rst | 64 +++--- .../normalization/BatchNormInference_5.rst | 64 +++--- .../normalization/LRN_1.rst | 4 +- .../normalization/MVN_6.rst | 4 +- .../normalization/NormalizeL2_1.rst | 6 +- .../reduction/ReduceL1_4.rst | 12 +- .../reduction/ReduceL2_4.rst | 10 +- .../reduction/ReduceLogicalAnd_1.rst | 10 +- .../reduction/ReduceLogicalOr_1.rst | 10 +- .../reduction/ReduceMax_1.rst | 10 +- .../reduction/ReduceMean_1.rst | 10 +- .../reduction/ReduceMin_1.rst | 10 +- .../reduction/ReduceProd_1.rst | 10 +- .../reduction/ReduceSum_1.rst | 10 +- .../sequence/CTCGreedyDecoderSeqLen_6.rst | 6 +- .../sequence/CTCLoss_4.rst | 14 +- .../sequence/OneHot_1.rst | 24 +-- .../shape/Reshape_1.rst | 12 +- .../shape/ShapeOf_1.rst | 4 +- .../shape/ShapeOf_3.rst | 4 +- .../shape/Squeeze_1.rst | 6 +- .../shape/Unsqueeze_1.rst | 6 +- .../signals/DFT_7.rst | 50 ++--- .../signals/IDFT_7.rst | 32 +-- .../signals/IRDFT_9.rst | 30 +-- .../signals/RDFT_9.rst | 22 +- .../sort/MatrixNMS_8.rst | 6 +- .../sort/MulticlassNonMaxSuppression_8.rst | 6 +- .../sort/MulticlassNonMaxSuppression_9.rst | 8 +- .../sort/NMSRotated_13.rst | 4 +- .../sort/NonMaxSuppression_4.rst | 6 +- .../sort/NonMaxSuppression_5.rst | 8 +- .../sort/NonMaxSuppression_9.rst | 8 +- .../sparse/EmbeddingBagOffsetsSum_3.rst | 16 +- .../sparse/EmbeddingBagPackedSum_3.rst | 12 +- .../sparse/EmbeddingSegmentsSum_3.rst | 18 +- .../type/ConvertLike_1.rst | 12 +- .../type/Convert_1.rst | 10 +- 83 files changed, 952 insertions(+), 952 deletions(-) diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/activation/Swish_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/activation/Swish_4.rst index bcbf32234356ac..51c7537399c0bd 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/activation/Swish_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/activation/Swish_4.rst @@ -5,7 +5,7 @@ Swish .. meta:: - :description: Learn about Swish-4 - an element-wise, activation operation, which + :description: Learn about Swish-4 - an element-wise, activation operation, which can be performed on a single tensor in OpenVINO. **Versioned name**: *Swish-4* @@ -55,7 +55,7 @@ Example: Second input ``beta`` provided 256 56 - < !-- beta value: 2.0 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/CumSum_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/CumSum_3.rst index a6270e77ad8f49..5a1626d8db60c6 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/CumSum_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/CumSum_3.rst @@ -5,7 +5,7 @@ CumSum .. meta:: - :description: Learn about CumSum-3 - an element-wise, arithmetic operation, which + :description: Learn about CumSum-3 - an element-wise, arithmetic operation, which can be performed on a single tensor in OpenVINO. **Versioned name**: *CumSum-3* @@ -24,7 +24,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr * **Description**: If the attribute is set to ``true``, then exclusive sums are returned, the ``j-th`` element is not included in the ``j-th`` sum. Otherwise, the inclusive sum of the first ``j`` elements for the ``j-th`` element is calculated. * **Range of values**: - + * ``false`` - include the top element * ``true`` - do not include the top element * **Type**: ``boolean`` @@ -35,7 +35,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr * **Description**: If set to ``true`` will perform the sums in reverse direction. * **Range of values**: - + * ``false`` - do not perform sums in reverse direction * ``true`` - perform sums in reverse direction * **Type**: ``boolean`` @@ -63,16 +63,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr .. code-block:: xml :force: - + - < !-- input value is: [1., 2., 3., 4., 5.] --> + 5 - < !-- axis value is: 0 --> + - < !-- output value is: [1., 3., 6., 10., 15.] --> + 5 @@ -82,16 +82,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr .. code-block:: xml :force: - + - < !-- input value is: [1., 2., 3., 4., 5.] --> + 5 - < !-- axis value is: 0 --> + - < !-- output value is: [0., 1., 3., 6., 10.] --> + 5 @@ -101,16 +101,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr .. code-block:: xml :force: - + - < !-- input value is: [1., 2., 3., 4., 5.] --> + 5 - < !-- axis value is: 0 --> + - < !-- output value is: [15., 14., 12., 9., 5.] --> + 5 @@ -120,7 +120,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr .. code-block:: xml :force: - + < -- input value is: [1., 2., 3., 4., 5.] --> diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/Sqrt_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/Sqrt_1.rst index c90bacf4443d2a..b6d380638db5c2 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/Sqrt_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/arithmetic/Sqrt_1.rst @@ -5,7 +5,7 @@ Sqrt .. meta:: - :description: Learn about Sqrt-1 - an element-wise, arithmetic operation, which + :description: Learn about Sqrt-1 - an element-wise, arithmetic operation, which can be performed on a single tensor in OpenVINO. **Versioned name**: *Sqrt-1* @@ -48,12 +48,12 @@ Sqrt - 4 < !-- float input values: [4.0, 7.0, 9.0, 10.0] --> + 4 - 4 < !-- float output values: [2.0, 2.6457512, 3.0, 3.1622777] --> + 4 @@ -66,12 +66,12 @@ Sqrt - 4 < !-- int input values: [4, 7, 9, 10] --> + 4 - 4 < !-- int output values: [2, 3, 3, 3] --> + 4 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/comparison/IsFinite_10.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/comparison/IsFinite_10.rst index a72896382765e2..d38e91d1328d2c 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/comparison/IsFinite_10.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/comparison/IsFinite_10.rst @@ -5,7 +5,7 @@ IsFinite .. meta:: - :description: Learn about IsFinite-10 - an element-wise, comparison operation, which + :description: Learn about IsFinite-10 - an element-wise, comparison operation, which can be performed on a single tensor in OpenVINO. **Versioned name**: *IsFinite-10* @@ -64,12 +64,12 @@ IsFinite - 4 < !-- Input value is: [NaN, 2.1, 3.7, Inf] --> + 4  - 4 < !-- Output value is: [False, True, True, False] --> + 4  diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/condition/Select_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/condition/Select_1.rst index 272b29acfd7f47..2d093126a11c1d 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/condition/Select_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/condition/Select_1.rst @@ -5,7 +5,7 @@ Select .. meta:: - :description: Learn about Select-1 - an element-wise, condition operation, which + :description: Learn about Select-1 - an element-wise, condition operation, which can be performed on three given tensors in OpenVINO. **Versioned name**: *Select-1* @@ -58,21 +58,21 @@ Select - < !-- cond value is: [[false, false], [true, false], [true, true]] --> + 3 2 - < !-- then value is: [[-1, 0], [1, 2], [3, 4]] --> + 3 2 - < !-- else value is: [[11, 10], [9, 8], [7, 6]] --> + 3 2 - < !-- output value is: [[11, 10], [1, 8], [3, 4]] --> + 3 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/convolution/ConvolutionBackpropData_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/convolution/ConvolutionBackpropData_1.rst index cc0a265754a6af..b39df77e94b5de 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/convolution/ConvolutionBackpropData_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/convolution/ConvolutionBackpropData_1.rst @@ -5,7 +5,7 @@ ConvolutionBackpropData .. meta:: - :description: Learn about ConvolutionBackpropData-1 - a 1D, 2D or 3D convolution operation, which + :description: Learn about ConvolutionBackpropData-1 - a 1D, 2D or 3D convolution operation, which can be performed on input and kernel tensors in OpenVINO. **Versioned name**: *ConvolutionBackpropData-1* @@ -24,11 +24,11 @@ When output shape is specified as an input tensor ``output_shape`` then it speci .. code-block:: xml :force: - + if auto_pads != None: pads_begin[i] = 0 pads_end[i] = 0 - + Y_i = stride[i] * (X_i - 1) + ((K_i - 1) * dilations[i] + 1) - pads_begin[i] - pads_end[i] + output_padding[i] where ``K_i`` filter kernel dimension along spatial axis ``i``. @@ -37,7 +37,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a .. code-block:: xml :force: - + total_padding[i] = stride[i] * (X_i - 1) + ((K_i - 1) * dilations[i] + 1) - output_shape[i] + output_padding[i] if auto_pads != SAME_UPPER: pads_begin[i] = total_padding[i] // 2 @@ -81,7 +81,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a * *auto_pad* * **Description**: *auto_pad* has the same definition as *auto_pad* for a regular Convolution but applied in the backward way, for the output tensor. - + * *explicit*: use explicit padding values from ``pads_begin`` and ``pads_end``. * *same_upper* the input is padded to match the output size. In case of odd padding value an extra padding is added at the end. * *same_lower* the input is padded to match the output size. In case of odd padding value an extra padding is added at the beginning. @@ -105,7 +105,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a * **2**: Convolution kernel tensor of type *T1* and rank 3, 4 or 5. Layout is ``[C_INPUT, C_OUTPUT, Z, Y, X]`` (number of input channels, number of output channels, spatial axes Z, Y, X). Spatial size of the kernel is derived from the shape of this input and aren't specified by any attribute. **Required.** * **3**: ``output_shape`` is 1D tensor of type *T2* that specifies spatial shape of the output. If specified, *padding amount* is deduced from relation of input and output spatial shapes according to formulas in the description. If not specified, *output shape* is calculated based on the ``pads_begin`` and ``pads_end`` or completely according to ``auto_pad``. **Optional.** * **Note**: Type of the convolution (1D, 2D or 3D) is derived from the rank of the input tensors and not specified by any attribute: - + * 1D convolution (input tensors rank 3) means that there is only one spatial axis X, * 2D convolution (input tensors rank 4) means that there are two spatial axes Y, X, * 3D convolution (input tensors rank 5) means that there are three spatial axes Z, Y, X. @@ -125,7 +125,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a .. code-block:: xml :force: - + @@ -156,7 +156,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a .. code-block:: xml :force: - + @@ -187,7 +187,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a .. code-block:: xml :force: - + @@ -204,7 +204,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a 3 - 2 < !-- output_shape value is: [450, 450]--> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBoxClustered_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBoxClustered_1.rst index 9c44b148909d46..ef7ba693c1e8d0 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBoxClustered_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBoxClustered_1.rst @@ -5,7 +5,7 @@ PriorBoxClustered .. meta:: - :description: Learn about PriorBoxClustered-1 - an object detection operation, + :description: Learn about PriorBoxClustered-1 - an object detection operation, which can be performed on two 1D input tensors. **Versioned name**: *PriorBoxClustered-1* @@ -94,7 +94,7 @@ If *clip* is defined, the coordinates of prior boxes are recalculated with the f * *step (step_w, step_h)* - * **Description**: *step (step_w, step_h)* is a distance between box centers. For example, *step* equal 85 means that the distance between neighborhood prior boxes centers is 85. If both *step_h* and *step_w* are 0 then they are updated with value of *step*. If after that they are still 0 then they are calculated as input image width(height) divided with first input width(height). + * **Description**: *step (step_w, step_h)* is a distance between box centers. For example, *step* equal 85 means that the distance between neighborhood prior boxes centers is 85. If both *step_h* and *step_w* are 0 then they are updated with value of *step*. If after that they are still 0 then they are calculated as input image width(height) divided with first input width(height). * **Range of values**: floating-point positive number * **Type**: ``float`` * **Default value**: 0.0 @@ -139,10 +139,10 @@ If *clip* is defined, the coordinates of prior boxes are recalculated with the f - 2 < !-- [10, 19] --> + 2 - 2 < !-- [180, 320] --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_1.rst index 6c5bb401ee1039..05955f73889aee 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_1.rst @@ -6,7 +6,7 @@ PriorBox .. meta:: - :description: Learn about PriorBox-1 - an object detection operation, + :description: Learn about PriorBox-1 - an object detection operation, which can be performed on two required input tensors. **Versioned name**: *PriorBox-1* @@ -22,44 +22,44 @@ PriorBox 1. First calculates *center_x* and *center_y* of prior box: .. math:: - + W \equiv Width \quad Of \quad Image \\ H \equiv Height \quad Of \quad Image - - + + * If step equals 0: - + .. math:: - + center_x=(w+0.5) \\ center_y=(h+0.5) - + * else: - + .. math:: - + center_x=(w+offset)*step \\ center_y=(h+offset)*step \\ w \subset \left( 0, W \right ) \\ h \subset \left( 0, H \right ) 2. Then, for each :math:`s \subset \left( 0, min\_sizes \right )` calculates coordinates of prior boxes: .. math:: - + xmin = \frac{\frac{center_x - s}{2}}{W} - - - + + + .. math:: - + ymin = \frac{\frac{center_y - s}{2}}{H} - - - + + + .. math:: - + xmax = \frac{\frac{center_x + s}{2}}{W} - - - + + + .. math:: - + ymin = \frac{\frac{center_y + s}{2}}{H} 3. If *clip* attribute is set to true, each output value is clipped between :math:`\left< 0, 1 \right>`. @@ -186,10 +186,10 @@ PriorBox - 2 < !-- values: [24, 42] --> + 2 - 2 < !-- values: [384, 672] --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_8.rst index 4535ad02ca962c..e1b9e1e71ac084 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/PriorBox_8.rst @@ -5,7 +5,7 @@ PriorBox .. meta:: - :description: Learn about PriorBox-8 - an object detection operation, + :description: Learn about PriorBox-8 - an object detection operation, which can be performed on two required input tensors. **Versioned name**: *PriorBox-8* @@ -21,41 +21,41 @@ PriorBox 1. First, it calculates *center_x* and *center_y* of a prior box: .. math:: - + W \equiv Width \quad Of \quad Image \\ H \equiv Height \quad Of \quad Image * If step equals 0: .. math:: - + center_x=(w+0.5) \\ center_y=(h+0.5) * else: .. math:: - + center_x=(w+offset)*step \\ center_y=(h+offset)*step \\ w \subset \left( 0, W \right ) \\ h \subset \left( 0, H \right ) 2. Then, it calculates coordinates of prior boxes for each :math:`s \subset \left( 0, min\_sizes \right )` : .. math:: - + xmin = \frac{\frac{center_x - s}{2}}{W} - - - + + + .. math:: - + ymin = \frac{\frac{center_y - s}{2}}{H} - - + + .. math:: - + xmax = \frac{\frac{center_x + s}{2}}{W} - - + + .. math:: - + ymin = \frac{\frac{center_y + s}{2}}{H} 3. If *clip* attribute is set to true, each output value is clipped between :math:`\left< 0, 1 \right>`. @@ -82,7 +82,7 @@ PriorBox * **Description**: *flip* is a flag that denotes that each *aspect_ratio* is duplicated and flipped. For example, *flip* equals 1 and *aspect_ratio* equals ``[4.0,2.0]``, meaning that the aspect_ratio is equal to ``[4.0,2.0,0.25,0.5]``. * **Range of values**: - + * false or 0 - each *aspect_ratio* is flipped * true or 1 - each *aspect_ratio* is not flipped * **Type**: ``boolean`` @@ -193,10 +193,10 @@ PriorBox - 2 < !-- values: [24, 42] --> + 2 - 2 < !-- values: [384, 672] --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/RegionYolo_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/RegionYolo_1.rst index 0466aca91977d9..f1c235ab3ef8c1 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/RegionYolo_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/detection/RegionYolo_1.rst @@ -5,7 +5,7 @@ RegionYolo .. meta:: - :description: Learn about RegionYolo-1 - an object detection operation, + :description: Learn about RegionYolo-1 - an object detection operation, which can be performed on a 4D input tensor. **Versioned name**: *RegionYolo-1* @@ -65,7 +65,7 @@ RegionYolo * **Description**: *do_softmax* is a flag that specifies the inference method and affects how the number of regions is determined. It also affects output shape. If it is 0, then output shape is 4D, and 2D otherwise. * **Range of values**: - + * *false* - do not perform softmax * *true* - perform softmax * **Type**: ``boolean`` @@ -100,7 +100,7 @@ RegionYolo .. code-block:: xml :force: - < !-- YOLO V3 example --> + @@ -120,8 +120,8 @@ RegionYolo - - < !-- YOLO V2 Example --> + + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Eye_9.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Eye_9.rst index aabb8ab101c212..411c54364258f8 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Eye_9.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Eye_9.rst @@ -5,7 +5,7 @@ Eye .. meta:: - :description: Learn about Eye-9 - a generation operation, which can be + :description: Learn about Eye-9 - a generation operation, which can be performed on three required and one optional input tensors. **Versioned name**: *Eye-9* @@ -23,13 +23,13 @@ Example 1. *Eye* output with ``output_type`` = ``i32``: .. code-block:: xml :force: - + num_rows = 3 - + num_columns = 4 - + diagonal_index = 2 - + output = [[0 0 1 0] [0 0 0 1] [0 0 0 0]] @@ -38,13 +38,13 @@ Example 2. *Eye* output with ``output_type`` = ``i32``: .. code-block:: xml :force: - + num_rows = 3 - + num_columns = 4 - + diagonal_index = -1 - + output = [[0 0 0 0] [1 0 0 0] [0 1 0 0]] @@ -53,13 +53,13 @@ Example 3. *Eye* output with ``output_type`` = ``f16``: .. code-block:: xml :force: - + num_rows = 2 - + diagonal_index = 5 - + batch_shape = [1, 2] - + output = [[[[0. 0.] [0. 0.]] [[0. 0.] @@ -97,13 +97,13 @@ Example 3. *Eye* output with ``output_type`` = ``f16``: .. code-block:: xml :force: - + - < !-- num rows: 5 --> - < !-- num columns: 5 --> - < !-- diagonal index --> + + + @@ -117,14 +117,14 @@ Example 3. *Eye* output with ``output_type`` = ``f16``: .. code-block:: xml :force: - + - < !-- num rows --> - < !-- num columns --> - < !-- diagonal index --> - < !-- batch_shape : [2, 3] --> + + + + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Multinomial_13.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Multinomial_13.rst index 34f355612232f1..46d2d66213594f 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Multinomial_13.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Multinomial_13.rst @@ -91,10 +91,10 @@ Example 3 - 2D tensor, without replacement * **Description**: controls whether to sample with replacement (classes can be sampled multiple times). * **Range of values**: `true`, `false` - + * ``true`` - class indices can be sampled multiple times. * ``false`` - class indices will not repeat in the output and the size of ``probs``' ``class_size`` dimension is required to be larger or equal to *num_samples* value. Might affect performance. - + * **Type**: `bool` * **Required**: *Yes* @@ -149,16 +149,16 @@ Example 3 - 2D tensor, without replacement - < !-- probs value: [[0.1, 0.5, 0.4]] --> - 1 < !-- batch size of 2 --> + + 1 3 - < !-- num_samples value: 5 --> + - 1 < !--dimension depends on input batch size --> - 5 < !--dimension depends on num_samples --> + 1 + 5 @@ -171,16 +171,16 @@ Example 3 - 2D tensor, without replacement - < !-- probs value: [[-1, 1, 2], [50, 1, 21]] --> - 2 < !-- batch size of 2 --> + + 2 3 - < !-- num_samples value: 10 --> + - 2 < !--dimension depends on input batch size --> - 10 < !--dimension depends on num_samples --> + 2 + 10 @@ -193,16 +193,16 @@ Example 3 - 2D tensor, without replacement - < !-- probs value: [[0.1, 0.5, 0.4]] --> - 2 < !-- batch size of 2 --> + + 2 3 - < !-- num_samples value: 2 --> + - 2 < !-- batch size of 2 --> - 2 < !-- 2 unique samples of classes --> + 2 + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/RandomUniform_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/RandomUniform_8.rst index d7b63d49b83d54..526d13d594afdb 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/RandomUniform_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/RandomUniform_8.rst @@ -5,7 +5,7 @@ RandomUniform .. meta:: - :description: Learn about RandomUniform-8 - a generation operation, which can be + :description: Learn about RandomUniform-8 - a generation operation, which can be performed on three required input tensors. **Versioned name**: *RandomUniform-8* @@ -16,10 +16,10 @@ RandomUniform **Detailed description**: -*RandomUniform* operation generates random numbers from a uniform distribution in the range ``[minval, maxval)``. -The generation algorithm is based on underlying random integer generator that uses Philox algorithm. Philox algorithm -is a counter-based pseudo-random generator, which produces uint32 values. Single invocation of Philox algorithm returns -four result random values, depending on the given *key* and *counter* values. *Key* and *counter* are initialized +*RandomUniform* operation generates random numbers from a uniform distribution in the range ``[minval, maxval)``. +The generation algorithm is based on underlying random integer generator that uses Philox algorithm. Philox algorithm +is a counter-based pseudo-random generator, which produces uint32 values. Single invocation of Philox algorithm returns +four result random values, depending on the given *key* and *counter* values. *Key* and *counter* are initialized with *global_seed* and *op_seed* attributes respectively. If both seed values equal to zero, RandomUniform generates non-deterministic sequence. @@ -32,7 +32,7 @@ If both seed values equal to zero, RandomUniform generates non-deterministic seq Link to the original paper `Parallel Random Numbers: As Easy as 1, 2, 3 `__. -The result of Philox is calculated by applying a fixed number of *key* and *counter* updating so-called "rounds". +The result of Philox is calculated by applying a fixed number of *key* and *counter* updating so-called "rounds". This implementation uses 4x32_10 version of Philox algorithm, where number of rounds = 10. Suppose we have *n* which determines *n*-th 4 elements of random sequence. @@ -43,7 +43,7 @@ In each round *key*, *counter* and *n* are splitted to pairs of uint32 values: R = cast\_to\_uint32(value)\\ L = cast\_to\_uint32(value >> 32), -where *cast\_to\_uint32* - static cast to uint32, *value* - uint64 input value, *L*, *R* - uint32 +where *cast\_to\_uint32* - static cast to uint32, *value* - uint64 input value, *L*, *R* - uint32 result values, >> - bitwise right shift. Then *n* and *counter* are updated with the following formula: @@ -68,7 +68,7 @@ Values :math:`L'_{n}, R'_{n}, L'_{counter}, R'_{counter}` are resulting four ran Float values between [0..1) are obtained from 32-bit integers by the following rules. -Float16 is formatted as follows: *sign* (1 bit) *exponent* (5 bits) *mantissa* (10 bits). The value is interpreted +Float16 is formatted as follows: *sign* (1 bit) *exponent* (5 bits) *mantissa* (10 bits). The value is interpreted using following formula: .. math:: @@ -99,7 +99,7 @@ where x is uint32 generated random value. Float32 is formatted as follows: *sign* (1 bit) *exponent* (8 bits) *mantissa* (23 bits). The value is interpreted using following formula: .. math:: - + (-1)^{sign} * 1, mantissa * 2 ^{exponent - 127} @@ -117,7 +117,7 @@ So the resulting float value is: .. code-block:: xml :force: - + val = ((exponent << 23) | x & 0x7fffffu) - 1.0, where x is uint32 generated random value. @@ -125,7 +125,7 @@ where x is uint32 generated random value. Double is formatted as follows: *sign* (1 bit) *exponent* (11 bits) *mantissa* (52 bits). The value is interpreted using following formula: .. math:: - + (-1)^{sign} * 1, mantissa * 2 ^{exponent - 1023} @@ -133,7 +133,7 @@ so to obtain double values *sign*, *exponent* and *mantissa* are set as follows: .. code-block:: xml :force: - + sign = 0 exponent = 1023 - representation of a zero exponent. mantissa = 52 right bits from two concatinated uint32 values from random integer generator. @@ -143,7 +143,7 @@ So the resulting double is obtained as follows: .. code-block:: xml :force: - + mantissa_h = x0 & 0xfffffu; // upper 20 bits of mantissa mantissa_l = x1; // lower 32 bits of mantissa mantissa = (mantissa_h << 32) | mantissa_l; @@ -156,7 +156,7 @@ To obtain a value in a specified range each value is processed with the followin For float values: .. math:: - + result = x * (maxval - minval) + minval, where *x* is random float or double value between [0..1). @@ -174,7 +174,7 @@ Example 1. *RandomUniform* output with ``global_seed`` = 150, ``op_seed`` = 10, .. code-block:: xml :force: - + input_shape = [ 3, 3 ] output = [[0.7011236 0.30539632 0.93931055] [0.9456035 0.11694777 0.50770056] @@ -185,7 +185,7 @@ Example 2. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, .. code-block:: xml :force: - + input_shape = [ 2, 2 ] minval = 2 @@ -200,7 +200,7 @@ Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, .. code-block:: xml :force: - + input_shape = [ 2, 3 ] minval = 50 @@ -261,11 +261,11 @@ Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100, - < !-- shape value: [2, 3, 10] --> + 3 - < !-- min value --> - < !-- max value --> + + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_1.rst index fa0b5fe6bb1dee..689f8ae0e617e1 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_1.rst @@ -5,7 +5,7 @@ Range .. meta:: - :description: Learn about Range-1 - a generation operation, which can be + :description: Learn about Range-1 - a generation operation, which can be performed on three required input tensors. **Versioned name**: *Range-1* @@ -46,7 +46,7 @@ For a positive ``step``: for a negative ``step``: .. math:: - + start>=val[i]>stop, @@ -66,16 +66,16 @@ where - < !-- start value: 2 --> + - < !-- stop value: 23 --> + - < !-- step value: 3 --> + - 7 < !-- [ 2, 5, 8, 11, 14, 17, 20] --> + 7 @@ -88,16 +88,16 @@ where - < !-- start value: 23 --> + - < !-- stop value: 2 --> + - < !-- step value: -3 --> + - 7 < !-- [23, 20, 17, 14, 11, 8, 5] --> + 7 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_4.rst index 0a0418124d75f1..471eeef22482ab 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/generation/Range_4.rst @@ -5,7 +5,7 @@ Range .. meta:: - :description: Learn about Range-4 - a generation operation, which can be + :description: Learn about Range-4 - a generation operation, which can be performed on three required input tensors. **Versioned name**: *Range-4* @@ -81,16 +81,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf - < !-- start value: 2 --> + - < !-- stop value: 23 --> + - < !-- step value: 3 --> + - 7 < !-- [ 2, 5, 8, 11, 14, 17, 20] --> + 7 @@ -104,16 +104,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf - < !-- start value: 23 --> + - < !-- stop value: 2 --> + - < !-- step value: -3 --> + - 7 < !-- [23, 20, 17, 14, 11, 8, 5] --> + 7 @@ -127,16 +127,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf - < !-- start value: 1 --> + - < !-- stop value: 2.5 --> + - < !-- step value: 0.5 --> + - 3 < !-- [ 1.0, 1.5, 2.0] --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toBGR_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toBGR_8.rst index 8b5e46eeb6ca98..a3df192c305726 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toBGR_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toBGR_8.rst @@ -5,7 +5,7 @@ I420toBGR .. meta:: - :description: Learn about I420toBGR-8 - an image processing operation, which + :description: Learn about I420toBGR-8 - an image processing operation, which can be performed to convert image from I420 to BGR format. **Versioned name**: *I420toBGR-8* @@ -70,19 +70,19 @@ Same as specified for :doc:`I420toRGB ` ope -  < !-- Y plane --> +   1 480 640 1 -  < !-- U plane --> +   1 240 320 1 -  < !-- V plane --> +   1 240 320 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toRGB_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toRGB_8.rst index a0d4a3d0532e28..8d37f583503ec1 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toRGB_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/I420toRGB_8.rst @@ -5,7 +5,7 @@ I420toRGB .. meta:: - :description: Learn about I420toRGB-8 - an image processing operation, which + :description: Learn about I420toRGB-8 - an image processing operation, which can be performed to convert image from I420 to RGB format. **Versioned name**: *I420toRGB-8* @@ -113,19 +113,19 @@ Input I420 image tensor shall have ``NHWC (also known as NYXC)`` layout and can -  < !-- Y plane --> +   1 480 640 1 -  < !-- U plane --> +   1 240 320 1 -  < !-- V plane --> +   1 240 320 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_1.rst index 0bed435759eb60..470fa5b7099006 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_1.rst @@ -5,7 +5,7 @@ Interpolate .. meta:: - :description: Learn about I420toRGB-8 - an image processing operation, which + :description: Learn about I420toRGB-8 - an image processing operation, which can be performed on two required tensors. **Versioned name**: *Interpolate-1* @@ -91,7 +91,7 @@ This is a scalar that specifies padding for each spatial dimension. 80 - 2  < !--The values in this input are [50, 60] --> + 2   diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_11.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_11.rst index b497cd42d297f9..281607f2504e62 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_11.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_11.rst @@ -5,7 +5,7 @@ Interpolate .. meta:: - :description: Learn about Interpolate-11 - an image processing operation, which + :description: Learn about Interpolate-11 - an image processing operation, which can be performed on two required and one optional tensor. **Versioned name**: *Interpolate-11* @@ -129,13 +129,13 @@ Interpolate 80 - 2 < !--The values in this input are [24, 160] --> + 2  - 2 < !--The values in this input are [0.5, 2.0] --> + 2  - 2 < !--The values in this input are [2, 3] (axes). --> + 2  diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_4.rst index c81ccff8eac943..7572f7c1bc97ac 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/Interpolate_4.rst @@ -5,7 +5,7 @@ Interpolate .. meta:: - :description: Learn about Interpolate-4 - an image processing operation, which + :description: Learn about Interpolate-4 - an image processing operation, which can be performed on three required and one optional tensor. **Versioned name**: *Interpolate-4* @@ -128,7 +128,7 @@ Calculations are performed according to the following rules. import math import numpy as np from enum import Enum, unique - + class GetNearestPixel: def __init__(self, mode: str): self.func = { @@ -138,37 +138,37 @@ Calculations are performed according to the following rules. 'ceil': GetNearestPixel.ceil_func, 'simple': GetNearestPixel.simple_func }[mode] - + def __call__(self, x_original, is_downsample): return self.func(x_original, is_downsample) - + @staticmethod def prefer_floor_func(x_original, is_downsample): if x_original == int(x_original) + 0.5: return int(math.floor(x_original)) else: return int(round(x_original)) - + @staticmethod def prefer_ceil_func(x_original, is_downsample): return int(round(x_original)) - + @staticmethod def floor_func(x_original, is_downsample): return int(math.floor(x_original)) - + @staticmethod def ceil_func(x_original, is_downsample): return int(math.ceil(x_original)) - + @staticmethod def simple_func(x_original, is_downsample): if is_downsample: return int(math.ceil(x_original)) else: return int(x_original) - - + + class GetOriginalCoordinate: def __init__(self, mode: str): self.func = { @@ -178,31 +178,31 @@ Calculations are performed according to the following rules. 'tf_half_pixel_for_nn': GetOriginalCoordinate.tf_half_pixel_for_nn_func, 'align_corners': GetOriginalCoordinate.align_corners_func }[mode] - + def __call__(self, x_resized, x_scale, length_resized, length_original): return self.func(x_resized, x_scale, length_resized, length_original) - + @staticmethod def half_pixel_func(x_resized, x_scale, length_resized, length_original): return ((x_resized + 0.5) / x_scale) - 0.5 - + @staticmethod def pytorch_half_pixel_func(x_resized, x_scale, length_resized, length_original): return (x_resized + 0.5) / x_scale - 0.5 if length_resized > 1 else 0.0 - + @staticmethod def asymmetric_func(x_resized, x_scale, length_resized, length_original): return x_resized / x_scale - + @staticmethod def tf_half_pixel_for_nn_func(x_resized, x_scale, length_resized, length_original): return (x_resized + 0.5) / x_scale - + @staticmethod def align_corners_func(x_resized, x_scale, length_resized, length_original): return 0 if length_resized == 1 else x_resized * (length_original - 1) / (length_resized - 1) - - + + def get_cubic_coeff(s, a): abs_s = abs(s) coeff = np.zeros(4) @@ -211,18 +211,18 @@ Calculations are performed according to the following rules. coeff[2] = (((-a -2.0) * abs_s+ (2.0 * a + 3.0)) * abs_s - a) * abs_s coeff[3] = - a * abs_s * abs_s * (abs_s - 1.0) return coeff - - + + def triangle_coeffs(dz): return np.maximum(0.0, 1.0 - np.abs(dz)) - - + + @unique class ShapeCalculationMode(Enum): SIZES = 0 SCALES = 1 - - + + class InterpolateCalculation: def __init__(self, attrs: dict): self.mode = attrs['mode'] @@ -233,38 +233,38 @@ Calculations are performed according to the following rules. 'linear_onnx': self.onnx_linear_interpolation }[self.mode] self.attrs = attrs - + self.pads_begin = attrs.get('pads_begin', [0]) self.pads_end = attrs.get('pads_end', [0]) self.coordinate_transformation_mode = attrs.get('coordinate_transformation_mode', 'half_pixel') self.nearest_mode = attrs.get('nearest_mode', 'round_prefer_floor') self.cube_coeff = attrs.get('cube_coeff', -0.75) self.antialias = attrs.get('antialias', False) - + self.shape_calculation_mode = { 'sizes': ShapeCalculationMode.SIZES, 'scales': ShapeCalculationMode.SCALES }[attrs['shape_calculation_mode']] - + self.get_original_coordinate = self.get_coordinate_transformation_mode() self.get_nearest_pixel = GetNearestPixel(self.nearest_mode) - - + + def get_coordinate_transformation_mode(self): return GetOriginalCoordinate(self.coordinate_transformation_mode) - + def shape_infer(self, input_data, sizes, scales): result = input_data.shape + self.pads_begin + self.pads_end - + if self.shape_calculation_mode == ShapeCalculationMode.SIZES: for i, axis in enumerate(self.axes): result[axis] = sizes[i] else: for i, axis in enumerate(self.axes): result[axis] = math.floor(scales[i] * result[axis]) - + return result - + @staticmethod def correct_pad(pad, rank): pad_len = len(pad) @@ -274,17 +274,17 @@ Calculations are performed according to the following rules. return np.array(pad[: rank - 1]).astype(np.int64) else: return np.array(pad, dtype=np.int64) - + def __call__(self, input_data, sizes, scales, axes): rank = input_data.ndim self.pads_begin = InterpolateCalculation.correct_pad(self.pads_begin, rank) self.pads_end = InterpolateCalculation.correct_pad(self.pads_end, rank) self.pads = list(zip(self.pads_begin, self.pads_end)) self.axes = np.array(axes).astype(np.int64) - + self.output_shape = self.shape_infer(input_data, sizes, scales) padded_data = np.pad(input_data, self.pads, 'constant') - + if self.shape_calculation_mode == ShapeCalculationMode.SIZES: num_of_axes = len(self.axes) self.scales = np.zeros(num_of_axes) @@ -292,18 +292,18 @@ Calculations are performed according to the following rules. self.scales[i] = self.output_shape[axis] / padded_data.shape[axis] else: self.scales = scales - + if self.mode == 'nearest': self.all_scales = np.ones(rank).astype(np.float) for i, axis in enumerate(self.axes): self.all_scales[axis] = self.scales[i] - + self.input_shape = padded_data.shape return self.func(padded_data) - + def clip_coord(self, coord, axis): return max(0, min(coord, self.input_shape[axis] - 1)) - + def cubic_interpolation(self, input_data): rank = len(self.input_shape) result = np.zeros(self.output_shape) @@ -328,28 +328,28 @@ Calculations are performed according to the following rules. summa += coeffs_prod * input_data[tuple(coords_for_sum)] result[coordinates] = summa return result - + def linear_interpolation(self, input_data): result = np.zeros(self.output_shape) num_of_axes = len(self.axes) is_downsample = False - + for scale in self.scales: is_downsample = is_downsample or (scale < 1) - + antialias = is_downsample and self.antialias - + a = np.zeros(num_of_axes) for i, _ in enumerate(self.axes): a[i] = self.scales[i] if antialias else 1.0 - + prod_of_a = np.prod(a) r = np.zeros(num_of_axes).astype(np.int64) for i, _ in enumerate(self.axes): r[i] = 2 if self.scales[i] > 1.0 else int(math.ceil(2.0/a[i])) - + indices = [tuple(np.array(ind).astype(np.int64) - r) for ind in np.ndindex(tuple(2 * r + 1))] - + for coordinates in np.ndindex(tuple(self.output_shape)): icoords = np.array(coordinates).astype(np.float64) icoords_r = np.array(coordinates).astype(np.float64) @@ -357,51 +357,51 @@ Calculations are performed according to the following rules. in_coord = self.get_original_coordinate(coordinates[axis], self.scales[i], self.output_shape[axis], self.input_shape[axis]) icoords[axis] = in_coord icoords_r[axis] = round(in_coord) - + summa = 0.0 wsum = 0.0 - + for index in indices: inner_coords = np.array(coordinates) for i, axis in enumerate(self.axes): inner_coords[axis] = index[i] + icoords_r[axis] - + conditions = [inner_coords[axis] >= 0 and inner_coords[axis] < self.input_shape[axis] for axis in self.axes] if not all(conditions): continue - + dz = np.zeros(num_of_axes) for i, axis in enumerate(self.axes): dz[i] = icoords[axis] - inner_coords[axis] - + w = prod_of_a * np.prod(triangle_coeffs(a * dz)) wsum += w summa += w * input_data[tuple(inner_coords)] - + if wsum == 0: result[coordinates] = 0.0 else: result[coordinates] = summa / wsum - + return result - + def onnx_linear_interpolation5D(self, input_data): rank = len(self.input_shape) assert rank in [3, 5], "mode 'linear_onnx' supports only 3D or 5D tensors" assert set(self.axes) == {2, 3, 4} or set(self.axes) == {0, 1, 2}, \ "mode 'linear_onnx' supports only case when axes = {2, 3, 4} or axes = {0, 1, 2}" - + result = np.zeros(self.output_shape) - + if rank == 3: reshaped_data = np.reshape(input_data, (1, 1, self.input_shape[0], self.input_shape[1], self.input_shape[2])) result = np.reshape(result, (1, 1, self.output_shape[0], self.output_shape[1], self.output_shape[2])) else: reshaped_data = input_data - + input_shape = np.array(reshaped_data.shape).astype(np.int64) output_shape = np.array(result.shape).astype(np.int64) - + batch_size = input_shape[0]; num_channels = input_shape[1]; input_depth = input_shape[2]; @@ -410,31 +410,31 @@ Calculations are performed according to the following rules. output_depth = output_shape[2]; output_height = output_shape[3]; output_width = output_shape[4]; - + depth_scale = self.scales[0]; height_scale = self.scales[1]; width_scale = self.scales[2]; - + z_original = np.zeros(output_depth).astype(np.float) y_original = np.zeros(output_height).astype(np.float) x_original = np.zeros(output_width).astype(np.float) - + in_z1 = np.zeros(output_depth).astype(np.int64) in_z2 = np.zeros(output_depth).astype(np.int64) in_y1 = np.zeros(output_height).astype(np.int64) in_y2 = np.zeros(output_height).astype(np.int64) in_x1 = np.zeros(output_width).astype(np.int64) in_x2 = np.zeros(output_width).astype(np.int64) - + dz1 = np.zeros(output_depth).astype(np.float) dz2 = np.zeros(output_depth).astype(np.float) - + dy1 = np.zeros(output_height).astype(np.float) dy2 = np.zeros(output_height).astype(np.float) - + dx1 = np.zeros(output_width).astype(np.float) dx2 = np.zeros(output_width).astype(np.float) - + for z in range(0, output_depth): in_z = self.get_original_coordinate(z, depth_scale, output_depth, input_depth) z_original[z] = in_z @@ -443,11 +443,11 @@ Calculations are performed according to the following rules. in_z2[z] = min(in_z1[z] + 1, input_depth - 1) dz1[z] = abs(in_z - in_z1[z]) dz2[z] = abs(in_z - in_z2[z]) - + if in_z1[z] == in_z2[z]: dz1[z] = 0.5 dz2[z] = 0.5 - + for y in range(0, output_height): in_y = self.get_original_coordinate(y, height_scale, output_height, input_height) y_original[y] = in_y @@ -456,19 +456,19 @@ Calculations are performed according to the following rules. in_y2[y] = min(in_y1[y] + 1, input_height - 1) dy1[y] = abs(in_y - in_y1[y]) dy2[y] = abs(in_y - in_y2[y]) - + if in_y1[y] == in_y2[y]: dy1[y] = 0.5 dy2[y] = 0.5 - + for x in range(0, output_width): in_x = self.get_original_coordinate(x, width_scale, output_width, input_width); x_original[x] = in_x in_x = max(0.0, min(in_x, input_width - 1)); - + in_x1[x] = min(in_x, input_width - 1); in_x2[x] = min(in_x1[x] + 1, input_width - 1); - + dx1[x] = abs(in_x - in_x1[x]); dx2[x] = abs(in_x - in_x2[x]); if in_x1[x] == in_x2[x]: @@ -487,33 +487,33 @@ Calculations are performed according to the following rules. x212 = reshaped_data[n, c, in_z2[z], in_y1[y], in_x2[x]] x122 = reshaped_data[n, c, in_z2[z], in_y2[y], in_x1[x]] x222 = reshaped_data[n, c, in_z2[z], in_y2[y], in_x2[x]] - + temp = dx2[x] * dy2[y] * dz2[z] * x111 + dx1[x] * dy2[y] * dz2[z] * x211 temp += dx2[x] * dy1[y] * dz2[z] * x121 + dx1[x] * dy1[y] * dz2[z] * x221 temp += dx2[x] * dy2[y] * dz1[z] * x112 + dx1[x] * dy2[y] * dz1[z] * x212 temp += dx2[x] * dy1[y] * dz1[z] * x122 + dx1[x] * dy1[y] * dz1[z] * x222 - + result[n, c, z, y, x] = temp - + return np.reshape(result, self.output_shape) - + def onnx_linear_interpolation4D(self, input_data): rank = len(self.input_shape) assert rank in [2, 4], "mode 'linear_onnx' supports only 2D or 4D tensors" assert set(self.axes) == {2, 3} or set(self.axes) == {0, 1}, \ "mode 'linear_onnx' supports only case when axes = {2, 3} or axes = {0, 1}" - + result = np.zeros(self.output_shape) - + if rank == 2: reshaped_data = np.reshape(input_data, (1, 1, self.input_shape[0], self.input_shape[1])) result = np.reshape(result, (1, 1, self.output_shape[0], self.output_shape[1])) else: reshaped_data = input_data - + input_shape = np.array(reshaped_data.shape).astype(np.int64) output_shape = np.array(result.shape).astype(np.int64) - + output_height = output_shape[2] output_width = output_shape[3] input_height = input_shape[2] @@ -522,21 +522,21 @@ Calculations are performed according to the following rules. width_scale = self.scales[1] batch_size = input_shape[0] num_channels = input_shape[1] - + y_original = np.zeros(output_height).astype(np.float) x_original = np.zeros(output_width).astype(np.float) - + in_y1 = np.zeros(output_height).astype(np.int64) in_y2 = np.zeros(output_height).astype(np.int64) in_x1 = np.zeros(output_width).astype(np.int64) in_x2 = np.zeros(output_width).astype(np.int64) - + dy1 = np.zeros(output_height).astype(np.float) dy2 = np.zeros(output_height).astype(np.float) - + dx1 = np.zeros(output_width).astype(np.float) dx2 = np.zeros(output_width).astype(np.float) - + for y in range(0, output_height): in_y = self.get_original_coordinate(y, height_scale, output_height, input_height) y_original[y] = in_y @@ -545,25 +545,25 @@ Calculations are performed according to the following rules. in_y2[y] = min(in_y1[y] + 1, input_height - 1) dy1[y] = abs(in_y - in_y1[y]) dy2[y] = abs(in_y - in_y2[y]) - + if in_y1[y] == in_y2[y]: dy1[y] = 0.5 dy2[y] = 0.5 - + for x in range(0, output_width): in_x = self.get_original_coordinate(x, width_scale, output_width, input_width); x_original[x] = in_x in_x = max(0.0, min(in_x, input_width - 1)); - + in_x1[x] = min(in_x, input_width - 1); in_x2[x] = min(in_x1[x] + 1, input_width - 1); - + dx1[x] = abs(in_x - in_x1[x]); dx2[x] = abs(in_x - in_x2[x]); if in_x1[x] == in_x2[x]: dx1[x] = 0.5 dx2[x] = 0.5 - + for n in range(0, batch_size): for c in range(0, num_channels): for y in range(0, output_height): @@ -574,21 +574,21 @@ Calculations are performed according to the following rules. x22 = reshaped_data[n, c, in_y2[y], in_x2[x]] temp = dx2[x] * dy2[y] * x11 + dx1[x] * dy2[y] * x21 + dx2[x] * dy1[y] * x12 + dx1[x] * dy1[y] * x22 result[n, c, y, x] = temp - + return np.reshape(result, self.output_shape) - + def onnx_linear_interpolation(self, input_data): rank = len(self.input_shape) assert rank in [2, 3, 4, 5], "mode 'linear_onnx' supports only 2D, 3D, 4D, or 5D tensors" - + if rank in [2, 4]: self.onnx_linear_interpolation4D(input_data) else: self.onnx_linear_interpolation5D(input_data) - + def nearest_interpolation(self, input_data): result = np.zeros(self.output_shape) - + num_of_axes = len(self.axes) for coordinates in np.ndindex(tuple(self.output_shape)): input_coords = np.array(coordinates, dtype=np.int64) @@ -597,7 +597,7 @@ Calculations are performed according to the following rules. nearest_pixel = self.get_nearest_pixel(in_coord, scale < 1) input_coords[axis] = max(0, min(nearest_pixel, self.input_shape[axis] - 1)) result[coordinates] = input_data[tuple(input_coords)] - + return result @@ -617,13 +617,13 @@ Calculations are performed according to the following rules. 80 - 2  < !--The values in this input are [24, 160] --> + 2   - 2  < !--The values in this input are [0.5, 2.0] --> + 2   - 2  < !--The values in this input are [2, 3] (axes). --> + 2   diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toBGR_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toBGR_8.rst index 777d132f7a9e7e..5320ecd4fe4317 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toBGR_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toBGR_8.rst @@ -5,7 +5,7 @@ NV12toBGR .. meta:: - :description: Learn about NV12toBGR-8 - an image processing operation, which + :description: Learn about NV12toBGR-8 - an image processing operation, which can be performed to convert an image from NV12 to BGR format. **Versioned name**: *NV12toBGR-8* @@ -70,13 +70,13 @@ Same as specified for :doc:`NV12toRGB ` ope - < !-- Y plane --> + 1 480 640 1 - < !-- UV plane --> + 1 240 320 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toRGB_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toRGB_8.rst index 1044e6b18916c5..2012d9f3d0c642 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toRGB_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/image/NV12toRGB_8.rst @@ -5,7 +5,7 @@ NV12toRGB .. meta:: - :description: Learn about NV12toRGB-8 - an image processing operation, which + :description: Learn about NV12toRGB-8 - an image processing operation, which can be performed to convert an image from NV12 to RGB format. **Versioned name**: *NV12toRGB-8* @@ -102,13 +102,13 @@ Input NV12 image tensor shall have ``NHWC (also known as NYXC)`` layout and can - < !-- Y plane --> + 1 480 640 1 - < !-- UV plane --> + 1 240 320 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/BatchToSpace_2.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/BatchToSpace_2.rst index e7a52a05faf540..051cababe93065 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/BatchToSpace_2.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/BatchToSpace_2.rst @@ -5,7 +5,7 @@ BatchToSpace .. meta:: - :description: Learn about BatchToSpace-2 - a data movement operation, + :description: Learn about BatchToSpace-2 - a data movement operation, which can be performed on four required input tensors. **Versioned name**: *BatchToSpace-2* @@ -21,25 +21,25 @@ BatchToSpace 1. Reshape ``data`` input to produce a tensor of shape :math:`[B_1, \dots, B_{N - 1}, \frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, D_2, \dots, D_{N - 1}]` .. math:: - + x^{\prime} = reshape(data, [B_1, \dots, B_{N - 1}, \frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, D_2, \dots, D_{N - 1}]) 2. Permute dimensions of :math:`x^{\prime}` to produce a tensor of shape :math:`[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, B_1, D_2, B_2, \dots, D_{N-1}, B_{N - 1}]` .. math:: - + x^{\prime\prime} = transpose(x', [N, N + 1, 0, N + 2, 1, \dots, N + N - 1, N - 1]) 3. Reshape :math:`x^{\prime\prime}` to produce a tensor of shape :math:`[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1 \times B_1, D_2 \times B_2, \dots, D_{N - 1} \times B_{N - 1}]` .. math:: - + x^{\prime\prime\prime} = reshape(x^{\prime\prime}, [\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1 \times B_1, D_2 \times B_2, \dots, D_{N - 1} \times B_{N - 1}]) 4. Crop the start and end of spatial dimensions of :math:`x^{\prime\prime\prime}` according to ``crops_begin`` and ``crops_end`` inputs to produce the output :math:`y` of shape: .. math:: - + \left[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, crop(D_1 \times B_1, CB_1, CE_1), crop(D_2 \times B_2, CB_2, CE_2), \dots , crop(D_{N - 1} \times B_{N - 1}, CB_{N - 1}, CE_{N - 1})\right] Where @@ -80,27 +80,27 @@ Example: 2D input tensor ``data`` .. code-block:: xml :force: - + - < !-- data --> - 10 < !-- batch --> - 2 < !-- spatial dimension 1 --> + + 10 + 2 - < !-- block_shape value: [1, 5] --> + 2 - < !-- crops_begin value: [0, 2] --> + 2 - < !-- crops_end value: [0, 0] --> + 2 - 2 < !-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1]) --> - 8 < !-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]--> + 2 + 8 @@ -109,33 +109,33 @@ Example: 5D input tensor ``data`` .. code-block:: xml :force: - + - < !-- data --> - 48 < !-- batch --> - 3 < !-- spatial dimension 1 --> - 3 < !-- spatial dimension 2 --> - 1 < !-- spatial dimension 3 --> - 3 < !-- spatial dimension 4 --> + + 48 + 3 + 3 + 1 + 3 - < !-- block_shape value: [1, 2, 4, 3, 1] --> + 5 - < !-- crops_begin value: [0, 0, 1, 0, 0] --> + 5 - < !-- crops_end value: [0, 0, 1, 0, 0] --> + 5 - 2 < !-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1] * ... * block_shape.shape[4]) --> - 6 < !-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]--> - 10 < !-- data.shape[2] * block_shape.shape[2] - crops_begin[2] - crops_end[2] --> - 3 < !-- data.shape[3] * block_shape.shape[3] - crops_begin[3] - crops_end[3] --> - 3 < !-- data.shape[4] * block_shape.shape[4] - crops_begin[4] - crops_end[4] --> + 2 + 6 + 10 + 3 + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_1.rst index 37f7c4e3f101ff..583a182609403e 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_1.rst @@ -5,7 +5,7 @@ Broadcast .. meta:: - :description: Learn about Broadcast-1 - a data movement operation, + :description: Learn about Broadcast-1 - a data movement operation, which can be performed on two required and one optional input tensor. **Versioned name**: *Broadcast-1* @@ -53,7 +53,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape .. code-block:: xml :force: - + @@ -63,9 +63,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 1 - 4 < !--The tensor contains 4 elements: [1, 16, 50, 50] --> + 4 - < !-- the 3rd input shouldn't be provided with mode="numpy" --> + @@ -76,7 +76,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape - + @@ -84,10 +84,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 16 - 4 < !--The tensor contains 4 elements: [1, 16, 50, 50] --> + 4 - 1 < !--The tensor contains 1 elements: [1] --> + 1 @@ -99,7 +99,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape - + @@ -108,10 +108,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 50 - 4 < !--The tensor contains 4 elements: [1, 50, 50, 16] --> + 4 - 2 < !--The tensor contains 2 elements: [1, 2] --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_3.rst index e7b3f3a0d3d1fd..e13946f4780518 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Broadcast_3.rst @@ -5,7 +5,7 @@ Broadcast .. meta:: - :description: Learn about Broadcast-3 - a data movement operation, + :description: Learn about Broadcast-3 - a data movement operation, which can be performed on two required and one optional input tensor. **Versioned name**: *Broadcast-3* @@ -61,7 +61,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape .. code-block:: xml :force: - + @@ -71,9 +71,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 1 - 4 < !--The tensor contains 4 elements: [1, 16, 50, 50] --> + 4 - < !-- the 3rd input shouldn't be provided with mode="numpy" --> + @@ -84,7 +84,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape - + @@ -92,10 +92,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 16 - 4 < !--The tensor contains 4 elements: [1, 16, 50, 50] --> + 4 - 1 < !--The tensor contains 1 elements: [1] --> + 1 @@ -107,7 +107,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape - + @@ -116,10 +116,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 50 - 4 < !--The tensor contains 4 elements: [1, 50, 50, 16] --> + 4 - 2 < !--The tensor contains 2 elements: [1, 2] --> + 2 @@ -131,7 +131,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape - + @@ -141,9 +141,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape 1 - 4 < !--The tensor contains 4 elements: [1, 1, 50, 50] --> + 4 - < !-- the 3rd input shouldn't be provided with mode="bidirectional" --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Concat_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Concat_1.rst index 6c07321e08be99..7c3c11131f49e4 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Concat_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Concat_1.rst @@ -5,7 +5,7 @@ Concat .. meta:: - :description: Learn about Concat-1 - a data movement operation, + :description: Learn about Concat-1 - a data movement operation, which can be performed on arbitrary number of input tensors. **Versioned name**: *Concat-1* @@ -39,25 +39,25 @@ Concat .. code-block:: xml :force: - + 1 - 8 < !-- axis for concatenation --> + 8 50 50 1 - 16 < !-- axis for concatenation --> + 16 50 50 1 - 32 < !-- axis for concatenation --> + 32 50 50 @@ -65,7 +65,7 @@ Concat 1 - 56 < !-- concatenated axis: 8 + 16 + 32 = 48 --> + 56 50 50 @@ -75,25 +75,25 @@ Concat .. code-block:: xml :force: - + 1 - 8 < !-- axis for concatenation --> + 8 50 50 1 - 16 < !-- axis for concatenation --> + 16 50 50 1 - 32 < !-- axis for concatenation --> + 32 50 50 @@ -101,7 +101,7 @@ Concat 1 - 56 < !-- concatenated axis: 8 + 16 + 32 = 48 --> + 56 50 50 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/DepthToSpace_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/DepthToSpace_1.rst index de7af7a597b276..1df751ac0c5f68 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/DepthToSpace_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/DepthToSpace_1.rst @@ -5,7 +5,7 @@ DepthToSpace .. meta:: - :description: Learn about DepthToSpace-1 - a data movement operation, + :description: Learn about DepthToSpace-1 - a data movement operation, which can be performed on a single input tensor. **Versioned name**: *DepthToSpace-1* @@ -21,7 +21,7 @@ DepthToSpace The operation is equivalent to the following transformation of the input tensor ``data`` with ``K`` spatial dimensions of shape ``[N, C, D1, D2, ..., DK]`` to *Y* output tensor. If ``mode = blocks_first``: .. code-block:: cpp - + x' = reshape(data, [N, block_size, block_size, ..., block_size, C / (block_size ^ K), D1, D2, ..., DK]) x'' = transpose(x', [0, K + 1, K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K]) y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size]) @@ -29,7 +29,7 @@ The operation is equivalent to the following transformation of the input tensor If ``mode = depth_first``: .. code-block:: cpp - + x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK]) x'' = transpose(x', [0, 1, K + 2, 2, K + 3, 3, K + 4, 4, ..., K + (K + 1), K + 1]) y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size]) @@ -70,7 +70,7 @@ If ``mode = depth_first``: .. code-block:: xml :force: - + @@ -83,10 +83,10 @@ If ``mode = depth_first``: - 5 < !-- data.shape[0] --> - 7 < !-- data.shape[1] / (block_size ^ 2) --> - 4 < !-- data.shape[2] * block_size --> - 6 < !-- data.shape[3] * block_size --> + 5 + 7 + 4 + 6 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_1.rst index a2d18a3c4c65a1..35036ddf555950 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_1.rst @@ -5,14 +5,14 @@ Gather .. meta:: - :description: Learn about Gather-1 - a data movement operation, + :description: Learn about Gather-1 - a data movement operation, which can be performed on three required input tensors. **Versioned name:** *Gather-1* **Category:** *Data movement* -**Short description:** *Gather* operation takes slices of data in the first input tensor according +**Short description:** *Gather* operation takes slices of data in the first input tensor according to the indices specified in the second input tensor and axis from the third input. **Detailed description** @@ -30,13 +30,13 @@ Where ``axis`` is the value from the third input. * **1**: Tensor with arbitrary data. **Required.** * **2**: Tensor with indices to gather. The values for indices are in the range ``[0, input1[axis] - 1]``. **Required.** -* **3**: Scalar or 1D tensor *axis* is a dimension index to gather data from. For example, *axis* equal - to 1 means that gathering is performed over the first dimension. Negative value means reverse indexing. +* **3**: Scalar or 1D tensor *axis* is a dimension index to gather data from. For example, *axis* equal + to 1 means that gathering is performed over the first dimension. Negative value means reverse indexing. Allowed values are from ``[-len(input1.shape), len(input1.shape) - 1]``. **Required.** **Outputs** -* **1**: The resulting tensor that consists of elements from the first input tensor gathered by indices +* **1**: The resulting tensor that consists of elements from the first input tensor gathered by indices from the second input tensor. Shape of the tensor is ``[input1.shape[:axis], input2.shape, input1.shape[axis + 1:]]`` **Example** @@ -58,17 +58,17 @@ Where ``axis`` is the value from the third input. 20 28 - < !-- axis = 1 --> + - 6 < !-- embedded dimension from the 1st input --> - 15 < !-- embedded dimension from the 2nd input --> - 4 < !-- embedded dimension from the 2nd input --> - 20 < !-- embedded dimension from the 2nd input --> - 28 < !-- embedded dimension from the 2nd input --> - 10 < !-- embedded dimension from the 1st input --> - 24 < !-- embedded dimension from the 1st input --> + 6 + 15 + 4 + 20 + 28 + 10 + 24 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_7.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_7.rst index d2cee5ffd926c4..ebe248309a122d 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_7.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_7.rst @@ -5,7 +5,7 @@ Gather .. meta:: - :description: Learn about Gather-7 - a data movement operation, + :description: Learn about Gather-7 - a data movement operation, which can be performed on three required input tensors. **Versioned name**: *Gather-7* @@ -29,12 +29,12 @@ the number of batch dimensions. ``N`` and ``M`` are numbers of dimensions of ``d **Attributes**: * *batch_dims* - - * **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` - tensor and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` - dimension. It requires the first ``b`` dimensions in `data` and `indices` tensors to be equal. + + * **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` + tensor and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` + dimension. It requires the first ``b`` dimensions in `data` and `indices` tensors to be equal. If ``batch_dims`` is less than zero, the normalized value is used ``batch_dims = indices.rank + batch_dims``. - * **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and + * **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and ``batch_dims' <= axis'``. Where ``batch_dims'`` and ``axis'`` stand for normalized ``batch_dims`` and ``axis`` values. * **Type**: *T_AXIS* * **Default value**: 0 @@ -46,7 +46,7 @@ Example 1 with default *batch_dims* value: batch_dims = 0 axis = 0 - + indices = [0, 0, 4] data = [1, 2, 3, 4, 5] output = [1, 1, 5] @@ -58,15 +58,15 @@ Example 2 with non-default *batch_dims* value: batch_dims = 1 axis = 1 - + indices = [[0, 0, 4], <-- this is applied to the first batch [4, 0, 0]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[1, 2, 3, 4, 5], <-- the first batch [6, 7, 8, 9, 10]] <-- the second batch data_shape = (2, 5) - + output = [[ 1, 1, 5], [10, 6, 6]] output_shape = (2, 3) @@ -78,24 +78,24 @@ Example 3 with non-default *batch_dims* value: batch_dims = 2 axis = 2 - + indices = [[[0, 0, 4], <-- this is applied to the first batch, index = (0, 0) [4, 0, 0]], <-- this is applied to the second batch, index = (0, 1) - + [[1, 2, 4], <-- this is applied to the third batch, index = (1, 0) [4, 3, 2]]] <-- this is applied to the fourth batch, index = (1, 1) indices_shape = (2, 2, 3) - + data = [[[1, 2, 3, 4, 5], <-- the first batch, index = (0, 0) [6, 7, 8, 9, 10]], <-- the second batch, index = (0, 1) - + [[11, 12, 13, 14, 15], <-- the third batch, index = (1, 0) [16, 17, 18, 19, 20]]] <-- the fourth batch, index = (1, 1) data_shape = (2, 2, 5) - + output = [[[ 1, 1, 5], [10, 6, 6]], - + [[12, 13, 15], [20, 19, 18]]] output_shape = (2, 2, 3) @@ -106,28 +106,28 @@ Example 4 with *axis* > *batch_dims*: batch_dims = 1 axis = 2 - + indices = [[1, 2, 4], <-- this is applied to the first batch [4, 3, 2]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[[[ 1, 2, 3, 4], <-- first batch [ 5, 6, 7, 8], [ 9, 10, 11, 12], [13, 14, 15, 16], [17, 18, 19, 20]]], - + [[[21, 22, 23, 24], <-- second batch [25, 26, 27, 28], [29, 30, 31, 32], [33, 34, 35, 36], [37, 38, 39, 40]]]] data_shape = (2, 1, 5, 4) - + output = [[[[ 5, 6, 7, 8], [ 9, 10, 11, 12], [17, 18, 19, 20]]], - + [[[37, 38, 39, 40], [33, 34, 35, 36], [29, 30, 31, 32]]]] @@ -140,15 +140,15 @@ Example 5 with negative *batch_dims* value: batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1 axis = 1 - + indices = [[0, 0, 4], <-- this is applied to the first batch [4, 0, 0]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[1, 2, 3, 4, 5], <-- the first batch [6, 7, 8, 9, 10]] <-- the second batch data_shape = (2, 5) - + output = [[ 1, 1, 5], [10, 6, 6]] output_shape = (2, 3) @@ -167,7 +167,7 @@ Example 5 with negative *batch_dims* value: **Outputs** -* **1**: The resulting tensor of type *T* that consists of elements from ``data`` tensor gathered by ``indices``. +* **1**: The resulting tensor of type *T* that consists of elements from ``data`` tensor gathered by ``indices``. The shape of the output tensor is ``data.shape[:axis] + indices.shape[batch_dims:] + data.shape[axis + 1:]`` **Types** @@ -193,7 +193,7 @@ Example 5 with negative *batch_dims* value: 32 21 - < !-- axis = 1 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_8.rst index c4df65f49e1be8..b2bb5bf0235c60 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Gather_8.rst @@ -6,7 +6,7 @@ Gather .. meta:: - :description: Learn about Gather-8 - a data movement operation, + :description: Learn about Gather-8 - a data movement operation, which can be performed on three required input tensors. **Versioned name**: *Gather-8* @@ -33,10 +33,10 @@ range output data for corresponding index will be filled with zeros (Example 7). **Attributes**: * *batch_dims* - - * **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` tensor - and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` dimension. - It requires the first ``b`` dimensions in ``data`` and ``indices`` tensors to be equal. + + * **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` tensor + and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` dimension. + It requires the first ``b`` dimensions in ``data`` and ``indices`` tensors to be equal. If ``batch_dims`` is less than zero, normalized value is used ``batch_dims = indices.rank + batch_dims``. * **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and ``batch_dims' <= axis'``. Where ``batch_dims'`` and ``axis'`` stand for normalized ``batch_dims`` and ``axis`` values. @@ -50,7 +50,7 @@ Example 1 with default *batch_dims* value: batch_dims = 0 axis = 0 - + indices = [0, 0, 4] data = [1, 2, 3, 4, 5] output = [1, 1, 5] @@ -61,15 +61,15 @@ Example 2 with non-default *batch_dims* value: batch_dims = 1 axis = 1 - + indices = [[0, 0, 4], <-- this is applied to the first batch [4, 0, 0]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[1, 2, 3, 4, 5], <-- the first batch [6, 7, 8, 9, 10]] <-- the second batch data_shape = (2, 5) - + output = [[ 1, 1, 5], [10, 6, 6]] output_shape = (2, 3) @@ -81,24 +81,24 @@ Example 3 with non-default *batch_dims* value: batch_dims = 2 axis = 2 - + indices = [[[0, 0, 4], <-- this is applied to the first batch, index = (0, 0) [4, 0, 0]], <-- this is applied to the second batch, index = (0, 1) - + [[1, 2, 4], <-- this is applied to the third batch, index = (1, 0) [4, 3, 2]]] <-- this is applied to the fourth batch, index = (1, 1) indices_shape = (2, 2, 3) - + data = [[[1, 2, 3, 4, 5], <-- the first batch, index = (0, 0) [6, 7, 8, 9, 10]], <-- the second batch, index = (0, 1) - + [[11, 12, 13, 14, 15], <-- the third batch, index = (1, 0) [16, 17, 18, 19, 20]]] <-- the fourth batch, index = (1, 1) data_shape = (2, 2, 5) - + output = [[[ 1, 1, 5], [10, 6, 6]], - + [[12, 13, 15], [20, 19, 18]]] output_shape = (2, 2, 3) @@ -109,28 +109,28 @@ Example 4 with *axis* > *batch_dims*: batch_dims = 1 axis = 2 - + indices = [[1, 2, 4], <-- this is applied to the first batch [4, 3, 2]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[[[ 1, 2, 3, 4], <-- first batch [ 5, 6, 7, 8], [ 9, 10, 11, 12], [13, 14, 15, 16], [17, 18, 19, 20]]], - + [[[21, 22, 23, 24], <-- second batch [25, 26, 27, 28], [29, 30, 31, 32], [33, 34, 35, 36], [37, 38, 39, 40]]]] data_shape = (2, 1, 5, 4) - + output = [[[[ 5, 6, 7, 8], [ 9, 10, 11, 12], [17, 18, 19, 20]]], - + [[[37, 38, 39, 40], [33, 34, 35, 36], [29, 30, 31, 32]]]] @@ -143,15 +143,15 @@ Example 5 with negative *batch_dims* value: batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1 axis = 1 - + indices = [[0, 0, 4], <-- this is applied to the first batch [4, 0, 0]] <-- this is applied to the second batch indices_shape = (2, 3) - + data = [[1, 2, 3, 4, 5], <-- the first batch [6, 7, 8, 9, 10]] <-- the second batch data_shape = (2, 5) - + output = [[ 1, 1, 5], [10, 6, 6]] output_shape = (2, 3) @@ -163,7 +163,7 @@ Example 6 with negative indices: batch_dims = 0 axis = 0 - + indices = [0, -2, -1] data = [1, 2, 3, 4, 5] output = [1, 4, 5] @@ -175,8 +175,8 @@ Example 7 with indices out of the range: batch_dims = 0 axis = 0 - - indices = [3, 10, -20] + + indices = [3, 10, -20] data = [1, 2, 3, 4, 5] output = [4, 0, 0] @@ -221,7 +221,7 @@ of the output tensor is ``data.shape[:axis] + indices.shape[batch_dims:] + data. 32 21 - < !-- axis = 1 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_1.rst index 3c44d8b8188c76..41ef471065e158 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_1.rst @@ -5,7 +5,7 @@ Pad .. meta:: - :description: Learn about Pad-1 - a data movement operation, + :description: Learn about Pad-1 - a data movement operation, which can be performed on three required and one optional input tensor. **Versioned name**: *Pad-1* @@ -26,7 +26,7 @@ The following examples illustrate how output tensor is generated for the *Pad* l [ 9 10 11 12 ]] -with the following attributes: +with the following attributes: .. code-block:: cpp @@ -36,7 +36,7 @@ with the following attributes: depending on the *pad_mode*. -* ``pad_mode = "constant"``: +* ``pad_mode = "constant"``: .. code-block:: cpp @@ -48,7 +48,7 @@ depending on the *pad_mode*. [ 0 0 0 0 0 0 0 0 ]] -* ``pad_mode = "edge"``: +* ``pad_mode = "edge"``: .. code-block:: cpp @@ -121,7 +121,7 @@ depending on the *pad_mode*. **Example**: constant mode .. code-block:: xml - :force: + :force: @@ -133,22 +133,22 @@ depending on the *pad_mode*. 40 - 4 < !-- pads_begin = [0, 5, 2, 1] --> + 4 - 4 < !-- pads_end = [1, 0, 3, 7] --> + 4 - < !-- pad_value = 15.0 --> + - 2 < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] --> - 8 < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] --> - 37 < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] --> - 48 < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] --> - < !-- all new elements are filled with 15.0 value --> + 2 + 8 + 37 + 48 + @@ -169,18 +169,18 @@ depending on the *pad_mode*. 40 - 4 < !-- pads_begin = [0, 5, 2, 1] --> + 4 - 4 < !-- pads_end = [1, 0, 3, 7] --> + 4 - 2 < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] --> - 8 < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] --> - 37 < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] --> - 48 < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] --> + 2 + 8 + 37 + 48 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_12.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_12.rst index eea353f0934bbb..1c214393d6cc4e 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_12.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Pad_12.rst @@ -5,7 +5,7 @@ Pad .. meta:: - :description: Learn about Pad-12 - a data movement operation, + :description: Learn about Pad-12 - a data movement operation, which can be performed on three required and one optional input tensor. **Versioned name**: *Pad-12* @@ -19,7 +19,7 @@ Pad The following examples illustrate how output tensor is generated for the *Pad* layer for a given inputs: Positive pads example: -######################## +######################## .. code-block:: cpp @@ -82,7 +82,7 @@ depending on the *pad_mode* attribute: Negative pads example: -######################### +######################### .. code-block:: cpp @@ -111,7 +111,7 @@ for all of the *pad_mode* attribute options: Mixed pads example: -######################## +######################## .. code-block:: cpp @@ -178,7 +178,7 @@ Mixed pads example: * **Description**: *pad_mode* specifies the method used to generate the padding values. * **Range of values**: Name of the method in string format: - + * ``constant`` - padded values are taken from the *pad_value* input. If the input is not provided, the padding elements are equal to zero. * ``edge`` - padded values are copied from the respective edge of the input ``data`` tensor. * ``reflect`` - padded values are a reflection of the input `data` tensor. Values on the edges are not duplicated, ``pads_begin[D]`` and ``pads_end[D]`` must be not greater than ``data.shape[D] – 1`` for any valid ``D``. @@ -223,22 +223,22 @@ Mixed pads example: 40 - 4 < !-- pads_begin = [0, 5, 2, 1] --> + 4 - 4 < !-- pads_end = [1, 0, 3, 7] --> + 4 - < !-- pad_value = 15.0 --> + - 2 < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] --> - 8 < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] --> - 37 < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] --> - 48 < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] --> - < !-- all new elements are filled with 15.0 value --> + 2 + 8 + 37 + 48 + @@ -247,7 +247,7 @@ Mixed pads example: **Example**: constant mode (positive and negative pads) .. code-block:: xml - :force: + :force: @@ -259,22 +259,22 @@ Mixed pads example: 40 - 4 < !-- pads_begin = [0, -2, -8, 1] --> + 4 - 4 < !-- pads_end = [-1, 4, -6, 7] --> + 4 - < !-- pad_value = 15.0 --> + - 1 < !-- 2 = 0 + 2 + (-1) = pads_begin[0] + input.shape[0] + pads_end[0] --> - 5 < !-- 5 = (-2) + 3 + 4 = pads_begin[1] + input.shape[1] + pads_end[1] --> - 18 < !-- 18 = (-8) + 32 (-6) = pads_begin[2] + input.shape[2] + pads_end[2] --> - 48 < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] --> - < !-- all new elements are filled with 15.0 value --> + 1 + 5 + 18 + 48 + @@ -283,7 +283,7 @@ Mixed pads example: **Example**: edge mode .. code-block:: xml - :force: + :force: @@ -295,18 +295,18 @@ Mixed pads example: 40 - 4 < !-- pads_begin = [0, 5, 2, 1] --> + 4 - 4 < !-- pads_end = [1, 0, 3, 7] --> + 4 - 2 < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] --> - 8 < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] --> - 37 < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] --> - 48 < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] --> + 2 + 8 + 37 + 48 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ReverseSequence_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ReverseSequence_1.rst index 5b6e7909f67b10..9497c6a1a1fc94 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ReverseSequence_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ReverseSequence_1.rst @@ -5,7 +5,7 @@ ReverseSequence .. meta:: - :description: Learn about ReverseSequence-1 - a data movement operation, + :description: Learn about ReverseSequence-1 - a data movement operation, which can be performed on two required input tensors. **Versioned name**: *ReverseSequence-1* @@ -58,14 +58,14 @@ ReverseSequence - < !-- data --> - 4 < !-- batch_axis --> - 10 < !-- seq_axis --> + + 4 + 10 100 200 - 4 < !-- seq_lengths value: [2, 4, 8, 10] --> + 4 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Reverse_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Reverse_1.rst index e9325266d00294..fc22ffc74dd410 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Reverse_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Reverse_1.rst @@ -5,7 +5,7 @@ Reverse .. meta:: - :description: Learn about Reverse-1 - a data movement operation, + :description: Learn about Reverse-1 - a data movement operation, which can be performed on one required and one optional input tensor. **Versioned name**: *Reverse-1* @@ -62,7 +62,7 @@ If no axis specified, that means either the second input is empty if ``index`` m 200 - 1 < !-- reverting along single axis --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Roll_7.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Roll_7.rst index a8c9df7c993a74..20b086f93e225d 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Roll_7.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Roll_7.rst @@ -5,7 +5,7 @@ Roll .. meta:: - :description: Learn about Roll-7 - a data movement operation, which can be + :description: Learn about Roll-7 - a data movement operation, which can be performed on three required input tensors. **Versioned name**: *Roll-7* @@ -100,7 +100,7 @@ No attributes available. 2 - 2 < !-- shifting along specified axes with the corresponding shift values --> + 2 @@ -131,7 +131,7 @@ No attributes available. 1 - 2 < !-- shifting along specified axes with the same shift value --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_12.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_12.rst index d0e810326634f6..aa5b2809e71219 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_12.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_12.rst @@ -130,22 +130,22 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` - > < !-- data --> - 4 < !-- values: [2, 3, 4, 6] --> + > + 4 - < !-- indices (negative values allowed) --> - 6 < !-- values: [1, 0, 0, -2, -1, 2] --> + + 6 - > < !-- updates --> - 6 < !-- values: [10, 20, 30, 40, 70, 60] --> + > + 6 - < !-- values: [0] --> + 1 - 4 < !-- values: [52, 13, 104, 76] --> + 4 @@ -157,22 +157,22 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` - > < !-- data --> - 4 < !-- values: [2, 3, 4, 6] --> + > + 4 - < !-- indices --> - 6 < !-- values: [1, 0, 0, 2, 3, 2] --> + + 6 - > < !-- updates --> - 6 < !-- values: [10, 20, 30, 40, 70, 60] --> + > + 6 - < !-- values: [0] --> + 1 - 4 < !-- values: [50, 10, 100, 70] --> + 4 @@ -184,30 +184,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` - > < !-- data --> + > 3 - 4 < !-- values: [[0, 0, 0, 0], + 4 - < !-- indices --> + 2 - 2 < !-- values: [[1, 2], + 2 - > < !-- updates --> + > 2 - 2 < !-- values: [[11, 12], + 2 - < !-- values: [1] --> + 1 3 - 4 < !-- values: [[ 0, 11, 12, 0], + 4 @@ -221,30 +221,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` - > < !-- data --> + > 3 - 4 < !-- values: [[1, 1, 1, 1], + 4 - < !-- indices --> + 2 - 2 < !-- values: [[1, 1], + 2 - > < !-- updates --> + > 2 - 2 < !-- values: [[11, 12], + 2 - < !-- values: [1] --> + 1 3 - 4 < !-- values: [[ 1, 24, 1, 1], + 4 @@ -258,30 +258,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` - > < !-- data --> + > 3 - 4 < !-- values: [[2, 2, 2, 2], + 4 - < !-- indices --> + 2 - 2 < !-- values: [[1, 1], + 2 - > < !-- updates --> + > 2 - 2 < !-- values: [[11, 12], + 2 - < !-- values: [1] --> + 1 3 - 4 < !-- values: [[ 2, 264, 2, 2], + 4 @@ -313,7 +313,7 @@ Accordingly for 3D tensor case, the update of the element corresponding to the ` 7 6 - < !-- values: [0] --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_3.rst index fe927abc9b9e95..69eafbb10f7c26 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterElementsUpdate_3.rst @@ -5,7 +5,7 @@ ScatterElementsUpdate .. meta:: - :description: Learn about ScatterElementsUpdate-3 - a data movement operation, which can be + :description: Learn about ScatterElementsUpdate-3 - a data movement operation, which can be performed on four required input tensors. **Versioned name**: *ScatterElementsUpdate-3* @@ -81,7 +81,7 @@ The value can be in range ``[-r, r - 1]`` where ``r`` is the rank of ``data``. * 7 6 - < !-- value [0] --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterUpdate_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterUpdate_3.rst index f6fba7c4427115..86bbacc8b1a7cc 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterUpdate_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/ScatterUpdate_3.rst @@ -5,7 +5,7 @@ ScatterUpdate .. meta:: - :description: Learn about ScatterUpdate-3 - a data movement operation, which can be + :description: Learn about ScatterUpdate-3 - a data movement operation, which can be performed on four required input tensors. **Versioned name**: *ScatterUpdate-3* @@ -35,14 +35,14 @@ Several examples for case when `axis = 0`: * **1**: ``data`` tensor of arbitrary rank ``r`` and type *T_NUMERIC*. **Required.** -* **2**: ``indices`` tensor with indices of type *T_IND*. All index values are expected to be within bounds ``[0, s - 1]`` along the axis of size ``s``. If multiple indices point to the -same output location, the order of updating the values is undefined. If an index points to a non-existing output -tensor element or is negative, then an exception is raised. **Required.** +* **2**: ``indices`` tensor with indices of type *T_IND*. All index values are expected to be within bounds ``[0, s - 1]`` along the axis + of size ``s``. If multiple indices point to the same output location, the order of updating the values is undefined. + If an index points to a non-existing output tensor element or is negative, then an exception is raised. **Required.** * **3**: ``updates`` tensor of type *T_NUMERIC* and rank equal to ``rank(indices) + rank(data) - 1`` **Required.** * **4**: ``axis`` tensor with scalar or 1D tensor with one element of type *T_AXIS* specifying axis for scatter. -The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``data``. **Required.** + The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``data``. **Required.** **Outputs**: @@ -65,29 +65,29 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat - < !-- data --> + 1000 256 10 15 - < !-- indices --> + 125 20 - < !-- updates --> + 1000 125 20 10 15 - < !-- axis --> - 1 < !-- value [1] --> + + 1 - < !-- output --> + 1000 256 10 @@ -103,26 +103,26 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat - < !-- data --> - 3 < !-- {{-1.0f, 1.0f, -1.0f, 3.0f, 4.0f}, --> - 5 < !-- {-1.0f, 6.0f, -1.0f, 8.0f, 9.0f}, --> - < !-- {-1.0f, 11.0f, 1.0f, 13.0f, 14.0f}} --> - < !-- indices --> - 2 < !-- {0, 2} --> + + 3 + 5 + + + 2 - < !-- updates --> - 3 < !-- {1.0f, 1.0f} --> - 2 < !-- {1.0f, 1.0f} --> - < !-- {1.0f, 2.0f} --> - < !-- axis --> - 1 < !-- {1} --> + + 3 + 2 + + + 1 - < !-- output --> - 3 < !-- {{1.0f, 1.0f, 1.0f, 3.0f, 4.0f}, --> - 5 < !-- {1.0f, 6.0f, 1.0f, 8.0f, 9.0f}, --> - < !-- {1.0f, 11.0f, 2.0f, 13.0f, 14.0f}} --> + + 3 + 5 + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Slice_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Slice_8.rst index 22b0a7bfbd72af..207ddda0721436 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Slice_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Slice_8.rst @@ -5,7 +5,7 @@ Slice .. meta:: - :description: Learn about Slice-8 - a data movement operation, + :description: Learn about Slice-8 - a data movement operation, which can be performed on four required and one optional input tensor. **Versioned name**: *Slice-8* @@ -82,24 +82,24 @@ Example 1: basic slicing - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [1] --> + 1 - < !-- stop: [8] --> + 1 - < !-- step: [1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [1, 2, 3, 4, 5, 6, 7] --> + 7 @@ -113,21 +113,21 @@ Example 2: basic slicing, ``axes`` default - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [1] --> + 1 - < !-- stop: [8] --> + 1 - < !-- step: [1] --> + 1 - < !-- output: [1, 2, 3, 4, 5, 6, 7] --> + 7 @@ -141,24 +141,24 @@ Example 3: basic slicing, ``step: [2]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [1] --> + 1 - < !-- stop: [8] --> + 1 - < !-- step: [2] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [1, 3, 5, 7] --> + 4 @@ -171,24 +171,24 @@ Example 4: ``start`` and ``stop`` out of the dimension size, ``step: [1]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [-100] --> + 1 - < !-- stop: [100] --> + 1 - < !-- step: [1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 @@ -202,24 +202,24 @@ Example 5: slicing backward all elements, ``step: [-1]``, ``stop: [-11]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [9] --> + 1 - < !-- stop: [-11] --> + 1 - < !-- step: [-1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> + 10 @@ -233,29 +233,29 @@ Example 6: slicing backward, ``step: [-1]``, ``stop: [0]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [9] --> + 1 - < !-- stop: [0] --> + 1 - < !-- step: [-1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> + 9 - + Example 7: slicing backward, ``step: [-1]``, ``stop: [-10]`` @@ -264,24 +264,24 @@ Example 7: slicing backward, ``step: [-1]``, ``stop: [-10]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [9] --> + 1 - < !-- stop: [-10] --> + 1 - < !-- step: [-1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] --> + 9 @@ -295,24 +295,24 @@ Example 8: slicing backward, ``step: [-2]`` - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [9] --> + 1 - < !-- stop: [-11] --> + 1 - < !-- step: [-2] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [9, 7, 5, 3, 1] --> + 5 @@ -326,24 +326,24 @@ Example 9: ``start`` and ``stop`` out of the dimension size, slicing backward - < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] --> + 10 - < !-- start: [100] --> + 1 - < !-- stop: [-100] --> + 1 - < !-- step: [-1] --> + 1 - < !-- axes: [0] --> + 1 - < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] --> + 10 @@ -357,31 +357,31 @@ Example 10: slicing 2D tensor, all axes specified - < !-- data: data: [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] --> + 2 5 - < !-- start: [0, 1] --> + 2 - < !-- stop: [2, 4] --> + 2 - < !-- step: [1, 2] --> + 2 - < !-- axes: [0, 1] --> + 2 - < !-- output: [1, 3, 6, 8] --> + 2 2 - + Example 11: slicing 3D tensor, all axes specified @@ -390,26 +390,26 @@ Example 11: slicing 3D tensor, all axes specified - < !-- data --> + 20 10 5 - < !-- start: [0, 0, 0] --> + 2 - < !-- stop: [4, 10, 5] --> + 2 - < !-- step: [1, 1, 1] --> + 2 - < !-- axes: [0, 1, 2] --> + 2 - < !-- output --> + 4 10 5 @@ -424,26 +424,26 @@ Example 12: slicing 3D tensor, last axes default - < !-- data --> + 20 10 5 - < !-- start: [0, 0] --> + 2 - < !-- stop: [4, 10] --> + 2 - < !-- step: [1, 1] --> + 2 - < !-- axes: [0, 1] --> + 2 - < !-- output --> + 4 10 5 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/SpaceToBatch_2.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/SpaceToBatch_2.rst index 5b1f060e7bc7cb..6b7ddb69c2ef53 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/SpaceToBatch_2.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/SpaceToBatch_2.rst @@ -5,7 +5,7 @@ SpaceToBatch .. meta:: - :description: Learn about SpaceToBatch-2 - a data movement operation, + :description: Learn about SpaceToBatch-2 - a data movement operation, which can be performed on four required input tensors. **Versioned name**: *SpaceToBatch-2* @@ -79,30 +79,30 @@ No attributes available. - < !-- data --> - 2 < !-- batch --> - 6 < !-- spatial dimension 1 --> - 10 < !-- spatial dimension 2 --> - 3 < !-- spatial dimension 3 --> - 3 < !-- spatial dimension 4 --> + + 2 + 6 + 10 + 3 + 3 - < !-- block_shape value: [1, 2, 4, 3, 1] --> + 5 - < !-- pads_begin value: [0, 0, 1, 0, 0] --> + 5 - < !-- pads_end value: [0, 0, 1, 0, 0] --> + 5 - 48 < !-- data.shape[0] * block_shape.shape[0] * block_shape.shape[1] *... * block_shape.shape[4] --> - 3 < !-- (data.shape[1] + pads_begin[1] + pads_end[1]) / block_shape.shape[1] --> - 3 < !-- (data.shape[2] + pads_begin[2] + pads_end[2]) / block_shape.shape[2] --> - 1 < !-- (data.shape[3] + pads_begin[3] + pads_end[3]) / block_shape.shape[3] --> - 3 < !-- (data.shape[4] + pads_begin[4] + pads_end[4]) / block_shape.shape[4] --> + 48 + 3 + 3 + 1 + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Split_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Split_1.rst index bf955d0c8b6d58..0731920bd6db48 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Split_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Split_1.rst @@ -5,7 +5,7 @@ Split .. meta:: - :description: Learn about Split-1 - a data movement operation, + :description: Learn about Split-1 - a data movement operation, which can be performed on two required input tensors. **Versioned name**: *Split-1* @@ -58,13 +58,13 @@ Where D is the rank of input tensor ``data``. The axis being split must be evenl - < !-- some data --> + 6 12 10 24 - < !-- axis: 1 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/StridedSlice_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/StridedSlice_1.rst index b282848e4af0e1..a4025de9a9f924 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/StridedSlice_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/StridedSlice_1.rst @@ -5,7 +5,7 @@ StridedSlice .. meta:: - :description: Learn about StridedSlice-1 - a data movement operation, + :description: Learn about StridedSlice-1 - a data movement operation, which can be performed on three required and one optional input tensor. **Versioned name**: *StridedSlice-1* @@ -88,13 +88,13 @@ Example of ``begin_mask`` & ``end_mask`` usage. 4 - 2 < !-- begin: [1, 0, 0] --> + 2 - 2 < !-- end: [0, 0, 2] --> + 2 - 2 < !-- stride: [1, 1, 1] --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Tile_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Tile_1.rst index 6c734cc3bba114..f788e136c8fa62 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Tile_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Tile_1.rst @@ -5,7 +5,7 @@ Tile .. meta:: - :description: Learn about Tile-1 - a data movement operation, which can be + :description: Learn about Tile-1 - a data movement operation, which can be performed on two required input tensors. **Versioned name**: *Tile-1* @@ -39,10 +39,10 @@ No attributes available. *Tile* operation extends input tensor and filling in output tensor by the following rules: -.. math:: +.. math:: out_i=input_i[inner_dim*t] - + .. math:: t \in \left ( 0, \quad tiles \right ) @@ -62,7 +62,7 @@ No attributes available. 4 - 3 < !-- [1, 2, 3] --> + 3 @@ -81,13 +81,13 @@ No attributes available. - < !-- will be promoted to shape (1, 2, 3, 4) --> + 2 3 4 - 4 < !-- [5, 1, 2, 3] --> + 4 @@ -114,7 +114,7 @@ No attributes available. 4 - 3 < !-- [1, 2, 3] will be promoted to [1, 1, 2, 3] --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Transpose_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Transpose_1.rst index 28cd04c2767e18..54dbdb1d13d1f3 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Transpose_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/Transpose_1.rst @@ -5,7 +5,7 @@ Transpose .. meta:: - :description: Learn about Transpose-1 - a data movement operation, which can be + :description: Learn about Transpose-1 - a data movement operation, which can be performed on two required input tensors. **Versioned name**: *Transpose-1* @@ -53,7 +53,7 @@ Transpose 4 - 3 < !-- [2, 0, 1] --> + 3 @@ -79,7 +79,7 @@ Transpose 4 - 0 < !-- input_order is an empty 1D tensor --> + 0 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/VariadicSplit_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/VariadicSplit_1.rst index d87c037d44a9f0..19b64c2711d347 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/VariadicSplit_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/movement/VariadicSplit_1.rst @@ -5,7 +5,7 @@ VariadicSplit .. meta:: - :description: Learn about VariadicSplit-1 - a data movement operation, which can be + :description: Learn about VariadicSplit-1 - a data movement operation, which can be performed on three required input tensors. **Versioned name**: *VariadicSplit-1* @@ -20,7 +20,7 @@ VariadicSplit The i-th output tensor shape is equal to the input tensor `data` shape, except for dimension along `axis` which is ``split_lengths[i]``. .. math:: - + shape\_output\_tensor = [data.shape[0], data.shape[1], \dotsc , split\_lengths[i], \dotsc , data.shape[D-1]] Where D is the rank of input tensor `data`. The sum of elements in ``split_lengths`` must match ``data.shape[axis]``. @@ -49,16 +49,16 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt - < !-- some data --> + 6 12 10 24 - < !-- axis: 0 --> + - 3 < !-- split_lengths: [1, 2, 3] --> + 3 @@ -89,21 +89,21 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt - < !-- some data --> + 6 12 10 24 - < !-- axis: 0 --> + - 2 < !-- split_lengths: [-1, 2] --> + 2 - 4 < !-- 4 = 6 - 2 --> + 4 12 10 24 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_1.rst index e5233fb3d3eb7a..91b803f757d519 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_1.rst @@ -5,7 +5,7 @@ BatchNormInference .. meta:: - :description: Learn about BatchNormInference-5 - a normalization operation, which can be + :description: Learn about BatchNormInference-5 - a normalization operation, which can be performed on five required input tensors. **Versioned name**: *BatchNormInference-5* @@ -19,19 +19,19 @@ BatchNormInference *BatchNormInference* performs the following operations on a given data batch input tensor ``data``: * Normalizes each activation :math:`x^{(k)}` by the mean and variance. - + .. math:: - + \hat{x}^{(k)}=\frac{x^{(k)} - E[x^{(k)}]}{\sqrt{Var(x^{(k)}) + \epsilon}} where :math:`E[x^{(k)}]` and :math:`Var(x^{(k)})` are the mean and variance, calculated per channel axis of ``data`` input, and correspond to ``mean`` and ``variance`` inputs, respectively. Additionally, :math:`\epsilon` is a value added to the variance for numerical stability and corresponds to ``epsilon`` attribute. * Performs linear transformation of each normalized activation based on ``gamma`` and ``beta`` input, representing the scaling factor and shift, respectively. - + .. math:: - + \hat{y}^{(k)}=\gamma^{(k)}\hat{x}^{(k)} + \beta^{(k)} - + where :math:`\gamma^{(k)}` and :math:`\beta^{(k)}` are learnable parameters, calculated per channel axis, and correspond to ``gamma`` and ``beta`` inputs. **Mathematical Formulation** @@ -41,46 +41,46 @@ Let ``x`` be a *d*-dimensional input, :math:`x=(x_{1}\dotsc x_{d})`. Since norma For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m values. *BatchNormInference* performs Batch Normalization algorithm as follows: * **Input**: Values of :math:`x` over a mini-batch: - + .. math:: - + \mathcal{B} = {x_{1...m}} * **Parameters to learn**: :math:`\gamma, \beta` * **Output**: - + .. math:: - + {o_{i} = BN_{\gamma, \beta} ( b_{i} )} * **Mini-batch mean**: - + .. math:: - + \mu_{\mathcal{B}} \leftarrow \frac{1}{m}\sum_{i=1}^{m}b_{i} * **Mini-batch variance**: - + .. math:: - + \sigma_{\mathcal{B}}^{2}\leftarrow \frac{1}{m}\sum_{i=1}^{m} ( b_{i} - \mu_{\mathcal{B}})^{2} * **Normalize**: - + .. math:: - + \hat{b_{i}} \leftarrow \frac{b_{i} - \mu_{\mathcal{B}}}{\sqrt{\sigma_{\mathcal{B}}^{2} + \epsilon }} * **Scale and shift**: - + .. math:: - + o_{i} \leftarrow \gamma\hat{b_{i}} + \beta = BN_{\gamma ,\beta } ( b_{i} ) **Attributes**: * *epsilon* - + * **Description**: *epsilon* is a constant added to the variance for numerical stability. * **Range of values**: a floating-point number greater than or equal to zero * **Type**: ``float`` @@ -104,28 +104,28 @@ For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m valu **Examples** -Example: 2D input tensor ``data`` +Example: 2D input tensor ``data`` .. code-block:: xml :force: - + - < !-- input --> + 10 128 - < !-- gamma --> + 128 - < !-- beta --> + 128 - < !-- mean --> + 128 - < !-- variance --> + 128 @@ -141,26 +141,26 @@ Example: 4D input tensor ``data`` .. code-block:: xml :force: - + - < !-- input --> + 1 3 224 224 - < !-- gamma --> + 3 - < !-- beta --> + 3 - < !-- mean --> + 3 - < !-- variance --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_5.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_5.rst index 5c8bb387c4a116..d5a11a0db718c8 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_5.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/BatchNormInference_5.rst @@ -5,7 +5,7 @@ BatchNormInference .. meta:: - :description: Learn about BatchNormInference-5 - a normalization operation, which can be + :description: Learn about BatchNormInference-5 - a normalization operation, which can be performed on five required input tensors. **Versioned name**: *BatchNormInference-5* @@ -21,17 +21,17 @@ BatchNormInference * Normalizes each activation :math:`x^{(k)}` by the mean and variance. .. math:: - + \hat{x}^{(k)}=\frac{x^{(k)} - E[x^{(k)}]}{\sqrt{Var(x^{(k)}) + \epsilon}} - + where :math:`E[x^{(k)}]` and :math:`Var(x^{(k)})` are the mean and variance, calculated per channel axis of ``data`` input, and correspond to ``mean`` and ``variance`` inputs, respectively. Additionally, :math:`\epsilon` is a value added to the variance for numerical stability and corresponds to ``epsilon`` attribute. * Performs linear transformation of each normalized activation based on ``gamma`` and ``beta`` input, representing the scaling factor and shift, respectively. .. math:: - + \hat{y}^{(k)}=\gamma^{(k)}\hat{x}^{(k)} + \beta^{(k)} - + where :math:`\gamma^{(k)}` and :math:`\beta^{(k)}` are learnable parameters, calculated per channel axis, and correspond to ``gamma`` and ``beta`` inputs. **Mathematical Formulation** @@ -41,47 +41,47 @@ Let ``x`` be a *d*-dimensional input, :math:`x=(x_{1}\dotsc x_{d})`. Since norma For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m values. *BatchNormInference* performs Batch Normalization algorithm as follows: * **Input**: Values of :math:`x` over a mini-batch: - + .. math:: - + \mathcal{B} = {x_{1...m}} - + * **Parameters to learn**: :math:`\gamma, \beta` * **Output**: - + .. math:: - + {o_{i} = BN_{\gamma, \beta} ( b_{i} )} - + * **Mini-batch mean**: - + .. math:: - + \mu_{\mathcal{B}} \leftarrow \frac{1}{m}\sum_{i=1}^{m}b_{i} * **Mini-batch variance**: - + .. math:: - + \sigma_{\mathcal{B}}^{2}\leftarrow \frac{1}{m}\sum_{i=1}^{m} ( b_{i} - \mu_{\mathcal{B}})^{2} * **Normalize**: - + .. math:: - + \hat{b_{i}} \leftarrow \frac{b_{i} - \mu_{\mathcal{B}}}{\sqrt{\sigma_{\mathcal{B}}^{2} + \epsilon }} * **Scale and shift**: - + .. math:: - + o_{i} \leftarrow \gamma\hat{b_{i}} + \beta = BN_{\gamma ,\beta } ( b_{i} ) **Attributes**: * *epsilon* - + * **Description**: *epsilon* is a constant added to the variance for numerical stability. * **Range of values**: a floating-point number greater than or equal to zero * **Type**: ``float`` @@ -109,24 +109,24 @@ Example: 2D input tensor ``data`` .. code-block:: xml :force: - + - < !-- input --> + 10 128 - < !-- gamma --> + 128 - < !-- beta --> + 128 - < !-- mean --> + 128 - < !-- variance --> + 128 @@ -142,26 +142,26 @@ Example: 4D input tensor ``data`` .. code-block:: xml :force: - + - < !-- input --> + 1 3 224 224 - < !-- gamma --> + 3 - < !-- beta --> + 3 - < !-- mean --> + 3 - < !-- variance --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/LRN_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/LRN_1.rst index c1fb7927f3ddf5..2231e3bc7fa7ed 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/LRN_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/LRN_1.rst @@ -5,7 +5,7 @@ LRN .. meta:: - :description: Learn about LRN-1 - a normalization operation, which can be + :description: Learn about LRN-1 - a normalization operation, which can be performed on two required input tensors. **Versioned name**: *LRN-1* @@ -105,7 +105,7 @@ Example for 4D ``data`` input tensor and ``axes = [2, 3]``: 24 - 1 < !-- value is [1] that means independent normalization for each pixel along channels --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/MVN_6.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/MVN_6.rst index ba04fb3b8cec33..444762f7ef0b57 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/MVN_6.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/MVN_6.rst @@ -5,7 +5,7 @@ MVN .. meta:: - :description: Learn about MVN-6 - a normalization operation, which can be + :description: Learn about MVN-6 - a normalization operation, which can be performed on two required input tensors. **Versioned name**: *MVN-6* @@ -100,7 +100,7 @@ If *normalize_variance* is set to ``true``, the output blob is divided by varian 24 - 3 < !-- value of [0,2,3] means independent normalization per channels --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/NormalizeL2_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/NormalizeL2_1.rst index 8bd1da903fdcc9..61b3d439a2ef7f 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/NormalizeL2_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/normalization/NormalizeL2_1.rst @@ -5,7 +5,7 @@ NormalizeL2 .. meta:: - :description: Learn about MVN-1 - a normalization operation, which can be + :description: Learn about MVN-1 - a normalization operation, which can be performed on two required input tensors. **Versioned name**: *NormalizeL2-1* @@ -79,7 +79,7 @@ Example: Normalization over channel dimension for ``NCHW`` layout 24 - 1 < !-- axes list [1] means normalization over channel dimension --> + 1 @@ -108,7 +108,7 @@ Example: Normalization over channel and spatial dimensions for ``NCHW`` layout 24 - 3 < !-- axes list [1, 2, 3] means normalization over channel and spatial dimensions --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL1_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL1_4.rst index e2cd7c83c2feb3..6acdb9e5786943 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL1_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL1_4.rst @@ -5,7 +5,7 @@ ReduceL1 .. meta:: - :description: Learn about ReduceL1-4 - a reduction operation, which can be + :description: Learn about ReduceL1-4 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceL1-4* @@ -68,7 +68,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -96,7 +96,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -122,7 +122,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -149,7 +149,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 @@ -160,4 +160,4 @@ Particular cases: - + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL2_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL2_4.rst index 0556516d5bfbd3..aa908c97f6c0c4 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL2_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceL2_4.rst @@ -5,7 +5,7 @@ ReduceL2 .. meta:: - :description: Learn about ReduceL2-4 - a reduction operation, which can be + :description: Learn about ReduceL2-4 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceL2-4* @@ -68,7 +68,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -95,7 +95,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -120,7 +120,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -146,7 +146,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalAnd_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalAnd_1.rst index e92b9153a12d12..01dbfc47902f05 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalAnd_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalAnd_1.rst @@ -5,7 +5,7 @@ ReduceLogicalAnd .. meta:: - :description: Learn about ReduceLogicalAnd-1 - a reduction operation, which can be + :description: Learn about ReduceLogicalAnd-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceLogicalAnd-1* @@ -70,7 +70,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -97,7 +97,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -122,7 +122,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -148,7 +148,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalOr_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalOr_1.rst index 7cfdbc95eea5a0..e033e136f5b0e2 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalOr_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceLogicalOr_1.rst @@ -5,7 +5,7 @@ ReduceLogicalOr .. meta:: - :description: Learn about ReduceLogicalOr-1 - a reduction operation, which can be + :description: Learn about ReduceLogicalOr-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceLogicalOr-1* @@ -70,7 +70,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -97,7 +97,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -121,7 +121,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -147,7 +147,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMax_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMax_1.rst index 5037372de4cbce..4e22be42d2636d 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMax_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMax_1.rst @@ -5,7 +5,7 @@ ReduceMax .. meta:: - :description: Learn about ReduceMax-1 - a reduction operation, which can be + :description: Learn about ReduceMax-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceMax-1* @@ -72,7 +72,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -99,7 +99,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -124,7 +124,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -150,7 +150,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMean_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMean_1.rst index c3b71fa89c95e1..9aef4e981cf46f 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMean_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMean_1.rst @@ -5,7 +5,7 @@ ReduceMean .. meta:: - :description: Learn about ReduceMean-1 - a reduction operation, which can be + :description: Learn about ReduceMean-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceMean-1* @@ -70,7 +70,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -97,7 +97,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -122,7 +122,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -147,7 +147,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMin_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMin_1.rst index 4986ddc474606f..f20a0cfda064d4 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMin_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceMin_1.rst @@ -5,7 +5,7 @@ ReduceMin .. meta:: - :description: Learn about ReduceMin-1 - a reduction operation, which can be + :description: Learn about ReduceMin-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceMin-1* @@ -72,7 +72,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -99,7 +99,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -124,7 +124,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -150,7 +150,7 @@ Reducing empty tensor results in an undefined behavior. 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceProd_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceProd_1.rst index 0c75cb833c6a43..04af9115fb93c5 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceProd_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceProd_1.rst @@ -5,7 +5,7 @@ ReduceProd .. meta:: - :description: Learn about ReduceProd-1 - a reduction operation, which can be + :description: Learn about ReduceProd-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceProd-1* @@ -70,7 +70,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -97,7 +97,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -122,7 +122,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -148,7 +148,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceSum_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceSum_1.rst index d2a4858eae201e..b42536dc0baba7 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceSum_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/reduction/ReduceSum_1.rst @@ -5,7 +5,7 @@ ReduceSum .. meta:: - :description: Learn about ReduceSum-1 - a reduction operation, which can be + :description: Learn about ReduceSum-1 - a reduction operation, which can be performed on two required input tensors. **Versioned name**: *ReduceSum-1* @@ -70,7 +70,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -97,7 +97,7 @@ Particular cases: 24 - 2 < !-- value is [2, 3] that means independent reduction in each channel and batch --> + 2 @@ -122,7 +122,7 @@ Particular cases: 24 - 1 < !-- value is [1] that means independent reduction in each channel and spatial dimensions --> + 1 @@ -148,7 +148,7 @@ Particular cases: 24 - 1 < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCGreedyDecoderSeqLen_6.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCGreedyDecoderSeqLen_6.rst index e64cd14263bebe..6ff19be0776a80 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCGreedyDecoderSeqLen_6.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCGreedyDecoderSeqLen_6.rst @@ -5,7 +5,7 @@ CTCGreedyDecoderSeqLen .. meta:: - :description: Learn about CTCGreedyDecoderSeqLen-6 - a sequence processing + :description: Learn about CTCGreedyDecoderSeqLen-6 - a sequence processing operation, which can be performed on two required input tensors. **Versioned name**: *CTCGreedyDecoderSeqLen-6* @@ -77,7 +77,7 @@ The main difference between :doc:`CTCGreedyDecoder @@ -89,7 +89,7 @@ The main difference between :doc:`CTCGreedyDecoder 8 - < !-- blank_index = 120 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCLoss_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCLoss_4.rst index 8f43fc62309fda..49191ec889b5fe 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCLoss_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/CTCLoss_4.rst @@ -5,7 +5,7 @@ CTCLoss .. meta:: - :description: Learn about CTCLoss-4 - a sequence processing operation, which + :description: Learn about CTCLoss-4 - a sequence processing operation, which can be performed on four required and one optional input tensor. **Versioned name**: *CTCLoss-4* @@ -29,19 +29,19 @@ Otherwise, the operation behaviour is undefined. 1. Compute probability of ``j``-th character at time step ``t`` for ``i``-th input sequence from ``logits`` using softmax formula: .. math:: - + p_{i,t,j} = \frac{\exp(logits[i,t,j])}{\sum^{K}_{k=0}{\exp(logits[i,t,k])}} 2. For a given ``i``-th target from ``labels[i,:]`` find all aligned paths. A path ``S = (c1,c2,...,cT)`` is aligned with a target ``G=(g1,g2,...,gT)`` if both chains are equal after decoding. The decoding extracts substring of length ``label_length[i]`` from a target ``G``, merges repeated characters in ``G`` in case *preprocess_collapse_repeated* equal to true and finds unique elements in the order of character occurrence in case *unique* equal to true. The decoding merges repeated characters in ``S`` in case *ctc_merge_repeated* equal to true and removes blank characters represented by ``blank_index``. By default, ``blank_index`` is equal to ``C-1``, where ``C`` is a number of classes including the blank. For example, in case default *ctc_merge_repeated*, *preprocess_collapse_repeated*, *unique* and ``blank_index`` a target sequence ``G=(0,3,2,2,2,2,2,4,3)`` of a length ``label_length[i]=4`` is processed to ``(0,3,2,2)`` and a path ``S=(0,0,4,3,2,2,4,2,4)`` of a length ``logit_length[i]=9`` is also processed to ``(0,3,2,2)``, where ``C=5``. There exist other paths that are also aligned with ``G``, for instance, ``0,4,3,3,2,4,2,2,2``. Paths checked for alignment with a target ``label[:,i]`` must be of length ``logit_length[i] = L_i``. Compute probabilities of these aligned paths (alignments) as follows: .. math:: - + p(S) = \prod_{t=1}^{L_i} p_{i,t,ct} 3. Finally, compute negative log of summed up probabilities of all found alignments: .. math:: - + CTCLoss = - \ln \sum_{S} p(S) **Note 1**: This calculation scheme does not provide steps for optimal implementation and primarily serves for better explanation. @@ -50,7 +50,7 @@ Otherwise, the operation behaviour is undefined. Having log-probabilities for aligned paths, log of summed up probabilities for these paths can be computed as follows: .. math:: - + \ln(a + b) = \ln(a) + \ln(1 + \exp(\ln(b) - \ln(a))) **Attributes** @@ -100,7 +100,7 @@ Having log-probabilities for aligned paths, log of summed up probabilities for t .. code-block:: xml :force: - + @@ -118,7 +118,7 @@ Having log-probabilities for aligned paths, log of summed up probabilities for t 8 - < !-- blank_index value is: 120 --> + diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/OneHot_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/OneHot_1.rst index 77631b7d1fa3f5..8e085896d9b05f 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/OneHot_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sequence/OneHot_1.rst @@ -5,7 +5,7 @@ OneHot .. meta:: - :description: Learn about OneHot-1 - a sequence processing operation, which + :description: Learn about OneHot-1 - a sequence processing operation, which can be performed on four required input tensors. **Versioned name**: *OneHot-1* @@ -64,18 +64,18 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq - < !-- indices value: [0, 3, 1, 2] --> + 4 - < !-- depth value: 3 --> + - < !-- on_value 1 --> + - < !-- off_value 2 --> + - < !-- output value # [[1, 2, 2], [2, 2, 2], [2, 1, 2], [2, 2, 1]] --> + 4 3 @@ -90,20 +90,20 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq - < !-- indices value: [[0, 3, 1], [1, 2, 4]] --> + 2 3 - < !-- depth value: 3 --> + - < !-- on_value 1 --> + - < !-- off_value 0 --> + - < !-- output value: [[[1, 0, 0], [0, 0, 1], [0, 0, 0]], --> - 2 < !-- [[0, 0, 0], [1, 0, 0], [0, 1, 0]]] --> + + 2 3 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Reshape_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Reshape_1.rst index 6700be5536c1d6..064fcb92a9b95e 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Reshape_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Reshape_1.rst @@ -5,7 +5,7 @@ Reshape .. meta:: - :description: Learn about Reshape-1 - a shape manipulation operation, which + :description: Learn about Reshape-1 - a shape manipulation operation, which can be performed on two required input tensors. **Versioned name**: *Reshape-1* @@ -65,7 +65,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the 0 - 2 < !--The tensor contains 2 elements: 0, 4 --> + 2 @@ -92,7 +92,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the 24 - 3 < !--The tensor contains 3 elements: 0, -1, 4 --> + 3 @@ -119,7 +119,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the 3 - 4 < !--The tensor contains 4 elements: 0, 0, 1, -1 --> + 4 @@ -147,7 +147,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the 1 - 2 < !--The tensor contains 2 elements: -1, 0 --> + 2 @@ -173,7 +173,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the 1 - 2 < !--The tensor contains 2 elements: 0, -1 --> + 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_1.rst index 3b98d8362d181f..176e79a927c0bd 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_1.rst @@ -5,7 +5,7 @@ ShapeOf .. meta:: - :description: Learn about ShapeOf-1 - a shape manipulation operation, which + :description: Learn about ShapeOf-1 - a shape manipulation operation, which can be performed on an arbitrary input tensor. **Versioned name**: *ShapeOf-1* @@ -39,7 +39,7 @@ ShapeOf - < !-- output value is: [2,3,224,224]--> + 4 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_3.rst index 7e68b4447beeaf..bb64e7517f60de 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/ShapeOf_3.rst @@ -5,7 +5,7 @@ ShapeOf .. meta:: - :description: Learn about ShapeOf-3 - a shape manipulation operation, which + :description: Learn about ShapeOf-3 - a shape manipulation operation, which can be performed on an arbitrary input tensor. **Versioned name**: *ShapeOf-3* @@ -54,7 +54,7 @@ ShapeOf - < !-- output value is: [2,3,224,224]--> + 4 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Squeeze_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Squeeze_1.rst index e8933f2aceb603..9d426f88e5ff83 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Squeeze_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Squeeze_1.rst @@ -5,7 +5,7 @@ Squeeze .. meta:: - :description: Learn about Squeeze-1 - a shape manipulation operation, which + :description: Learn about Squeeze-1 - a shape manipulation operation, which can be performed on one required and one optional input tensor. **Versioned name**: *Squeeze-1* @@ -55,7 +55,7 @@ Squeeze - 2 < !-- value [0, 2] --> + 2 @@ -79,7 +79,7 @@ Squeeze - 1 < !-- value is [0] --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Unsqueeze_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Unsqueeze_1.rst index 62a908b5296dac..5bab816f35f0bc 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Unsqueeze_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/shape/Unsqueeze_1.rst @@ -5,7 +5,7 @@ Unsqueeze .. meta:: - :description: Learn about Unsqueeze-1 - a shape manipulation operation, which + :description: Learn about Unsqueeze-1 - a shape manipulation operation, which can be performed on two required input tensors. **Versioned name**: *Unsqueeze-1* @@ -48,7 +48,7 @@ Unsqueeze - 2 < !-- value is [0, 3] --> + 2 @@ -74,7 +74,7 @@ Unsqueeze - 1 < !-- value is [0] --> + 1 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/DFT_7.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/DFT_7.rst index 90a42a0ac1fdbb..b32b1eb4c23729 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/DFT_7.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/DFT_7.rst @@ -5,7 +5,7 @@ DFT .. meta:: - :description: Learn about DFT-7 - a signal processing operation, which can be + :description: Learn about DFT-7 - a signal processing operation, which can be performed on two required and one optional input tensor. **Versioned name**: *DFT-7* @@ -23,14 +23,14 @@ No attributes available. * **1**: ``data`` - Input tensor of type *T* with data for the DFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.** * **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where DFT is applied, and ``axes`` is any unordered list of indices of different dimensions of input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.** - .. note:: - + .. note:: + The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes``. * **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then DFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > input_shape[: r - 1][axes[i]]``, then input data are zero-padded with respect to the axis ``axes[i]`` at the end. Finally, ``signal_size[i] < input_shape[: r - 1][axes[i]]``, then input data are trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optional, with default value ```[input_shape[: r - 1][a] for a in axes]```. - .. note:: - + .. note:: + If the input ``signal_size`` is specified, the size of ``signal_size`` must be the same as the size of ``axes``. **Outputs** @@ -52,7 +52,7 @@ Let ``D`` be an input tensor ``A``, taking into account the ``signal_size``, and Next, put .. math:: - + X[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1}]=D[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},0]+iD[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},1] for all indices ``j_0,...,j_{k+r-1}``, where ``i`` is an imaginary unit, that is ``X`` is a complex tensor. @@ -60,17 +60,17 @@ for all indices ``j_0,...,j_{k+r-1}``, where ``i`` is an imaginary unit, that is Then the discrete Fourier transform is the tensor :math:`Y` of the same shape as the tensor :math:`X`, such that .. math:: - + Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}]=\sum\limits_{j_0=0}^{S_0-1}\cdots\sum\limits_{j_{r-1}=0}^{S_{r-1}-1}X[n_0,\dots,n_{k-1},j_0,\dots,j_{r-1}]\exp\left(-2\pi i\sum\limits_{q=0}^{r-1}\frac{m_qj_q}{S_q}\right) for all indices ``n_0,...,n_{k-1}``, ``m_0,...,m_{r-1}``, and the result of the operation is the real tensor ``Z`` with the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]`` and such that .. math:: - + Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 0]=Re Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}], .. math:: - + Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 1]=Im Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}]. Calculations for the generic case of axes and signal sizes are similar. @@ -81,7 +81,7 @@ There is no ``signal_size`` input (4D input tensor): .. code-block:: xml :force: - + @@ -91,7 +91,7 @@ There is no ``signal_size`` input (4D input tensor): 2 - 2 < !-- axes input contains [1, 2] --> + 2 @@ -107,7 +107,7 @@ There is no ``signal_size`` input (3D input tensor): .. code-block:: xml :force: - + @@ -116,7 +116,7 @@ There is no ``signal_size`` input (3D input tensor): 2 - 2 < !-- axes input contains [0, 1] --> + 2 @@ -131,7 +131,7 @@ There is ``signal_size`` input (4D input tensor): .. code-block:: xml :force: - + @@ -141,10 +141,10 @@ There is ``signal_size`` input (4D input tensor): 2 - 2 < !-- axes input contains [1, 2] --> + 2 - 2 < !-- signal_size input contains [512, 100] --> + 2 @@ -160,7 +160,7 @@ There is ``signal_size`` input (3D input tensor): .. code-block:: xml :force: - + @@ -169,10 +169,10 @@ There is ``signal_size`` input (3D input tensor): 2 - 2 < !-- axes input contains [0, 1] --> + 2 - 2 < !-- signal_size input contains [512, 100] --> + 2 @@ -187,7 +187,7 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso .. code-block:: xml :force: - + @@ -198,10 +198,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 1, 2] --> + 3 - 3 < !-- signal_size input contains [170, -1, 1024] --> + 3 @@ -218,7 +218,7 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso .. code-block:: xml :force: - + @@ -229,10 +229,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 0, 2] --> + 3 - 3 < !-- signal_size input contains [258, -1, 2056] --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IDFT_7.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IDFT_7.rst index e3651b2c44dc58..0621a323428543 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IDFT_7.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IDFT_7.rst @@ -5,7 +5,7 @@ Inverse Discrete Fourier Transformation (IDFT) .. meta:: - :description: Learn about IDFT-7 - a signal processing operation, which can be + :description: Learn about IDFT-7 - a signal processing operation, which can be performed on two required and one optional input tensor. **Versioned name**: *IDFT-7* @@ -22,16 +22,16 @@ No attributes available. * **1**: ``data`` - Input tensor of type *T* with data for the IDFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.** * **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where IDFT is applied, and ``axes`` is any unordered list of indices of different dimensions of input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.** -* +* .. note:: - + The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes``. * **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then IDFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > input_shape[: r - 1][axes[i]]``, then input data are zero-padded with respect to the axis ``axes[i]`` at the end. Finally, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, then input data are trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optional, with default value ``[input_shape[: r - 1][a] for a in axes]``. -* +* .. note:: - + If the input ``signal_size`` is specified, then the size of ``signal_size`` must be the same as the size of ``axes``. **Outputs** @@ -52,7 +52,7 @@ For simplicity, assume that an input tensor ``A`` has the shape ``[B_0, ..., B_{ Let ``D`` be an input tensor ``A``, taking into account the ``signal_size``, and, hence, ``D`` has the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]``. -Next, put +Next, put .. math:: @@ -94,7 +94,7 @@ There is no ``signal_size`` input (4D input tensor): 2 - 2 < !-- [1, 2] --> + 2  @@ -120,7 +120,7 @@ There is no ``signal_size`` input (3D input tensor): 2 - 2 < !-- [0, 1] --> + 2  @@ -147,10 +147,10 @@ There is ``signal_size`` input (4D input tensor): 2 - 2 < !-- [1, 2] --> + 2  - 2 < !-- [512, 100] --> + 2  @@ -177,10 +177,10 @@ There is ``signal_size`` input (3D input tensor): 2 - 2 < !-- [0, 1] --> + 2  - 2 < !-- [512, 100] --> + 2  @@ -208,10 +208,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 1, 2] --> + 3  - 3 < !-- signal_size input contains [170, -1, 1024] --> + 3  @@ -241,10 +241,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 0, 2] --> + 3  - 3 < !-- signal_size input contains [258, -1, 2056] --> + 3  diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IRDFT_9.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IRDFT_9.rst index 7b8804cd841871..d067654709da10 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IRDFT_9.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/IRDFT_9.rst @@ -5,7 +5,7 @@ Inverse Discrete complex-to-real Fourier Transformation (IRDFT) .. meta:: - :description: Learn about IRDFT-9 - a signal processing operation, which can be + :description: Learn about IRDFT-9 - a signal processing operation, which can be performed on two required and one optional input tensor. **Versioned name**: *IRDFT-9* @@ -22,18 +22,18 @@ No attributes available. * **1**: ``data`` - Input tensor of type *T* with data for the IRDFT transformation. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.** * **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where IRDFT is applied, and ``axes`` is any unordered list of indices of different dimensions of the input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in the ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.** -* +* .. note:: - + The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and (rank(data) - 1) not in axes and (-1) not in axes``. * **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then IRDFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > data_shape[: r - 1][axes[i]]``, then input data is zero-padded with respect to the axis ``axes[i]`` at the end. Finally, if ``signal_size[i] < data_shape[: r - 1][axes[i]]``, then input data is trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < data_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optionally, with default value ``[data_shape[: r - 1][a] for a in axes]``. -* +* .. note:: - + If the input ``signal_size`` is specified, then the size of ``signal_size`` must be the same as the size of ``axes``. @@ -110,7 +110,7 @@ There is no ``signal_size`` input (4D input tensor): 2 - 2 < !-- [1, 2] --> + 2  @@ -135,7 +135,7 @@ There is no ``signal_size`` input (3D input tensor): 2 - 2 < !-- [0, 1] --> + 2  @@ -160,10 +160,10 @@ There is ``signal_size`` input (4D input tensor): 2 - 2 < !-- [1, 2] --> + 2  - 2 < !-- [512, 100] --> + 2  @@ -189,10 +189,10 @@ There is ``signal_size`` input (3D input tensor): 2 - 2 < !-- [0, 1] --> + 2  - 2 < !-- [512, 100] --> + 2  @@ -219,10 +219,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 1, 2] --> + 3  - 3 < !-- signal_size input contains [170, -1, 1024] --> + 3  @@ -250,10 +250,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso 2 - 3 < !-- axes input contains [3, 0, 2] --> + 3  - 3 < !-- signal_size input contains [258, -1, 2056] --> + 3  diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/RDFT_9.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/RDFT_9.rst index 325a34bcdb55b5..14270fa42458ca 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/RDFT_9.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/signals/RDFT_9.rst @@ -5,7 +5,7 @@ Discrete Fourier Transformation for real-valued input (RDFT) .. meta:: - :description: Learn about RDFT-9 - a signal processing operation, which can be + :description: Learn about RDFT-9 - a signal processing operation, which can be performed on two required and one optional input tensor. **Versioned name**: *RDFT-9* @@ -85,7 +85,7 @@ There is no ``signal_size`` input (3D input tensor): 320 - 2 < !-- axes input contains [1, 2] --> + 2 @@ -110,7 +110,7 @@ There is no ``signal_size`` input (2D input tensor): 320 - 2 < !-- axes input contains [0, 1] --> + 2 @@ -136,10 +136,10 @@ There is ``signal_size`` input (3D input tensor): 320 - 2 < !-- axes input contains [1, 2] --> + 2 - 2 < !-- signal_size input contains [512, 100] --> + 2 @@ -163,10 +163,10 @@ There is ``signal_size`` input (2D input tensor): 320 - 2 < !-- axes input contains [0, 1] --> + 2 - 2 < !-- signal_size input contains [512, 100] --> + 2 @@ -192,10 +192,10 @@ There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unso 320 - 3 < !-- axes input contains [3, 1, 2] --> + 3 - 3 < !-- signal_size input contains [170, -1, 1024] --> + 3 @@ -222,10 +222,10 @@ There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unso 320 - 3 < !-- axes input contains [3, 0, 2] --> + 3 - 3 < !-- signal_size input contains [258, -1, 2056] --> + 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MatrixNMS_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MatrixNMS_8.rst index c4d7cefdd3687c..881003047efe38 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MatrixNMS_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MatrixNMS_8.rst @@ -5,8 +5,8 @@ MatrixNonMaxSuppression .. meta:: - :description: Learn about MatrixNonMaxSuppression-8 - a sorting and - maximization operation, which can be performed on two required + :description: Learn about MatrixNonMaxSuppression-8 - a sorting and + maximization operation, which can be performed on two required input tensors. **Versioned name**: *MatrixNonMaxSuppression-8* @@ -176,7 +176,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected - -1 < !-- "-1" means a undefined dimension calculated during the model inference --> + -1 6 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_8.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_8.rst index cd992042f1f534..5d0fe3c3c3a518 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_8.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_8.rst @@ -5,8 +5,8 @@ MulticlassNonMaxSuppression .. meta:: - :description: Learn about MulticlassNonMaxSuppression-8 - a sorting and - maximization operation, which can be performed on two required + :description: Learn about MulticlassNonMaxSuppression-8 - a sorting and + maximization operation, which can be performed on two required input tensors. **Versioned name**: *MulticlassNonMaxSuppression-8* @@ -168,7 +168,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected - -1 < !-- "-1" means a undefined dimension calculated during the model inference --> + -1 6 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_9.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_9.rst index 7caccb99ac3e6d..ae8187d60598b0 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_9.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/MulticlassNonMaxSuppression_9.rst @@ -2,8 +2,8 @@ .. meta:: - :description: Learn about MulticlassNonMaxSuppression-8 - a sorting and - maximization operation, which can be performed on two or three + :description: Learn about MulticlassNonMaxSuppression-8 - a sorting and + maximization operation, which can be performed on two or three required input tensors. **Versioned name**: *MulticlassNonMaxSuppression-9* @@ -174,7 +174,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected - -1 < !-- "-1" means a undefined dimension calculated during the model inference --> + -1 6 @@ -211,7 +211,7 @@ Another possible example with 3 inputs could be like: - -1 < !-- "-1" means a undefined dimension calculated during the model inference --> + -1 6 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NMSRotated_13.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NMSRotated_13.rst index 0400d62c414a6f..256e3ad76f637f 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NMSRotated_13.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NMSRotated_13.rst @@ -131,11 +131,11 @@ Plugins that do not support dynamic output tensors produce ``selected_indices`` - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_4.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_4.rst index 34102251ddfefc..161a68b255b1c9 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_4.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_4.rst @@ -5,8 +5,8 @@ NonMaxSuppression .. meta:: - :description: Learn about NonMaxSuppression-4 - a sorting and maximization - operation, which can be performed on two required and three + :description: Learn about NonMaxSuppression-4 - a sorting and maximization + operation, which can be performed on two required and three optional input tensors. **Versioned name**: *NonMaxSuppression-4* @@ -108,7 +108,7 @@ The output tensor is filled with -1s for output tensor elements if the total num - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_5.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_5.rst index 21089de7445b14..f0756ca40d0b2a 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_5.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_5.rst @@ -5,8 +5,8 @@ NonMaxSuppression .. meta:: - :description: Learn about NonMaxSuppression-5 - a sorting and maximization - operation, which can be performed on two required and four + :description: Learn about NonMaxSuppression-5 - a sorting and maximization + operation, which can be performed on two required and four optional input tensors. **Versioned name**: *NonMaxSuppression-5* @@ -120,11 +120,11 @@ Plugins which do not support dynamic output tensors produce ``selected_indices`` - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_9.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_9.rst index 6dece225f34b95..54386e7fb41529 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_9.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sort/NonMaxSuppression_9.rst @@ -5,8 +5,8 @@ NonMaxSuppression .. meta:: - :description: Learn about NonMaxSuppression-9 - a sorting and maximization - operation, which can be performed on two required and four + :description: Learn about NonMaxSuppression-9 - a sorting and maximization + operation, which can be performed on two required and four optional input tensors. **Versioned name**: *NonMaxSuppression-9* @@ -120,11 +120,11 @@ Plugins which do not support dynamic output tensors produce ``selected_indices`` - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 - 150 < !-- min(100, 10) * 3 * 5 --> + 150 3 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagOffsetsSum_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagOffsetsSum_3.rst index 722da5f3f8c4cc..0a0cb67afb0f06 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagOffsetsSum_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagOffsetsSum_3.rst @@ -5,7 +5,7 @@ EmbeddingBagOffsetsSum .. meta:: - :description: Learn about EmbeddingBagOffsetsSum-3 - a sparse operation, which + :description: Learn about EmbeddingBagOffsetsSum-3 - a sparse operation, which can be performed on three required and two optional input tensors. **Versioned name**: *EmbeddingBagOffsetsSum-3* @@ -38,26 +38,26 @@ EmbeddingBagOffsetsSum **Example** .. code-block:: cpp - + - < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] --> + 5 2 - < !-- indices value is: [0, 2, 3, 4] --> + 4 - < !-- offsets value is: [0, 2, 2] - 3 "bags" containing [2,0,4-2] elements, second "bag" is empty --> + 3 - < !-- default_index value is: 0 --> - < !-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] --> + + 4 - < !-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] --> + 3 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagPackedSum_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagPackedSum_3.rst index d389446505409d..9ef623ca7755eb 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagPackedSum_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingBagPackedSum_3.rst @@ -5,7 +5,7 @@ EmbeddingBagPackedSum .. meta:: - :description: Learn about EmbeddingBagPackedSum-3 - a sparse operation, which + :description: Learn about EmbeddingBagPackedSum-3 - a sparse operation, which can be performed on two required and one optional input tensor. **Versioned name**: *EmbeddingBagPackedSum-3* @@ -36,24 +36,24 @@ EmbeddingBagPackedSum **Example** .. code-block:: cpp - + - < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] --> + 5 2 - < !-- indices value is: [[0, 2], [1, 2], [3, 4]] --> + 3 2 - < !-- per_sample_weigths value is: [[0.5, 0.5], [0.5, 0.5], [0.5, 0.5]] --> + 3 2 - < !-- output value is: [[-1.05, -1.2], [-1., -1.1], [-0.1, 0.4]] --> + 3 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingSegmentsSum_3.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingSegmentsSum_3.rst index 583477506df52c..20ae7b30675361 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingSegmentsSum_3.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/sparse/EmbeddingSegmentsSum_3.rst @@ -5,7 +5,7 @@ EmbeddingSegmentsSum .. meta:: - :description: Learn about EmbeddingSegmentsSum-3 - a sparse operation, which + :description: Learn about EmbeddingSegmentsSum-3 - a sparse operation, which can be performed on four required and two optional input tensors. **Versioned name**: *EmbeddingSegmentsSum-3* @@ -39,27 +39,27 @@ EmbeddingSegmentsSum **Example** .. code-block:: cpp - + - < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] --> + 5 2 - < !-- indices value is: [0, 2, 3, 4] --> + 4 - < !-- segment_ids value is: [0, 0, 2, 2] - second segment is empty --> + 4 - < !-- num_segments value is: 3 --> - < !-- default_index value is: 0 --> - < !-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] --> + + + 4 - < !-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] --> + 3 2 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/ConvertLike_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/ConvertLike_1.rst index e93fe6cd59878a..3f2cf1d356de5a 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/ConvertLike_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/ConvertLike_1.rst @@ -5,7 +5,7 @@ ConvertLike .. meta:: - :description: Learn about ConvertLike-1 - an element-wise, type conversion + :description: Learn about ConvertLike-1 - an element-wise, type conversion operation, which can be performed two required input tensors. **Versioned name**: *ConvertLike-1* @@ -45,19 +45,19 @@ where ``a`` and ``b`` correspond to ``data`` and ``like`` input tensors, respect **Example** .. code-block:: cpp - + - < !-- type: int32 --> + 256 56 - < !-- type: float32 --> - 3 < !-- any data --> + + 3 - < !-- result type: float32 --> + 256 56 diff --git a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/Convert_1.rst b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/Convert_1.rst index 3f209cc5168377..50c99c14d0b878 100644 --- a/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/Convert_1.rst +++ b/docs/articles_en/documentation/openvino_ir/operation_sets/operations_specifications/type/Convert_1.rst @@ -5,7 +5,7 @@ Convert .. meta:: - :description: Learn about Convert-1 - an element-wise, type conversion + :description: Learn about Convert-1 - an element-wise, type conversion operation, which can be performed on a single input tensor. **Versioned name**: *Convert-1* @@ -23,7 +23,7 @@ Conversion of negative signed integer to unsigned integer value happens in accor The result of unsupported conversions is undefined. Output elements are represented as follows: .. math:: - + o_{i} = Convert(a_{i}) where ``a`` corresponds to the input tensor. @@ -52,17 +52,17 @@ where ``a`` corresponds to the input tensor. **Example** .. code-block:: cpp - + - < !-- type: i32 --> + 256 56 - < !-- result type: f32 --> + 256 56 From 39c35a2365307c689eafa572b94cc8da5e62181b Mon Sep 17 00:00:00 2001 From: Evgeny Kotov Date: Tue, 6 Feb 2024 15:43:47 +0100 Subject: [PATCH 22/55] LP Transformation tests decrease thresholds (#22662) ### Details: - remove thresholds from SetUp() test classes - use rel_threshold = 1.1, abs_threshold = 1.0e-4 defined in LayerTransformation class as default values ### Tickets: - 131727 Co-authored-by: Ivan Tikhonov --- .../src/low_precision_transformations/add_transformation.cpp | 2 -- .../batch_to_space_transformation.cpp | 2 -- .../src/low_precision_transformations/clamp_transformation.cpp | 2 -- .../low_precision_transformations/concat_transformation.cpp | 3 --- .../concat_with_child_and_output.cpp | 3 --- .../concat_with_different_precision_on_children.cpp | 2 -- .../concat_with_intermediate_transformation.cpp | 2 -- .../concat_with_neighbors_graph_transformation.cpp | 2 -- .../concat_with_split_transformation.cpp | 3 --- .../convolution_backprop_data_transformation.cpp | 3 --- .../convolution_qdq_transformation.cpp | 3 --- .../convolution_transformation.cpp | 3 --- .../convolution_with_incorrect_weights.cpp | 3 --- .../eliminate_fake_quantize_transformation.cpp | 1 - .../fake_quantize_and_avg_pool_transformation.cpp | 2 -- .../fake_quantize_and_max_pool_transformation.cpp | 1 - .../fake_quantize_and_two_output_branches_with_convolution.cpp | 3 --- .../fake_quantize_precision_selection_transformation.cpp | 2 -- .../fake_quantize_transformation.cpp | 2 -- .../fake_quantize_with_dq_not_optimal_transformation.cpp | 2 -- .../fully_connected_transformation.cpp | 2 -- .../fuse_convert_transformation.cpp | 1 - .../fuse_dequantize_to_fake_quantize_transformation.cpp | 2 -- .../fuse_fake_quantize_and_scale_shift_transformation.cpp | 1 - .../src/low_precision_transformations/gemm_transformation.cpp | 2 -- .../group_convolution_transformation.cpp | 3 --- .../groupconvolution_qdq_transformation.cpp | 3 --- .../low_precision_transformations/mat_mul_transformation.cpp | 2 -- .../mat_mul_with_constant_transformation.cpp | 2 -- .../mat_mul_with_optimized_constant_fq.cpp | 3 --- .../move_fake_quantize_transformation.cpp | 2 -- .../low_precision_transformations/multiply_transformation.cpp | 2 -- .../multiply_with_one_parent_transformation.cpp | 2 -- .../src/low_precision_transformations/mvn_transformation.cpp | 1 - .../low_precision_transformations/normalize_transformation.cpp | 3 --- .../src/low_precision_transformations/output_layers_concat.cpp | 2 -- .../output_layers_concat_multi_channel.cpp | 2 -- .../src/low_precision_transformations/pad_transformation.cpp | 1 - .../pull_reshape_through_dequantization_transformation.cpp | 2 -- .../recurrent_cell_transformation.cpp | 2 -- .../reduce_max_transformation.cpp | 1 - .../reduce_mean_transformation.cpp | 1 - .../reduce_min_transformation.cpp | 1 - .../reduce_sum_transformation.cpp | 2 -- .../src/low_precision_transformations/relu_transformation.cpp | 1 - .../shuffle_channels_transformation.cpp | 1 - .../space_to_batch_transformation.cpp | 1 - .../src/low_precision_transformations/split_transformation.cpp | 1 - .../low_precision_transformations/squeeze_transformation.cpp | 1 - .../strided_slice_transformation.cpp | 1 - .../low_precision_transformations/subtract_transformation.cpp | 1 - .../transpose_after_matmul_transformation.cpp | 1 - .../low_precision_transformations/unsqueeze_transformation.cpp | 2 -- .../variadic_split_transformation.cpp | 1 - 54 files changed, 102 deletions(-) diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/add_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/add_transformation.cpp index 0879ae91c2562c..6da4d0f86fd173 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/add_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/add_transformation.cpp @@ -51,8 +51,6 @@ std::string AddTransformation::getTestCaseName(const testing::TestParamInfo< Add } void AddTransformation::SetUp() { - abs_threshold = 1.1; - rel_threshold = 3; ov::element::Type precision; ov::PartialShape inputShape; AddTestValues param; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/batch_to_space_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/batch_to_space_transformation.cpp index 6bd189263a8f11..1ba23576aa88aa 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/batch_to_space_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/batch_to_space_transformation.cpp @@ -24,8 +24,6 @@ std::string BatchToSpaceTransformation::getTestCaseName(const testing::TestParam } void BatchToSpaceTransformation::SetUp() { - abs_threshold = 1.1; - ov::element::Type input_type; BatchToSpaceTransformationParam param; std::tie(input_type, targetDevice, param) = this->GetParam(); diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/clamp_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/clamp_transformation.cpp index 5a97477cc9abae..2cf6ee1d670730 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/clamp_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/clamp_transformation.cpp @@ -28,8 +28,6 @@ std::string ClampTransformation::getTestCaseName(const testing::TestParamInfo inputShapeAndHandling; ov::Shape outputShape; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp index e92913b60189ff..e98dca9eec9bb1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp @@ -33,9 +33,6 @@ std::string ConvolutionQDqTransformation::getTestCaseName(const testing::TestPar } void ConvolutionQDqTransformation::SetUp() { - rel_threshold = 0.1; - abs_threshold = 12.8; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp index 02c366f8fc5298..b1acadbb73dc5d 100755 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp @@ -36,9 +36,6 @@ std::string ConvolutionTransformation::getTestCaseName(const testing::TestParamI } void ConvolutionTransformation::SetUp() { - rel_threshold = 1.0e+10; - abs_threshold = 1.4; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp index 14b49e5800bdf4..f79028e3ccb4cc 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp @@ -36,9 +36,6 @@ std::string ConvolutionWIthIncorrectWeightsTransformation::getTestCaseName(const } void ConvolutionWIthIncorrectWeightsTransformation::SetUp() { - rel_threshold = 0.1; - abs_threshold = 16.1; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/eliminate_fake_quantize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/eliminate_fake_quantize_transformation.cpp index e35d184ba71c7b..ed2d115e1155c1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/eliminate_fake_quantize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/eliminate_fake_quantize_transformation.cpp @@ -49,7 +49,6 @@ void EliminateFakeQuantizeTransformation::SetUp() { TEST_P(EliminateFakeQuantizeTransformation, CompareWithRefImpl) { SKIP_IF_CURRENT_TEST_IS_DISABLED(); - abs_threshold = 2.3; run(); EliminateFakeQuantizeTransformationTestValues testValues; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_avg_pool_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_avg_pool_transformation.cpp index fd766959b0f383..8b9b70481d5880 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_avg_pool_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_avg_pool_transformation.cpp @@ -27,8 +27,6 @@ std::string FakeQuantizeAndAvgPoolTransformation::getTestCaseName(const testing: } void FakeQuantizeAndAvgPoolTransformation::SetUp() { - rel_threshold = 0.5f; - abs_threshold = 1.0; ov::element::Type precision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_max_pool_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_max_pool_transformation.cpp index a641d08caed2aa..f447002a927de7 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_max_pool_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_max_pool_transformation.cpp @@ -27,7 +27,6 @@ std::string FakeQuantizeAndMaxPoolTransformation::getTestCaseName(const testing: } void FakeQuantizeAndMaxPoolTransformation::SetUp() { - abs_threshold = 1.0; ov::element::Type precision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp index 5aad24deae06bf..f80290734b2cff 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp @@ -35,9 +35,6 @@ std::string FakeQuantizeAndTwoOutputBranchesWithConvolutionTransformation::getTe } void FakeQuantizeAndTwoOutputBranchesWithConvolutionTransformation::SetUp() { - rel_threshold = 0.1; - abs_threshold = 0.1; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_precision_selection_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_precision_selection_transformation.cpp index de67a53328239e..8b81da2d6b6070 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_precision_selection_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_precision_selection_transformation.cpp @@ -28,8 +28,6 @@ std::string FakeQuantizePrecisionSelectionTransformation::getTestCaseName(const } void FakeQuantizePrecisionSelectionTransformation::SetUp() { - abs_threshold = 0.01; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_transformation.cpp index fdf773a9a8c784..6d6751db46d5b1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_transformation.cpp @@ -32,8 +32,6 @@ std::string FakeQuantizeTransformation::getTestCaseName(const testing::TestParam } void FakeQuantizeTransformation::SetUp() { - abs_threshold = 1.0e-3; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_with_dq_not_optimal_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_with_dq_not_optimal_transformation.cpp index 8ed160a3ec2b3f..969b137dcb540a 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_with_dq_not_optimal_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_with_dq_not_optimal_transformation.cpp @@ -28,8 +28,6 @@ std::string FakeQuantizeWithNotOptimalTransformation::getTestCaseName(const test } void FakeQuantizeWithNotOptimalTransformation::SetUp() { - abs_threshold = 4; - rel_threshold = 2778; SKIP_IF_CURRENT_TEST_IS_DISABLED(); ov::PartialShape inputShape; ov::element::Type netPrecision; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp index 74a31d244b20a6..b26f67cc07d444 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp @@ -37,8 +37,6 @@ std::string FullyConnectedTransformation::getTestCaseName(const testing::TestPar } void FullyConnectedTransformation::SetUp() { - abs_threshold = 0.6; - ov::element::Type precision; MatMulShapes shapes; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp index 85fdbd1bb57d7d..503ffe24462700 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp @@ -36,7 +36,6 @@ std::string FuseConvertTransformation::getTestCaseName(const testing::TestParamI } void FuseConvertTransformation::SetUp() { - abs_threshold = 0.01; ov::PartialShape shape; ov::element::Type precision; ov::builder::subgraph::DequantizationOperations deqOperations; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_dequantize_to_fake_quantize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_dequantize_to_fake_quantize_transformation.cpp index 4ed6f51df2cec2..fac36d8f56b863 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_dequantize_to_fake_quantize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_dequantize_to_fake_quantize_transformation.cpp @@ -33,8 +33,6 @@ std::string FuseDequantizeToFakeQuantizeTransformation::getTestCaseName(const te } void FuseDequantizeToFakeQuantizeTransformation::SetUp() { - abs_threshold = 0.1; - FuseDequantizeToFakeQuantizeTransformationTestValues testValues; std::tie(targetDevice, testValues) = this->GetParam(); diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_fake_quantize_and_scale_shift_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_fake_quantize_and_scale_shift_transformation.cpp index 1ebafccd1a21d8..1a428dce08778e 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_fake_quantize_and_scale_shift_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_fake_quantize_and_scale_shift_transformation.cpp @@ -27,7 +27,6 @@ std::string FuseFakeQuantizeAndScaleShiftTransformation::getTestCaseName(const t } void FuseFakeQuantizeAndScaleShiftTransformation::SetUp() { - abs_threshold = 1.8; ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp index ce67bff1d06dcd..150f8c146feedb 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp @@ -30,8 +30,6 @@ std::string GemmTransformation::getTestCaseName(const testing::TestParamInfo inputShapes; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp index 6ad674ee9439d5..4658d4a9a684e0 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp @@ -33,9 +33,6 @@ std::string GroupConvolutionQDqTransformation::getTestCaseName(const testing::Te } void GroupConvolutionQDqTransformation::SetUp() { - abs_threshold = 153.7; - - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp index 8151bc84410211..a6e9f54178775c 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_transformation.cpp @@ -37,8 +37,6 @@ std::string MatMulTransformation::getTestCaseName(const testing::TestParamInfoGetParam(); diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp index 6de4a9423ffc84..9b70e211c1ae38 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp @@ -39,9 +39,6 @@ std::string MatMulWithOptimizedConstantFq::getTestCaseName( } void MatMulWithOptimizedConstantFq::SetUp() { - rel_threshold = 0.01; - abs_threshold = 2.1; - ov::element::Type precision; std::pair shapes; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp index 144ba7dd1b8a60..d41e69a80763e5 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp @@ -36,8 +36,6 @@ std::string MoveFakeQuantizeTransformation::getTestCaseName(testing::TestParamIn } void MoveFakeQuantizeTransformation::SetUp() { - abs_threshold = 1.1; - ov::element::Type netPrecision; std::vector inputShapes; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_transformation.cpp index 44e0a99c3c4452..a6d5d3b83b3c7a 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_transformation.cpp @@ -49,8 +49,6 @@ std::string MultiplyTransformation::getTestCaseName(const testing::TestParamInfo } void MultiplyTransformation::SetUp() { - abs_threshold = 0.1; - ov::element::Type precision; ov::PartialShape inputShape; MultiplyTestValues param; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_with_one_parent_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_with_one_parent_transformation.cpp index f7ec4d8d4afcae..d8b961f6accd95 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_with_one_parent_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_with_one_parent_transformation.cpp @@ -28,8 +28,6 @@ std::string MultiplyWithOneParentTransformation::getTestCaseName(const testing:: } void MultiplyWithOneParentTransformation::SetUp() { - rel_threshold = 0.01f; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp index 3dfc7692486a6a..f94a99c14035cc 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp @@ -36,7 +36,6 @@ std::string MVNTransformation::getTestCaseName(const testing::TestParamInfo shapes; ov::element::Type precision; std::vector axes; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp index 0beb3f72899172..be639c37df1085 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp @@ -45,8 +45,6 @@ std::string OutputLayersConcat::getTestCaseName(const testing::TestParamInfo activations_shapes; std::vector weights_shapes; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_max_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_max_transformation.cpp index 67e232a4a4f77a..1fa455b5da8673 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_max_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_max_transformation.cpp @@ -30,7 +30,6 @@ std::string ReduceMaxTransformation::getTestCaseName(const testing::TestParamInf } void ReduceMaxTransformation::SetUp() { - abs_threshold = 1.1; ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_mean_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_mean_transformation.cpp index b28c4128686593..3a4611f2288100 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_mean_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_mean_transformation.cpp @@ -42,7 +42,6 @@ std::string ReduceMeanTransformation::getTestCaseName(const testing::TestParamIn } void ReduceMeanTransformation::SetUp() { - abs_threshold = 4.1; ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_min_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_min_transformation.cpp index 52cdf578ab8d67..9c84ef2c860e29 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_min_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_min_transformation.cpp @@ -30,7 +30,6 @@ std::string ReduceMinTransformation::getTestCaseName(const testing::TestParamInf } void ReduceMinTransformation::SetUp() { - abs_threshold = 0.1; ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_sum_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_sum_transformation.cpp index 171fbfefa28e67..4cf3f75185b9e7 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_sum_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/reduce_sum_transformation.cpp @@ -30,8 +30,6 @@ std::string ReduceSumTransformation::getTestCaseName(const testing::TestParamInf } void ReduceSumTransformation::SetUp() { - abs_threshold = 4.1; - ov::element::Type netPrecision; ov::PartialShape inputShape; ov::pass::low_precision::LayerTransformation::Params params; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/relu_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/relu_transformation.cpp index b4bb254e3d4b71..603349350cdeb0 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/relu_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/relu_transformation.cpp @@ -32,7 +32,6 @@ std::string ReluTransformation::getTestCaseName(const testing::TestParamInfoGetParam(); diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/split_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/split_transformation.cpp index ee5eb94eeb970d..d014d159ab4c70 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/split_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/split_transformation.cpp @@ -30,7 +30,6 @@ std::string SplitTransformation::getTestCaseName(const testing::TestParamInfo Date: Wed, 7 Feb 2024 09:26:17 +0800 Subject: [PATCH 23/55] disable unstable proposal testcase (#22415) ### Details: - *quickly comment out paddle testcase generate_proposals_v2_5. It is unstable in CI* - *will track and fix later* ### Tickets: - *130605* --- src/frontends/paddle/tests/op_fuzzy.cpp | 3 ++- .../test_models/gen_scripts/generate_generate_proposal_v2.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/paddle/tests/op_fuzzy.cpp b/src/frontends/paddle/tests/op_fuzzy.cpp index acc9ade78c0f18..835f9da29b4084 100644 --- a/src/frontends/paddle/tests/op_fuzzy.cpp +++ b/src/frontends/paddle/tests/op_fuzzy.cpp @@ -245,7 +245,8 @@ static const std::vector models{ std::string("generate_proposals_v2_2"), std::string("generate_proposals_v2_3"), std::string("generate_proposals_v2_4"), - std::string("generate_proposals_v2_5"), + // ticket 130605: actual res value is not close + // std::string("generate_proposals_v2_5"), std::string("generate_proposals_v2_6"), // greater_equal_big_int64(failure due to CPU inference), std::string("greater_equal_big_int64"), diff --git a/src/frontends/paddle/tests/test_models/gen_scripts/generate_generate_proposal_v2.py b/src/frontends/paddle/tests/test_models/gen_scripts/generate_generate_proposal_v2.py index 8621a596417332..55f03c09e39cff 100644 --- a/src/frontends/paddle/tests/test_models/gen_scripts/generate_generate_proposal_v2.py +++ b/src/frontends/paddle/tests/test_models/gen_scripts/generate_generate_proposal_v2.py @@ -133,6 +133,8 @@ def generate_proposals_v2(name: str, input_data: dict, attr: dict): generate_proposals_v2(input_name, input_data, attr) # test case 5 + ''' + TODO: ticket 130605 input_name = "generate_proposals_v2_5" input_data["scores"] = np.random.rand(1, 6, 10, 8).astype('float32') input_data["bbox_deltas"] = np.random.rand(1, 24, 10, 8).astype('float32') @@ -145,6 +147,7 @@ def generate_proposals_v2(name: str, input_data: dict, attr: dict): attr["post_nms_top_n"] = 60 generate_proposals_v2(input_name, input_data, attr) + ''' # test case 6 input_name = "generate_proposals_v2_6" From 411b951ca5737d5dd7320a3d8a7534d42163cd56 Mon Sep 17 00:00:00 2001 From: Jade Cho Date: Wed, 7 Feb 2024 11:58:50 +0900 Subject: [PATCH 24/55] [GPU] Add new weights formats (#22652) + Added os_is_yx_osv8_isv16 and os_is_yx_osv4_isv2. ### Tickets: - *130599* --- .../include/intel_gpu/runtime/format.hpp | 2 ++ .../graph/impls/ocl/kernel_selector_helper.cpp | 8 ++++++++ .../include/batch_headers/fetch_weights.cl | 16 ++++++++++++++++ .../cl_kernels/reorder_weights.cl | 8 ++++++++ .../kernel_selector/kernel_selector_common.cpp | 2 ++ .../src/kernel_selector/tensor_type.cpp | 12 ++++++++++++ .../intel_gpu/src/kernel_selector/tensor_type.h | 2 ++ src/plugins/intel_gpu/src/runtime/format.cpp | 2 ++ 8 files changed, 52 insertions(+) diff --git a/src/plugins/intel_gpu/include/intel_gpu/runtime/format.hpp b/src/plugins/intel_gpu/include/intel_gpu/runtime/format.hpp index dc756006c18264..947cdf06553417 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/runtime/format.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/runtime/format.hpp @@ -241,6 +241,8 @@ struct format { os_zy_is_x_osv8_isv2, os_zy_is_x_osv8_isv4, os_is_yx_osv4_isv16, + os_is_yx_osv4_isv2, + os_is_yx_osv8_isv16, os_is_yx_osv2_isv4, os_is_yx_osv2_isv16, os_is_yx_osv2_isv32, diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/kernel_selector_helper.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/kernel_selector_helper.cpp index fff672088f233e..5030b1e2cfa0e4 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/kernel_selector_helper.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/kernel_selector_helper.cpp @@ -502,6 +502,10 @@ kernel_selector::weights_layout to_weights_layout(format f, bool is_grouped) { return kernel_selector::weights_layout::os_is_yx_osv8_isv4; case format::os_is_yx_osv4_isv16: return kernel_selector::weights_layout::os_is_yx_osv4_isv16; + case format::os_is_yx_osv8_isv16: + return kernel_selector::weights_layout::os_is_yx_osv8_isv16; + case format::os_is_yx_osv4_isv2: + return kernel_selector::weights_layout::os_is_yx_osv4_isv2; case format::os_is_yx_osv2_isv4: return kernel_selector::weights_layout::os_is_yx_osv2_isv4; case format::os_is_yx_osv2_isv16: @@ -908,6 +912,10 @@ cldnn::format::type from_weights_layout(kernel_selector::weights_layout l) { return cldnn::format::os_is_yx_osv8_isv4; case kernel_selector::weights_layout::os_is_yx_osv4_isv16: return cldnn::format::os_is_yx_osv4_isv16; + case kernel_selector::weights_layout::os_is_yx_osv8_isv16: + return cldnn::format::os_is_yx_osv8_isv16; + case kernel_selector::weights_layout::os_is_yx_osv4_isv2: + return cldnn::format::os_is_yx_osv4_isv2; case kernel_selector::weights_layout::os_is_yx_osv2_isv4: return cldnn::format::os_is_yx_osv2_isv4; case kernel_selector::weights_layout::os_is_yx_osv2_isv16: diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/include/batch_headers/fetch_weights.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/include/batch_headers/fetch_weights.cl index 492086141aea7d..bdd92a6085ea49 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/include/batch_headers/fetch_weights.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/include/batch_headers/fetch_weights.cl @@ -1538,6 +1538,22 @@ inline uint get_g_os_is_yx_osv_isv(uint g, uint o, uint i, uint y, uint x, CAT(prefix, _SIZE_X), \ CAT(prefix, _SIZE_Y), 4, 16) +#define GET_FILTER_OS_IS_YX_OSV8_ISV16_INDEX(prefix, o, i, y, x) \ + get_g_os_is_yx_osv_isv( \ + 0, o, i, y, x, \ + CAT(prefix, _IFM_NUM), \ + CAT(prefix, _OFM_NUM), \ + CAT(prefix, _SIZE_X), \ + CAT(prefix, _SIZE_Y), 8, 16) + +#define GET_FILTER_OS_IS_YX_OSV4_ISV2_INDEX(prefix, o, i, y, x) \ + get_g_os_is_yx_osv_isv( \ + 0, o, i, y, x, \ + CAT(prefix, _IFM_NUM), \ + CAT(prefix, _OFM_NUM), \ + CAT(prefix, _SIZE_X), \ + CAT(prefix, _SIZE_Y), 4, 2) + #define GET_FILTER_OS_IS_YX_OSV8_ISV2_INDEX(prefix, o, i, y, x) \ get_g_os_is_yx_osv_isv( \ 0, o, i, y, x, \ diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_weights.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_weights.cl index dbc584eba22714..30d06e2e7ca9a0 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_weights.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/reorder_weights.cl @@ -448,6 +448,10 @@ inline uint FUNC(get_input_index)(uint g, uint o, uint i, uint z, uint y, uint x return GET_FILTER_OS_IS_YX_OSV2_ISV32_INDEX(INPUT0, o, i, y, x); #elif defined INPUT0_LAYOUT_OS_IS_YX_OSV4_ISV16 return GET_FILTER_OS_IS_YX_OSV4_ISV16_INDEX(INPUT0, o, i, y, x); +#elif defined INPUT0_LAYOUT_OS_IS_YX_OSV8_ISV16 + return GET_FILTER_OS_IS_YX_OSV8_ISV16_INDEX(INPUT0, o, i, y, x); +#elif defined INPUT0_LAYOUT_OS_IS_YX_OSV4_ISV2 + return GET_FILTER_OS_IS_YX_OSV4_ISV2_INDEX(INPUT0, o, i, y, x); #elif defined INPUT0_LAYOUT_G_OS_IS_ZYX_OSV16_ISV16 return GET_FILTER_G_OS_IS_ZYX_OSV16_ISV16_INDEX(INPUT0, g, o, i, z, y, x); #elif defined INPUT0_LAYOUT_OS_IS_ZYX_OSV32_ISV16 @@ -567,6 +571,10 @@ inline uint FUNC(get_output_index)(uint g, uint o, uint i, uint z, uint y, uint return GET_FILTER_OS_IS_YX_OSV2_ISV32_INDEX(OUTPUT, o, i, y, x); #elif defined OUTPUT_LAYOUT_OS_IS_YX_OSV4_ISV16 return GET_FILTER_OS_IS_YX_OSV4_ISV16_INDEX(OUTPUT, o, i, y, x); +#elif defined OUTPUT_LAYOUT_OS_IS_YX_OSV8_ISV16 + return GET_FILTER_OS_IS_YX_OSV8_ISV16_INDEX(OUTPUT, o, i, y, x); +#elif defined OUTPUT_LAYOUT_OS_IS_YX_OSV4_ISV2 + return GET_FILTER_OS_IS_YX_OSV4_ISV2_INDEX(OUTPUT, o, i, y, x); #elif defined OUTPUT_LAYOUT_OS_IS_YX_OSV32_ISV4_SWIZZLED_BY_2 return GET_FILTER_OS_IS_YX_OSV32_ISV4_SWIZZLED_BY_2_INDEX(OUTPUT, o, i, y, x); #elif defined OUTPUT_LAYOUT_OS_IS_YX_OSV32_ISV4 diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_common.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_common.cpp index a56f49b468b7fd..6caa5e75a474b7 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_common.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/kernel_selector_common.cpp @@ -385,6 +385,8 @@ std::string toString(WeightsLayout layout) { case WeightsLayout::os_is_yx_osv2_isv16: return "OS_IS_YX_OSV2_ISV16"; case WeightsLayout::os_is_yx_osv2_isv32: return "OS_IS_YX_OSV2_ISV32"; case WeightsLayout::os_is_yx_osv4_isv16: return "OS_IS_YX_OSV4_ISV16"; + case WeightsLayout::os_is_yx_osv8_isv16: return "OS_IS_YX_OSV8_ISV16"; + case WeightsLayout::os_is_yx_osv4_isv2: return "OS_IS_YX_OSV4_ISV2"; case WeightsLayout::os_is_zyx_osv8_isv2: return "OS_IS_ZYX_OSV8_ISV2"; case WeightsLayout::goiyx: return "GOIYX"; case WeightsLayout::gioyx: return "GIOYX"; diff --git a/src/plugins/intel_gpu/src/kernel_selector/tensor_type.cpp b/src/plugins/intel_gpu/src/kernel_selector/tensor_type.cpp index f6ca2a01254f27..24d79936715b14 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/tensor_type.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/tensor_type.cpp @@ -141,6 +141,8 @@ WeightsTensor::WeightsChannelArray WeightsTensor::weightsChannelArray {{ { WeightsLayout::os_is_yx_osv2_isv16, { 0, 1, -1, 2, 3, -1 } }, { WeightsLayout::os_is_yx_osv2_isv32, { 0, 1, -1, 2, 3, -1 } }, { WeightsLayout::os_is_yx_osv4_isv16, { 0, 1, -1, 2, 3, -1 } }, + { WeightsLayout::os_is_yx_osv8_isv16, { 0, 1, -1, 2, 3, -1 } }, + { WeightsLayout::os_is_yx_osv4_isv2, { 0, 1, -1, 2, 3, -1 } }, { WeightsLayout::os_is_yx_osv8_isv4, { 0, 1, -1, 2, 3, -1 } }, { WeightsLayout::os_is_zyx_osv8_isv4, { 0, 1, 2, 3, 4, -1 } }, { WeightsLayout::os_is_yx_osv8_isv2, { 0, 1, -1, 2, 3, -1 } }, @@ -871,6 +873,16 @@ NDims WeightsTensor::GetSimpleDims(const std::vector& d, WeightsLayout l newDims[2] = RoundUp(newDims[2], 16); newDims[3] = RoundUp(newDims[3], 4); break; + case os_is_yx_osv8_isv16: + assert(newDims.size() == 4); + newDims[2] = RoundUp(newDims[2], 16); + newDims[3] = RoundUp(newDims[3], 8); + break; + case os_is_yx_osv4_isv2: + assert(newDims.size() == 4); + newDims[2] = RoundUp(newDims[2], 2); + newDims[3] = RoundUp(newDims[3], 4); + break; case os_is_yx_osv8_isv4: assert(newDims.size() == 4); newDims[2] = RoundUp(newDims[2], 4); diff --git a/src/plugins/intel_gpu/src/kernel_selector/tensor_type.h b/src/plugins/intel_gpu/src/kernel_selector/tensor_type.h index d16dee409c91b4..6a70cff8deb861 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/tensor_type.h +++ b/src/plugins/intel_gpu/src/kernel_selector/tensor_type.h @@ -191,6 +191,8 @@ enum WeightsLayout { os_is_yx_osv2_isv16, os_is_yx_osv2_isv32, os_is_yx_osv4_isv16, + os_is_yx_osv8_isv16, + os_is_yx_osv4_isv2, oizyx, iozyx, os_is_osv32_isv32_swizzled_by_4, // for weights for 1x1 IMAD convolution diff --git a/src/plugins/intel_gpu/src/runtime/format.cpp b/src/plugins/intel_gpu/src/runtime/format.cpp index 5a4872c19200bd..f7f1eb94b2501c 100644 --- a/src/plugins/intel_gpu/src/runtime/format.cpp +++ b/src/plugins/intel_gpu/src/runtime/format.cpp @@ -123,6 +123,8 @@ static const std::map format_traits_map { FMT_TRAITS(os_is_yx_osv2_isv16, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 2}, {1, 16}}), FMT_TRAITS(os_is_yx_osv2_isv32, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 2}, {1, 32}}), FMT_TRAITS(os_is_yx_osv4_isv16, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 4}, {1, 16}}), + FMT_TRAITS(os_is_yx_osv8_isv16, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 8}, {1, 16}}), + FMT_TRAITS(os_is_yx_osv4_isv2, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 4}, {1, 2}}), FMT_TRAITS(os_is_yx_osv16_isv4, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 16}, {1, 4}}), FMT_TRAITS(os_is_yx_osv8_isv4, 1, 1, 2, 0, {0, 1, 2, 3}, "oiyx", "oixy", {{0, 8}, {1, 4}}), FMT_TRAITS(os_is_zyx_osv8_isv4, 1, 1, 3, 0, {0, 1, 2, 3, 4}, "oizyx", "oixyz", {{0, 8}, {1, 4}}), From 56719acac591e97d9b6db8f35bc156faa0847e9d Mon Sep 17 00:00:00 2001 From: hyunback kim Date: Wed, 7 Feb 2024 12:36:00 +0900 Subject: [PATCH 25/55] [GPU] Resolved function test issue. (#22648) ### Tickets: - *129728* --------- Signed-off-by: hyunback --- .../behavior/ov_plugin/properties_tests.cpp | 3 --- .../shared_tests_instances/skip_tests_config.cpp | 9 ++++++++- .../include/behavior/ov_plugin/core_integration_sw.hpp | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp index 5cbe29b4241bc0..a680a2bc65974d 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp @@ -682,7 +682,6 @@ TEST_P(OVGetMetricPropsTest_CACHING_PROPERTIES, GetMetricAndPrintNoThrow) { const std::vector expected_properties = { ov::device::architecture.name(), ov::intel_gpu::execution_units_count.name(), - ov::intel_gpu::driver_version.name(), ov::hint::inference_precision.name(), ov::hint::execution_mode.name(), }; @@ -700,8 +699,6 @@ TEST_P(OVGetMetricPropsTest_CACHING_PROPERTIES, GetMetricAndPrintNoThrow) { ASSERT_TRUE(std::find(caching_properties.begin(), caching_properties.end(), property_name) != caching_properties.end()); } - - OV_ASSERT_PROPERTY_SUPPORTED(ov::internal::caching_properties); } INSTANTIATE_TEST_SUITE_P(nightly_OVGetMetricPropsTest, diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index aac54a9c72f723..87fd919febed9f 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -21,6 +21,8 @@ std::vector disabledTestPatterns() { // Unknown issues R"(.*(LSTMSequence).*mode=.*_RAND_SEQ_LEN_CONST.*)", R"(.*(smoke_DetectionOutput5In).*)", + + // TODO: Issue: 47773 R"(.*(ProposalLayerTest).*)", // TODO: Issue: 54194 @@ -35,12 +37,14 @@ std::vector disabledTestPatterns() { R"(.*Behavior.*OVInferRequestIOTensorTest.*canInferAfterIOBlobReallocation.*)", // Not implemented yet: R"(.*Behavior.*ExecutableNetworkBaseTest.*canSetConfigToExecNet.*)", + // Issue: 122177 + R"(.*LSTMSequenceCommon.*LSTMSequenceTest.Inference.*CONVERT_TO_TI.*)", // TODO: Issue 67408 R"(.*smoke_LSTMSequenceCommonClip.*LSTMSequenceTest.*Inference.*)", // TODO: Issue 114262 R"(LSTMSequenceCommonZeroClipNonConstantWRB/LSTMSequenceTest.Inference/mode=PURE_SEQ_seq_lengths=2_batch=10_hidden_size=1_.*relu.*)", // Expected behavior. GPU plugin doesn't support i64 for eltwise power operation. - R"(.*EltwiseLayerTest.*OpType=Pow.*NetType=i64.*)", + R"(.*EltwiseLayerTest.*eltwise_op_type=Pow.*model_type=i64.*)", // TODO: Issue: 68712 R"(.*.MatMul.*CompareWithRefs.*IS0=\(1.5\)_IS1=\(1.5\).*transpose_a=0.*transpose_b=1.*CONSTANT.*FP16.*UNSPECIFIED.*UNSPECIFIED.*ANY.*)", // Unsupported @@ -66,6 +70,9 @@ std::vector disabledTestPatterns() { R"(.*CachingSupportCase.*GPU.*CompileModelCacheTestBase.*CompareWithRefImpl.*)", // unsupported metrics R"(.*nightly_HeteroAutoBatchOVGetMetricPropsTest.*OVGetMetricPropsTest.*(FULL_DEVICE_NAME_with_DEVICE_ID|AVAILABLE_DEVICES|DEVICE_UUID|OPTIMIZATION_CAPABILITIES|MAX_BATCH_SIZE|DEVICE_GOPS|DEVICE_TYPE|RANGE_FOR_ASYNC_INFER_REQUESTS|RANGE_FOR_STREAMS).*)", + // Issue: 131699 SUPPORTED_PROPERTIES in BATCH issue. DEVICE_ID in BATCH, HETERO issue. + R"(.*OVClassCompiledModelGetPropertyTest/OVClassCompiledModelGetPropertyTest.GetMetricNoThrow_SUPPORTED_CONFIG_KEYS/2)", + R"(.*nightly_HeteroAutoBatchOVCheckChangePropComplieModleGetPropTests_DEVICE_ID.*)", // Issue: 111437 R"(.*smoke_Deconv_2D_Dynamic_.*FP32/DeconvolutionLayerGPUTest.Inference.*)", R"(.*smoke_GroupDeconv_2D_Dynamic_.*FP32/GroupDeconvolutionLayerGPUTest.Inference.*)", diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration_sw.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration_sw.hpp index a505c6fa46b457..b6a56c63e283c6 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration_sw.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/core_integration_sw.hpp @@ -98,7 +98,7 @@ TEST_P(OVClassSeveralDevicesTestQueryModel, QueryModelActualSeveralDevicesNoThro clear_target_device = target_devices.begin()->substr(0, pos); } auto deviceIDs = ie.get_property(clear_target_device, ov::available_devices); - ASSERT_LT(deviceIDs.size(), target_devices.size()); + ASSERT_LE(deviceIDs.size(), target_devices.size()); std::string multi_target_device = ov::test::utils::DEVICE_MULTI + std::string(":"); for (auto& dev_name : target_devices) { From 8f232278e3ef9c439cd30702f8d91e3a9bc38988 Mon Sep 17 00:00:00 2001 From: Oleg Pipikin Date: Wed, 7 Feb 2024 04:53:46 +0100 Subject: [PATCH 26/55] Cleaning and refactoring test utils (#22653) ### Details: - Cleaning and refactoring test utils ### Tickets: - [CVS-111359](https://jira.devtools.intel.com/browse/CVS-111359) --- .../fq_mul_fusion_test.cpp | 1 - .../src/concat_const_inplace.cpp | 1 + .../execution_graph_tests/add_output.cpp | 1 - .../concurrency/gpu_concurrency_tests.cpp | 13 +- .../gpu_remote_tensor_tests.cpp | 19 +- .../src/read_ir/read_ir.cpp | 2 +- .../include/base/behavior_test_utils.hpp | 188 ------ .../include/base/ov_behavior_test_utils.hpp | 4 +- .../compiled_model/compiled_model_base.hpp | 7 +- .../ov_infer_request/batched_tensors.hpp | 2 +- .../infer_request_dynamic.hpp | 4 +- .../behavior/ov_infer_request/inference.hpp | 2 +- .../ov_infer_request/inference_chaining.hpp | 2 +- .../ov_infer_request/iteration_chaining.hpp | 2 +- .../ov_infer_request/memory_states.hpp | 2 +- .../ov_infer_request/properties_tests.hpp | 5 +- .../ov_plugin/auto_batching_tests.hpp | 1 - .../behavior/ov_plugin/caching_tests.hpp | 1 - .../include/behavior/ov_plugin/version.hpp | 2 +- .../ov_infer_request/batched_tensors.cpp | 2 +- .../ov_infer_request/memory_states.cpp | 2 - .../num_inputs_fusing_bin_conv.cpp | 2 +- .../convolution_qdq_transformation.cpp | 2 - .../convolution_transformation.cpp | 2 - .../convolution_with_incorrect_weights.cpp | 2 - .../depth_to_space_transformation.cpp | 3 +- ...d_two_output_branches_with_convolution.cpp | 2 - .../fully_connected_transformation.cpp | 2 - .../fuse_convert_transformation.cpp | 2 - .../gemm_transformation.cpp | 2 - .../group_convolution_transformation.cpp | 2 - .../groupconvolution_qdq_transformation.cpp | 2 - .../mat_mul_with_optimized_constant_fq.cpp | 2 - .../move_fake_quantize_transformation.cpp | 1 - ...ly_to_group_convolution_transformation.cpp | 2 - .../mvn_transformation.cpp | 2 - .../normalize_transformation.cpp | 2 - .../output_layers_concat.cpp | 2 - .../output_layers_concat_multi_channel.cpp | 2 - ...put_layers_handling_in_transformations.cpp | 2 - ..._through_dequantization_transformation.cpp | 2 - .../recurrent_cell_transformation.cpp | 2 - .../shuffle_channels_transformation.cpp | 1 - .../transpose_after_matmul_transformation.cpp | 2 - .../base/layer_test_utils.hpp | 2 +- .../layer_transformation.cpp | 2 - .../src/subgraph/perm_conv_perm_concat.cpp | 2 +- .../include/common_test_utils/data_utils.hpp | 230 +------ .../common_test_utils/src/data_utils.cpp | 200 +----- .../common_test_utils/tests/utils_tests.cpp | 3 +- .../functional_test_utils/blob_utils.hpp | 583 ------------------ .../functional_test_utils/plugin_cache.hpp | 34 - .../functional_test_utils/precision_utils.hpp | 62 -- .../src/plugin_cache.cpp | 109 ---- .../mocks/mock_engine/mock_plugin.cpp | 1 - .../mocks/mock_engine/mock_plugin.hpp | 4 - 56 files changed, 41 insertions(+), 1499 deletions(-) delete mode 100644 src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp delete mode 100644 src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp delete mode 100644 src/tests/test_utils/functional_test_utils/include/functional_test_utils/plugin_cache.hpp delete mode 100644 src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp delete mode 100644 src/tests/test_utils/functional_test_utils/src/plugin_cache.cpp diff --git a/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp b/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp index 7dcf6a9c44b3c3..f9036fb5eadda2 100644 --- a/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp +++ b/src/common/transformations/tests/common_optimizations/fq_mul_fusion_test.cpp @@ -12,7 +12,6 @@ #include "common_test_utils/common_utils.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "common_test_utils/test_common.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "openvino/core/model.hpp" #include "openvino/opsets/opset4.hpp" #include "openvino/pass/manager.hpp" diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp index bb12b5de29b23d..0844ce4a2b85f8 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp @@ -5,6 +5,7 @@ #include "ov_models/utils/ov_helpers.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" #include "utils/cpu_test_utils.hpp" +#include "common_test_utils/ov_tensor_utils.hpp" using namespace CPUTestUtils; diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/add_output.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/add_output.cpp index 786a204488c5ee..f01cfa5db36cc2 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/add_output.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/execution_graph_tests/add_output.cpp @@ -4,7 +4,6 @@ #include #include "execution_graph_tests/add_output.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "openvino/op/multiply.hpp" #include "openvino/op/sigmoid.hpp" #include "openvino/op/constant.hpp" diff --git a/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp b/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp index e493792d58d2dc..32418b94b52e66 100644 --- a/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/concurrency/gpu_concurrency_tests.cpp @@ -4,8 +4,6 @@ #include "common_test_utils/test_common.hpp" -#include "functional_test_utils/plugin_cache.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "openvino/core/preprocess/pre_post_process.hpp" #include "transformations/utils/utils.hpp" #include "common_test_utils/file_utils.hpp" @@ -242,20 +240,15 @@ TEST(smoke_InferRequestDeviceMemoryAllocation, usmHostIsNotChanged) { // Modify tensor somehow and save as a reference values ov::test::utils::fill_tensor_random(output_tensor2); - std::vector ref_values; - ref_values.resize(output_tensor2.get_byte_size()); - std::memcpy(ref_values.data(), output_tensor2.data(), output_tensor2.get_byte_size()); + ov::Tensor ref_tensor(output_tensor2.get_element_type(), output_tensor2.get_shape()); + output_tensor2.copy_to(ref_tensor); // Perform second infer() call with a system host memory tensor infer_request1.set_output_tensor(output_tensor1); ASSERT_NO_THROW(infer_request1.infer()); // Expect that output_tensor2 will not change it's data after infer() call - FuncTestUtils::compareRawBuffers(ref_values.data(), - output_tensor2.data(), - ref_values.size(), - ov::shape_size(output_tensor2.get_shape()), - 1e-4f); + ov::test::utils::compare(ref_tensor, output_tensor2, 1e-4); } TEST(smoke_InferRequestDeviceMemoryAllocation, canSetSystemHostTensor) { diff --git a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp index 300d88ec88240a..74fda0a8dc3263 100644 --- a/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp +++ b/src/plugins/intel_gpu/tests/functional/remote_tensor_tests/gpu_remote_tensor_tests.cpp @@ -9,6 +9,7 @@ #include "remote_tensor_tests/helpers.hpp" #include "common_test_utils/ov_tensor_utils.hpp" +#include "common_test_utils/data_utils.hpp" #include "base/ov_behavior_test_utils.hpp" #include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" #include "common_test_utils/subgraph_builders/split_multi_conv_concat.hpp" @@ -1891,9 +1892,9 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_single_plane) { ASSERT_EQ(output_tensor_regular.get_size() * num_batch, output_tensor_shared.get_size()); float thr = 0.1f; - FuncTestUtils::compareRawBuffers(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), + ov::test::utils::compare_raw_data(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), static_cast(output_tensor_regular.data()), - output_tensor_regular.get_size(), output_tensor_regular.get_size(), thr); + output_tensor_regular.get_size(), thr); } } @@ -2022,9 +2023,9 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_image_two_planes) { ASSERT_EQ(output_tensor_regular.get_size() * num_batch, output_tensor_shared.get_size()); float thr = 0.1f; - FuncTestUtils::compareRawBuffers(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), + ov::test::utils::compare_raw_data(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), static_cast(output_tensor_regular.data()), - output_tensor_regular.get_size(), output_tensor_regular.get_size(), thr); + output_tensor_regular.get_size(), thr); } } @@ -2145,9 +2146,9 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toGray) { ASSERT_EQ(output_tensor_regular.get_size() * num_batch, output_tensor_shared.get_size()); float thr = 0.1f; - FuncTestUtils::compareRawBuffers(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), + ov::test::utils::compare_raw_data(static_cast(output_tensor_shared.data()) + i * output_tensor_regular.get_size(), static_cast(output_tensor_regular.data()), - output_tensor_regular.get_size(), output_tensor_regular.get_size(), thr); + output_tensor_regular.get_size(), thr); } } @@ -2304,9 +2305,9 @@ TEST_P(OVRemoteTensorBatched_Test, NV12toBGR_buffer) { ASSERT_EQ(output_tensor_regular.get_size() * num_batch, out_tensor_new.get_size()); float thr = 0.1f; - FuncTestUtils::compareRawBuffers(static_cast(out_tensor_new.data()) + i * output_tensor_regular.get_size(), - static_cast(output_tensor_regular.data()), - output_tensor_regular.get_size(), output_tensor_regular.get_size(), thr); + ov::test::utils::compare_raw_data(static_cast(out_tensor_new.data()) + i * output_tensor_regular.get_size(), + static_cast(output_tensor_regular.data()), + output_tensor_regular.get_size(), thr); } } diff --git a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/read_ir/read_ir.cpp b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/read_ir/read_ir.cpp index 10db7aebd9d195..b289ebe5549b6b 100644 --- a/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/read_ir/read_ir.cpp +++ b/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/read_ir/read_ir.cpp @@ -301,7 +301,7 @@ std::vector ReadIRTest::calculate_refs() { std::ifstream ref_data_ifstream(path_to_ref_tensor, std::ifstream::binary); ref_data_ifstream.open(path_to_ref_tensor, std::ios::binary); if (!ref_data_ifstream.is_open()) - IE_THROW() << "Weights file " << path_to_ref_tensor << " cannot be opened!"; + OPENVINO_THROW("Weights file ", path_to_ref_tensor, " cannot be opened!"); size_t buf_size = 0; for (const auto& output : functionRefs->outputs()) { diff --git a/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp b/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp deleted file mode 100644 index 5d446bb5043d80..00000000000000 --- a/src/tests/functional/plugin/shared/include/base/behavior_test_utils.hpp +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "ov_behavior_test_utils.hpp" - -#include "ie_core.hpp" -#include "functional_test_utils/plugin_cache.hpp" -#include "common_test_utils/file_utils.hpp" -#include "openvino/util/file_util.hpp" -#include "functional_test_utils/summary/api_summary.hpp" -#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp" - -namespace BehaviorTestsUtils { - -class IEInferRequestTestBase : public ov::test::behavior::APIBaseTest { -private: - void set_api_entity() override { - api_entity = ov::test::utils::ov_entity::ie_infer_request; - }; -}; - -class IEExecutableNetworkTestBase : public ov::test::behavior::APIBaseTest { -private: - void set_api_entity() override { - api_entity = ov::test::utils::ov_entity::ie_executable_network; - }; -}; - -class IEPluginTestBase : public ov::test::behavior::APIBaseTest { -private: - void set_api_entity() override { - api_entity = ov::test::utils::ov_entity::ie_plugin; - }; -}; - -typedef std::tuple< - std::string, // Device name - std::map // Config -> InferRequestParams; - -class InferRequestTests : public testing::WithParamInterface, - public IEInferRequestTestBase { -public: - static std::string getTestCaseName(testing::TestParamInfo obj) { - std::string targetDevice; - std::map configuration; - std::tie(targetDevice, configuration) = obj.param; - std::ostringstream result; - std::replace(targetDevice.begin(), targetDevice.end(), ':', '.'); - result << "targetDevice=" << targetDevice << "_"; - if (!configuration.empty()) { - for (auto &configItem : configuration) { - result << "configItem=" << configItem.first << "_" << configItem.second << "_"; - } - } - return result.str(); - } - - void SetUp() override { - std::tie(target_device, configuration) = this->GetParam(); - // Skip test according to plugin specific disabledTestPatterns() (if any) - SKIP_IF_CURRENT_TEST_IS_DISABLED() - APIBaseTest::SetUp(); - function = ov::test::behavior::getDefaultNGraphFunctionForTheDevice(); - cnnNet = InferenceEngine::CNNNetwork(function); - // Load CNNNetwork to target plugins - execNet = ie->LoadNetwork(cnnNet, target_device, configuration); - } - - void TearDown() override { - if (!configuration.empty()) { - PluginCache::get().reset(); - } - APIBaseTest::TearDown(); - } - -protected: - InferenceEngine::CNNNetwork cnnNet; - InferenceEngine::ExecutableNetwork execNet; - std::shared_ptr ie = PluginCache::get().ie(); - std::shared_ptr function; - std::map configuration;; -}; - -inline InferenceEngine::Core createIECoreWithTemplate() { - PluginCache::get().reset(); - InferenceEngine::Core ie; -#ifndef OPENVINO_STATIC_LIBRARY - std::string pluginName = "openvino_template_plugin" OV_BUILD_POSTFIX; - ie.RegisterPlugin(ov::util::make_plugin_library_name(ov::test::utils::getExecutableDirectory(), pluginName), - ov::test::utils::DEVICE_TEMPLATE); -#endif // !OPENVINO_STATIC_LIBRARY - return ie; -} - -class IEClassNetworkTest : public ov::test::behavior::OVClassNetworkTest { -public: - InferenceEngine::CNNNetwork actualCnnNetwork, simpleCnnNetwork, multinputCnnNetwork, ksoCnnNetwork; - - void SetUp() { - SKIP_IF_CURRENT_TEST_IS_DISABLED(); - OVClassNetworkTest::SetUp(); - // Generic network - ASSERT_NO_THROW(actualCnnNetwork = InferenceEngine::CNNNetwork(actualNetwork)); - // Quite simple network - ASSERT_NO_THROW(simpleCnnNetwork = InferenceEngine::CNNNetwork(simpleNetwork)); - // Multinput to substruct network - ASSERT_NO_THROW(multinputCnnNetwork = InferenceEngine::CNNNetwork(multinputNetwork)); - // Network with KSO - ASSERT_NO_THROW(ksoCnnNetwork = InferenceEngine::CNNNetwork(ksoNetwork)); - } -}; - -class IEClassBaseTestP : public IEClassNetworkTest, - public ::testing::WithParamInterface, - public IEPluginTestBase { -public: - void SetUp() override { - target_device = GetParam(); - SKIP_IF_CURRENT_TEST_IS_DISABLED(); - APIBaseTest::SetUp(); - IEClassNetworkTest::SetUp(); - } -}; - -class IEExecNetClassBaseTestP : public IEClassNetworkTest, - public ::testing::WithParamInterface, - public IEExecutableNetworkTestBase { -public: - void SetUp() override { - target_device = GetParam(); - SKIP_IF_CURRENT_TEST_IS_DISABLED(); - APIBaseTest::SetUp(); - IEClassNetworkTest::SetUp(); - } -}; - -typedef std::tuple< - InferenceEngine::Precision, // Network precision - std::string, // Device name - std::map // Config -> BehaviorBasicParams; - -class BehaviorTestsBasicBase : public testing::WithParamInterface { -public: - static std::string getTestCaseName(testing::TestParamInfo obj) { - using namespace ov::test::utils; - - InferenceEngine::Precision netPrecision; - std::string targetDevice; - std::map configuration; - std::tie(netPrecision, targetDevice, configuration) = obj.param; - std::replace(targetDevice.begin(), targetDevice.end(), ':', '_'); - std::ostringstream result; - result << "netPRC=" << netPrecision.name() << "_"; - result << "targetDevice=" << targetDevice << "_"; - if (!configuration.empty()) { - result << "config=" << configuration; - } - return result.str(); - } - - std::shared_ptr ie = PluginCache::get().ie(); - std::shared_ptr function; - InferenceEngine::Precision netPrecision; - std::map configuration; -}; - -class BehaviorTestsBasic : public BehaviorTestsBasicBase, - public IEPluginTestBase { -protected: - void SetUp() override { - std::tie(netPrecision, target_device, configuration) = this->GetParam(); - SKIP_IF_CURRENT_TEST_IS_DISABLED() - APIBaseTest::SetUp(); - function = ov::test::utils::make_conv_pool_relu(); - } - void TearDown() override { - if (!configuration.empty()) { - PluginCache::get().reset(); - } - APIBaseTest::TearDown(); - } -}; -} // namespace BehaviorTestsUtils diff --git a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp index e8b3278a69c590..b7f27d1819022e 100644 --- a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp +++ b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp @@ -20,10 +20,8 @@ #include "functional_test_utils/crash_handler.hpp" #include "common_test_utils/file_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/ov_plugin_cache.hpp" #include "functional_test_utils/skip_tests_config.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "functional_test_utils/summary/api_summary.hpp" #include "openvino/util/file_util.hpp" #include "common_test_utils/subgraph_builders/split_conv_concat.hpp" @@ -147,7 +145,7 @@ class OVInferRequestTests : public testing::WithParamInterface std::string { auto it = rtInfo.find(paramName); - IE_ASSERT(rtInfo.end() != it); + OPENVINO_ASSERT(rtInfo.end() != it); return it->second.as(); }; @@ -414,7 +413,7 @@ TEST_P(OVCompiledModelBaseTestOptional, CheckExecGraphInfoAfterExecution) { auto getExecValue = [&rtInfo](const std::string& paramName) -> std::string { auto it = rtInfo.find(paramName); - IE_ASSERT(rtInfo.end() != it); + OPENVINO_ASSERT(rtInfo.end() != it); return it->second.as(); }; @@ -682,7 +681,7 @@ class CompiledModelSetType : public testing::WithParamInterface #include #include "functional_test_utils/ov_plugin_cache.hpp" -#include +#include "base/ov_behavior_test_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_request_dynamic.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_request_dynamic.hpp index 6c309643c99334..89d0f092274aaf 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_request_dynamic.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_request_dynamic.hpp @@ -16,10 +16,8 @@ #include "shared_test_classes/base/layer_test_utils.hpp" #include #include -#include +#include "base/ov_behavior_test_utils.hpp" #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" // TODO [mandrono]: move current test case inside CPU plug-in and return the original tests diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference.hpp index 929ce1472c5746..636b164c96912e 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference.hpp @@ -7,7 +7,7 @@ #include #include #include "functional_test_utils/ov_plugin_cache.hpp" -#include +#include "base/ov_behavior_test_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference_chaining.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference_chaining.hpp index 9ff9f9144f8bc2..4965ac87ee8fe6 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference_chaining.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/inference_chaining.hpp @@ -11,7 +11,7 @@ #include #include -#include "base/behavior_test_utils.hpp" +#include "base/ov_behavior_test_utils.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/model.hpp" #include "openvino/core/node.hpp" diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/iteration_chaining.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/iteration_chaining.hpp index 725899cd075c44..966632f62c73bb 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/iteration_chaining.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/iteration_chaining.hpp @@ -11,7 +11,7 @@ #include #include -#include "base/behavior_test_utils.hpp" +#include "base/ov_behavior_test_utils.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/model.hpp" #include "openvino/core/node.hpp" diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/memory_states.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/memory_states.hpp index d9b93c2f8352f5..ca971cfa02e2d9 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/memory_states.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/memory_states.hpp @@ -4,7 +4,7 @@ #pragma once -#include "base/behavior_test_utils.hpp" +#include "base/ov_behavior_test_utils.hpp" #include "common_test_utils/test_common.hpp" namespace ov { diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/properties_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/properties_tests.hpp index 22435559e792bf..ac191f2966bbd8 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/properties_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/properties_tests.hpp @@ -4,7 +4,7 @@ #pragma once -#include "base/behavior_test_utils.hpp" +#include "base/ov_behavior_test_utils.hpp" #include "openvino/runtime/threading/executor_manager.hpp" namespace ov { @@ -31,7 +31,7 @@ class InferRequestPropertiesTest : public testing::WithParamInterfaceclear(); ASSERT_EQ(0u, ov::threading::executor_manager()->get_executors_number()); ASSERT_EQ(0u, ov::threading::executor_manager()->get_idle_cpu_streams_executors_number()); diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/auto_batching_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/auto_batching_tests.hpp index 180894fef92a56..6d1288adbebeb6 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/auto_batching_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/auto_batching_tests.hpp @@ -12,7 +12,6 @@ #include "common_test_utils/subgraph_builders/single_conv.hpp" #include "common_test_utils/subgraph_builders/detection_output.hpp" #include "common_test_utils/subgraph_builders/multi_single_conv.hpp" -#include "functional_test_utils/plugin_cache.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/caching_tests.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/caching_tests.hpp index 4dafda58404f08..5e91f3f8e8db73 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/caching_tests.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/caching_tests.hpp @@ -8,7 +8,6 @@ #include #include "shared_test_classes/base/ov_subgraph.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "common_test_utils/unicode_utils.hpp" #include "openvino/util/common_util.hpp" #include "base/ov_behavior_test_utils.hpp" diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/version.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/version.hpp index 437261507d435d..19cbdf7154c031 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_plugin/version.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_plugin/version.hpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "base/behavior_test_utils.hpp" +#include "base/ov_behavior_test_utils.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/batched_tensors.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/batched_tensors.cpp index 45df311d407153..590c7ab16b912c 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/batched_tensors.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/batched_tensors.cpp @@ -39,7 +39,7 @@ void OVInferRequestBatchedTests::TearDown() { if (m_need_reset_core) { ie->set_property({ov::cache_dir()}); ie.reset(); - PluginCache::get().reset(); + ov::test::utils::PluginCache::get().reset(); ov::test::utils::removeFilesWithExt(m_cache_dir, "blob"); ov::test::utils::removeDir(m_cache_dir); } diff --git a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/memory_states.cpp b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/memory_states.cpp index 9ed8d89bad7afc..bac86ba34646f1 100644 --- a/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/memory_states.cpp +++ b/src/tests/functional/plugin/shared/src/behavior/ov_infer_request/memory_states.cpp @@ -4,9 +4,7 @@ #include "behavior/ov_infer_request/memory_states.hpp" -#include "base/behavior_test_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "openvino/op/multiply.hpp" #include "openvino/op/sigmoid.hpp" diff --git a/src/tests/functional/plugin/shared/src/execution_graph_tests/num_inputs_fusing_bin_conv.cpp b/src/tests/functional/plugin/shared/src/execution_graph_tests/num_inputs_fusing_bin_conv.cpp index ddfd51d9b7f271..cc52f0157cfa79 100644 --- a/src/tests/functional/plugin/shared/src/execution_graph_tests/num_inputs_fusing_bin_conv.cpp +++ b/src/tests/functional/plugin/shared/src/execution_graph_tests/num_inputs_fusing_bin_conv.cpp @@ -58,7 +58,7 @@ TEST_P(ExecGraphInputsFusingBinConv, CheckNumInputsInBinConvFusingWithConv) { const auto & rtInfo = op->get_rt_info(); auto getExecValue = [&rtInfo](const std::string & paramName) -> std::string { auto it = rtInfo.find(paramName); - IE_ASSERT(rtInfo.end() != it); + OPENVINO_ASSERT(rtInfo.end() != it); return it->second.as(); }; diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp index e98dca9eec9bb1..62818c22a05557 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_qdq_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/fake_quantize_and_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp index b1acadbb73dc5d..90ba837d86ae01 100755 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/fake_quantize_and_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp index f79028e3ccb4cc..a799cd8fc2929a 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/convolution_with_incorrect_weights.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp index 31270f5180f684..68ce95d492a2fa 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/depth_to_space_transformation.cpp @@ -8,7 +8,6 @@ #include #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "low_precision_transformations/depth_to_space_transformation.hpp" #include "openvino/core/model.hpp" #include "openvino/op/depth_to_space.hpp" @@ -52,7 +51,7 @@ void DepthToSpaceTransformation::SetUp() { init_input_shapes(inputShape); if (inputShape.rank().is_dynamic() || inputShape.rank().get_length() != 4) { - IE_THROW() << "not supported input shape size " << inputShape.rank(); + OPENVINO_THROW("not supported input shape size ", inputShape.rank()); } function = ov::builder::subgraph::DepthToSpaceFunction::getOriginal(precision, inputShape, mode, blockSize); diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp index f80290734b2cff..449110e7fe55e1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fake_quantize_and_two_output_branches_with_convolution.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" namespace LayerTestsDefinitions { diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp index b26f67cc07d444..694962036010b1 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fully_connected_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/mat_mul.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp index 503ffe24462700..09be58373119de 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/fuse_convert_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/fuse_convert.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp index 150f8c146feedb..b915fe21762141 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/gemm_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_lpt_models/mat_mul.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/group_convolution_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/group_convolution_transformation.cpp index db409a1cd3c63c..796f5d7d609ddb 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/group_convolution_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/group_convolution_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/group_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp index 4658d4a9a684e0..57c92ecd4c411d 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/groupconvolution_qdq_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/fake_quantize_and_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp index 9b70e211c1ae38..f5981ec8e77f74 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mat_mul_with_optimized_constant_fq.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/mat_mul_with_optimized_constant_fake_quantize.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp index d41e69a80763e5..0767ffb272b00f 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/move_fake_quantize_transformation.cpp @@ -12,7 +12,6 @@ #include "common_test_utils/common_utils.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_lpt_models/move_fake_quantize.hpp" namespace LayerTestsDefinitions { diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_to_group_convolution_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_to_group_convolution_transformation.cpp index 32fdb92de0ab8a..2827bc00ec6834 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_to_group_convolution_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/multiply_to_group_convolution_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/multiply_to_group_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp index f94a99c14035cc..38d001149ea0e3 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/mvn_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/mvn.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/normalize_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/normalize_transformation.cpp index 1a14675855a89d..e8ab412cc19366 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/normalize_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/normalize_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/normalize_l2.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp index be639c37df1085..f216fbe18e16d3 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "common_test_utils/node_builders/fake_quantize.hpp" #include "ov_models/pass/convert_prc.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat_multi_channel.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat_multi_channel.cpp index 83e2a3cb6e05b1..eb6c2d3ce3791d 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat_multi_channel.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_concat_multi_channel.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "common_test_utils/node_builders/fake_quantize.hpp" #include "ov_models/pass/convert_prc.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_handling_in_transformations.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_handling_in_transformations.cpp index ff3399d346c4eb..676f69d53c9458 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_handling_in_transformations.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/output_layers_handling_in_transformations.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "common_test_utils/node_builders/fake_quantize.hpp" #include "ov_models/pass/convert_prc.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/pull_reshape_through_dequantization_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/pull_reshape_through_dequantization_transformation.cpp index bb7e5b3900e1f0..fe39393189e3d5 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/pull_reshape_through_dequantization_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/pull_reshape_through_dequantization_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_models/pass/convert_prc.hpp" #include "ov_lpt_models/fake_quantize_and_convolution.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/recurrent_cell_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/recurrent_cell_transformation.cpp index 82491301482760..c61577faa8f1f5 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/recurrent_cell_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/recurrent_cell_transformation.cpp @@ -9,10 +9,8 @@ #include #include - #include "common_test_utils/common_utils.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_lpt_models/recurrent_cell.hpp" namespace LayerTestsDefinitions { diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/shuffle_channels_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/shuffle_channels_transformation.cpp index aba4da9c6a0372..479418a3d2dca2 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/shuffle_channels_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/shuffle_channels_transformation.cpp @@ -11,7 +11,6 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" #include "ov_lpt_models/shuffle_channels.hpp" diff --git a/src/tests/functional/plugin/shared/src/low_precision_transformations/transpose_after_matmul_transformation.cpp b/src/tests/functional/plugin/shared/src/low_precision_transformations/transpose_after_matmul_transformation.cpp index ca93bb11c46800..0a70a1727d189e 100644 --- a/src/tests/functional/plugin/shared/src/low_precision_transformations/transpose_after_matmul_transformation.cpp +++ b/src/tests/functional/plugin/shared/src/low_precision_transformations/transpose_after_matmul_transformation.cpp @@ -11,9 +11,7 @@ #include "common_test_utils/common_utils.hpp" -#include "functional_test_utils/plugin_cache.hpp" #include "shared_test_classes/base/layer_test_utils.hpp" -#include "functional_test_utils/blob_utils.hpp" #include "ov_lpt_models/transpose_after_mat_mul.hpp" diff --git a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp index a23e1be0e84943..8a6237856bbbf1 100644 --- a/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp +++ b/src/tests/functional/shared_test_classes/include/shared_test_classes/base/layer_test_utils.hpp @@ -7,9 +7,9 @@ #include #include "common_test_utils/common_utils.hpp" +#include "common_test_utils/data_utils.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "common_test_utils/test_common.hpp" -#include "common_test_utils/data_utils.hpp" #include "functional_test_utils/crash_handler.hpp" #include "functional_test_utils/skip_tests_config.hpp" #include "functional_test_utils/summary/environment.hpp" diff --git a/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp b/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp index 6ff1d2a6e23a2b..61de1970774a86 100644 --- a/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp +++ b/src/tests/functional/shared_test_classes/src/base/low_precision_transformations/layer_transformation.cpp @@ -7,8 +7,6 @@ #include #include -#include "functional_test_utils/blob_utils.hpp" - #include "ov_models/pass/convert_prc.hpp" namespace LayerTestsUtils { diff --git a/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp b/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp index 0e2a53737bdaac..7cc5f2a4f5fe73 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/perm_conv_perm_concat.cpp @@ -91,7 +91,7 @@ void PermConvPermConcat::SetUp() { auto reshape_out_pattern = std::make_shared( ov::element::i64, ov::Shape{2}, - InferenceEngine::SizeVector({1, (permute_out_shape[2] + 1) * permute_out_shape[3]})); + std::vector({1, (permute_out_shape[2] + 1) * permute_out_shape[3]})); auto reshape_out = std::make_shared(concat, reshape_out_pattern, false); function = std::make_shared(reshape_out, input_parameter, "perm_conv_perm_concat"); diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp index a41bbd4e61b2ff..1c4a169e896033 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/data_utils.hpp @@ -11,7 +11,6 @@ #include "common_test_utils/common_utils.hpp" #include "gtest/gtest.h" -#include "ie_blob.h" #include "openvino/core/type/element_type_traits.hpp" #include "openvino/runtime/tensor.hpp" @@ -45,51 +44,22 @@ inline std::vector generate_float_numbers(std::size_t vec_len, float min, } /** - * Fill blob with value data blob. Broadcast semantic is included. + * Fill tensor with value data. Broadcast semantic is included. * Broadcasting with alignment through last dimension. * - * @param blob tensor to fill in + * @param tensor tensor to fill in * @param values src tensor which should be broadcast */ -OPENVINO_SUPPRESS_DEPRECATED_START -void fill_data_with_broadcast(InferenceEngine::Blob::Ptr& blob, InferenceEngine::Blob::Ptr& values); -OPENVINO_SUPPRESS_DEPRECATED_END void fill_data_with_broadcast(ov::Tensor& tensor, ov::Tensor& values); /** * Wrapper on top of fill_data_with_broadcast with simplified signature * - * @param blob the destination blob to fill in + * @param tensor tensor to fill in * @param axis Axis to apply values * @param values data to broadcast */ -OPENVINO_SUPPRESS_DEPRECATED_START -void fill_data_with_broadcast(InferenceEngine::Blob::Ptr& blob, size_t axis, std::vector values); -OPENVINO_SUPPRESS_DEPRECATED_END void fill_data_with_broadcast(ov::Tensor& tensor, size_t axis, std::vector values); -/** - * Make a view blob with new shape. It will reinterpret original tensor data as a tensor with new shape. - * - * NB! Limitation: the nwe one blob will no have ownership of data buffer. The original blob should be alive - * while view is in use. - * - * @param tensor original source tensor - * @param new_shape new one shape for view blob - * @return new one blob view - */ -OPENVINO_SUPPRESS_DEPRECATED_START -InferenceEngine::Blob::Ptr make_reshape_view(const InferenceEngine::Blob::Ptr& blob, - InferenceEngine::SizeVector new_shape); -OPENVINO_SUPPRESS_DEPRECATED_END - -/** - * Calculate size of buffer required for provided tensor descriptor. - * @param tdesc provided tensor descriptor - * @return size in bytes - */ -OPENVINO_SUPPRESS_DEPRECATED_START -size_t byte_size(const InferenceEngine::TensorDesc& tdesc); -OPENVINO_SUPPRESS_DEPRECATED_END ov::Tensor make_tensor_with_precision_convert(const ov::Tensor& tensor, ov::element::Type prc); @@ -139,27 +109,6 @@ inline void fill_roi_raw_ptr(T* data, } } -OPENVINO_SUPPRESS_DEPRECATED_START -template -inline void fill_data_roi(InferenceEngine::Blob::Ptr& blob, - const uint32_t range, - const int height, - const int width, - const float omega, - const bool is_roi_max_mode, - const int seed = 1, - void (*propGenerator)(InferenceEngine::Blob::Ptr&) = nullptr) { - if (propGenerator != nullptr) { - propGenerator(blob); - return; - } - using T = typename InferenceEngine::PrecisionTrait::value_type; - auto* data = blob->buffer().as(); - fill_roi_raw_ptr(data, blob->size(), range, height, width, omega, is_roi_max_mode, seed); -} - -OPENVINO_SUPPRESS_DEPRECATED_END - void fill_psroi(ov::Tensor& tensor, int batchSize, int height, @@ -308,82 +257,6 @@ void fill_tensor_random(ov::Tensor& tensor, const int32_t k = 1, const int seed = 1); -/** @brief Fill blob with random data. - * - * @param blob Target blob - * @param range Values range - * @param start_from Value from which range should start - * @param k Resolution of floating point numbers. - * - With k = 1 every random number will be basically integer number. - * - With k = 2 numbers resolution will 1/2 so outputs only .0 or .50 - * - With k = 4 numbers resolution will 1/4 so outputs only .0 .25 .50 0.75 and etc. - */ -OPENVINO_SUPPRESS_DEPRECATED_START -template -void inline fill_data_random(InferenceEngine::Blob::Ptr& blob, - const uint32_t range = 10, - int32_t start_from = 0, - const int32_t k = 1, - const int seed = 1) { - using T = typename InferenceEngine::PrecisionTrait::value_type; - auto* rawBlobDataPtr = blob->buffer().as(); - if (PRC == InferenceEngine::Precision::U4 || PRC == InferenceEngine::Precision::I4 || - PRC == InferenceEngine::Precision::BIN) { - fill_data_random(rawBlobDataPtr, blob->byteSize(), range, start_from, k, seed); - } else { - fill_data_random(rawBlobDataPtr, blob->size(), range, start_from, k, seed); - } -} -OPENVINO_SUPPRESS_DEPRECATED_END - -/** @brief Fill blob with a sorted sequence of unique elements randomly generated. - * - * This function generates and fills a blob of a certain precision, with a - * sorted sequence of unique elements. - * - * @param blob Target blob - * @param range Values range - * @param start_from Value from which range should start - * @param k Resolution of floating point numbers. - * - With k = 1 every random number will be basically integer number. - * - With k = 2 numbers resolution will 1/2 so outputs only .0 or .50 - * - With k = 4 numbers resolution will 1/4 so outputs only .0 .25 .50 0.75 and etc. - */ -OPENVINO_SUPPRESS_DEPRECATED_START -template -void inline fill_random_unique_sequence(InferenceEngine::Blob::Ptr& blob, - uint64_t range, - int64_t start_from = 0, - const int64_t k = 1, - const int32_t seed = 1) { - using T = typename InferenceEngine::PrecisionTrait::value_type; - auto* rawBlobDataPtr = blob->buffer().as(); - - if (start_from < 0 && !std::is_signed::value) { - start_from = 0; - } - - if (range < blob->size()) { - range = blob->size() * 2; - } - - std::mt19937 generator(seed); - std::uniform_int_distribution dist(k * start_from, k * (start_from + range)); - - std::set elems; - while (elems.size() != blob->size()) { - auto value = static_cast(dist(generator)); - value /= static_cast(k); - if (PRC == InferenceEngine::Precision::FP16) { - elems.insert(static_cast(ov::float16(value).to_bits())); - } else { - elems.insert(static_cast(value)); - } - } - std::copy(elems.begin(), elems.end(), rawBlobDataPtr); -} -OPENVINO_SUPPRESS_DEPRECATED_END - template void inline fill_data_ptr_consistently(T* data, size_t size, @@ -402,45 +275,6 @@ void inline fill_data_ptr_consistently(T* data, } } -OPENVINO_SUPPRESS_DEPRECATED_START -template -void inline fill_data_consistently(InferenceEngine::Blob::Ptr& blob, - const uint32_t range = 10, - int32_t start_from = 0, - const int32_t k = 1) { - using T = typename InferenceEngine::PrecisionTrait::value_type; - auto* rawBlobDataPtr = blob->buffer().as(); - if (start_from < 0 && !std::is_signed::value) { - start_from = 0; - } - fill_data_ptr_consistently(rawBlobDataPtr, blob->size(), range, start_from, k); -} - -template -void inline fill_data_random_float(InferenceEngine::Blob::Ptr& blob, - const uint32_t range, - int32_t start_from, - const int32_t k, - const int seed = 1) { - using T = typename InferenceEngine::PrecisionTrait::value_type; - std::default_random_engine random(seed); - // 1/k is the resolution of the floating point numbers - std::uniform_int_distribution distribution(k * start_from, k * (start_from + range)); - - auto* rawBlobDataPtr = blob->buffer().as(); - for (size_t i = 0; i < blob->size(); i++) { - auto value = static_cast(distribution(random)); - value /= static_cast(k); - if (PRC == InferenceEngine::Precision::FP16) { - rawBlobDataPtr[i] = static_cast(ov::float16(value).to_bits()); - } else if (PRC == InferenceEngine::Precision::BF16) { - rawBlobDataPtr[i] = static_cast(ov::bfloat16(value).to_bits()); - } else { - rawBlobDataPtr[i] = static_cast(value); - } - } -} - template void inline fill_data_ptr_normal_random_float(T* data, size_t size, @@ -451,8 +285,7 @@ void inline fill_data_ptr_normal_random_float(T* data, std::normal_distribution<> normal_d{mean, stddev}; for (size_t i = 0; i < size; i++) { auto value = static_cast(normal_d(random)); - if (typeid(T) == - typeid(typename InferenceEngine::PrecisionTrait::value_type)) { + if (typeid(T) == typeid(typename ov::fundamental_type_for)) { data[i] = static_cast(ov::float16(value).to_bits()); } else { data[i] = static_cast(value); @@ -460,61 +293,6 @@ void inline fill_data_ptr_normal_random_float(T* data, } } -template -void inline fill_data_normal_random_float(InferenceEngine::Blob::Ptr& blob, - const float mean, - const float stddev, - const int seed = 1) { - using T = typename InferenceEngine::PrecisionTrait::value_type; - auto* rawBlobDataPtr = blob->buffer().as(); - fill_data_ptr_normal_random_float(rawBlobDataPtr, blob->size(), mean, stddev, seed); -} - -template -void inline fill_data_float_array(InferenceEngine::Blob::Ptr& blob, const T values[], const size_t size) { - using Type = typename InferenceEngine::PrecisionTrait::value_type; - - auto* rawBlobDataPtr = blob->buffer().as(); - for (size_t i = 0; i < std::min(size, blob->size()); i++) { - auto value = values[i]; - if (typeid(Type) == - typeid(typename InferenceEngine::PrecisionTrait::value_type)) { - rawBlobDataPtr[i] = static_cast(ov::float16(value).to_bits()); - - } else { - rawBlobDataPtr[i] = static_cast(value); - } - } -} - -template <> -void inline fill_data_random(InferenceEngine::Blob::Ptr& blob, - const uint32_t range, - int32_t start_from, - const int32_t k, - const int seed) { - fill_data_random_float(blob, range, start_from, k, seed); -} - -template <> -void inline fill_data_random(InferenceEngine::Blob::Ptr& blob, - const uint32_t range, - int32_t start_from, - const int32_t k, - const int seed) { - fill_data_random_float(blob, range, start_from, k, seed); -} - -template <> -void inline fill_data_random(InferenceEngine::Blob::Ptr& blob, - const uint32_t range, - int32_t start_from, - const int32_t k, - const int seed) { - fill_data_random_float(blob, range, start_from, k, seed); -} -OPENVINO_SUPPRESS_DEPRECATED_END - void fill_random_string(std::string* dst, const size_t size, const size_t len_range = 10lu, diff --git a/src/tests/test_utils/common_test_utils/src/data_utils.cpp b/src/tests/test_utils/common_test_utils/src/data_utils.cpp index c9c25f82235cec..8d2f91aab3a69d 100644 --- a/src/tests/test_utils/common_test_utils/src/data_utils.cpp +++ b/src/tests/test_utils/common_test_utils/src/data_utils.cpp @@ -4,42 +4,14 @@ #include "common_test_utils/data_utils.hpp" -#include "blob_factory.hpp" -#include "ie_blob.h" -#include "openvino/core/deprecated.hpp" #include "openvino/core/type/element_type_traits.hpp" #include "openvino/runtime/tensor.hpp" #include "precomp.hpp" -using namespace InferenceEngine::details; - namespace ov { namespace test { namespace utils { - -OPENVINO_SUPPRESS_DEPRECATED_START - -bool isDenseBlob(const InferenceEngine::Blob::Ptr& blob) { - auto blk_desc = blob->getTensorDesc().getBlockingDesc(); - auto dims = blk_desc.getBlockDims(); - auto strs = blk_desc.getStrides(); - - IE_ASSERT(dims.size() == strs.size()) << " isDenseBlob: inconsistent tensor descriptor"; - - auto size = dims.size(); - if (size == 0) - return true; - if (size == 1) - return strs[0] == 1; - - for (auto i = size - 1; i > 0; i--) { - if (strs[i - 1] != strs[i - 1] * dims[i]) - return false; - } - - return true; -} - +namespace { template void copy_7D(void* src_raw_ptr, std::vector& src_str, @@ -79,175 +51,7 @@ void copy_7D(void* src_raw_ptr, } } } - -void fill_data_with_broadcast(InferenceEngine::Blob::Ptr& blob, InferenceEngine::Blob::Ptr& values) { - using InferenceEngine::SizeVector; - constexpr size_t MAX_N_DIMS = 7; // Suppose it's enough - - IE_ASSERT(blob->getTensorDesc().getPrecision() == values->getTensorDesc().getPrecision()); - - auto values_dims = values->getTensorDesc().getDims(); - auto blob_dims = blob->getTensorDesc().getDims(); - auto n_dims = blob_dims.size(); - IE_ASSERT(values_dims.size() <= n_dims); - IE_ASSERT(n_dims <= MAX_N_DIMS); - - ov::Shape src_dims(MAX_N_DIMS, 1); - std::copy(values_dims.rbegin(), values_dims.rend(), src_dims.rbegin()); - - ov::Shape dst_dims(MAX_N_DIMS, 1); - std::copy(blob_dims.rbegin(), blob_dims.rend(), dst_dims.rbegin()); - - bool compatible = true; - for (int i = 0; i < MAX_N_DIMS; i++) { - if (src_dims[i] != dst_dims[i] && src_dims[i] != 1) - compatible = false; - } - - IE_ASSERT(compatible); - - auto fill_strides_like_plain = [](ov::Shape dims) { - ov::Shape str(dims.size()); - if (str.empty()) - return str; - else - str.back() = 1; - - // stride[i] = stride[i+1]*d[i+1] - std::transform(dims.rbegin(), dims.rend() - 1, str.rbegin(), str.rbegin() + 1, [](size_t d, size_t s) { - return d * s; - }); - - // zeroing broadcast dimension equal 1 - std::transform(str.begin(), str.end(), dims.begin(), str.begin(), [](size_t s, size_t d) { - return d == 1 ? 0 : s; - }); - - return str; - }; - - SizeVector src_strides = fill_strides_like_plain(src_dims); - SizeVector dst_strides = fill_strides_like_plain(dst_dims); - - auto get_data = [](InferenceEngine::Blob::Ptr& blob) { - auto mem_blob = dynamic_cast(blob.get()); - auto mem = mem_blob->rwmap(); - return mem.as(); - }; - - auto dst_ptr = get_data(blob); - auto src_ptr = get_data(values); - - switch (blob->getTensorDesc().getPrecision()) { - case InferenceEngine::Precision::U64: - case InferenceEngine::Precision::I64: - copy_7D(src_ptr, src_strides, dst_ptr, dst_strides, dst_dims); - break; - case InferenceEngine::Precision::FP32: - case InferenceEngine::Precision::I32: - copy_7D(src_ptr, src_strides, dst_ptr, dst_strides, dst_dims); - break; - case InferenceEngine::Precision::I16: - case InferenceEngine::Precision::U16: - case InferenceEngine::Precision::FP16: - case InferenceEngine::Precision::BF16: - copy_7D(src_ptr, src_strides, dst_ptr, dst_strides, dst_dims); - break; - case InferenceEngine::Precision::U8: - case InferenceEngine::Precision::I8: - copy_7D(src_ptr, src_strides, dst_ptr, dst_strides, dst_dims); - break; - default: - IE_THROW() << "Unsupported precision by fill_data_with_broadcast function"; - } -} - -template -void copy_with_convert(InferenceEngine::Blob::Ptr& src_blob, InferenceEngine::Blob::Ptr& dst_blob) { - using SRC_TYPE = typename InferenceEngine::PrecisionTrait::value_type; - using DST_TYPE = typename InferenceEngine::PrecisionTrait::value_type; - - auto src_lock_m = src_blob->as()->rwmap(); - auto src_ptr = src_lock_m.as(); - auto src_size = src_blob->size(); - - auto dst_lock_m = dst_blob->as()->rwmap(); - auto dst_ptr = dst_lock_m.as(); - - std::copy(src_ptr, src_ptr + src_size, dst_ptr); -} - -InferenceEngine::Blob::Ptr make_with_precision_convert(InferenceEngine::Blob::Ptr& blob, - InferenceEngine::Precision prc) { - IE_ASSERT(isDenseBlob(blob)); - auto td = blob->getTensorDesc(); - td.setPrecision(prc); - - auto new_blob = make_blob_with_precision(td); - new_blob->allocate(); - -#define CASE(_PRC) \ - case InferenceEngine::Precision::_PRC: \ - copy_with_convert(blob, new_blob); \ - break - switch (prc) { - CASE(FP32); - CASE(I64); - CASE(U64); - CASE(I32); - CASE(U32); - CASE(I16); - CASE(U16); - CASE(I8); - CASE(U8); - default: - IE_THROW() << "Unsupported precision case"; - } -#undef CASE - - return new_blob; -} - -void fill_data_with_broadcast(InferenceEngine::Blob::Ptr& blob, size_t axis, std::vector values) { - InferenceEngine::SizeVector value_dims(blob->getTensorDesc().getDims().size() - axis, 1); - value_dims.front() = values.size(); - auto prc = blob->getTensorDesc().getPrecision(); - auto layout = InferenceEngine::TensorDesc::getLayoutByDims(value_dims); - InferenceEngine::TensorDesc value_tdesc(prc, value_dims, layout); - - InferenceEngine::Blob::Ptr values_blob; - if (prc == InferenceEngine::Precision::FP32) { - values_blob = make_blob_with_precision(value_tdesc, values.data()); - } else { - values_blob = make_blob_with_precision(value_tdesc, values.data()); - values_blob = make_with_precision_convert(values_blob, prc); - } - - fill_data_with_broadcast(blob, values_blob); -} - -InferenceEngine::Blob::Ptr make_reshape_view(const InferenceEngine::Blob::Ptr& blob, - InferenceEngine::SizeVector new_shape) { - using InferenceEngine::TensorDesc; - auto new_size = std::accumulate(new_shape.begin(), new_shape.end(), 1, std::multiplies()); - IE_ASSERT(new_size == blob->size()); - - auto orig_mem_blob = dynamic_cast(blob.get()); - auto orig_mem = orig_mem_blob->rwmap(); - auto orig_ptr = orig_mem.as(); - - auto new_tdesc = - TensorDesc(blob->getTensorDesc().getPrecision(), new_shape, TensorDesc::getLayoutByDims(new_shape)); - auto new_blob = make_blob_with_precision(new_tdesc, orig_ptr); - return new_blob; -} - -size_t byte_size(const InferenceEngine::TensorDesc& tdesc) { - auto prc = tdesc.getPrecision(); - auto dims = tdesc.getDims(); - return prc.size() * std::accumulate(std::begin(dims), std::end(dims), (size_t)1, std::multiplies()); -} -OPENVINO_SUPPRESS_DEPRECATED_END +} // namespace namespace { static int randInt(int low, int high) { diff --git a/src/tests/test_utils/common_test_utils/tests/utils_tests.cpp b/src/tests/test_utils/common_test_utils/tests/utils_tests.cpp index 141a1dee3f82ea..9bab74bcb8ea05 100644 --- a/src/tests/test_utils/common_test_utils/tests/utils_tests.cpp +++ b/src/tests/test_utils/common_test_utils/tests/utils_tests.cpp @@ -4,8 +4,8 @@ #include -#include "openvino/util/file_util.hpp" #include "openvino/util/common_util.hpp" +#include "openvino/util/file_util.hpp" using namespace testing; using namespace ov::util; @@ -14,7 +14,6 @@ TEST(UtilsTests, get_directory_returns_root) { ASSERT_EQ(get_directory("/test"), "/"); } - TEST(UtilsTests, filter_lines_by_prefix) { auto lines = "abc\nkkb\nabpp\n"; auto res = filter_lines_by_prefix(lines, "ab"); diff --git a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp deleted file mode 100644 index ed45a216537072..00000000000000 --- a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/blob_utils.hpp +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include -#include -#include -#include -#include - -#include "blob_factory.hpp" -#include "common_test_utils/data_utils.hpp" -#include "common_test_utils/test_constants.hpp" -#include "openvino/runtime/common.hpp" - -namespace FuncTestUtils { -namespace Bf16TestUtils { -inline short reducePrecisionBitwiseS(const float in); -} // namespace Bf16TestUtils - -enum CompareType { - ABS, - REL, - ABS_AND_REL // if absolute and relative differences are too high, an exception is thrown -}; -/** - * @brief Checks values of two blobs according to given algorithm and thresholds. - * In ABS and REL cases thr1 corresponds to the single threshold, - * In ABS_AND_REL case thr1 and thr2 mean absolute and relative threshold - * - * @tparam dType Type of blob data - * @param res Pointer to considered blob - * @param ref Pointer to reference blob - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param compareType Defines an algorithm of comparison - * @param thr1 First threshold of difference - * @param thr2 Second threshold of difference - * @param printData A flag if data printing is demanded - */ -template -inline void compareRawBuffers(const dType* res, - const dType* ref, - size_t resSize, - size_t refSize, - CompareType compareType, - float thr1 = 0.01, - float thr2 = 0.01, - bool printData = false) { - if (printData) { - std::cout << "Reference results: " << std::endl; - for (size_t i = 0; i < refSize; i++) { - std::cout << ref[i] << " "; - } - std::cout << std::endl; - std::cout << "Test results: " << std::endl; - for (size_t i = 0; i < resSize; i++) { - std::cout << res[i] << " "; - } - std::cout << std::endl; - } - - switch (compareType) { - case CompareType::ABS: - for (size_t i = 0; i < refSize; i++) { - float absDiff = std::abs(res[i] - ref[i]); - ASSERT_LE(absDiff, thr1) << "Relative comparison of values ref: " << ref[i] << " and res: " << res[i] - << " , index in blobs: " << i << " failed!"; - } - break; - case CompareType::REL: - for (size_t i = 0; i < refSize; i++) { - float absDiff = std::abs(res[i] - ref[i]); - float relDiff = absDiff / std::max(res[i], ref[i]); - ASSERT_LE(relDiff, thr2) << "Relative comparison of values ref: " << ref[i] << " and res: " << res[i] - << " , index in blobs: " << i << " failed!"; - } - break; - case CompareType::ABS_AND_REL: - for (size_t i = 0; i < refSize; i++) { - float absDiff = std::abs(res[i] - ref[i]); - if (absDiff > thr1) { - float relDiff = absDiff / std::max(res[i], ref[i]); - ASSERT_LE(relDiff, thr2) << "Comparison of values ref: " << ref[i] << " and res: " << res[i] - << " , index in blobs: " << i << " failed!"; - } - } - break; - } -} -/** - * @brief Checks absolute and relative difference of blob values according to given threshold. - * - * @tparam dType Type of blob data - * @param res Pointer to considered blob - * @param ref Pointer to reference blob - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param thr Threshold of difference, absolute and relative simultaneously - * @param printData Flag if data printing is demanded - */ -template -inline void compareRawBuffers(const dType* res, - const dType* ref, - size_t resSize, - size_t refSize, - float thr = 0.01, - bool printData = false) { - compareRawBuffers(res, ref, resSize, refSize, CompareType::ABS_AND_REL, thr, thr, printData); -} -/** - * @brief Checks values of two blobs according to given algorithm and thresholds. - * In ABS and REL cases thr1 corresponds to the single threshold, - * In ABS_AND_REL case thr1 and thr2 mean absolute and relative threshold - * - * @tparam dType Type of blob data - * @param res Vector of considered blob values - * @param ref Vector of reference blob values - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param compareType Defines an algorithm of comparision - * @param thr1 First threshold of difference - * @param thr2 Second threshold of difference - * @param printData A flag if data printing is demanded - */ -template -inline void compareRawBuffers(const std::vector res, - const std::vector ref, - const std::vector& resSizes, - const std::vector& refSizes, - CompareType compareType, - float thr1 = 0.01, - float thr2 = 0.01, - bool printData = false) { - ASSERT_TRUE(res.size() == ref.size()) << "Reference and Results vector have to be same length"; - ASSERT_TRUE(res.size() == resSizes.size()) << "Results vector and elements count vector have to be same length"; - ASSERT_TRUE(ref.size() == refSizes.size()) << "Reference vector and elements count vector have to be same length"; - for (size_t i = 0; i < res.size(); i++) { - if (printData) - std::cout << "BEGIN CHECK BUFFER [" << i << "]" << std::endl; - compareRawBuffers(res[i], ref[i], resSizes[i], refSizes[i], compareType, thr1, thr2, printData); - if (printData) - std::cout << "END CHECK BUFFER [" << i << "]" << std::endl; - } -} -/** - * @brief Checks absolute and relative difference of blob values according to given threshold. - * - * @tparam dType Type of blob data - * @param res Vector of considered blob values - * @param ref Vector of reference blob values - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param thr Threshold of difference, absolute and relative simultaneously - * @param printData A flag if data printing is demanded - */ -template -inline void compareRawBuffers(const std::vector res, - const std::vector ref, - const std::vector& resSizes, - const std::vector& refSizes, - float thr = 0.01, - bool printData = false) { - compareRawBuffers(res, ref, resSizes, refSizes, CompareType::ABS_AND_REL, thr, thr, printData); -} -/** - * @brief Checks values of two blobs according to given algorithm and thresholds. - * In ABS and REL cases thr1 corresponds to the single threshold, - * In ABS_AND_REL case thr1 and thr2 mean absolute and relative threshold - * - * @tparam dType Type of blob data - * @param res Vector of considered blob values - * @param ref Vector of reference blob values - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param compareType Defines an algorithm of comparision - * @param thr1 First threshold of difference - * @param thr2 Second threshold of difference - * @param printData A flag if data printing is demanded - */ -template -inline void compareRawBuffers(const std::vector res, - const std::vector> ref, - const std::vector& resSizes, - const std::vector& refSizes, - CompareType compareType, - float thr1 = 0.01, - float thr2 = 0.01, - bool printData = false) { - ASSERT_TRUE(res.size() == ref.size()) << "Reference and Results vector have to be same length"; - ASSERT_TRUE(res.size() == resSizes.size()) << "Results vector and elements count vector have to be same length"; - ASSERT_TRUE(ref.size() == refSizes.size()) << "Reference vector and elements count vector have to be same length"; - for (size_t i = 0; i < res.size(); i++) { - if (printData) - std::cout << "BEGIN CHECK BUFFER [" << i << "]" << std::endl; - compareRawBuffers(res[i], *ref[i], resSizes[i], refSizes[i], compareType, thr1, thr2, printData); - if (printData) - std::cout << "END CHECK BUFFER [" << i << "]" << std::endl; - } -} -/** - * @brief Checks absolute and relative difference of blob values according to given threshold. - * - * @tparam dType Type of blob data - * @param res Vector of considered blob values - * @param ref Vector of reference blob values - * @param resSize Size of considered blob - * @param refSize Size of reference blob - * @param thr Threshold of difference, absolute and relative simultaneously - * @param printData A flag if data printing is demanded - */ -template -inline void compareRawBuffers(const std::vector res, - const std::vector> ref, - const std::vector& resSizes, - const std::vector& refSizes, - float thr = 0.01, - bool printData = false) { - compareRawBuffers(res, ref, resSizes, refSizes, CompareType::ABS_AND_REL, thr, thr, printData); -} - -inline void GetComparisonThreshold(InferenceEngine::Precision prc, float& absoluteThreshold, float& relativeThreshold) { - switch (prc) { - case InferenceEngine::Precision::FP32: - absoluteThreshold = relativeThreshold = 1e-4f; - break; - case InferenceEngine::Precision::FP16: - absoluteThreshold = relativeThreshold = 1e-2f; - break; - case InferenceEngine::Precision::I16: - case InferenceEngine::Precision::I8: - case InferenceEngine::Precision::U8: - absoluteThreshold = relativeThreshold = 1; - break; - default: - IE_THROW() << "Unhandled precision " << prc << " passed to the GetComparisonThreshold()"; - } -} - -inline float GetComparisonThreshold(InferenceEngine::Precision prc) { - float res; - GetComparisonThreshold(prc, res, res); - return res; -} - -// Copy from net_pass.h -template -inline void convertArrayPrecision(typename InferenceEngine::PrecisionTrait::value_type* dst, - const typename InferenceEngine::PrecisionTrait::value_type* src, - size_t nelem) { - using dst_type = typename InferenceEngine::PrecisionTrait::value_type; - - for (size_t i = 0; i < nelem; i++) { - dst[i] = static_cast(src[i]); - } -} - -template <> -inline void convertArrayPrecision(float* dst, - const short* src, - size_t nelem) { - auto srcBf16 = reinterpret_cast(src); - for (size_t i = 0; i < nelem; i++) { - dst[i] = static_cast(srcBf16[i]); - } -} - -template -inline InferenceEngine::Blob::Ptr convertBlobPrecision(const InferenceEngine::Blob::Ptr& blob) { - using from_d_type = typename InferenceEngine::PrecisionTrait::value_type; - using to_d_type = typename InferenceEngine::PrecisionTrait::value_type; - - auto tensor_desc = blob->getTensorDesc(); - InferenceEngine::Blob::Ptr new_blob = InferenceEngine::make_shared_blob( - InferenceEngine::TensorDesc{PREC_TO, tensor_desc.getDims(), tensor_desc.getLayout()}); - new_blob->allocate(); - auto target = new_blob->buffer().as(); - auto source = blob->buffer().as(); - convertArrayPrecision(target, source, blob->size()); - return new_blob; -} - -inline InferenceEngine::Blob::Ptr createAndFillBlobFloatNormalDistribution(const InferenceEngine::TensorDesc& td, - const float mean, - const float stddev, - const int32_t seed = 1) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - blob->allocate(); - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_data_normal_random_float(blob, mean, stddev, seed); \ - break; - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::BIN) - CASE(InferenceEngine::Precision::I32) - CASE(InferenceEngine::Precision::BOOL) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -inline InferenceEngine::Blob::Ptr createAndFillBlobFloat(const InferenceEngine::TensorDesc& td, - const uint32_t range = 10, - const int32_t start_from = 0, - const int32_t resolution = 1, - const int32_t seed = 1) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - - blob->allocate(); - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_data_random_float(blob, range, start_from, resolution, seed); \ - break; - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::BIN) - CASE(InferenceEngine::Precision::I32) - CASE(InferenceEngine::Precision::BOOL) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -template -inline InferenceEngine::Blob::Ptr createAndFillBlobWithFloatArray(const InferenceEngine::TensorDesc& td, - const T values[], - const int size) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - blob->allocate(); - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_data_float_array(blob, values, size); \ - break; - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::BIN) - CASE(InferenceEngine::Precision::I32) - CASE(InferenceEngine::Precision::BOOL) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -inline InferenceEngine::Blob::Ptr createAndFillBlob(const InferenceEngine::TensorDesc& td, - const uint32_t range = 10, - const int32_t start_from = 0, - const int32_t resolution = 1, - const int seed = 1) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - blob->allocate(); - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_data_random(blob, range, start_from, resolution, seed); \ - break; - CASE(InferenceEngine::Precision::FP64) - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::BF16) - CASE(InferenceEngine::Precision::U4) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U32) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::U64) - CASE(InferenceEngine::Precision::I4) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I32) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::BIN) - CASE(InferenceEngine::Precision::BOOL) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -inline InferenceEngine::Blob::Ptr createAndFillBlobConsistently(const InferenceEngine::TensorDesc& td, - const uint32_t range, - const int32_t start_from, - const int32_t resolution) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - blob->allocate(); - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_data_consistently(blob, range, start_from, resolution); \ - break; - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::BIN) - CASE(InferenceEngine::Precision::I32) - CASE(InferenceEngine::Precision::BOOL) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -inline InferenceEngine::Blob::Ptr createAndFillBlobUniqueSequence(const InferenceEngine::TensorDesc& td, - const int32_t start_from = 0, - const int32_t resolution = 1, - const int32_t seed = 1) { - InferenceEngine::Blob::Ptr blob = make_blob_with_precision(td); - blob->allocate(); - auto shape = td.getDims(); - auto range = std::accumulate(begin(shape), end(shape), uint64_t(1), std::multiplies()) * 2; - switch (td.getPrecision()) { -#define CASE(X) \ - case X: \ - ov::test::utils::fill_random_unique_sequence(blob, range, start_from, resolution, seed); \ - break; - CASE(InferenceEngine::Precision::FP32) - CASE(InferenceEngine::Precision::FP16) - CASE(InferenceEngine::Precision::U8) - CASE(InferenceEngine::Precision::U16) - CASE(InferenceEngine::Precision::I8) - CASE(InferenceEngine::Precision::I16) - CASE(InferenceEngine::Precision::I64) - CASE(InferenceEngine::Precision::I32) -#undef CASE - default: - IE_THROW() << "Wrong precision specified: " << td.getPrecision().name(); - } - return blob; -} - -template -inline void fillInputsBySinValues(dType* data, size_t size) { - if (std::is_same::value) { - for (size_t i = 0; i < size; i++) { - data[i] = sin(static_cast(i)); - } - } else if (std::is_same::value) { - for (size_t i = 0; i < size; i++) { - data[i] = FuncTestUtils::Bf16TestUtils::reducePrecisionBitwiseS(sin(static_cast(i))); - } - } -} - -inline int fillInputsBySinValues(InferenceEngine::Blob::Ptr blob) { - InferenceEngine::MemoryBlob::Ptr mblob = InferenceEngine::as(blob); - if (!mblob) { - return -1; - } - if (mblob->getTensorDesc().getPrecision() != InferenceEngine::Precision::FP32) { - return -2; - } - auto lm = mblob->rwmap(); - fillInputsBySinValues(lm.as(), mblob->size()); - return 0; -} - -namespace Bf16TestUtils { - -#if defined __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wstrict-aliasing" -# pragma GCC diagnostic ignored "-Wuninitialized" -#endif - -inline float reducePrecisionBitwise(const float in) { - float f = in; - int* i = reinterpret_cast(&f); - int t2 = *i & 0xFFFF0000; - float ft1; - memcpy(&ft1, &t2, sizeof(float)); - if ((*i & 0x8000) && (*i & 0x007F0000) != 0x007F0000) { - t2 += 0x10000; - memcpy(&ft1, &t2, sizeof(float)); - } - return ft1; -} - -inline short reducePrecisionBitwiseS(const float in) { - float f = reducePrecisionBitwise(in); - int intf = *reinterpret_cast(&f); - intf = intf >> 16; - short s = intf; - return s; -} - -#if defined __GNUC__ -# pragma GCC diagnostic pop -#endif - -} // namespace Bf16TestUtils - -enum class BlobType { - Memory, - Compound, - Remote, -}; - -inline std::ostream& operator<<(std::ostream& os, BlobType type) { - switch (type) { - case BlobType::Memory: - return os << "Memory"; - case BlobType::Remote: - return os << "Remote"; - default: - IE_THROW() << "Not supported blob type"; - } -} - -inline bool checkLayout(InferenceEngine::Layout layout, const std::vector& inputShapes) { - bool check = false; - switch (layout) { - case InferenceEngine::Layout::SCALAR: - check = inputShapes.size() == 0; - break; - case InferenceEngine::Layout::C: - check = 1 == inputShapes.size(); - break; - case InferenceEngine::Layout::BLOCKED: - case InferenceEngine::Layout::ANY: - check = true; - break; - case InferenceEngine::Layout::GOIDHW: - check = 6 == inputShapes.size(); - break; - case InferenceEngine::Layout::NCDHW: - case InferenceEngine::Layout::NDHWC: - case InferenceEngine::Layout::OIDHW: - case InferenceEngine::Layout::GOIHW: - check = 5 == inputShapes.size(); - break; - case InferenceEngine::Layout::OIHW: - case InferenceEngine::Layout::NCHW: - case InferenceEngine::Layout::NHWC: - check = 4 == inputShapes.size(); - break; - case InferenceEngine::Layout::CHW: - case InferenceEngine::Layout::HWC: - check = 3 == inputShapes.size(); - break; - case InferenceEngine::Layout::CN: - case InferenceEngine::Layout::NC: - case InferenceEngine::Layout::HW: - check = 2 == inputShapes.size(); - break; - default: - break; - } - return check; -} -} // namespace FuncTestUtils diff --git a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/plugin_cache.hpp b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/plugin_cache.hpp deleted file mode 100644 index 20ebb92ed0d10e..00000000000000 --- a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/plugin_cache.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include - -namespace InferenceEngine { - -class Core; - -} // namespace InferenceEngine - -class PluginCache { -public: - std::shared_ptr ie(const std::string& deviceToCheck = std::string()); - - static PluginCache& get(); - - void reset(); - - PluginCache(const PluginCache&) = delete; - PluginCache& operator=(const PluginCache&) = delete; - -private: - PluginCache(); - ~PluginCache() = default; - - std::mutex g_mtx; - std::shared_ptr ie_core; -}; diff --git a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp b/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp deleted file mode 100644 index 38ba8b8ea515f3..00000000000000 --- a/src/tests/test_utils/functional_test_utils/include/functional_test_utils/precision_utils.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include "ie_precision.hpp" -#include "openvino/core/type/element_type.hpp" - -namespace FuncTestUtils { -namespace PrecisionUtils { - -// Copied from inference-engine/src/inference_engine/src/ie_ngraph_utils.hpp -inline ::ov::element::Type convertIE2nGraphPrc(const InferenceEngine::Precision& precision) { - InferenceEngine::Precision::ePrecision pType = precision; - switch (pType) { - case InferenceEngine::Precision::UNSPECIFIED: - return ::ov::element::Type(::ov::element::Type_t::undefined); - case InferenceEngine::Precision::FP64: - return ::ov::element::Type(::ov::element::Type_t::f64); - case InferenceEngine::Precision::FP32: - return ::ov::element::Type(::ov::element::Type_t::f32); - case InferenceEngine::Precision::FP16: - return ::ov::element::Type(::ov::element::Type_t::f16); - case InferenceEngine::Precision::BF16: - return ::ov::element::Type(::ov::element::Type_t::bf16); - case InferenceEngine::Precision::U4: - return ::ov::element::Type(::ov::element::Type_t::u4); - case InferenceEngine::Precision::I4: - return ::ov::element::Type(::ov::element::Type_t::i4); - case InferenceEngine::Precision::U8: - return ::ov::element::Type(::ov::element::Type_t::u8); - case InferenceEngine::Precision::I8: - return ::ov::element::Type(::ov::element::Type_t::i8); - case InferenceEngine::Precision::U16: - return ::ov::element::Type(::ov::element::Type_t::u16); - case InferenceEngine::Precision::I16: - return ::ov::element::Type(::ov::element::Type_t::i16); - case InferenceEngine::Precision::U32: - return ::ov::element::Type(::ov::element::Type_t::u32); - case InferenceEngine::Precision::I32: - return ::ov::element::Type(::ov::element::Type_t::i32); - case InferenceEngine::Precision::I64: - return ::ov::element::Type(::ov::element::Type_t::i64); - case InferenceEngine::Precision::U64: - return ::ov::element::Type(::ov::element::Type_t::u64); - case InferenceEngine::Precision::BOOL: - return ::ov::element::Type(::ov::element::Type_t::boolean); - case InferenceEngine::Precision::BIN: - return ::ov::element::Type(::ov::element::Type_t::u1); - case InferenceEngine::Precision::Q78: - case InferenceEngine::Precision::MIXED: - case InferenceEngine::Precision::CUSTOM: - default: - IE_THROW() << "Incorrect precision!"; - } -} - -} // namespace PrecisionUtils -} // namespace FuncTestUtils \ No newline at end of file diff --git a/src/tests/test_utils/functional_test_utils/src/plugin_cache.cpp b/src/tests/test_utils/functional_test_utils/src/plugin_cache.cpp deleted file mode 100644 index e809f9d260ca89..00000000000000 --- a/src/tests/test_utils/functional_test_utils/src/plugin_cache.cpp +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "functional_test_utils/plugin_cache.hpp" - -#include - -#include -#include - -#include "common_test_utils/file_utils.hpp" -#include "common_test_utils/test_constants.hpp" -#include "functional_test_utils/ov_plugin_cache.hpp" -#include "ie_core.hpp" -#include "openvino/util/file_util.hpp" - -namespace { -class TestListener : public testing::EmptyTestEventListener { -public: - void OnTestEnd(const testing::TestInfo& testInfo) override { - if (auto testResult = testInfo.result()) { - if (testResult->Failed()) { - PluginCache::get().reset(); - } - } - } -}; -} // namespace - -PluginCache& PluginCache::get() { - static PluginCache instance; - return instance; -} - -std::shared_ptr PluginCache::ie(const std::string& deviceToCheck) { - std::lock_guard lock(g_mtx); - if (std::getenv("DISABLE_PLUGIN_CACHE") != nullptr) { -#ifndef NDEBUG - std::cout << "'DISABLE_PLUGIN_CACHE' environment variable is set. New Core object will be created!" - << std::endl; -#endif - return std::make_shared(); - } -#ifndef NDEBUG - std::cout << "Access PluginCache ie core. IE Core use count: " << ie_core.use_count() << std::endl; -#endif - - if (!ie_core) { -#ifndef NDEBUG - std::cout << "Created ie core." << std::endl; -#endif - ie_core = std::make_shared(); - } - assert(0 != ie_core.use_count()); - - // register template plugin if it is needed - try { - std::string pluginName = "openvino_template_plugin"; - pluginName += OV_BUILD_POSTFIX; - ie_core->RegisterPlugin( - ov::util::make_plugin_library_name(ov::test::utils::getExecutableDirectory(), pluginName), - "TEMPLATE"); - } catch (...) { - } - - if (!deviceToCheck.empty()) { - std::vector metrics; - if (deviceToCheck.find(':') != std::string::npos) { - std::string realDevice = deviceToCheck.substr(0, deviceToCheck.find(':')); - metrics = {ie_core->GetMetric(realDevice, ov::supported_properties.name()).as()}; - } else { - metrics = {ie_core->GetMetric(deviceToCheck, ov::supported_properties.name()).as()}; - } - if (std::find(metrics.begin(), metrics.end(), ov::supported_properties.name()) != metrics.end()) { - auto availableDevices = - ie_core->GetMetric(deviceToCheck, ov::supported_properties.name()).as>(); - - if (availableDevices.empty()) { - std::cerr << "No available devices for " << deviceToCheck << std::endl; - std::exit(EXIT_FAILURE); - } - -#ifndef NDEBUG - std::cout << "Available devices for " << deviceToCheck << ":" << std::endl; - - for (const auto& device : availableDevices) { - std::cout << " " << device << std::endl; - } -#endif - } - } - return ie_core; -} - -void PluginCache::reset() { - std::lock_guard lock(g_mtx); - -#ifndef NDEBUG - std::cout << "Reset PluginCache. IE Core use count: " << ie_core.use_count() << std::endl; -#endif - - ie_core.reset(); -} - -PluginCache::PluginCache() { - auto& listeners = testing::UnitTest::GetInstance()->listeners(); - listeners.Append(new TestListener); -} diff --git a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp index a528596a468884..ae619f66f2a2a4 100644 --- a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp +++ b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp @@ -12,7 +12,6 @@ #include #include -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "description_buffer.hpp" #include "openvino/core/except.hpp" #include "openvino/runtime/common.hpp" diff --git a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.hpp b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.hpp index 505eeca3a32ee0..f06422af2a46a2 100644 --- a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.hpp +++ b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.hpp @@ -9,10 +9,6 @@ #include "openvino/runtime/iplugin.hpp" -namespace InferenceEngine { -class IInferencePlugin; -} - class MockPlugin : public ov::IPlugin { std::shared_ptr m_plugin; void set_parameters_if_need() const; From bf91804b2b439d268db07bc7b62a588b63a4c353 Mon Sep 17 00:00:00 2001 From: Wilson Seok Date: Wed, 7 Feb 2024 17:40:06 +0900 Subject: [PATCH 27/55] [GPU] get layout from prim_inst output layout instead of cldnn::memory (#22673) ### Details: - Get layout from prim_inst output layout instead of cldnn::memory to avoid getting wrong shape which is changed by faked alignment in fc. ### Tickets: - 114920 --- src/plugins/intel_gpu/src/graph/loop.cpp | 38 +++++++++++------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/loop.cpp b/src/plugins/intel_gpu/src/graph/loop.cpp index 36ca523093f595..159023105d5194 100644 --- a/src/plugins/intel_gpu/src/graph/loop.cpp +++ b/src/plugins/intel_gpu/src/graph/loop.cpp @@ -357,63 +357,61 @@ event::ptr loop_inst::set_output_memory(memory::ptr mem, bool check, size_t idx) } loop_inst::concatenated_memory_mapping::ptr loop_inst::create_concat_memory_map(const cldnn::loop::io_primitive_map& io_prim_map, - memory::ptr mem_ptr, + memory::ptr extern_mem_ptr, const int64_t num_iterations) { OPENVINO_ASSERT(io_prim_map.axis >= 0, "axis should not be negative"); const auto& external_id = io_prim_map.external_id; const auto& internal_id = io_prim_map.internal_id; auto& engine = body_network->get_engine(); auto& stream = body_network->get_stream(); - auto prim = body_network->get_primitive(internal_id.pid); + auto intern_prim = body_network->get_primitive(internal_id.pid); + auto extern_prim = get_network().get_primitive(external_id.pid); std::vector sliced_mems; // if memory is nullptr, that means memory is not allocated yet because current network is dynamic shape model. // In dynamic model, we can't calculate num_element_iteration, start, and sliced_layout. // will recalculate that parameters in backedge preprocessing map after first execution. - if (mem_ptr != nullptr) { - layout sliced_layout = prim->get_output_layout(internal_id.idx); - auto out_mem_ptr = prim->output_memory_ptr(internal_id.idx); - if (out_mem_ptr != nullptr) { - sliced_layout = out_mem_ptr->get_layout(); - } else { - // if inner body prim has no output memory because it has dynamic shape, - // calculate inner body prim layout using concat_mem's layout. + if (extern_mem_ptr != nullptr) { + layout sliced_layout = intern_prim->get_output_layout(internal_id.idx); + auto inter_mem_ptr = intern_prim->output_memory_ptr(internal_id.idx); + if (inter_mem_ptr == nullptr) { + // if inner body intern_prim has no output memory because it has dynamic shape, + // calculate inner body intern_prim layout using concat_mem's layout. auto updated_sliced_layout = sliced_layout.get_partial_shape(); OPENVINO_ASSERT(updated_sliced_layout[io_prim_map.axis].is_static() || num_iterations > 0, "Not allowed dynamic dimension for axis when num_iteraiont is negative"); - auto concat_mem_pshape = mem_ptr->get_layout().get_partial_shape(); - const auto shape_size = concat_mem_pshape.size(); + auto concat_pshape = extern_prim->get_output_layout().get_partial_shape(); + const auto shape_size = concat_pshape.size(); for (size_t i = 0; i < shape_size; i++) { if (updated_sliced_layout[i].is_dynamic()) { - updated_sliced_layout[i] = concat_mem_pshape[i]; + updated_sliced_layout[i] = concat_pshape[i]; } } - GPU_DEBUG_LOG << "output pshape for [" << prim->id() << "] is changed from " + GPU_DEBUG_LOG << "output pshape for [" << intern_prim->id() << "] is changed from " << sliced_layout.get_partial_shape().to_string() << " to " << updated_sliced_layout.to_string() << std::endl; sliced_layout.set_partial_shape(updated_sliced_layout); - out_mem_ptr = engine.allocate_memory(sliced_layout); - prim->set_output_layout(sliced_layout, internal_id.idx); + inter_mem_ptr = engine.allocate_memory(sliced_layout); + intern_prim->set_output_layout(sliced_layout, internal_id.idx); } // When num_iterations is -1, allocate first sliced_mem and allocate sliced memory if additional sliced mem is required if (num_iterations < 0) { - sliced_mems.push_back(out_mem_ptr); + sliced_mems.push_back(inter_mem_ptr); } else { sliced_mems.reserve(num_iterations); - sliced_mems.push_back(out_mem_ptr); + sliced_mems.push_back(inter_mem_ptr); for (int j=1; j < num_iterations; ++j) { memory::ptr sliced_mem = engine.allocate_memory(sliced_layout); sliced_mems.push_back(sliced_mem); } } } - auto sliced_data_prim = body_network->get_primitive(internal_id.pid); auto concat_data_prim = get_network().get_primitive(external_id.pid); auto concat_data_id = external_id; - return std::make_shared(mem_ptr, sliced_mems, stream, engine, + return std::make_shared(extern_mem_ptr, sliced_mems, stream, engine, concat_data_prim, sliced_data_prim, io_prim_map); } From bdb1d66821c4c4f572647427a49d0eeb591bab69 Mon Sep 17 00:00:00 2001 From: Maksim Kutakov Date: Wed, 7 Feb 2024 09:55:16 +0100 Subject: [PATCH 28/55] [CPU] Fix reading wrong data in the PriorBoxClustered shape infer check (#22681) ### Details: Instead of reading from the input memory, the `PriorBoxClustered::needShapeInfer()` used the output memory pointer to read `[height, width]`. This led to reading uninitialized data, causing a variety of sporadic SL tests failures ### Tickets: - 131476 - 130078 - 129659 - 125463 --- src/plugins/intel_cpu/src/nodes/priorbox_clustered.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/priorbox_clustered.cpp b/src/plugins/intel_cpu/src/nodes/priorbox_clustered.cpp index 857a2ed9e37441..cbb7d3eaae14d9 100644 --- a/src/plugins/intel_cpu/src/nodes/priorbox_clustered.cpp +++ b/src/plugins/intel_cpu/src/nodes/priorbox_clustered.cpp @@ -62,13 +62,13 @@ bool PriorBoxClustered::needShapeInfer() const { return true; } - const auto& outputShape = memory->getShape().getStaticDims(); - const int* in_data = memory->getDataAs(); + const auto& output_shape = memory->getShape().getStaticDims(); + const int* in_data = getSrcDataAtPortAs(0); const int h = in_data[0]; const int w = in_data[1]; const auto output = static_cast(4 * h * w * number_of_priors); - return outputShape[1] != output; + return output_shape[1] != output; } bool PriorBoxClustered::needPrepareParams() const { From eea8bf3ca1d5a32b43658f44477aad0281104b1a Mon Sep 17 00:00:00 2001 From: Maksim Kutakov Date: Wed, 7 Feb 2024 10:10:18 +0100 Subject: [PATCH 29/55] [CPU] Disable ExportImportTest for AMX platforms (#22685) ### Details: Disable the sporadically failing `ExportImportTest` test for AMX platforms. ### Tickets: - 131475 --- .../tests/functional/custom/behavior/export_import.cpp | 2 ++ .../functional/shared_tests_instances/skip_tests_config.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/intel_cpu/tests/functional/custom/behavior/export_import.cpp b/src/plugins/intel_cpu/tests/functional/custom/behavior/export_import.cpp index c9c548a852a43f..3deaa0dfebe3e6 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/behavior/export_import.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/behavior/export_import.cpp @@ -7,6 +7,7 @@ #include "common_test_utils/test_common.hpp" #include "common_test_utils/node_builders/eltwise.hpp" #include "common_test_utils/node_builders/constant.hpp" +#include "functional_test_utils/skip_tests_config.hpp" #include @@ -33,6 +34,7 @@ std::shared_ptr MakeMatMulModel() { } TEST_P(ExportOptimalNumStreams, OptimalNumStreams) { + SKIP_IF_CURRENT_TEST_IS_DISABLED(); auto original_model = MakeMatMulModel(); ov::Core core; std::string device_name; diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp index 08805d4e586c51..4822b3d6a23fff 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/skip_tests_config.cpp @@ -373,6 +373,8 @@ std::vector disabledTestPatterns() { retVector.emplace_back(R"(smoke_MM_Brgemm_Amx_.*/MatMulLayerCPUTest.*TS=\(\(55\.12\)\).*bf16.*_primitive=brgemm_avx512_amx.*)"); // Issue: 130471 retVector.emplace_back(R"(smoke_JIT_AVX512_DW_GroupConv/GroupConvolutionLayerCPUTest.*inFmts=nCdhw16c.*INFERENCE_PRECISION_HINT=bf16.*)"); + // Issue: 131475 + retVector.emplace_back(R"(smoke_ExportImportTest/ExportOptimalNumStreams.OptimalNumStreams/.*)"); } if (ov::with_cpu_x86_avx512_core_fp16()) { From 27919e69a267116bff8b532a52ebf50328730bb4 Mon Sep 17 00:00:00 2001 From: Mateusz Tabaka Date: Wed, 7 Feb 2024 11:11:28 +0100 Subject: [PATCH 30/55] Fuse Loop with LSTMCell to LSTMSequence (#22541) Ticket: CVS-129099, CVS-125605, CVS-123630 --------- Co-authored-by: Ivan Tikhonov --- .../convert_ti_to_sequences.hpp | 35 + .../convert_ti_to_sequences.cpp | 842 +++++++++++++++++- .../convert_ti_to_sequences_test.cpp | 463 ++++++++++ .../transformation_pipeline.cpp | 17 + .../src/plugin/transformations_pipeline.cpp | 12 + 5 files changed, 1368 insertions(+), 1 deletion(-) diff --git a/src/common/transformations/include/transformations/op_conversions/convert_ti_to_sequences.hpp b/src/common/transformations/include/transformations/op_conversions/convert_ti_to_sequences.hpp index 81ec7e98a53193..172dcdf657d950 100644 --- a/src/common/transformations/include/transformations/op_conversions/convert_ti_to_sequences.hpp +++ b/src/common/transformations/include/transformations/op_conversions/convert_ti_to_sequences.hpp @@ -18,6 +18,11 @@ class TRANSFORMATIONS_API ConvertTensorIteratorToRNNSequence; class TRANSFORMATIONS_API ConvertTensorIteratorToGRUSequence; class TRANSFORMATIONS_API ConvertTensorIteratorToSequence; +class TRANSFORMATIONS_API ConvertLoopToLSTMSequence; +class TRANSFORMATIONS_API FuseReverseLSTMSequence; + +class TRANSFORMATIONS_API FuseLSTMSequencesToBidirectionalLSTMSequence; + } // namespace pass } // namespace ov @@ -62,3 +67,33 @@ class ov::pass::ConvertTensorIteratorToSequence : public GraphRewrite { OPENVINO_RTTI("ConvertTensorIteratorToSequence", "0"); ConvertTensorIteratorToSequence(); }; + +/** + * @ingroup ie_transformation_common_api + * @brief Replaces Loop with LSTMCell inside to LSTMSequence + */ +class ov::pass::ConvertLoopToLSTMSequence : public ov::pass::MatcherPass { +public: + OPENVINO_RTTI("ConvertLoopToLSTMSequence", "0"); + ConvertLoopToLSTMSequence(); +}; + +/** + * @ingroup ie_transformation_common_api + * @brief Fuses ReverseSequence->LSTM->ReverseSequence to LSTMSequence with REVERSE direction flag + */ +class ov::pass::FuseReverseLSTMSequence : public ov::pass::MatcherPass { +public: + OPENVINO_RTTI("FuseReverseLSTMSequence", "0"); + FuseReverseLSTMSequence(); +}; + +/** + * @ingroup ie_transformation_common_api + * @brief Replaces two LSTMSequences to one bidirectional LSTMSequence + */ +class ov::pass::FuseLSTMSequencesToBidirectionalLSTMSequence : public ov::pass::MatcherPass { +public: + OPENVINO_RTTI("FuseLSTMSequencesToBidirectionalLSTMSequence", "0"); + FuseLSTMSequencesToBidirectionalLSTMSequence(); +}; diff --git a/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp b/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp index ced9d28880f272..669f0e6072f1f8 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp @@ -11,11 +11,15 @@ #include "openvino/core/graph_util.hpp" #include "openvino/core/node.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/op/add.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/gather.hpp" #include "openvino/op/gru_cell.hpp" #include "openvino/op/gru_sequence.hpp" +#include "openvino/op/less.hpp" +#include "openvino/op/logical_and.hpp" +#include "openvino/op/loop.hpp" #include "openvino/op/lstm_cell.hpp" #include "openvino/op/lstm_sequence.hpp" #include "openvino/op/parameter.hpp" @@ -23,14 +27,16 @@ #include "openvino/op/result.hpp" #include "openvino/op/rnn_cell.hpp" #include "openvino/op/rnn_sequence.hpp" +#include "openvino/op/scatter_nd_update.hpp" #include "openvino/op/shape_of.hpp" -#include "openvino/op/squeeze.hpp" #include "openvino/op/tensor_iterator.hpp" #include "openvino/op/transpose.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/pass/manager.hpp" +#include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" +#include "validation_util.hpp" namespace { bool convertTensorIteratorToSequence(const std::shared_ptr& ti, @@ -412,8 +418,842 @@ ov::pass::ConvertTensorIteratorToGRUSequence::ConvertTensorIteratorToGRUSequence register_matcher(m, callback); } +static bool get_scalar_constant_value(const ov::Output& node, int64_t& output_value) { + auto constant = ov::as_type(node.get_node()); + if (!constant) + return false; + if (ov::shape_size(constant->get_shape()) != 1) + return false; + const auto& type = constant->get_output_element_type(0); + if (type != ov::element::i32 && type != ov::element::i64) + return false; + output_value = constant->cast_vector()[0]; + return true; +} + +// clang-format off +/* + + Following subgraph in Loop is fused into LSTMSequence + + + +------------------------------+ + | X | +----------------+ +------+ + | (invariant) | | sequence index | | axis | + | [seq_len, batch, input_size] | | [] | | {0} | + +--------------+---------------+ +--------+-------+ +--+---+ + | | | + | +----------------- + | + +---+ | | + | | +---------------------------+ + | | | + | | | + v v v +----------------------+ +----------------------+ + +---+------+------+---+ | H | | C | + | Gather | | (merged with H_out) | | (merged with C_out) | +-----+ +-----+ +-----+ + | [batch, input_size] | | [batch, hidden_size] | | [batch, hidden_size] | | W | | R | | B | + +----------+----------+ +----------+-----------+ +----------+-----------+ +--+--+ +--+--+ +--+--+ + | | | | | | + | | | | | | + | | | | | | + | | | | | | + | | | | | | + | | | | | | + | | +---------------+ | | | + | | | | | | + | | | | | | + | | | +------------------------------+ | | + | | | | | | + | | | | | | + | +------+ | | +------------------------------------+ | + | | | | | | + +----------------------------+ | | | | +------------------------------------------+ + | | | | | | + +---+ v v v v v v + | Y | +---+----+----+----+----+----+---+ + +---+ | LSTMCell | + | +--------+-------------------+---+ + | | | + v | | + +-----+-----+ +----------+---------------+ | + | Broadcast | | | +---------------------+ + +-----+-----+ | | | + | v v v + | +----------------+ +------------+------------+ +---------+------------+ +--------+--------+ + | | sequence index | | Unsqueeze | | H_out | | C_out | + | +--------+-------+ | [batch, 1, hidden_size] | | (merged with H) | | (merged with C) | + | | +------------+------------+ | [batch, hidden_size] | +-----------------+ + | | | +----------------------+ + | | | + | | | + | | | +------+ + | | | | axis | + | | | | {0} | + | | +----------------+ +--+---+ + | | | | + | | | | + | +---+ | +---------------------+ + | | | | + | | | | + +---------------+ | | | + | | | | + v v v v + +---+----+----+----+---+ + | ScatterUpdate | + | (loop body output) | + +----------------------+ + +*/ +// clang-format on + +ov::pass::ConvertLoopToLSTMSequence::ConvertLoopToLSTMSequence() { + MATCHER_SCOPE(ConvertLoopToLSTMSequence); + auto input_label = pattern::any_input(pattern::rank_equals(3)); + auto input_transpose_const_label = pattern::wrap_type(); + auto input_transpose_label = + pattern::wrap_type({input_label, input_transpose_const_label}, + pattern::rank_equals(3)); + auto scatter_indexes_label = pattern::wrap_type(); + auto scatter_update_label = std::make_shared(OutputVector{input_transpose_label, input_label}); + auto scatter_label = pattern::wrap_type( + {pattern::any_input(), scatter_indexes_label, scatter_update_label}); + auto trip_count_label = pattern::wrap_type(); + auto cond_label = pattern::wrap_type(); + auto loop_label = pattern::wrap_type({trip_count_label, + cond_label, + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + scatter_label}); + auto output_transpose_const_label = pattern::wrap_type(); + auto output_transpose_label = pattern::wrap_type({loop_label, output_transpose_const_label}); + + // Loop body pattern: + auto sequence_index_label = pattern::any_input(pattern::rank_equals(0)); + auto iteration_counter_label = pattern::any_input(); + auto iteration_counter_step_label = pattern::wrap_type(); + auto iteration_counter_incremented_label = + pattern::wrap_type({iteration_counter_label, iteration_counter_step_label}); + auto iteration_counter_limit_label = pattern::wrap_type(); + auto iteration_counter_less_than_limit_label = + pattern::wrap_type({iteration_counter_incremented_label, iteration_counter_limit_label}); + auto sequence_index_step_label = pattern::wrap_type(); + auto sequence_index_incremented_label = + pattern::wrap_type({sequence_index_label, sequence_index_step_label}); + auto sequence_index_limit_label = pattern::wrap_type(); + auto sequence_index_less_than_limit_label = + pattern::wrap_type({sequence_index_incremented_label, sequence_index_limit_label}); + auto and_label = pattern::wrap_type( + {iteration_counter_less_than_limit_label, sequence_index_less_than_limit_label}); + auto loop_condition_label = pattern::wrap_type({and_label}); + + auto X_body_label = pattern::any_input(pattern::rank_equals(3)); + auto C_body_label = pattern::any_input(pattern::rank_equals(2)); + auto H_body_label = pattern::any_input(pattern::rank_equals(2)); + auto gather_axis_label = pattern::wrap_type(); + auto sequence_index_new_shape_label = pattern::wrap_type(); + auto sequence_index_reshaped_label = + pattern::wrap_type({sequence_index_label, sequence_index_new_shape_label}); + auto sequence_index_or_label = + std::make_shared(OutputVector{sequence_index_label, sequence_index_reshaped_label}); + auto gather_body_label = + pattern::wrap_type({X_body_label, sequence_index_or_label, gather_axis_label}, + pattern::rank_equals(2)); + auto W_label = pattern::any_input(); + auto R_label = pattern::any_input(); + auto B_label = pattern::wrap_type(); + auto lstm_cell_label = pattern::wrap_type( + {gather_body_label, H_body_label, C_body_label, W_label, R_label, B_label}); + auto scatter_index_new_shape_label = pattern::wrap_type(); + auto scatter_index_body_label = + pattern::wrap_type({sequence_index_label, scatter_index_new_shape_label}); + auto updates_label = pattern::wrap_type( + {lstm_cell_label, pattern::wrap_type()}); + auto scatter_axis_label = pattern::wrap_type(); + auto scatter_body_label = pattern::wrap_type( + {pattern::any_input(), scatter_index_body_label, updates_label, scatter_axis_label}, + pattern::rank_equals(3)); + auto loop_output_label = pattern::wrap_type({scatter_body_label}); + + matcher_pass_callback callback = [=](pattern::Matcher& m) { + const auto& pattern_map = m.get_pattern_value_map(); + auto match_root = m.get_match_root(); + + const auto loop = ov::as_type_ptr(pattern_map.at(loop_label).get_node_shared_ptr()); + const auto& output_descs = loop->get_output_descriptions(); + if (output_descs.size() != 1) + return false; + const auto body_output_desc = + std::dynamic_pointer_cast(output_descs[0]); + if (!body_output_desc || body_output_desc->m_iteration != -1) + return false; + + ov::pass::pattern::Matcher loop_condition_matcher(loop_condition_label); + ov::pass::pattern::Matcher loop_output_matcher(loop_output_label); + + auto body = loop->get_function(); + const auto& body_parameters = body->get_parameters(); + const auto& body_results = body->get_results(); + const auto special_body_ports = loop->get_special_body_ports(); + + if (!loop_condition_matcher.match(body_results[special_body_ports.body_condition_output_idx]->output(0))) + return false; + if (!loop_output_matcher.match(body_results[body_output_desc->m_body_value_index]->output(0))) + return false; + + const auto& loop_condition_map = loop_condition_matcher.get_pattern_value_map(); + const auto& loop_output_map = loop_output_matcher.get_pattern_value_map(); + + int64_t iteration_counter_step = -1; + if (!get_scalar_constant_value(loop_condition_map.at(iteration_counter_step_label), iteration_counter_step) || + iteration_counter_step != 1) + return false; + int64_t sequence_index_step = -1; + if (!get_scalar_constant_value(loop_condition_map.at(sequence_index_step_label), sequence_index_step) || + sequence_index_step != 1) + return false; + + int64_t iteration_counter_limit = -1; + if (!get_scalar_constant_value(loop_condition_map.at(iteration_counter_limit_label), iteration_counter_limit)) + return false; + int64_t sequence_index_limit = -1; + if (!get_scalar_constant_value(loop_condition_map.at(sequence_index_limit_label), sequence_index_limit)) + return false; + if (iteration_counter_limit != sequence_index_limit) + return false; + + int64_t gather_axis = -1; + if (!get_scalar_constant_value(loop_output_map.at(gather_axis_label), gather_axis) || gather_axis != 0) + return false; + int64_t scatter_axis = -1; + if (!get_scalar_constant_value(loop_output_map.at(scatter_axis_label), scatter_axis) || scatter_axis != 0) + return false; + + const auto& sequence_index = loop_condition_map.at(sequence_index_label).get_node_shared_ptr(); + const auto& iteration_counter = loop_condition_map.at(iteration_counter_label).get_node_shared_ptr(); + + const auto& X_body = loop_output_map.at(X_body_label).get_node_shared_ptr(); + const auto& H_body = loop_output_map.at(H_body_label).get_node_shared_ptr(); + const auto& C_body = loop_output_map.at(C_body_label).get_node_shared_ptr(); + auto W = loop_output_map.at(W_label).get_node_shared_ptr(); + auto R = loop_output_map.at(R_label).get_node_shared_ptr(); + auto B = loop_output_map.at(B_label).get_node_shared_ptr(); + const auto lstm_cell = + ov::as_type_ptr(loop_output_map.at(lstm_cell_label).get_node_shared_ptr()); + const auto H_unsqueeze = loop_output_map.at(updates_label).get_node_shared_ptr(); + if (H_unsqueeze->input_value(0) != lstm_cell->output(0)) + return false; + + Output X = pattern_map.at(input_label); + Output H; + Output C; + + const auto& input_descs = loop->get_input_descriptions(); + for (const auto& desc : input_descs) { + if (body_parameters[desc->m_body_parameter_index] == X_body) { + if (!std::dynamic_pointer_cast(desc)) { + return false; + } + if (loop->input_value(desc->m_input_index) != pattern_map.at(scatter_label)) { + return false; + } + } + if (body_parameters[desc->m_body_parameter_index] == H_body) { + auto merged_desc = std::dynamic_pointer_cast(desc); + if (!merged_desc) { + return false; + } + H = loop->input_value(desc->m_input_index); + const auto& result = body_results[merged_desc->m_body_value_index]; + if (result->input_value(0) != lstm_cell->output(0)) { + return false; + } + } + if (body_parameters[desc->m_body_parameter_index] == C_body) { + auto merged_desc = std::dynamic_pointer_cast(desc); + if (!merged_desc) { + return false; + } + C = loop->input_value(desc->m_input_index); + const auto& result = body_results[merged_desc->m_body_value_index]; + if (result->input_value(0) != lstm_cell->output(1)) { + return false; + } + } + if (body_parameters[desc->m_body_parameter_index] == sequence_index) { + auto merged_desc = std::dynamic_pointer_cast(desc); + if (!merged_desc) { + return false; + } + } + if (body_parameters[desc->m_body_parameter_index] == iteration_counter) { + auto merged_desc = std::dynamic_pointer_cast(desc); + if (!merged_desc) { + return false; + } + } + } + + auto constant_is_zero = [](const Output& node) -> bool { + auto constant = ov::as_type_ptr(node.get_node_shared_ptr()); + if (!constant) { + return false; + } + float value = -1.0f; + return ov::op::util::get_single_value(constant, value) && value == 0.0f; + }; + + if (!constant_is_zero(H)) + return false; + if (!constant_is_zero(C)) + return false; + + const auto& scatter = pattern_map.at(scatter_label); + const auto& scatter_shape = scatter.get_partial_shape(); // scatter shape [sequence length, batch, input size] + const auto& sequence_length_dimension = scatter_shape[0]; + const auto& batch_size_dimension = scatter_shape[1]; + const auto& input_size_dimension = scatter_shape[2]; + + std::vector batch_first_perm{1, 0, 2}; + std::vector new_input_perm_values; + + if (pattern_map.count(input_transpose_label) > 0) { + const auto& input_transpose = pattern_map.at(input_transpose_label).get_node(); + if (ov::is_type(input_transpose)) { + auto input_perm = ov::as_type(input_transpose->get_input_node_ptr(1)); + if (!input_perm) + return false; + auto input_perm_values = input_perm->cast_vector(); + for (size_t i = 0; i < input_perm_values.size(); i++) { + new_input_perm_values.push_back(input_perm_values[batch_first_perm[i]]); + } + } else if (ov::is_type(input_transpose)) { + const auto& input_shape = input_transpose->get_input_partial_shape(0); + const auto& output_shape = input_transpose->get_output_partial_shape(0); + if (input_shape.size() != output_shape.size()) + return false; + for (size_t i = 0; i < output_shape.size(); i++) { + const auto& dim = output_shape[i]; + for (size_t j = 0; j < input_shape.size(); j++) { + if (input_shape[j] == dim) { + new_input_perm_values.push_back(batch_first_perm[j]); + break; + } + } + } + } + } else { + new_input_perm_values = batch_first_perm; + } + + NodeRegistry node_registry; + + if (new_input_perm_values != std::vector{0, 1, 2}) { + auto new_input_perm = node_registry.make(element::i32, + Shape{new_input_perm_values.size()}, + new_input_perm_values); + X = node_registry.make(X, new_input_perm); + } + + const auto& X_shape = X.get_partial_shape(); + if (!X_shape[0].compatible(batch_size_dimension) || !X_shape[1].compatible(sequence_length_dimension) || + !X_shape[2].compatible(input_size_dimension)) { + return false; + } + + // Finally create LSTMSequence + auto zero = node_registry.make(element::i32, Shape{1}, 0); + auto max_sequence_length = node_registry.make(element::i32, Shape{1}, sequence_index_limit); + auto shapeof_X = node_registry.make(X); + auto batch_size = node_registry.make(shapeof_X, zero, zero); + auto shapeof_H = node_registry.make(H); + auto new_H_shape = node_registry.make(OutputVector{batch_size, shapeof_H}, 0); + auto new_H = node_registry.make(H, new_H_shape); + auto shapeof_C = node_registry.make(C); + auto new_C_shape = node_registry.make(OutputVector{batch_size, shapeof_C}, 0); + auto new_C = node_registry.make(C, new_C_shape); + auto new_W = node_registry.make(W, zero); + auto new_R = node_registry.make(R, zero); + auto new_B = node_registry.make(B, zero); + std::shared_ptr sequence_lengths = std::make_shared(max_sequence_length, batch_size); + if (auto constant = ov::util::constantfold_subgraph(sequence_lengths)) { + sequence_lengths = constant; + } + node_registry.add(sequence_lengths); + auto lstm = node_registry.make(X, + new_H, + new_C, + sequence_lengths, + new_W, + new_R, + new_B, + lstm_cell->get_hidden_size(), + op::v5::LSTMSequence::direction::FORWARD, + lstm_cell->get_activations_alpha(), + lstm_cell->get_activations_beta(), + lstm_cell->get_activations(), + lstm_cell->get_clip()); + if (transformation_callback(lstm)) + return false; + + const auto one = node_registry.make(element::i32, Shape{1}, 1); + auto H_squeezed = node_registry.make(lstm->output(0), one); + H_squeezed->set_friendly_name(match_root->get_friendly_name()); + + copy_runtime_info(NodeVector{scatter.get_node_shared_ptr(), loop}, node_registry.get()); + + for (auto&& loop_consumer : loop->output(0).get_target_inputs()) { + auto node = loop_consumer.get_node()->shared_from_this(); + if (ov::is_type(node)) { + auto shapeof = std::make_shared(H_squeezed); + auto indices = op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2}); + auto shapeof_gather = std::make_shared(shapeof, indices, zero); + shapeof_gather->set_friendly_name(node->get_friendly_name()); + copy_runtime_info(node, {shapeof, indices, shapeof_gather}); + replace_node(node, shapeof_gather); + } + } + + replace_node(match_root, H_squeezed); + + return true; + }; + + auto m = std::make_shared(output_transpose_label, matcher_name); + register_matcher(m, callback); +} + +class EliminateGatherWithRange : public ov::pass::MatcherPass { +public: + EliminateGatherWithRange() { + using namespace ov; + using namespace ov::pass; + + auto data_label = pattern::any_input(pattern::rank_equals(3)); + auto shapeof_label = pattern::wrap_type({data_label}); + auto shapeof_gather_label = pattern::wrap_type( + {shapeof_label, pattern::wrap_type(), pattern::wrap_type()}); + auto shapeof_gather2_label = pattern::wrap_type( + {shapeof_gather_label, pattern::wrap_type(), pattern::wrap_type()}); + auto reshape_label = + pattern::wrap_type({shapeof_gather2_label, pattern::wrap_type()}); + auto range_label = pattern::wrap_type( + {pattern::wrap_type(), reshape_label, pattern::wrap_type()}); + auto match_node = pass::pattern::wrap_type( + {data_label, range_label, pattern::wrap_type()}); + + matcher_pass_callback callback = [=](pass::pattern::Matcher& m) { + const auto& pattern_map = m.get_pattern_value_map(); + auto gather = ov::as_type_ptr(m.get_match_root()); + if (!gather) + return false; + auto axis = gather->get_axis(); + if (axis == op::v1::Gather::AXIS_NOT_SET_VALUE) { + return false; + } + + const auto shapeof_gather = pattern_map.at(shapeof_gather_label).get_node_shared_ptr(); + const auto shapeof_gather_indexes_node = + ov::as_type_ptr(shapeof_gather->get_input_node_shared_ptr(1)); + auto shapeof_gather_indexes = shapeof_gather_indexes_node->cast_vector(); + if (shapeof_gather_indexes.size() != 3) + return false; + const auto shapeof_gather2 = pattern_map.at(shapeof_gather2_label).get_node_shared_ptr(); + int64_t shapeof_gather2_index = -1; + int64_t shapeof_gather2_axis = -1; + if (!get_scalar_constant_value(shapeof_gather2->get_input_node_shared_ptr(1), shapeof_gather2_index)) + return false; + if (!get_scalar_constant_value(shapeof_gather2->get_input_node_shared_ptr(2), shapeof_gather2_axis) || + shapeof_gather2_axis != 0) + return false; + const auto reshape = pattern_map.at(reshape_label).get_node_shared_ptr(); + const auto& reshape_shape = reshape->get_output_partial_shape(0); + if (reshape_shape.is_dynamic() || reshape_shape.size() != 0) + return false; + const auto range = pattern_map.at(range_label).get_node_shared_ptr(); + int64_t range_start = -1; + int64_t range_step = -1; + if (!get_scalar_constant_value(range->get_input_node_shared_ptr(0), range_start) || range_start != 0) + return false; + if (!get_scalar_constant_value(range->get_input_node_shared_ptr(2), range_step) || range_step != 1) + return false; + + int64_t gather_axis = -1; + if (!get_scalar_constant_value(gather->get_input_node_shared_ptr(2), gather_axis) || + gather_axis != shapeof_gather_indexes[shapeof_gather2_index]) + return false; + + return replace_output_update_name(gather->output(0), gather->input_value(0)); + }; + + auto m = std::make_shared(match_node, "EliminateGatherWithRange"); + register_matcher(m, callback); + } +}; + +ov::pass::FuseReverseLSTMSequence::FuseReverseLSTMSequence() { + MATCHER_SCOPE(FuseReverseLSTMSequence); + + auto data_label = pattern::any_input(pattern::rank_equals(3)); + auto first_transpose_label = + pattern::wrap_type({data_label, pattern::wrap_type()}, + pattern::rank_equals(3)); + auto input_to_first_reverse_sequence_label = + std::make_shared(OutputVector{first_transpose_label, data_label}); + auto first_reverse_sequence_label = + pattern::wrap_type({input_to_first_reverse_sequence_label, pattern::any_input()}); + auto second_transpose_label = + pattern::wrap_type({first_reverse_sequence_label, pattern::wrap_type()}); + auto lstm_label = pattern::wrap_type({second_transpose_label, + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + pattern::any_input(), + pattern::any_input()}, + pattern::consumers_count(1)); + auto squeeze_label = pattern::wrap_type({lstm_label, pattern::wrap_type()}); + auto second_reverse_sequence_label = + pattern::wrap_type({squeeze_label, pattern::any_input()}); + + matcher_pass_callback callback = [=](pattern::Matcher& m) { + const auto& pattern_map = m.get_pattern_value_map(); + const auto& data = pattern_map.at(data_label); + const auto second_transpose = pattern_map.at(second_transpose_label).get_node_shared_ptr(); + const auto second_transpose_perm = + ov::as_type_ptr(second_transpose->get_input_node_shared_ptr(1)); + auto lstm = ov::as_type_ptr(pattern_map.at(lstm_label).get_node_shared_ptr()); + if (lstm->get_direction() != op::v5::LSTMSequence::direction::FORWARD) + return false; + + std::shared_ptr new_transpose_perm; + if (pattern_map.count(first_transpose_label) > 0) { + auto first_transpose = pattern_map.at(first_transpose_label).get_node_shared_ptr(); + if (ov::is_type(first_transpose)) { + const auto& reshape_input_shape = first_transpose->get_input_partial_shape(0); + const auto& reshape_output_shape = first_transpose->get_output_partial_shape(0); + if (reshape_input_shape.size() != reshape_output_shape.size()) + return false; + const auto second_transpose_perm_values = second_transpose_perm->cast_vector(); + std::vector new_perm_values; + for (size_t i = 0; i < reshape_output_shape.size(); i++) { + const auto& dim = reshape_output_shape[i]; + for (size_t j = 0; j < reshape_input_shape.size(); j++) { + if (dim == reshape_input_shape[j]) { + new_perm_values.push_back(second_transpose_perm_values[j]); + } + } + } + if (new_perm_values.size() != 3) + return false; + if (new_perm_values != std::vector{0, 1, 2}) { + new_transpose_perm = + op::v0::Constant::create(element::i32, Shape{new_perm_values.size()}, new_perm_values); + } + } else if (ov::is_type(first_transpose)) { + const auto first_transpose_perm = ov::as_type(first_transpose->get_input_node_ptr(1)); + const auto first_transpose_perm_values = first_transpose_perm->cast_vector(); + const auto second_transpose_perm_values = second_transpose_perm->cast_vector(); + if (first_transpose_perm_values.size() != second_transpose_perm_values.size()) + return false; + std::vector new_perm_values; + for (size_t i = 0; i < first_transpose_perm_values.size(); i++) { + new_perm_values.push_back(first_transpose_perm_values[second_transpose_perm_values[i]]); + } + if (new_perm_values.size() != 3) + return false; + if (new_perm_values != std::vector{0, 1, 2}) { + new_transpose_perm = + op::v0::Constant::create(element::i32, Shape{new_perm_values.size()}, new_perm_values); + } + } + } else { + new_transpose_perm = second_transpose_perm; + } + + NodeRegistry node_registry; + + Output new_lstm_input; + if (new_transpose_perm) { + new_lstm_input = node_registry.make(data, new_transpose_perm); + } else { + new_lstm_input = data; + } + + auto new_lstm = node_registry.make(new_lstm_input, + lstm->input_value(1), + lstm->input_value(2), + lstm->input_value(3), + lstm->input_value(4), + lstm->input_value(5), + lstm->input_value(6), + lstm->get_hidden_size(), + op::v5::LSTMSequence::direction::REVERSE, + lstm->get_activations_alpha(), + lstm->get_activations_beta(), + lstm->get_activations(), + lstm->get_clip()); + + auto squeeze = pattern_map.at(squeeze_label).get_node_shared_ptr(); + if (squeeze->input_value(0) != lstm->output(0)) + return false; + int64_t squeeze_axis = -1; + if (!get_scalar_constant_value(squeeze->get_input_node_shared_ptr(1), squeeze_axis) || squeeze_axis != 1) + return false; + auto new_squeeze = node_registry.make(new_lstm->output(0), squeeze->input_value(1)); + const auto match_root = m.get_match_root(); + new_squeeze->set_friendly_name(match_root->get_friendly_name()); + + for (auto& consumer : second_transpose->output(0).get_target_inputs()) { + auto node = consumer.get_node()->shared_from_this(); + if (ov::is_type(node)) { + auto shapeof = std::make_shared(new_lstm_input); + replace_node(node, shapeof); + } + } + + NodeVector from{pattern_map.at(first_reverse_sequence_label).get_node_shared_ptr(), + second_transpose, + lstm, + squeeze, + pattern_map.at(second_reverse_sequence_label).get_node_shared_ptr()}; + if (pattern_map.count(first_transpose_label) > 0) { + from.push_back(pattern_map.at(first_transpose_label).get_node_shared_ptr()); + } + + copy_runtime_info(from, node_registry.get()); + replace_node(match_root, new_squeeze); + + return true; + }; + + auto m = std::make_shared(second_reverse_sequence_label, matcher_name); + register_matcher(m, callback); +} + +ov::pass::FuseLSTMSequencesToBidirectionalLSTMSequence::FuseLSTMSequencesToBidirectionalLSTMSequence() { + MATCHER_SCOPE(FuseLSTMSequencesToBidirectionalLSTMSequence); + auto data_label = pattern::any_input(); + + // forward pattern + auto transpose_forward_label = + pattern::wrap_type({data_label, pattern::wrap_type()}); + auto lstm_sequence_forward_first_input_label = + std::make_shared(OutputVector{transpose_forward_label, data_label}); + auto shapeof_forward_label = pattern::wrap_type({lstm_sequence_forward_first_input_label}); + auto gather_forward_label = pattern::wrap_type( + {shapeof_forward_label, pattern::wrap_type(), pattern::wrap_type()}); + auto max_sequence_len_forward_label = pattern::wrap_type(); + auto broadcast_forward_label = + pattern::wrap_type({max_sequence_len_forward_label, gather_forward_label}); + auto const_sequence_lengths_forward_label = pattern::wrap_type(); + auto sequence_lengths_forward_label = + std::make_shared(OutputVector{broadcast_forward_label, const_sequence_lengths_forward_label}); + auto lstm_sequence_forward_label = + pattern::wrap_type({lstm_sequence_forward_first_input_label, + pattern::any_input(), + pattern::any_input(), + sequence_lengths_forward_label, + pattern::any_input(), + pattern::any_input(), + pattern::any_input()}); + auto squeeze_forward_label = + pattern::wrap_type({lstm_sequence_forward_label, pattern::wrap_type()}, + pattern::rank_equals(3)); + + // backward pattern + auto transpose_reverse_label = + pattern::wrap_type({data_label, pattern::wrap_type()}); + auto lstm_sequence_reverse_first_input_label = + std::make_shared(OutputVector{transpose_reverse_label, data_label}); + auto shapeof_reverse_label = pattern::wrap_type({lstm_sequence_reverse_first_input_label}); + auto gather_reverse_label = pattern::wrap_type( + {shapeof_reverse_label, pattern::wrap_type(), pattern::wrap_type()}); + auto max_sequence_len_reverse_label = pattern::wrap_type(); + auto broadcast_reverse_label = + pattern::wrap_type({max_sequence_len_reverse_label, gather_reverse_label}); + auto const_sequence_lengths_reverse_label = pattern::wrap_type(); + auto sequence_lengths_reverse_label = + std::make_shared(OutputVector{broadcast_reverse_label, const_sequence_lengths_reverse_label}); + auto lstm_sequence_reverse_label = + pattern::wrap_type({lstm_sequence_reverse_first_input_label, + pattern::any_input(), + pattern::any_input(), + sequence_lengths_reverse_label, + pattern::any_input(), + pattern::any_input(), + pattern::any_input()}); + auto squeeze_reverse_label = + pattern::wrap_type({lstm_sequence_reverse_label, pattern::wrap_type()}, + pattern::rank_equals(3)); + + auto concat_label = pattern::wrap_type({squeeze_forward_label, squeeze_reverse_label}); + + matcher_pass_callback callback = [=](pattern::Matcher& m) { + const auto& pattern_map = m.get_pattern_map(); + auto lstm_forward = ov::as_type_ptr(pattern_map.at(lstm_sequence_forward_label)); + auto lstm_reverse = ov::as_type_ptr(pattern_map.at(lstm_sequence_reverse_label)); + + NodeVector from{lstm_forward, lstm_reverse}; + + if (lstm_forward->get_direction() != op::v5::LSTMSequence::direction::FORWARD || + lstm_reverse->get_direction() != op::v5::LSTMSequence::direction::REVERSE) + return false; + + if (lstm_forward->get_hidden_size() != lstm_reverse->get_hidden_size()) + return false; + if (lstm_forward->get_activations_alpha() != lstm_reverse->get_activations_alpha()) + return false; + if (lstm_forward->get_activations_beta() != lstm_reverse->get_activations_beta()) + return false; + if (lstm_forward->get_activations() != lstm_reverse->get_activations()) + return false; + if (lstm_forward->get_clip() != lstm_reverse->get_clip()) + return false; + + auto squeeze_forward = pattern_map.at(squeeze_forward_label); + if (squeeze_forward->input_value(0) != lstm_forward->output(0)) + return false; + int64_t squeeze_forward_axis = -1; + if (!get_scalar_constant_value(squeeze_forward->get_input_node_shared_ptr(1), squeeze_forward_axis) || + squeeze_forward_axis != 1) + return false; + + auto squeeze_reverse = pattern_map.at(squeeze_reverse_label); + if (squeeze_reverse->input_value(0) != lstm_reverse->output(0)) + return false; + int64_t squeeze_reverse_axis = -1; + if (!get_scalar_constant_value(squeeze_reverse->get_input_node_shared_ptr(1), squeeze_reverse_axis) || + squeeze_reverse_axis != 1) + return false; + + auto concat = ov::as_type_ptr(pattern_map.at(concat_label)); + if (concat->get_axis() != 2) + return false; + + from.push_back(squeeze_forward); + from.push_back(squeeze_reverse); + from.push_back(concat); + + bool has_input_transpose_forward = pattern_map.count(transpose_forward_label) > 0; + bool has_input_transpose_reverse = pattern_map.count(transpose_reverse_label) > 0; + if (has_input_transpose_forward ^ has_input_transpose_reverse) + return false; + + bool is_forward_sequence_lengths_constant = pattern_map.count(const_sequence_lengths_forward_label) > 0; + bool is_reverse_sequence_lengths_constant = pattern_map.count(const_sequence_lengths_reverse_label) > 0; + if (is_forward_sequence_lengths_constant ^ is_reverse_sequence_lengths_constant) + return false; + + if (is_forward_sequence_lengths_constant) { + auto sequence_lengths_forward = + ov::as_type_ptr(pattern_map.at(const_sequence_lengths_forward_label)); + auto sequence_lengths_reverse = + ov::as_type_ptr(pattern_map.at(const_sequence_lengths_reverse_label)); + if (sequence_lengths_forward->get_shape() != sequence_lengths_reverse->get_shape()) + return false; + auto sequence_lengths_forward_values = sequence_lengths_forward->cast_vector(); + auto sequence_lengths_reverse_values = sequence_lengths_reverse->cast_vector(); + if (sequence_lengths_forward_values != sequence_lengths_reverse_values) + return false; + from.push_back(sequence_lengths_forward); + from.push_back(sequence_lengths_reverse); + } else { + auto max_sequence_len_forward = + ov::as_type_ptr(pattern_map.at(max_sequence_len_forward_label)); + auto max_sequence_len_reverse = + ov::as_type_ptr(pattern_map.at(max_sequence_len_reverse_label)); + if (max_sequence_len_forward->get_shape() != max_sequence_len_reverse->get_shape()) + return false; + auto max_sequence_len_forward_values = max_sequence_len_forward->cast_vector(); + auto max_sequence_len_reverse_values = max_sequence_len_reverse->cast_vector(); + if (max_sequence_len_forward_values != max_sequence_len_reverse_values) + return false; + + auto gather_forward = pattern_map.at(gather_forward_label); + int64_t gather_index = -1; + int64_t gather_axis = -1; + if (!get_scalar_constant_value(gather_forward->get_input_node_shared_ptr(1), gather_index) || + gather_index != 0) + return false; + if (!get_scalar_constant_value(gather_forward->get_input_node_shared_ptr(2), gather_axis) || + gather_axis != 0) + return false; + + auto gather_reverse = pattern_map.at(gather_reverse_label); + gather_index = -1; + gather_axis = -1; + if (!get_scalar_constant_value(gather_reverse->get_input_node_shared_ptr(1), gather_index) || + gather_index != 0) + return false; + if (!get_scalar_constant_value(gather_reverse->get_input_node_shared_ptr(2), gather_axis) || + gather_axis != 0) + return false; + + from.push_back(max_sequence_len_forward); + from.push_back(max_sequence_len_reverse); + from.push_back(gather_forward); + from.push_back(gather_reverse); + } + + NodeRegistry node_registry; + + auto new_H = + node_registry.make(OutputVector{lstm_forward->input_value(1), lstm_reverse->input_value(1)}, + 1); + auto new_C = + node_registry.make(OutputVector{lstm_forward->input_value(2), lstm_reverse->input_value(2)}, + 1); + auto new_W = + node_registry.make(OutputVector{lstm_forward->input_value(4), lstm_reverse->input_value(4)}, + 0); + auto new_R = + node_registry.make(OutputVector{lstm_forward->input_value(5), lstm_reverse->input_value(5)}, + 0); + auto new_B = + node_registry.make(OutputVector{lstm_forward->input_value(6), lstm_reverse->input_value(6)}, + 0); + auto new_lstm = node_registry.make(lstm_forward->input_value(0), + new_H, + new_C, + lstm_forward->input_value(3), + new_W, + new_R, + new_B, + lstm_forward->get_hidden_size(), + op::v5::LSTMSequence::direction::BIDIRECTIONAL, + lstm_forward->get_activations_alpha(), + lstm_forward->get_activations_beta(), + lstm_forward->get_activations(), + lstm_forward->get_clip()); + if (transformation_callback(new_lstm)) + return false; + + auto transpose = + node_registry.make(new_lstm->output(0), + op::v0::Constant::create(element::i32, Shape{4}, {0, 2, 1, 3})); + auto new_shape = node_registry.make(element::i32, Shape{3}, std::vector{0, 0, -1}); + auto reshape = node_registry.make(transpose, new_shape, true); + reshape->set_friendly_name(concat->get_friendly_name()); + + copy_runtime_info(from, node_registry.get()); + replace_node(concat, reshape); + + return true; + }; + + auto m = std::make_shared(concat_label, matcher_name); + register_matcher(m, callback); +} + ov::pass::ConvertTensorIteratorToSequence::ConvertTensorIteratorToSequence() { add_matcher(); add_matcher(); add_matcher(); + add_matcher(); + add_matcher(); + add_matcher(); + add_matcher(); } diff --git a/src/common/transformations/tests/op_conversions/convert_ti_to_sequences_test.cpp b/src/common/transformations/tests/op_conversions/convert_ti_to_sequences_test.cpp index 524e3735948a3b..4521936361c07c 100644 --- a/src/common/transformations/tests/op_conversions/convert_ti_to_sequences_test.cpp +++ b/src/common/transformations/tests/op_conversions/convert_ti_to_sequences_test.cpp @@ -802,3 +802,466 @@ TEST(TransformationTests, ConvertTensorIteratorToGRUSequenceDynamicSqueezeCase) auto res = compare_functions(f, f_ref); ASSERT_TRUE(res.first) << res.second; } + +using ConvertLoopToLSTMSequenceTestParams = std::tuple; // with_gather_reshape + +class ConvertLoopToLSTMSequenceTest : public testing::WithParamInterface, + public TransformationTestsF {}; + +TEST_P(ConvertLoopToLSTMSequenceTest, FusionTest) { + const auto& params = GetParam(); + bool with_input_transpose = std::get<0>(params); + bool with_gather_reshape = std::get<1>(params); + + size_t input_size = 3; + size_t hidden_size = 2; + size_t num_sequences = 5; + size_t batch_size = 1; + + { + auto trip_count = op::v0::Constant::create(element::i32, Shape{}, {-1}); + auto condition = op::v0::Constant::create(element::boolean, Shape{}, {true}); + auto iteration_counter = op::v0::Constant::create(element::i32, Shape{}, {0}); + auto sequence_index = op::v0::Constant::create(element::i32, Shape{}, {0}); + std::shared_ptr X; + std::shared_ptr scatter_updates; + if (with_input_transpose) { + X = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + scatter_updates = + std::make_shared(X, op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2})); + } else { + X = std::make_shared(element::f32, Shape{num_sequences, batch_size, input_size}); + scatter_updates = X; + } + auto scatter_input = op::v0::Constant::create(element::f32, Shape{num_sequences, batch_size, input_size}, {0}); + std::vector indexes_values(num_sequences); + std::iota(indexes_values.begin(), indexes_values.end(), 0); + auto scatter_indexes = op::v0::Constant::create(element::i32, Shape{num_sequences, 1}, indexes_values); + auto scatter = std::make_shared(scatter_input, scatter_indexes, scatter_updates); + auto H = op::v0::Constant::create(element::f32, Shape{batch_size, hidden_size}, {0}); + auto C = op::v0::Constant::create(element::f32, Shape{batch_size, hidden_size}, {0}); + auto Y = op::v0::Constant::create(element::f32, Shape{num_sequences, batch_size, hidden_size}, {0}); + + auto loop = std::make_shared(trip_count, condition); + + auto X_body = std::make_shared(element::f32, Shape{num_sequences, batch_size, input_size}); + auto Y_body = std::make_shared( + element::f32, + PartialShape{static_cast(num_sequences), static_cast(batch_size), -1}); + auto C_body = std::make_shared(element::f32, Shape{batch_size, hidden_size}); + auto sequence_index_body = std::make_shared(element::i32, Shape{}); + auto H_body = std::make_shared(element::f32, Shape{batch_size, hidden_size}); + auto iteration_counter_body = std::make_shared(element::i32, Shape{}); + auto iteration_counter_step = op::v0::Constant::create(element::i32, Shape{}, {1}); + auto iteration_counter_incremented = + std::make_shared(iteration_counter_body, iteration_counter_step); + auto iteration_counter_limit = op::v0::Constant::create(element::i32, Shape{}, {num_sequences}); + auto iteration_counter_less_than_limit = + std::make_shared(iteration_counter_incremented, iteration_counter_limit); + auto sequence_index_step = op::v0::Constant::create(element::i32, Shape{}, {1}); + auto sequence_index_incremented = std::make_shared(sequence_index_body, sequence_index_step); + auto sequence_index_limit = op::v0::Constant::create(element::i32, Shape{}, {num_sequences}); + auto sequence_index_less_than_limit = + std::make_shared(sequence_index_incremented, sequence_index_limit); + auto output_condition = + std::make_shared(iteration_counter_less_than_limit, sequence_index_less_than_limit); + auto condition_result = std::make_shared(output_condition); + auto Y_shape = std::make_shared(Y_body); + auto zero = op::v0::Constant::create(element::i32, Shape{1}, {0}); + auto max_sequence_length = std::make_shared(Y_shape, zero, zero); + auto sequence_index_new_shape = op::v0::Constant::create(element::i32, Shape{0}, {}); + std::shared_ptr gather_index; + if (with_gather_reshape) { + gather_index = std::make_shared(sequence_index_body, sequence_index_new_shape, false); + } else { + gather_index = sequence_index_body; + } + auto gather_axis = op::v0::Constant::create(element::i32, Shape{1}, {0}); + auto X_slice = std::make_shared(X_body, gather_index, gather_axis); + std::vector W_values(4 * hidden_size * input_size); + std::iota(W_values.begin(), W_values.end(), 0.0f); + auto W = op::v0::Constant::create(element::f32, Shape{4 * hidden_size, input_size}, W_values); + std::vector R_values(4 * hidden_size * hidden_size); + std::iota(R_values.begin(), R_values.end(), 0.0f); + auto R = op::v0::Constant::create(element::f32, Shape{4 * hidden_size, hidden_size}, R_values); + std::vector B_values(4 * hidden_size); + std::iota(B_values.begin(), B_values.end(), 0.0f); + auto B = op::v0::Constant::create(element::f32, Shape{4 * hidden_size}, B_values); + auto lstm_cell = std::make_shared(X_slice, + H_body, + C_body, + W, + R, + B, + hidden_size, + std::vector{"sigmoid", "tanh", "tanh"}); + auto Y_new_shape2 = std::make_shared(lstm_cell->output(0)); + auto Y_new_shape = std::make_shared(OutputVector{max_sequence_length, Y_new_shape2}, 0); + auto Y_broadcasted = std::make_shared(Y_body, Y_new_shape); + auto sequence_index_new_shape2 = op::v0::Constant::create(element::i64, Shape{1}, {-1}); + auto scatter_update_index = + std::make_shared(sequence_index_body, sequence_index_new_shape2, false); + auto H_unsqueezed = std::make_shared(lstm_cell->output(0), zero); + auto scatter_update_body = + std::make_shared(Y_broadcasted, scatter_update_index, H_unsqueezed, zero); + auto Y_result = std::make_shared(scatter_update_body); + auto Co_result = std::make_shared(lstm_cell->output(1)); + auto sequence_index_result = std::make_shared(sequence_index_incremented); + auto Ho_result = std::make_shared(lstm_cell->output(0)); + auto iteration_counter_result = std::make_shared(iteration_counter_incremented); + + ParameterVector params{X_body, H_body, C_body, Y_body, sequence_index_body, iteration_counter_body}; + ResultVector results{Y_result, + Ho_result, + Co_result, + sequence_index_result, + iteration_counter_result, + condition_result}; + auto body = std::make_shared(results, params); + loop->set_function(body); + + loop->set_invariant_input(Y_body, Y); + loop->get_iter_value(Y_result, -1); + loop->set_merged_input(iteration_counter_body, iteration_counter, iteration_counter_result); + loop->set_merged_input(H_body, H, Ho_result); + loop->set_merged_input(sequence_index_body, sequence_index, sequence_index_result); + loop->set_merged_input(C_body, C, Co_result); + loop->set_invariant_input(X_body, scatter); + loop->set_special_body_ports({-1, 5}); + auto transpose = + std::make_shared(loop->output(0), + op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2})); + + model = std::make_shared(transpose, ParameterVector{X}); + + manager.register_pass(); + } + + { + auto perm = op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2}); + std::shared_ptr X; + std::shared_ptr X_lstm; + if (with_input_transpose) { + // fused subgraph doesn't have Transpose + X = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + X_lstm = X; + } else { + X = std::make_shared(element::f32, Shape{num_sequences, batch_size, input_size}); + X_lstm = std::make_shared(X, perm); + } + auto one = op::v0::Constant::create(element::i32, Shape{1}, {1}); + auto zero = op::v0::Constant::create(element::i32, Shape{1}, {0}); + auto shapeof_X = std::make_shared(X_lstm); + auto batch_size_node = std::make_shared(shapeof_X, zero, zero); + auto H = op::v0::Constant::create(element::f32, Shape{batch_size, hidden_size}, {0}); + auto new_H_shape = + std::make_shared(OutputVector{batch_size_node, std::make_shared(H)}, 0); + auto H_broadcasted = std::make_shared(H, new_H_shape); + auto C = op::v0::Constant::create(element::f32, Shape{batch_size, hidden_size}, {0}); + auto new_C_shape = + std::make_shared(OutputVector{batch_size_node, std::make_shared(C)}, 0); + auto C_broadcasted = std::make_shared(C, new_C_shape); + + std::vector W_values(4 * hidden_size * input_size); + std::iota(W_values.begin(), W_values.end(), 0.0f); + std::vector R_values(4 * hidden_size * hidden_size); + std::iota(R_values.begin(), R_values.end(), 0.0f); + std::vector B_values(4 * hidden_size); + std::iota(B_values.begin(), B_values.end(), 0.0f); + auto W = std::make_shared( + op::v0::Constant::create(element::f32, Shape{4 * hidden_size, input_size}, W_values), + zero); + auto R = std::make_shared( + op::v0::Constant::create(element::f32, Shape{4 * hidden_size, hidden_size}, R_values), + zero); + auto B = std::make_shared( + op::v0::Constant::create(element::f32, Shape{4 * hidden_size}, B_values), + zero); + + auto sequence_lengths = op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}); + auto lstm = std::make_shared(X_lstm, + H_broadcasted, + C_broadcasted, + sequence_lengths, + W, + R, + B, + hidden_size, + op::v5::LSTMSequence::direction::FORWARD, + std::vector{}, + std::vector{}, + std::vector{"sigmoid", "tanh", "tanh"}); + auto Ho_squeezed = std::make_shared(lstm->output(0), one); + + model_ref = std::make_shared(Ho_squeezed, ParameterVector{X}); + } + + comparator.enable(FunctionsComparator::CmpValues::CONST_VALUES); + comparator.enable(FunctionsComparator::CmpValues::ATTRIBUTES); + comparator.enable(FunctionsComparator::CmpValues::ACCURACY); +} + +INSTANTIATE_TEST_SUITE_P(ConvertLoopToLSTMSequence, + ConvertLoopToLSTMSequenceTest, + testing::Combine(testing::Values(false, true), testing::Values(false, true))); + +class FuseReverseLSTMSequenceTest : public TransformationTestsF, public testing::WithParamInterface {}; + +TEST_P(FuseReverseLSTMSequenceTest, FusionTest) { + const auto with_input_transpose = GetParam(); + + size_t input_size = 3; + size_t hidden_size = 2; + size_t num_sequences = 5; + size_t batch_size = 1; + + { + std::shared_ptr input; + std::shared_ptr second_transpose; + if (with_input_transpose) { + input = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + auto input_transpose = + std::make_shared(input, op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2})); + auto input_reverse = std::make_shared( + input_transpose, + op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}), + 1, + 0); + second_transpose = + std::make_shared(input_reverse, + op::v0::Constant::create(element::i32, Shape{3}, {1, 0, 2})); + } else { + input = std::make_shared(element::f32, Shape{batch_size, input_size, num_sequences}); + auto input_reverse = std::make_shared( + input, + op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}), + 0, + 2); + second_transpose = + std::make_shared(input_reverse, + op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1})); + } + auto H = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {1.0f}); + auto C = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {2.0f}); + auto sequence_lengths = op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}); + auto W = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {3.0f}); + auto R = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {4.0f}); + auto B = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {5.0f}); + auto lstm = std::make_shared(second_transpose, + H, + C, + sequence_lengths, + W, + R, + B, + hidden_size, + op::v5::LSTMSequence::direction::FORWARD); + auto squeeze = + std::make_shared(lstm->output(0), op::v0::Constant::create(element::i32, Shape{}, {1})); + auto output_reverse = + std::make_shared(squeeze, + op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}), + 0, + 1); + + model = std::make_shared(output_reverse, ParameterVector{input}); + + manager.register_pass(); + } + + { + std::shared_ptr input; + std::shared_ptr lstm_input; + if (with_input_transpose) { + input = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + lstm_input = input; + } else { + input = std::make_shared(element::f32, Shape{batch_size, input_size, num_sequences}); + lstm_input = + std::make_shared(input, op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1})); + } + auto H = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {1.0f}); + auto C = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {2.0f}); + auto sequence_lengths = op::v0::Constant::create(element::i32, Shape{1}, {num_sequences}); + auto W = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {3.0f}); + auto R = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {4.0f}); + auto B = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {5.0f}); + auto lstm = std::make_shared(lstm_input, + H, + C, + sequence_lengths, + W, + R, + B, + hidden_size, + op::v5::LSTMSequence::direction::REVERSE); + auto squeeze = + std::make_shared(lstm->output(0), op::v0::Constant::create(element::i32, Shape{}, {1})); + + model_ref = std::make_shared(squeeze, ParameterVector{input}); + } + + comparator.enable(FunctionsComparator::CmpValues::CONST_VALUES); + comparator.enable(FunctionsComparator::CmpValues::ATTRIBUTES); + comparator.enable(FunctionsComparator::CmpValues::ACCURACY); +} + +INSTANTIATE_TEST_SUITE_P(FuseReverseLSTMSequence, FuseReverseLSTMSequenceTest, testing::Values(false, true)); + +class FuseLSTMSequencesToBidirectionalLSTMSequenceTest : public TransformationTestsF, + public testing::WithParamInterface> {}; + +TEST_P(FuseLSTMSequencesToBidirectionalLSTMSequenceTest, FusionTest) { + const auto& params = GetParam(); + bool with_input_transpose = std::get<0>(params); + bool const_sequence_lengths = std::get<1>(params); + + size_t input_size = 3; + size_t hidden_size = 2; + size_t num_sequences = 5; + size_t batch_size = 1; + + { + std::shared_ptr input; + std::shared_ptr forward_lstm_input; + std::shared_ptr reverse_lstm_input; + std::shared_ptr forward_sequence_lengths; + std::shared_ptr reverse_sequence_lengths; + if (with_input_transpose) { + input = std::make_shared(element::f32, Shape{batch_size, input_size, num_sequences}); + forward_lstm_input = + std::make_shared(input, op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1})); + reverse_lstm_input = + std::make_shared(input, op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1})); + } else { + input = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + forward_lstm_input = input; + reverse_lstm_input = input; + } + if (const_sequence_lengths) { + forward_sequence_lengths = op::v0::Constant::create(element::i32, Shape{batch_size}, {num_sequences}); + reverse_sequence_lengths = op::v0::Constant::create(element::i32, Shape{batch_size}, {num_sequences}); + } else { + auto shapeof_forward = std::make_shared(forward_lstm_input); + auto gather_forward = + std::make_shared(shapeof_forward, + op::v0::Constant::create(element::i32, Shape{1}, {0}), + op::v0::Constant::create(element::i32, Shape{}, {0})); + forward_sequence_lengths = + std::make_shared(op::v0::Constant::create(element::i32, Shape{}, {num_sequences}), + gather_forward); + auto shapeof_reverse = std::make_shared(reverse_lstm_input); + auto gather_reverse = + std::make_shared(shapeof_reverse, + op::v0::Constant::create(element::i32, Shape{1}, {0}), + op::v0::Constant::create(element::i32, Shape{}, {0})); + reverse_sequence_lengths = + std::make_shared(op::v0::Constant::create(element::i32, Shape{}, {num_sequences}), + gather_reverse); + } + auto H_forward = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {1.0f}); + auto C_forward = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {2.0f}); + auto W_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {3.0f}); + auto R_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {4.0f}); + auto B_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {5.0f}); + auto lstm_forward = std::make_shared(forward_lstm_input, + H_forward, + C_forward, + forward_sequence_lengths, + W_forward, + R_forward, + B_forward, + hidden_size, + op::v5::LSTMSequence::direction::FORWARD); + auto squeeze_forward = std::make_shared(lstm_forward->output(0), + op::v0::Constant::create(element::i32, Shape{}, {1})); + + auto H_reverse = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {6.0f}); + auto C_reverse = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {7.0f}); + auto W_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {8.0f}); + auto R_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {9.0f}); + auto B_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {10.0f}); + auto lstm_reverse = std::make_shared(reverse_lstm_input, + H_reverse, + C_reverse, + reverse_sequence_lengths, + W_reverse, + R_reverse, + B_reverse, + hidden_size, + op::v5::LSTMSequence::direction::REVERSE); + auto squeeze_reverse = std::make_shared(lstm_reverse->output(0), + op::v0::Constant::create(element::i32, Shape{}, {1})); + + auto concat = std::make_shared(OutputVector{squeeze_forward, squeeze_reverse}, 2); + model = std::make_shared(concat, ParameterVector{input}); + + manager.register_pass(); + } + + { + std::shared_ptr input; + std::shared_ptr lstm_input; + std::shared_ptr sequence_lengths; + if (with_input_transpose) { + input = std::make_shared(element::f32, Shape{batch_size, input_size, num_sequences}); + lstm_input = + std::make_shared(input, op::v0::Constant::create(element::i32, Shape{3}, {0, 2, 1})); + } else { + input = std::make_shared(element::f32, Shape{batch_size, num_sequences, input_size}); + lstm_input = input; + } + if (const_sequence_lengths) { + sequence_lengths = op::v0::Constant::create(element::i32, Shape{batch_size}, {num_sequences}); + } else { + auto shapeof = std::make_shared(lstm_input); + auto gather = std::make_shared(shapeof, + op::v0::Constant::create(element::i32, Shape{1}, {0}), + op::v0::Constant::create(element::i32, Shape{}, {0})); + sequence_lengths = + std::make_shared(op::v0::Constant::create(element::i32, Shape{}, {num_sequences}), + gather); + } + auto H_forward = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {1.0f}); + auto H_reverse = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {6.0f}); + auto H = std::make_shared(OutputVector{H_forward, H_reverse}, 1); + auto C_forward = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {2.0f}); + auto C_reverse = op::v0::Constant::create(element::f32, Shape{batch_size, 1, hidden_size}, {7.0f}); + auto C = std::make_shared(OutputVector{C_forward, C_reverse}, 1); + auto W_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {3.0f}); + auto W_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, input_size}, {8.0f}); + auto W = std::make_shared(OutputVector{W_forward, W_reverse}, 0); + auto R_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {4.0f}); + auto R_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size, hidden_size}, {9.0f}); + auto R = std::make_shared(OutputVector{R_forward, R_reverse}, 0); + auto B_forward = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {5.0f}); + auto B_reverse = op::v0::Constant::create(element::f32, Shape{1, 4 * hidden_size}, {10.0f}); + auto B = std::make_shared(OutputVector{B_forward, B_reverse}, 0); + + auto lstm = std::make_shared(lstm_input, + H, + C, + sequence_lengths, + W, + R, + B, + hidden_size, + op::v5::LSTMSequence::direction::BIDIRECTIONAL); + auto transpose = + std::make_shared(lstm->output(0), + op::v0::Constant::create(element::i32, Shape{4}, {0, 2, 1, 3})); + auto reshape = std::make_shared(transpose, + op::v0::Constant::create(element::i32, Shape{3}, {0, 0, -1}), + true); + model_ref = std::make_shared(reshape, ParameterVector{input}); + } + + comparator.enable(FunctionsComparator::CmpValues::CONST_VALUES); + comparator.enable(FunctionsComparator::CmpValues::ATTRIBUTES); + comparator.enable(FunctionsComparator::CmpValues::ACCURACY); +} + +INSTANTIATE_TEST_SUITE_P(FuseLSTMSequencesToBidirectionalLSTMSequence, + FuseLSTMSequencesToBidirectionalLSTMSequenceTest, + testing::Combine(testing::Values(false, true), testing::Values(false, true))); diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index 17c2574affb081..470454573c012b 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -21,6 +21,7 @@ #include "transformations/common_optimizations/add_fake_quantize_fusion.hpp" #include "transformations/fp16_compression/convert_compression_only_to_legacy.hpp" #include "transformations/common_optimizations/convert_quantize_dequantize.hpp" +#include "transformations/common_optimizations/lstm_cell_fusion.hpp" #include "transformations/common_optimizations/fq_mul_fusion.hpp" #include "transformations/common_optimizations/mul_fake_quantize_fusion.hpp" #include "transformations/common_optimizations/nop_elimination.hpp" @@ -425,6 +426,15 @@ void Transformations::PreLpt(const std::vector& defaultPrecis ov::pass::ConvertGRUSequenceToTensorIterator, ov::pass::ConvertLSTMSequenceToTensorIterator); + CPU_SET_CALLBACK_COMMON(manager, + [](const_node_ptr &node) -> bool { + std::string msg; + return !node::RNN::isSupportedOperation(node, msg); + }, + ov::pass::ConvertLoopToLSTMSequence, + ov::pass::FuseReverseLSTMSequence, + ov::pass::FuseLSTMSequencesToBidirectionalLSTMSequence); + CPU_SET_CALLBACK_COMMON(manager, [](const_node_ptr &node) -> bool { std::string msg; @@ -434,6 +444,13 @@ void Transformations::PreLpt(const std::vector& defaultPrecis ov::pass::GRUCellDecomposition, ov::pass::LSTMCellDecomposition); + CPU_SET_CALLBACK_COMMON(manager, + [](const_node_ptr &node) -> bool { + std::string msg; + return !node::RNN::isSupportedOperation(node, msg); + }, + ov::pass::LSTMCellFusion); + CPU_SET_CALLBACK_COMMON(manager, [](const_node_ptr &node) -> bool { std::string errorMessage; diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index f6b3e9ffda7830..4b0dafa847cc1d 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -56,6 +56,7 @@ #include "transformations/common_optimizations/broadcast_elementwise_fusion.hpp" #include "transformations/common_optimizations/broadcast_transition.hpp" #include "transformations/common_optimizations/lin_op_sequence_fusion.hpp" +#include "transformations/common_optimizations/lstm_cell_fusion.hpp" #include "transformations/common_optimizations/weights_dequantize_to_fake_quantize.hpp" #include "transformations/common_optimizations/convert_quantize_dequantize.hpp" #include "transformations/common_optimizations/wrap_interpolate_into_transposes.hpp" @@ -450,6 +451,11 @@ void TransformationsPipeline::apply(std::shared_ptr func) { return isCellPrimitiveSupported(node); }); + pass_config->set_callback( + [isCellPrimitiveSupported](const_node_ptr &node) -> bool { + return !isCellPrimitiveSupported(node); + }); + if (unroll_loop) { pass_config->set_callback func) { }); } + pass_config->set_callback( + [isSequencePrimitiveSupported](const_node_ptr &node) -> bool { + return !isSequencePrimitiveSupported(node); + }); pass_config->set_callback( [](const_node_ptr &node) -> bool { From 7987fef9ff6e9e0e0ddad57f5d8557cd4e71fad7 Mon Sep 17 00:00:00 2001 From: Vladislav Golubev Date: Wed, 7 Feb 2024 11:13:58 +0100 Subject: [PATCH 31/55] [LPT] Dequantization movement helpers: fixed incorrect calls in transformations, added asserts (#22519) ### Details: - *`NetworkHelper::moveDequantizationAfter`: changed behavior to throw an exception in case when `updateOutputPrecisions=false` and the target layer is not `TypeRelaxed`* - *Fixed `moveDequantizationAfter` calls in LPT which incorrectly set `updateOutputPrecisions` to false but was not covered in `TypeRelaxed`* - *The changes covered by LPT functional tests* ### Tickets: - *CVS-131058* - *CVS-130498* - *CVS-130646* --- .../low_precision/layer_transformation.hpp | 3 +- .../include/low_precision/network_helper.hpp | 3 +- .../src/batch_to_space.cpp | 2 +- .../src/gather.cpp | 2 +- .../src/interpolate.cpp | 2 +- .../src/layer_transformation.cpp | 6 +- .../src/max_pool.cpp | 2 +- .../src/move_fake_quantize.cpp | 2 +- .../src/network_helper.cpp | 16 ++-- .../low_precision_transformations/src/pad.cpp | 2 +- .../src/relu.cpp | 2 +- .../src/reshape.cpp | 2 +- .../src/shuffle_channels.cpp | 2 +- .../src/space_to_batch.cpp | 2 +- .../src/squeeze.cpp | 2 +- .../src/strided_slice.cpp | 2 +- .../src/transparent_base_transformation.cpp | 2 +- .../src/transpose.cpp | 2 +- .../src/unsqueeze.cpp | 2 +- .../low_precision_transformations_test.cpp | 70 ------------------ .../lpt_avoid_shapeof_propagation_test.cpp | 6 ++ ...ve_dequantization_after_transformation.cpp | 74 ++++++++++++++++--- .../move_dequantization_after.hpp | 6 +- .../src/move_dequantization_after.cpp | 53 ++++++++----- 24 files changed, 137 insertions(+), 130 deletions(-) delete mode 100644 src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp diff --git a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp index 87ce9fec59b8f3..b5062d5b761bcf 100644 --- a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp @@ -352,14 +352,13 @@ class LP_TRANSFORMATIONS_API LayerTransformation : public ov::pass::MatcherPass TransformationContext &context, const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, + const bool updateOutputPrecision = true, const bool moveSubtract = true) const; std::shared_ptr moveDequantizationBefore( TransformationContext& context, const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, const bool moveSubtract = true) const; bool updateOutput( diff --git a/src/common/low_precision_transformations/include/low_precision/network_helper.hpp b/src/common/low_precision_transformations/include/low_precision/network_helper.hpp index 5ca510079124c1..df5be5c8a22418 100644 --- a/src/common/low_precision_transformations/include/low_precision/network_helper.hpp +++ b/src/common/low_precision_transformations/include/low_precision/network_helper.hpp @@ -168,14 +168,13 @@ class LP_TRANSFORMATIONS_API NetworkHelper { static InsertDequantizationResult moveDequantizationAfter( const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, + const bool updateOutputPrecision, const bool moveSubtract, const std::vector& defaultPrecisions = precision_set::get_int8_support()); static InsertDequantizationResult moveDequantizationBefore( const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, const bool moveSubtract); static std::vector>> splitConstantsBeforeConcat( diff --git a/src/common/low_precision_transformations/src/batch_to_space.cpp b/src/common/low_precision_transformations/src/batch_to_space.cpp index cc80f95707eb70..0551ac9dcf2972 100644 --- a/src/common/low_precision_transformations/src/batch_to_space.cpp +++ b/src/common/low_precision_transformations/src/batch_to_space.cpp @@ -50,7 +50,7 @@ bool BatchToSpaceTransformation::transform(TransformationContext& context, ov::p } const std::shared_ptr op = NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions); - moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions), false); + moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/gather.cpp b/src/common/low_precision_transformations/src/gather.cpp index 59fbf5d7f78cba..86e699030fda4d 100644 --- a/src/common/low_precision_transformations/src/gather.cpp +++ b/src/common/low_precision_transformations/src/gather.cpp @@ -119,7 +119,7 @@ bool GatherTransformation::transform(TransformationContext& context, ov::pass::p replace_node(dequantization.subtractConstant, newConstant); } - moveDequantizationAfter(context, gather, NetworkHelper::getDequantization(gather, defaultPrecisions), false); + moveDequantizationAfter(context, gather, NetworkHelper::getDequantization(gather, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/interpolate.cpp b/src/common/low_precision_transformations/src/interpolate.cpp index 24855aac822ddd..56d47e0511cb20 100644 --- a/src/common/low_precision_transformations/src/interpolate.cpp +++ b/src/common/low_precision_transformations/src/interpolate.cpp @@ -60,7 +60,7 @@ bool InterpolateTransformation::transform(TransformationContext &context, ov::pa return false; } interpolate = NetworkHelper::separateInStandaloneBranch(interpolate, defaultPrecisions); - moveDequantizationAfter(context, interpolate, NetworkHelper::getDequantization(interpolate, defaultPrecisions), true); + moveDequantizationAfter(context, interpolate, NetworkHelper::getDequantization(interpolate, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/layer_transformation.cpp b/src/common/low_precision_transformations/src/layer_transformation.cpp index 86c2ba9e7df65c..d3e3103c107aa1 100644 --- a/src/common/low_precision_transformations/src/layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/layer_transformation.cpp @@ -397,11 +397,11 @@ std::shared_ptr LayerTransformation::moveDequantizationAfter( TransformationContext &context, const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, + const bool updateOutputPrecision, const bool moveSubtract) const { const auto result = ov::pass::low_precision::NetworkHelper::moveDequantizationAfter(operation, dequantization, - updatePrecision, + updateOutputPrecision, moveSubtract, defaultPrecisions); updateOutput(context, result.lastDequantization, result.newOperation); @@ -412,11 +412,9 @@ std::shared_ptr LayerTransformation::moveDequantizationBefore( TransformationContext& context, const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, const bool moveSubtract) const { const auto result = ov::pass::low_precision::NetworkHelper::moveDequantizationBefore(operation, dequantization, - updatePrecision, moveSubtract); updateOutput(context, result.newOperation, result.lastDequantization); return result.newOperation; diff --git a/src/common/low_precision_transformations/src/max_pool.cpp b/src/common/low_precision_transformations/src/max_pool.cpp index a2f4f70b0649de..8eb39f8a98603a 100644 --- a/src/common/low_precision_transformations/src/max_pool.cpp +++ b/src/common/low_precision_transformations/src/max_pool.cpp @@ -57,7 +57,7 @@ bool MaxPoolTransformation::transform(TransformationContext& context, ov::pass:: } const std::shared_ptr pooling = NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions); - moveDequantizationAfter(context, pooling, NetworkHelper::getDequantization(pooling, defaultPrecisions), false); + moveDequantizationAfter(context, pooling, NetworkHelper::getDequantization(pooling, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/move_fake_quantize.cpp b/src/common/low_precision_transformations/src/move_fake_quantize.cpp index 3c43c501efcb29..c2e550d447fd8d 100644 --- a/src/common/low_precision_transformations/src/move_fake_quantize.cpp +++ b/src/common/low_precision_transformations/src/move_fake_quantize.cpp @@ -148,7 +148,7 @@ bool MoveFakeQuantize::transform(TransformationContext& context, ov::pass::patte newConcat->set_friendly_name(concat->get_friendly_name()); NetworkHelper::copyInfo(concat, newConcat); if (!dequantization.empty()) { - moveDequantizationBefore(context, newConcat, dequantization, false); + moveDequantizationBefore(context, newConcat, dequantization); return true; } replace_node(fq, newConcat); diff --git a/src/common/low_precision_transformations/src/network_helper.cpp b/src/common/low_precision_transformations/src/network_helper.cpp index 327188c7003d50..be575495ff1052 100644 --- a/src/common/low_precision_transformations/src/network_helper.cpp +++ b/src/common/low_precision_transformations/src/network_helper.cpp @@ -1450,7 +1450,7 @@ std::shared_ptr NetworkHelper::optimizeSubtract(std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, + const bool updateOutputPrecision, const bool moveSubtract, const std::vector& defaultPrecisions) { assert( @@ -1466,6 +1466,10 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter // we must have dequantization multiply assert(dequantization.multiply != nullptr); + OPENVINO_ASSERT(operation->get_output_size() == 1, + "moveDequantizationAfter doesn't suppport dequantization propagation for layers with several outputs. (", + operation, " has ", operation->get_output_size(), " outputs)"); + OutputVector inputs = operation->input_values(); const size_t dequantizationIndex = getChildInputIndex(dequantization.multiply, operation); inputs[dequantizationIndex] = (!moveSubtract && dequantization.subtract != nullptr) ? @@ -1477,10 +1481,12 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter ov::copy_runtime_info(operation, newOperation); if (const auto op = std::dynamic_pointer_cast(newOperation)) { - op->set_overridden_output_type(updatePrecision ? + op->set_overridden_output_type(updateOutputPrecision ? newOperation->get_input_element_type(0) : dequantization.multiplyConstant->get_element_type()); newOperation->validate_and_infer_types(); + } else { + OPENVINO_ASSERT(updateOutputPrecision, "moveDequantizationAfter can't save old output precision since layer is not TypeRelaxed: ", newOperation); } std::shared_ptr parent = newOperation; @@ -1545,7 +1551,6 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationAfter NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefore( const std::shared_ptr& operation, const FakeQuantizeDequantization& dequantization, - const bool updatePrecision, const bool moveSubtract) { assert( (NetworkHelper::getDequantizationBelow(operation).subtractConstant == nullptr) || @@ -1642,11 +1647,8 @@ NetworkHelper::InsertDequantizationResult NetworkHelper::moveDequantizationBefor THROW_TRANSFORMATION_EXCEPTION << "dequantization operations must end with multiply"; } replace_node(dequantization.multiply, newOperation); - if (const auto op = std::dynamic_pointer_cast(newOperation)) { - op->set_overridden_output_type(updatePrecision ? - newOperation->get_input_element_type(0) : - dequantization.multiplyConstant->get_element_type()); + op->set_overridden_output_type(dequantization.multiplyConstant->get_element_type()); newOperation->validate_and_infer_types(); } diff --git a/src/common/low_precision_transformations/src/pad.cpp b/src/common/low_precision_transformations/src/pad.cpp index 859e5d9488f6cc..9119ebef34d0f5 100644 --- a/src/common/low_precision_transformations/src/pad.cpp +++ b/src/common/low_precision_transformations/src/pad.cpp @@ -163,7 +163,7 @@ bool PadTransformation::transform(TransformationContext& context, ov::pass::patt const auto convertedZero = ov::opset1::Constant::create(dequantization.data.get_element_type(), Shape{}, { padConstantValue }); pad->set_argument(3, convertedZero); - moveDequantizationAfter(context, pad, dequantization, true); + moveDequantizationAfter(context, pad, dequantization); return true; } diff --git a/src/common/low_precision_transformations/src/relu.cpp b/src/common/low_precision_transformations/src/relu.cpp index 4cc0f26ce0cc12..9e72d90a497179 100644 --- a/src/common/low_precision_transformations/src/relu.cpp +++ b/src/common/low_precision_transformations/src/relu.cpp @@ -42,7 +42,7 @@ bool ReluTransformation::transform(TransformationContext& context, ov::pass::pat relu = NetworkHelper::separateInStandaloneBranch(relu, defaultPrecisions); const FakeQuantizeDequantization dequantization = NetworkHelper::getDequantization(relu, defaultPrecisions, 0); - moveDequantizationAfter(context, relu, dequantization, false, false); + moveDequantizationAfter(context, relu, dequantization); return true; } diff --git a/src/common/low_precision_transformations/src/reshape.cpp b/src/common/low_precision_transformations/src/reshape.cpp index 0c5f83502df4e8..f8dfbfa8e00065 100644 --- a/src/common/low_precision_transformations/src/reshape.cpp +++ b/src/common/low_precision_transformations/src/reshape.cpp @@ -157,7 +157,7 @@ bool ReshapeTransformation::transform(TransformationContext& context, ov::pass:: reshape = ov::as_type_ptr(NetworkHelper::separateInStandaloneBranch(reshape, defaultPrecisions)); reshapeDequantizationConstant(reshape, defaultPrecisions); - moveDequantizationAfter(context, reshape, NetworkHelper::getDequantization(reshape, defaultPrecisions, 0), false); + moveDequantizationAfter(context, reshape, NetworkHelper::getDequantization(reshape, defaultPrecisions, 0)); return true; } diff --git a/src/common/low_precision_transformations/src/shuffle_channels.cpp b/src/common/low_precision_transformations/src/shuffle_channels.cpp index 9587d47939b9a6..332ddd0a8eb235 100644 --- a/src/common/low_precision_transformations/src/shuffle_channels.cpp +++ b/src/common/low_precision_transformations/src/shuffle_channels.cpp @@ -71,7 +71,7 @@ bool ShuffleChannelsTransformation::transform(TransformationContext& context, ov replace_node(dequantization.multiplyConstant, shuffledMulConst); dequantization.multiplyConstant = shuffledMulConst; - moveDequantizationAfter(context, shuffleChannels, dequantization, false); + moveDequantizationAfter(context, shuffleChannels, dequantization); return true; } diff --git a/src/common/low_precision_transformations/src/space_to_batch.cpp b/src/common/low_precision_transformations/src/space_to_batch.cpp index 75bf0f9dbbc559..0783f5e182dcc1 100644 --- a/src/common/low_precision_transformations/src/space_to_batch.cpp +++ b/src/common/low_precision_transformations/src/space_to_batch.cpp @@ -50,7 +50,7 @@ bool SpaceToBatchTransformation::transform(TransformationContext& context, ov::p } const std::shared_ptr op = NetworkHelper::separateInStandaloneBranch(m.get_match_root(), defaultPrecisions); - moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions), false); + moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/squeeze.cpp b/src/common/low_precision_transformations/src/squeeze.cpp index cdffa6e41f2edf..9570c74d12237b 100644 --- a/src/common/low_precision_transformations/src/squeeze.cpp +++ b/src/common/low_precision_transformations/src/squeeze.cpp @@ -66,7 +66,7 @@ bool SqueezeTransformation::transform(TransformationContext& context, ov::pass:: replace_node(dequantization.subtractConstant, newConstant); } - moveDequantizationAfter(context, squeeze, NetworkHelper::getDequantization(squeeze, defaultPrecisions), false); + moveDequantizationAfter(context, squeeze, NetworkHelper::getDequantization(squeeze, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/strided_slice.cpp b/src/common/low_precision_transformations/src/strided_slice.cpp index dbe9b852f875a2..3a067d2ee8265a 100644 --- a/src/common/low_precision_transformations/src/strided_slice.cpp +++ b/src/common/low_precision_transformations/src/strided_slice.cpp @@ -131,7 +131,7 @@ bool StridedSliceTransformation::transform(TransformationContext& context, ov::p replace_node(dequantization.multiplyConstant, new_mul_const); dequantization.multiplyConstant = new_mul_const; - moveDequantizationAfter(context, strided_slice, NetworkHelper::getDequantization(strided_slice, defaultPrecisions), false); + moveDequantizationAfter(context, strided_slice, NetworkHelper::getDequantization(strided_slice, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/transparent_base_transformation.cpp b/src/common/low_precision_transformations/src/transparent_base_transformation.cpp index 8630dfc932422f..014303f1b8cfab 100644 --- a/src/common/low_precision_transformations/src/transparent_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/transparent_base_transformation.cpp @@ -20,7 +20,7 @@ bool TransparentBaseTransformation::transform(TransformationContext& context, ov } op = NetworkHelper::separateInStandaloneBranch(op, defaultPrecisions); - moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions), true); + moveDequantizationAfter(context, op, NetworkHelper::getDequantization(op, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/src/transpose.cpp b/src/common/low_precision_transformations/src/transpose.cpp index eb40b4e183abaa..7b4c68ddc780d6 100644 --- a/src/common/low_precision_transformations/src/transpose.cpp +++ b/src/common/low_precision_transformations/src/transpose.cpp @@ -90,7 +90,7 @@ bool TransposeTransformation::transform(TransformationContext& context, ov::pass transpose = NetworkHelper::separateInStandaloneBranch(transpose, defaultPrecisions); transposeDequantizationConstant(transpose, defaultPrecisions); - moveDequantizationAfter(context, transpose, NetworkHelper::getDequantization(transpose, defaultPrecisions, 0), false); + moveDequantizationAfter(context, transpose, NetworkHelper::getDequantization(transpose, defaultPrecisions, 0)); return true; } diff --git a/src/common/low_precision_transformations/src/unsqueeze.cpp b/src/common/low_precision_transformations/src/unsqueeze.cpp index 76967e2cca4de8..4b9e8b684e1f4e 100644 --- a/src/common/low_precision_transformations/src/unsqueeze.cpp +++ b/src/common/low_precision_transformations/src/unsqueeze.cpp @@ -68,7 +68,7 @@ bool UnsqueezeTransformation::transform(TransformationContext& context, ov::pass replace_node(dequantization.subtractConstant, newConstant); } - moveDequantizationAfter(context, unsqueeze, NetworkHelper::getDequantization(unsqueeze, defaultPrecisions), false); + moveDequantizationAfter(context, unsqueeze, NetworkHelper::getDequantization(unsqueeze, defaultPrecisions)); return true; } diff --git a/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp b/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp deleted file mode 100644 index 8179503e732d31..00000000000000 --- a/src/common/low_precision_transformations/tests/low_precision_transformations_test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "low_precision/concat.hpp" -#include "low_precision/convolution.hpp" -#include "low_precision/mat_mul.hpp" -#include "low_precision/fuse_convert.hpp" - -using namespace ::testing; -using namespace ov::pass::low_precision; - -class smoke_LPT_LowPrecisionTransformationsTests : public Test {}; - -// TODO: LPT: not implemented -TEST_F(smoke_LPT_LowPrecisionTransformationsTests, DISABLED_removeAll) { - //TODO: FIXME - ASSERT_EQ(1, 0); - //LowPrecisionTransformations transformations = LowPrecisionTransformer::getAllTransformations(LayerTransformation::Params()); - //auto transformation = transformations.find("Convolution"); - //ASSERT_NE(0, transformation.size()); - - //transformations.removeAll(); - //transformation = transformations.find("Convolution"); - //ASSERT_EQ(0, transformation.size()); -} -// -//TEST_F(LowPrecisionTransformationsTests, removeBranchSpecific) { -// LowPrecisionTransformations transformations = LowPrecisionTransformer::getAllTransformations(LayerTransformation::Params()); -// auto transformation = transformations.find("Concat"); -// ASSERT_NE(0, transformation.size()); -// -// transformations.removeBranchSpecific(); -// transformation = transformations.find("Concat"); -// ASSERT_EQ(0, transformation.size()); -//} -// -//TEST_F(LowPrecisionTransformationsTests, remove) { -// LowPrecisionTransformations transformations = LowPrecisionTransformer::getAllTransformations(LayerTransformation::Params()); -// auto transformation = transformations.find("MatMul"); -// ASSERT_NE(0, transformation.size()); -// -// transformations.remove(); -// transformation = transformations.find("MatMul"); -// ASSERT_EQ(0, transformation.size()); -//} -// -//TEST_F(LowPrecisionTransformationsTests, removeCleanup) { -// LowPrecisionTransformations transformations = LowPrecisionTransformer::getAllTransformations(LayerTransformation::Params()); -// auto transformation = transformations.find("Multiply"); -// ASSERT_NE(0, transformation.size()); -// const size_t originalSize = transformation.size(); -// -// transformations.removeCleanup(); -// transformation = transformations.find("Multiply"); -// ASSERT_EQ(originalSize - 1, transformation.size()); -//} -// -//TEST_F(LowPrecisionTransformationsTests, removeStandaloneCleanup) { -// LowPrecisionTransformations transformations = LowPrecisionTransformer::getAllTransformations(LayerTransformation::Params()); -// auto transformation = transformations.find("Multiply"); -// ASSERT_NE(0, transformation.size()); -// const size_t originalSize = transformation.size(); -// -// transformations.removeStandaloneCleanup(); -// transformation = transformations.find("Multiply"); -// ASSERT_EQ(originalSize - 1, transformation.size()); -//} diff --git a/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp b/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp index f8e2ddb16e28db..44f6e884a766bc 100644 --- a/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp +++ b/src/common/low_precision_transformations/tests/lpt_avoid_shapeof_propagation_test.cpp @@ -20,6 +20,7 @@ #include "low_precision/fake_quantize_decomposition.hpp" #include "low_precision/group_convolution.hpp" #include "low_precision/interpolate.hpp" +#include "low_precision/low_precision.hpp" #include "low_precision/mat_mul.hpp" #include "low_precision/max_pool.hpp" #include "low_precision/multiply_partial.hpp" @@ -86,6 +87,7 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationAvgPoolTransformation) { auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; + m.register_pass(); m.register_pass(); m.run_passes(f); @@ -106,6 +108,7 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationClampTransformation) { auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; + m.register_pass(); m.register_pass(); m.run_passes(f); @@ -445,6 +448,7 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationPReluTransformation) { auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; + m.register_pass(); m.register_pass(); m.run_passes(f); @@ -487,6 +491,7 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceMeanTransformation) { auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; + m.register_pass(); m.register_pass(); m.run_passes(f); @@ -529,6 +534,7 @@ TEST(LPT, AvoidDequantizationToShapeOfPropagationReduceSumTransformation) { auto f = std::make_shared(ResultVector{result1, result2}, ParameterVector{input}); pass::Manager m; + m.register_pass(); m.register_pass(); m.run_passes(f); diff --git a/src/common/low_precision_transformations/tests/move_dequantization_after_transformation.cpp b/src/common/low_precision_transformations/tests/move_dequantization_after_transformation.cpp index 5e69a03dd24021..b775b4c9865a65 100644 --- a/src/common/low_precision_transformations/tests/move_dequantization_after_transformation.cpp +++ b/src/common/low_precision_transformations/tests/move_dequantization_after_transformation.cpp @@ -36,13 +36,28 @@ class MoveDequantizationAfterTransformationParams { ov::element::Type precisionAfterOperation; ov::builder::subgraph::DequantizationOperations dequantizationAfter; }; + MoveDequantizationAfterTransformationParams(ov::element::Type originalPrecision, + TestTransformationParams params, + bool updateOutputPrecision, + bool moveSubtract, + Actual actual, + Expected expected, + bool typeRelaxed = true) + : originalPrecision(originalPrecision), + params(params), + updateOutputPrecision(updateOutputPrecision), + moveSubtract(moveSubtract), + actual(std::move(actual)), + expected(std::move(expected)), + typeRelaxed(typeRelaxed) {} ov::element::Type originalPrecision; TestTransformationParams params; - bool updatePrecision; + bool updateOutputPrecision; bool moveSubtract; Actual actual; Expected expected; + bool typeRelaxed; }; typedef std::tuple< @@ -59,14 +74,15 @@ class MoveDequantizationAfterTransformation : actualFunction = ov::builder::subgraph::MoveDequantizationAfterFunction::getOriginal( testValues.originalPrecision, inputShape, - testValues.actual.dequantization); + testValues.actual.dequantization, + testValues.typeRelaxed); const auto targetNode = actualFunction->get_output_op(0)->get_input_node_shared_ptr(0); const auto dequantization = ov::pass::low_precision::NetworkHelper::getDequantization(targetNode); ov::pass::low_precision::NetworkHelper::moveDequantizationAfter( targetNode, dequantization, - testValues.updatePrecision, + testValues.updateOutputPrecision, testValues.moveSubtract); referenceFunction = ov::builder::subgraph::MoveDequantizationAfterFunction::getReference( @@ -74,7 +90,8 @@ class MoveDequantizationAfterTransformation : inputShape, testValues.expected.dequantizationBefore, testValues.expected.precisionAfterOperation, - testValues.expected.dequantizationAfter); + testValues.expected.dequantizationAfter, + testValues.typeRelaxed); } static std::string getTestCaseName(testing::TestParamInfo obj) { @@ -87,7 +104,8 @@ class MoveDequantizationAfterTransformation : inputShape << "_" << testValues.actual.dequantization << "_" << (testValues.moveSubtract ? "move_subtract_" : "don't_move_subtract_") << - (testValues.updatePrecision ? "updatePrecision" : "don't_update_precision"); + (testValues.updateOutputPrecision ? "updateOutputPrecision_" : "don't_update_precision_") << + (testValues.typeRelaxed ? "typeRelaxed" : "not_typeRelaxed"); return result.str(); } }; @@ -100,6 +118,7 @@ TEST_P(MoveDequantizationAfterTransformation, CompareFunctions) { ASSERT_TRUE(LayerTransformation::allNamesAreUnique(actualFunction)) << "Not all names are unique"; } +namespace { const std::vector inputShapes = { { 1, 3, 16, 16 }, { 4, 3, 16, 16 } @@ -136,7 +155,7 @@ const std::vector testValues = { { {}, {}, { 10.f } }, }, }, - // updatePrecision = false + // updateOutputPrecision = false { ov::element::u8, LayerTransformation::createParamsU8I8(), @@ -151,7 +170,7 @@ const std::vector testValues = { { {}, { 7.f }, { 10.f } }, }, }, - // moveSubtract = false & updatePrecision = false + // moveSubtract = false & updateOutputPrecision = false { ov::element::u8, LayerTransformation::createParamsU8I8(), @@ -196,7 +215,7 @@ const std::vector testValues = { { {}, {}, { 10.f } }, }, }, - // updatePrecision = false + // updateOutputPrecision = false { ov::element::i8, LayerTransformation::createParamsI8I8(), @@ -211,7 +230,7 @@ const std::vector testValues = { { {}, { 7.f }, { 10.f } }, }, }, - // moveSubtract = false & updatePrecision = false + // moveSubtract = false & updateOutputPrecision = false { ov::element::i8, LayerTransformation::createParamsI8I8(), @@ -256,6 +275,22 @@ const std::vector testValues = { { {}, {}, { { 10.f, 12.f, 16.f } } }, }, }, + // updateOutputPrecision = true & typeRelaxed = false + { + ov::element::u8, + LayerTransformation::createParamsU8I8(), + true, + true, + { + { {ov::element::f32}, { 7.f }, { 10.f } }, + }, + { + { {}, {}, {} }, + ov::element::u8, + { {ov::element::f32}, { 7.f }, { 10.f } }, + }, + false + }, }; INSTANTIATE_TEST_SUITE_P( @@ -265,3 +300,24 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(inputShapes), ::testing::ValuesIn(testValues)), MoveDequantizationAfterTransformation::getTestCaseName); +} // namespace + +TEST(LPT, MoveDequantizationAfterTransformationNegative) { + const bool typeRelaxed = false; + const bool updateOutputPrecision = false; + + auto model = ov::builder::subgraph::MoveDequantizationAfterFunction::getOriginal( + ov::element::u8, + ov::Shape{1, 3, 16, 16}, + ov::builder::subgraph::DequantizationOperations{{ov::element::f32}, {7.f}, {10.f}}, + typeRelaxed); + + const auto targetNode = model->get_output_op(0)->get_input_node_shared_ptr(0); + const auto dequantization = ov::pass::low_precision::NetworkHelper::getDequantization(targetNode); + + // updateOutputPrecision is supported only for type relaxed nodes + EXPECT_ANY_THROW(ov::pass::low_precision::NetworkHelper::moveDequantizationAfter(targetNode, + dequantization, + updateOutputPrecision, + true)); +} diff --git a/src/tests/ov_helpers/ov_lpt_models/include/ov_lpt_models/move_dequantization_after.hpp b/src/tests/ov_helpers/ov_lpt_models/include/ov_lpt_models/move_dequantization_after.hpp index 8fc307e23ee1ee..3403b606a5499b 100644 --- a/src/tests/ov_helpers/ov_lpt_models/include/ov_lpt_models/move_dequantization_after.hpp +++ b/src/tests/ov_helpers/ov_lpt_models/include/ov_lpt_models/move_dequantization_after.hpp @@ -17,14 +17,16 @@ class MoveDequantizationAfterFunction { static std::shared_ptr getOriginal( const ov::element::Type precision, const ov::Shape& inputShape, - const ov::builder::subgraph::DequantizationOperations dequantization); + const ov::builder::subgraph::DequantizationOperations dequantization, + const bool typeRelaxed = true); static std::shared_ptr getReference( const ov::element::Type precision, const ov::Shape& inputShape, const ov::builder::subgraph::DequantizationOperations dequantizationBefore, const ov::element::Type precisionAfterOperation, - const ov::builder::subgraph::DequantizationOperations dequantizationAfter); + const ov::builder::subgraph::DequantizationOperations dequantizationAfter, + const bool typeRelaxed = true); }; } // namespace subgraph diff --git a/src/tests/ov_helpers/ov_lpt_models/src/move_dequantization_after.cpp b/src/tests/ov_helpers/ov_lpt_models/src/move_dequantization_after.cpp index ba01fe7d965261..a0ef6e1acbee10 100644 --- a/src/tests/ov_helpers/ov_lpt_models/src/move_dequantization_after.cpp +++ b/src/tests/ov_helpers/ov_lpt_models/src/move_dequantization_after.cpp @@ -16,16 +16,26 @@ namespace subgraph { std::shared_ptr MoveDequantizationAfterFunction::getOriginal( const ov::element::Type precision, const ov::Shape& inputShape, - const ov::builder::subgraph::DequantizationOperations dequantization) { + const ov::builder::subgraph::DequantizationOperations dequantization, + const bool typeRelaxed) { const auto input = std::make_shared(precision, inputShape); const auto deq = makeDequantization(input, dequantization); - const auto op = - ov::opset1::MaxPool(deq, Strides{1, 1}, Shape{1, 1}, Shape{0, 0}, Shape{2, 2}, ov::op::RoundingType::FLOOR); - const auto targetOp = std::make_shared>( - op, - std::vector{ov::element::f32, ov::element::f32}, - std::vector{}); + const auto targetOp = typeRelaxed ? std::make_shared>( + std::vector{ov::element::f32, ov::element::f32}, + std::vector{}, + deq, + Strides{1, 1}, + Shape{1, 1}, + Shape{0, 0}, + Shape{2, 2}, + ov::op::RoundingType::FLOOR) + : std::make_shared(deq, + Strides{1, 1}, + Shape{1, 1}, + Shape{0, 0}, + Shape{2, 2}, + ov::op::RoundingType::FLOOR); auto& rtInfo = targetOp->get_rt_info(); rtInfo["Variant::std::string"] = "targetOp"; @@ -40,21 +50,26 @@ namespace subgraph { const ov::Shape& inputShape, const ov::builder::subgraph::DequantizationOperations dequantizationBefore, const ov::element::Type precisionAfterOperation, - const ov::builder::subgraph::DequantizationOperations dequantizationAfter) { + const ov::builder::subgraph::DequantizationOperations dequantizationAfter, + const bool typeRelaxed) { const auto input = std::make_shared(precision, inputShape); const auto deqBefore = makeDequantization(input, dequantizationBefore); - const auto op = ov::opset1::MaxPool(deqBefore, - Strides{1, 1}, - Shape{1, 1}, - Shape{0, 0}, - Shape{2, 2}, - ov::op::RoundingType::FLOOR); - const auto targetOp = std::make_shared>( - op, - std::vector{ov::element::f32, ov::element::f32}, - std::vector{}); - ov::pass::low_precision::NetworkHelper::setOutDataPrecisionForTypeRelaxed(targetOp, precisionAfterOperation); + const auto targetOp = typeRelaxed ? std::make_shared>( + std::vector{ov::element::f32, ov::element::f32}, + std::vector{precisionAfterOperation}, + deqBefore, + Strides{1, 1}, + Shape{1, 1}, + Shape{0, 0}, + Shape{2, 2}, + ov::op::RoundingType::FLOOR) + : std::make_shared(deqBefore, + Strides{1, 1}, + Shape{1, 1}, + Shape{0, 0}, + Shape{2, 2}, + ov::op::RoundingType::FLOOR); auto& rtInfo = targetOp->get_rt_info(); rtInfo["Variant::std::string"] = "targetOp"; From b7a0444e1f50697d3b9fa171aec033d760848984 Mon Sep 17 00:00:00 2001 From: Andrei Kashchikhin Date: Wed, 7 Feb 2024 10:53:58 +0000 Subject: [PATCH 32/55] [CI] [GHA] Add logs showing and uploading for Coverity (#22698) As the project has a limited number of daily runs, I suggest merging these changes and verifying them in the next nightly run. --- .github/workflows/coverity.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 53d34680b62b5b..de7d53265ca2e3 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -146,3 +146,15 @@ jobs: --form description="https://github.com/openvinotoolkit/openvino/runs/${{ github.run_number }}" \ https://scan.coverity.com/builds?project=openvino popd + + - name: Show Coverity configure logs + continue-on-error: true + run: cov-configure -c ${COVERITY_TOOL_DIR}/cov-analysis-linux64-2023.6.2/config/coverity_config.xml -lscc text + + - name: Upload Coverity logs + uses: actions/upload-artifact@v3 + if: always() + with: + name: coverity_logs + path: ${{ env.BUILD_DIR }}/cov-int/build-log.txt + if-no-files-found: 'error' From ad97bc557db2ce133a9ba85afadfb77c6d4ff1e0 Mon Sep 17 00:00:00 2001 From: Sergey Shlyapnikov Date: Wed, 7 Feb 2024 14:58:34 +0400 Subject: [PATCH 33/55] [GPU] Do not use oneDNN impls with dynamic paddings (#22692) ### Details: - This PR fixes the accuracy on dGPUs in LLMs compressed models. oneDNN can't handle dynamic paddings properly, so change impl back to ocl. ### Tickets: - 131241 --- .../src/graph/graph_optimizer/prepare_buffer_fusing.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp index db9216202cfb55..64ed3013efe97a 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_buffer_fusing.cpp @@ -693,6 +693,14 @@ void prepare_buffer_fusing::run(program& p) { if (gather_prim) { update_dep(gather_prim); } + + // Fallback to ocl impl since oneDNN doesn't support dynamic paddings + for (auto user : node.get_users()) { + if (user->get_preferred_impl_type() == impl_types::onednn) { + GPU_DEBUG_TRACE_DETAIL << user->id() << ": change impl to ocl because of dynamic input paddings\n"; + user->set_preferred_impl_type(impl_types::ocl); + } + } } }); program_helpers::do_for_types(*node, [](read_value_node& node) { From 47c738f556ada559433686f9c05fdb7a4ad2bb6e Mon Sep 17 00:00:00 2001 From: Georgy Krivoruchko Date: Wed, 7 Feb 2024 03:26:10 -0800 Subject: [PATCH 34/55] [ONNX] Frontend refactoring: cleanup (#22695) ### Details: - Updated docs - Updated *.py tests - Updated *.prototxt - Removed an unused quant_conv.cpp/hpp - Fix in comments in operator_set.hpp ### Tickets: - 125501 --- src/frontends/onnx/docs/how_to_add_op.md | 58 ++-- .../onnx/frontend/src/core/operator_set.hpp | 2 +- .../onnx/frontend/src/op/quant_conv.cpp | 275 ------------------ .../onnx/frontend/src/op/quant_conv.hpp | 29 -- src/frontends/onnx/tests/models/abs.prototxt | 2 +- .../onnx/tests/models/acosh.prototxt | 2 +- .../onnx/tests/models/add_abc.prototxt | 2 +- .../onnx/tests/models/add_abc_3d.prototxt | 2 +- .../models/add_abc_initializers.prototxt | 2 +- .../onnx/tests/models/add_bcast.prototxt | 2 +- .../models/add_v6_broadcast_axes_1_2.prototxt | 2 +- .../models/add_v6_broadcast_axis_1.prototxt | 2 +- .../models/add_v6_broadcast_dynamic.prototxt | 2 +- .../models/add_v6_broadcast_no_axis.prototxt | 2 +- .../onnx/tests/models/add_v7.prototxt | 2 +- .../onnx/tests/models/addmul_abc.prototxt | 2 +- .../onnx/tests/models/affine.prototxt | 2 +- .../onnx/tests/models/argmax_float.prototxt | 2 +- .../onnx/tests/models/argmax_int32.prototxt | 2 +- .../models/argmax_select_last_index.prototxt | 2 +- .../onnx/tests/models/argmin_float.prototxt | 2 +- .../onnx/tests/models/argmin_int32.prototxt | 2 +- .../tests/models/argmin_no_keepdims.prototxt | 2 +- .../models/argmin_select_last_index.prototxt | 2 +- .../onnx/tests/models/asinh.prototxt | 2 +- .../onnx/tests/models/atanh.prototxt | 2 +- .../aten_embedding_sum_many_outputs.prototxt | 2 +- .../aten_embedding_sum_offset_3in.prototxt | 2 +- .../aten_embedding_sum_offset_4in.prototxt | 2 +- .../aten_embedding_sum_packed_2in.prototxt | 2 +- ...edding_sum_packed_3in_offset_none.prototxt | 2 +- ...sum_packed_4in_per_sample_weights.prototxt | 2 +- ...embedding_sum_packed_4in_two_none.prototxt | 2 +- .../aten_unsupported_embedding_mode.prototxt | 2 +- .../models/aten_unsupported_operator.prototxt | 2 +- .../tests/models/average_pool_2d.prototxt | 2 +- .../models/average_pool_2d_pads.prototxt | 2 +- .../average_pool_empty_auto_pad.prototxt | 2 +- .../tests/models/batchnorm_default.prototxt | 2 +- .../onnx/tests/models/bitwise_not.prototxt | 2 +- .../models/blackmanwindow_periodic.prototxt | 2 +- .../models/blackmanwindow_symmetric.prototxt | 2 +- .../onnx/tests/models/bool_const_op.prototxt | 2 +- .../onnx/tests/models/bool_init_and.prototxt | 2 +- .../onnx/tests/models/bool_init_raw.prototxt | 2 +- .../onnx/tests/models/bool_input_or.prototxt | 2 +- .../castlike_bfloat16_to_float32.prototxt | 2 +- .../models/castlike_float16_to_int64.prototxt | 2 +- .../castlike_float16_to_uint32.prototxt | 2 +- .../castlike_float32_to_bfloat16.prototxt | 2 +- .../models/castlike_float64_to_int32.prototxt | 2 +- .../models/castlike_float64_to_int64.prototxt | 2 +- .../models/castlike_int32_to_float64.prototxt | 2 +- .../models/castlike_int8_to_float16.prototxt | 2 +- .../models/castlike_int8_to_int16.prototxt | 2 +- .../models/castlike_int8_to_uint16.prototxt | 2 +- .../tests/models/clip_no_min_no_max.prototxt | 2 +- .../models/clip_no_min_no_max_int64.prototxt | 2 +- .../tests/models/clip_no_min_set_max.prototxt | 2 +- .../models/clip_no_min_set_max_int64.prototxt | 2 +- .../tests/models/clip_set_min_no_max.prototxt | 2 +- .../clip_set_min_no_max_initializers.prototxt | 2 +- .../models/clip_set_min_set_max.prototxt | 2 +- ...clip_set_min_set_max_initializers.prototxt | 2 +- .../models/com.microsoft/attention.prototxt | 2 +- .../attention_dynamic_shapes.prototxt | 2 +- .../attention_extra_add.prototxt | 2 +- .../attention_mask_index_1.prototxt | 2 +- .../attention_mask_index_2.prototxt | 2 +- .../attention_mask_index_3.prototxt | 2 +- .../attention_mask_index_4.prototxt | 2 +- .../com.microsoft/attention_past.prototxt | 2 +- .../attention_qkv_hidden_sizes.prototxt | 2 +- .../attention_unidirectional.prototxt | 2 +- .../models/com.microsoft/bias_gelu.prototxt | 2 +- .../embed_layer_normalization.prototxt | 2 +- ...ayer_normalization_dynamic_shapes.prototxt | 2 +- ..._dynamic_shapes_with_position_ids.prototxt | 2 +- ...malization_with_segment_embedding.prototxt | 2 +- ...n_with_segment_embedding_and_mask.prototxt | 2 +- .../com.microsoft/fused_conv_clip.prototxt | 2 +- .../fused_conv_hard_sigmoid.prototxt | 2 +- .../fused_conv_leaky_relu.prototxt | 2 +- .../com.microsoft/fused_conv_relu.prototxt | 2 +- .../fused_conv_relu_z_input.prototxt | 2 +- .../com.microsoft/fused_conv_sigmoid.prototxt | 2 +- .../com.microsoft/fused_conv_tanh.prototxt | 2 +- .../models/com.microsoft/fusedgemm.prototxt | 2 +- ...ayer_normalization_dynamic_shapes.prototxt | 2 +- ...ip_layer_normalization_with_gamma.prototxt | 2 +- ...yer_normalization_with_gamma_beta.prototxt | 2 +- ...ormalization_with_gamma_beta_bias.prototxt | 2 +- .../models/com.microsoft/trilu_lower.prototxt | 2 +- .../onnx/tests/models/compress_0.prototxt | 2 +- .../onnx/tests/models/compress_1.prototxt | 2 +- .../models/compress_default_axis.prototxt | 2 +- .../models/compress_negative_axis.prototxt | 2 +- .../onnx/tests/models/concat.prototxt | 2 +- .../tests/models/concat_empty_init.prototxt | 2 +- .../models/concat_negative_axis.prototxt | 2 +- .../models/constant_bfloat_tensor.prototxt | 2 +- .../models/constant_fill_extra_shape.prototxt | 2 +- ...fill_input_as_shape_default_value.prototxt | 2 +- ...stant_fill_input_as_shape_u8_type.prototxt | 2 +- .../constant_fill_shape_attribute.prototxt | 2 +- .../models/constant_float_array.prototxt | 2 +- .../models/constant_float_scalar.prototxt | 2 +- .../models/constant_float_tensor.prototxt | 2 +- .../models/constant_integer_array.prototxt | 2 +- .../models/constant_integer_scalar.prototxt | 2 +- .../constant_of_shape_empty_init.prototxt | 2 +- .../constant_of_shape_null_node.prototxt | 2 +- .../models/constant_sparse_tensor.prototxt | 2 +- ...nstant_sparse_tensor_bfloat16_3x4.prototxt | 2 +- ...onstant_sparse_tensor_boolean_3x4.prototxt | 2 +- ...constant_sparse_tensor_double_3x4.prototxt | 2 +- ...onstant_sparse_tensor_float16_3x4.prototxt | 2 +- ...stant_sparse_tensor_float_2x2x3x4.prototxt | 2 +- ...onstant_sparse_tensor_float_2x3x4.prototxt | 2 +- .../constant_sparse_tensor_float_3x4.prototxt | 2 +- ...nsor_float_3x4_linearized_indices.prototxt | 2 +- ...constant_sparse_tensor_float_8x17.prototxt | 2 +- .../constant_sparse_tensor_int16_3x4.prototxt | 2 +- .../constant_sparse_tensor_int32_3x4.prototxt | 2 +- .../constant_sparse_tensor_int64_3x4.prototxt | 2 +- .../constant_sparse_tensor_int8_3x4.prototxt | 2 +- ...constant_sparse_tensor_uint16_3x4.prototxt | 2 +- ...constant_sparse_tensor_uint32_3x4.prototxt | 2 +- ...constant_sparse_tensor_uint64_3x4.prototxt | 2 +- .../constant_sparse_tensor_uint8_3x4.prototxt | 2 +- ...if_branches_with_different_inputs.prototxt | 2 +- ...if_branches_with_multiple_outputs.prototxt | 2 +- .../if_branches_with_same_inputs.prototxt | 2 +- .../if_branches_without_inputs.prototxt | 2 +- .../controlflow/if_dynamic_inputs.prototxt | 2 +- .../models/controlflow/if_inside_if.prototxt | 2 +- .../if_inside_if_inside_loop.prototxt | 2 +- .../controlflow/if_inside_loop.prototxt | 2 +- .../if_missing_else_branch.prototxt | 2 +- .../if_missing_then_branch.prototxt | 2 +- ..._mismatch_between_branches_output.prototxt | 2 +- .../models/controlflow/loop_2d_add.prototxt | 2 +- ...add_cond_and_trip_count_as_inputs.prototxt | 2 +- ...rip_count_as_inputs_static_shapes.prototxt | 2 +- .../loop_2d_add_const_cond.prototxt | 2 +- ...onst_no_identity_termination_cond.prototxt | 2 +- ...ty_termination_cond_static_shapes.prototxt | 2 +- ...d_add_incorrect_access_body_scope.prototxt | 2 +- ...add_initializer_from_parent_scope.prototxt | 2 +- ...op_2d_add_input_from_parent_graph.prototxt | 2 +- ..._add_no_identity_termination_cond.prototxt | 2 +- ...o_identity_termination_cond_false.prototxt | 2 +- ...ty_termination_cond_static_shapes.prototxt | 2 +- ...oop_2d_add_node_from_parent_scope.prototxt | 2 +- .../loop_2d_add_the_same_name.prototxt | 2 +- ...d_add_trip_count_and_cond_skipped.prototxt | 2 +- .../loop_2d_add_trip_count_dynamic.prototxt | 2 +- .../loop_2d_add_trip_count_max_int.prototxt | 2 +- .../controlflow/loop_2d_mul_opset1.prototxt | 2 +- ...ode_from_parent_scope_infer_types.prototxt | 2 +- ..._scope_used_in_parent_and_in_body.prototxt | 2 +- .../controlflow/loop_concat_values.prototxt | 2 +- .../models/controlflow/loop_infinite.prototxt | 2 +- .../models/controlflow/loop_pow.prototxt | 2 +- .../controlflow/loop_scalars_add.prototxt | 2 +- ...x_controlflow_loop_2d_infer_types.prototxt | 2 +- ...onv2d_dilation_assym_pads_strides.prototxt | 2 +- .../onnx/tests/models/conv3d_bias.prototxt | 2 +- .../models/conv_fp16_W_as_int32.prototxt | 2 +- .../onnx/tests/models/conv_integer.prototxt | 2 +- .../tests/models/conv_integer_int8.prototxt | 2 +- .../conv_integer_no_zero_point.prototxt | 2 +- .../models/conv_integer_overload.prototxt | 2 +- .../models/conv_integer_scalar_zp.prototxt | 2 +- .../conv_integer_vector_w_zero_point.prototxt | 2 +- .../models/conv_transpose_w_groups.prototxt | 2 +- ...th_strides_and_asymmetric_padding.prototxt | 2 +- .../conv_with_strides_no_padding.prototxt | 2 +- .../models/conv_with_strides_padding.prototxt | 2 +- .../conv_with_strides_padding_bias.prototxt | 2 +- .../models/convtranspose_dyn_data.prototxt | 2 +- .../models/convtranspose_dyn_filters.prototxt | 2 +- .../convtranspose_groups_pads_bias.prototxt | 2 +- .../convtranspose_groups_w_pads.prototxt | 2 +- .../convtranspose_output_shape.prototxt | 2 +- ...output_shape_auto_pads_same_lower.prototxt | 2 +- ...output_shape_auto_pads_same_upper.prototxt | 2 +- src/frontends/onnx/tests/models/cosh.prototxt | 2 +- src/frontends/onnx/tests/models/crop.prototxt | 2 +- .../tests/models/crop_with_scale.prototxt | 2 +- .../onnx/tests/models/cum_sum_1d.prototxt | 2 +- .../models/cum_sum_2d_axis_input.prototxt | 2 +- .../models/cum_sum_2d_axis_input_1d.prototxt | 2 +- .../cum_sum_2d_dynamic_axis_input.prototxt | 2 +- .../cum_sum_2d_dynamic_axis_input_1d.prototxt | 2 +- .../cum_sum_3d_exclusive_reverse.prototxt | 2 +- .../tests/models/custom_operator.prototxt | 2 +- .../custom_operator_default_domain.prototxt | 2 +- .../tests/models/dangling_parameter.prototxt | 2 +- .../onnx/tests/models/depth_to_space.prototxt | 2 +- .../depth_to_space_bad_blocksize.prototxt | 2 +- .../depth_to_space_bad_input_shape.prototxt | 2 +- .../models/depth_to_space_bad_mode.prototxt | 2 +- .../tests/models/depth_to_space_crd.prototxt | 2 +- .../depth_to_space_no_blocksize.prototxt | 2 +- .../tests/models/depth_to_space_v1.prototxt | 2 +- .../onnx/tests/models/dequant_lin.prototxt | 2 +- .../tests/models/dequantize_linear_0.prototxt | 2 +- .../tests/models/dequantize_linear_1.prototxt | 2 +- .../tests/models/dequantize_linear_2.prototxt | 2 +- .../tests/models/dequantize_linear_3.prototxt | 2 +- .../tests/models/dequantize_linear_4.prototxt | 2 +- .../dequantize_linear_4_dynamic.prototxt | 2 +- .../tests/models/dequantize_linear_5.prototxt | 2 +- .../dequantize_linear_no_zero_point.prototxt | 2 +- ...uantize_linear_scalar_ignore_axis.prototxt | 2 +- .../dequantize_linear_scalar_inputs.prototxt | 2 +- .../dequantize_linear_scalar_scale.prototxt | 2 +- ...inear_scalar_scale_and_zero_point.prototxt | 2 +- ...quantize_linear_scalar_zero_point.prototxt | 2 +- .../models/dequantize_linear_u16.prototxt | 2 +- .../tests/models/detection_output.prototxt | 2 +- src/frontends/onnx/tests/models/div.prototxt | 2 +- .../models/div_v6_broadcast_axes_1_2.prototxt | 2 +- .../models/div_v6_broadcast_axis_1.prototxt | 2 +- .../models/div_v6_broadcast_no_axis.prototxt | 2 +- .../onnx/tests/models/div_v7.prototxt | 2 +- .../tests/models/div_v7_broadcast.prototxt | 2 +- ...pout12_no_training_no_return_mask.prototxt | 2 +- ...dropout12_no_training_return_mask.prototxt | 2 +- ...ropout12_no_traning_no_const_rato.prototxt | 2 +- ...dropout12_not_const_training_mode.prototxt | 2 +- .../models/dropout12_training_mode.prototxt | 2 +- ...opout1_no_training_no_return_mask.prototxt | 2 +- .../dropout1_no_training_return_mask.prototxt | 2 +- .../models/dropout7_no_return_mask.prototxt | 2 +- .../duplicated_more_output_names.prototxt | 2 +- .../models/duplicated_output_name.prototxt | 2 +- .../dynamic_shapes/a_plus_b_dyn_rank.prototxt | 2 +- .../models/dynamic_shapes/ab_plus_c.prototxt | 2 +- .../dynamic_shapes/acosh_dyn_shape.prototxt | 2 +- .../models/dynamic_shapes/argmax_dyn.prototxt | 2 +- .../argmin_no_keep_dims_dyn.prototxt | 2 +- .../dynamic_shapes/asinh_dyn_shape.prototxt | 2 +- .../dynamic_shapes/atanh_dyn_shape.prototxt | 2 +- .../average_pool_2d_dyn.prototxt | 2 +- .../constant_of_shape_float_zeros.prototxt | 2 +- .../constant_of_shape_int_ones.prototxt | 2 +- .../conv_with_dynamic_batch.prototxt | 2 +- .../conv_with_dynamic_bias.prototxt | 2 +- .../dynamic_shapes/depth_to_space.prototxt | 2 +- .../models/dynamic_shapes/expand_dyn.prototxt | 2 +- .../dynamic_shapes/expand_uint16_dyn.prototxt | 2 +- .../dynamic_shapes/eye_like_dyn_rank.prototxt | 2 +- .../eye_like_dyn_shape.prototxt | 2 +- .../flatten_dyn_shape_axis.prototxt | 2 +- .../flatten_dyn_shape_axis0.prototxt | 2 +- .../flatten_dyn_shape_neg_axis.prototxt | 2 +- .../global_average_pool_dyn.prototxt | 2 +- .../global_max_pool_dyn.prototxt | 2 +- .../gru_defaults_fwd_const_dynamic.prototxt | 2 +- .../instance_norm_dyn_shape.prototxt | 2 +- .../instance_norm_dyn_shape2.prototxt | 2 +- .../lstm_dyn_batch_seq.prototxt | 2 +- .../lstm_dyn_batch_seq_3_inputs.prototxt | 2 +- .../dynamic_shapes/max_pool_2d_dyn.prototxt | 2 +- ...ol_dyn_rank_without_default_attrs.prototxt | 2 +- .../max_pool_with_indices_output.prototxt | 2 +- ..._dynamic_input_rank_negative_axis.prototxt | 2 +- .../rnn_defaults_fwd_const_dynamic.prototxt | 2 +- .../scalar_initializers.prototxt | 2 +- .../dynamic_shapes/size_op_dyn.prototxt | 2 +- .../slice_2d_clamp_neg_ends_opset1.prototxt | 2 +- ...ce_2d_default_steps_dyn_begin_end.prototxt | 2 +- .../dynamic_shapes/slice_2d_input.prototxt | 2 +- .../slice_2d_input_opset1.prototxt | 2 +- .../slice_2d_the_same_out_shape.prototxt | 2 +- .../dynamic_shapes/slice_3d_input.prototxt | 2 +- .../slice_3d_input_12_axes.prototxt | 2 +- .../slice_3d_input_20_axes.prototxt | 2 +- ..._3d_input_21_axes_ends_max_opset1.prototxt | 2 +- .../slice_3d_input_neg_axes.prototxt | 2 +- ...slice_4d_input_0231_axes_ends_max.prototxt | 2 +- .../slice_4d_input_2103_axes.prototxt | 2 +- .../slice_4d_input_23_axes.prototxt | 2 +- .../slice_4d_input_23_axes_21_steps.prototxt | 2 +- .../slice_default_axes.prototxt | 2 +- .../slice_default_steps.prototxt | 2 +- .../dynamic_shapes/space_to_depth.prototxt | 2 +- .../models/dynamic_shapes/transpose.prototxt | 2 +- .../dynamic_shapes/trilu_lower.prototxt | 2 +- .../onnx/tests/models/einsum_sum.prototxt | 2 +- src/frontends/onnx/tests/models/elu.prototxt | 2 +- .../empty_initializers_handling.prototxt | 2 +- src/frontends/onnx/tests/models/erf.prototxt | 2 +- .../onnx/tests/models/erf_int32.prototxt | 2 +- .../models/expand_failsafe_node.prototxt | 2 +- .../tests/models/expand_static_shape.prototxt | 2 +- .../external_data/external_data.prototxt | 2 +- .../external_data_different_paths.prototxt | 2 +- .../external_data_file_not_found.prototxt | 2 +- .../external_data_in_constant_node.prototxt | 2 +- ...xternal_data_incorrect_data_shape.prototxt | 2 +- ...external_data_invalid_data_length.prototxt | 2 +- ...an_page_size_with_length_provided.prototxt | 2 +- ...an_page_size_with_length_provided.prototxt | 2 +- .../external_data_optional_fields.prototxt | 2 +- ...ptional_fields_offset_not_aligned.prototxt | 2 +- .../external_data_sanitize_test.prototxt | 2 +- ...two_tensors_data_in_the_same_file.prototxt | 2 +- .../external_data_file_in_up_dir.prototxt | 2 +- ...gned_with_page_in_two_pages_scope.prototxt | 2 +- .../onnx/tests/models/eye_like.prototxt | 2 +- .../models/eye_like_wrong_shape.prototxt | 2 +- .../onnx/tests/models/flatten.prototxt | 2 +- .../onnx/tests/models/gatherND_float.prototxt | 2 +- .../onnx/tests/models/gatherND_int32.prototxt | 2 +- .../models/gather_elements_float_1D.prototxt | 2 +- .../gather_elements_float_3D_axis_2.prototxt | 2 +- ...ther_elements_float_negative_axis.prototxt | 2 +- .../gather_elements_int32_axis_0.prototxt | 2 +- .../gather_elements_int8_axis_1.prototxt | 2 +- .../onnx/tests/models/gemm_abc.prototxt | 2 +- .../models/global_lp_pool_dynamic_hw.prototxt | 2 +- .../tests/models/global_lp_pool_p0.prototxt | 2 +- .../tests/models/global_lp_pool_p1.prototxt | 2 +- .../tests/models/global_lp_pool_p2.prototxt | 2 +- .../tests/models/global_lp_pool_p3.prototxt | 2 +- .../models/greater_or_equal_float.prototxt | 2 +- .../models/greater_or_equal_int.prototxt | 2 +- .../onnx/tests/models/grid_sample.prototxt | 2 +- .../onnx/tests/models/group_norm.prototxt | 2 +- .../group_norm_4D_bias_and_scale.prototxt | 2 +- .../onnx/tests/models/group_norm_5d.prototxt | 2 +- .../models/group_normalization_2grp.prototxt | 2 +- .../models/group_normalization_3grp.prototxt | 2 +- .../group_normalization_custom_eps.prototxt | 2 +- .../gru_bidir_mixed_seq_len_const.prototxt | 2 +- .../tests/models/gru_bidirectional.prototxt | 2 +- .../models/gru_bidirectional_const.prototxt | 2 +- .../tests/models/gru_defaults_fwd.prototxt | 2 +- .../models/gru_defaults_fwd_const.prototxt | 2 +- ..._fwd_activations_relu_hardsigmoid.prototxt | 2 +- ...wd_activations_relu_sigmoid_const.prototxt | 2 +- .../models/gru_fwd_bias_initial_h.prototxt | 2 +- .../gru_fwd_bias_initial_h_const.prototxt | 2 +- .../gru_fwd_linear_before_reset.prototxt | 2 +- ...gru_fwd_linear_before_reset_const.prototxt | 2 +- .../models/gru_fwd_mixed_seq_len.prototxt | 2 +- .../gru_fwd_mixed_seq_len_const.prototxt | 2 +- .../onnx/tests/models/gru_rev_clip.prototxt | 2 +- .../tests/models/gru_rev_clip_const.prototxt | 2 +- .../onnx/tests/models/gru_reverse.prototxt | 2 +- .../tests/models/gru_reverse_const.prototxt | 2 +- .../gru_reverse_mixed_seq_len_const.prototxt | 2 +- .../models/hammingwindow_periodic.prototxt | 2 +- .../models/hammingwindow_symmetric.prototxt | 2 +- .../tests/models/hannwindow_periodic.prototxt | 2 +- .../models/hannwindow_symmetric.prototxt | 2 +- .../onnx/tests/models/hard_sigmoid.prototxt | 2 +- .../onnx/tests/models/hardmax.prototxt | 2 +- .../onnx/tests/models/image_scaler.prototxt | 2 +- .../models/initializer_wo_input.prototxt | 2 +- .../onnx/tests/models/instance_norm.prototxt | 2 +- .../instance_norm_bad_scale_type.prototxt | 2 +- .../models/instance_norm_dynamic.prototxt | 2 +- .../onnx/tests/models/is_finite.prototxt | 2 +- .../onnx/tests/models/is_inf.prototxt | 2 +- .../tests/models/is_inf_negative.prototxt | 2 +- .../onnx/tests/models/is_inf_none.prototxt | 2 +- .../tests/models/is_inf_positive.prototxt | 2 +- .../onnx/tests/models/is_nan.prototxt | 2 +- .../onnx/tests/models/leaky_relu.prototxt | 2 +- .../tests/models/logsoftmax13_1D.prototxt | 2 +- .../tests/models/logsoftmax13_2D.prototxt | 2 +- .../onnx/tests/models/logsoftmax_0D.prototxt | 2 +- .../onnx/tests/models/logsoftmax_1D.prototxt | 2 +- .../tests/models/lp_norm_default.prototxt | 2 +- .../models/lp_norm_default_dynamic.prototxt | 2 +- .../onnx/tests/models/lp_norm_p1.prototxt | 2 +- .../onnx/tests/models/lp_norm_p2.prototxt | 2 +- .../tests/models/lstm_bidir_const.prototxt | 2 +- .../lstm_bidir_mixed_seq_const.prototxt | 2 +- ...tm_dynamic_batch_size_and_seq_len.prototxt | 2 +- .../tests/models/lstm_fwd_clip_const.prototxt | 2 +- .../models/lstm_fwd_default_const.prototxt | 2 +- .../lstm_fwd_hardsigmoid_activation.prototxt | 2 +- .../lstm_fwd_large_batch_no_clip.prototxt | 2 +- .../tests/models/lstm_fwd_mixed_seq.prototxt | 2 +- .../models/lstm_fwd_mixed_seq_const.prototxt | 2 +- .../lstm_fwd_with_clip_peepholes.prototxt | 2 +- .../tests/models/lstm_reverse_const.prototxt | 2 +- .../lstm_reverse_mixed_seq_const.prototxt | 2 +- .../onnx/tests/models/matmul.prototxt | 2 +- .../onnx/tests/models/matmul_integer.prototxt | 2 +- .../models/matmul_integer_2d_x_3d.prototxt | 2 +- .../tests/models/matmul_integer_3d.prototxt | 2 +- .../models/matmul_integer_3d_x_2d.prototxt | 2 +- .../tests/models/matmul_integer_4d.prototxt | 2 +- .../matmul_integer_4d_no_zero_point.prototxt | 2 +- .../tests/models/matmul_integer_int8.prototxt | 2 +- .../matmul_integer_matrix_zero_point.prototxt | 2 +- .../matmul_integer_no_zero_point.prototxt | 2 +- ...mul_integer_vectorized_zero_point.prototxt | 2 +- .../tests/models/matmul_vec_ten3d.prototxt | 2 +- src/frontends/onnx/tests/models/max.prototxt | 2 +- .../onnx/tests/models/max_opset1.prototxt | 2 +- .../tests/models/max_pool_2d_pads.prototxt | 2 +- .../onnx/tests/models/max_pool_3d.prototxt | 2 +- .../models/max_pool_4d_ceil_mode.prototxt | 2 +- .../models/max_pool_4d_ceil_strides.prototxt | 2 +- .../models/max_pool_4d_dilations.prototxt | 2 +- .../tests/models/max_pool_4d_strides.prototxt | 2 +- .../models/max_pool_empty_auto_pad.prototxt | 2 +- .../tests/models/max_pool_simple.prototxt | 2 +- .../models/max_pool_simple_named.prototxt | 2 +- .../tests/models/max_pool_transposed.prototxt | 2 +- .../models/max_pool_transposed_named.prototxt | 2 +- src/frontends/onnx/tests/models/mean.prototxt | 2 +- .../onnx/tests/models/mean_opset1.prototxt | 2 +- .../onnx/tests/models/min_two_inputs.prototxt | 2 +- .../models/min_two_inputs_opset1.prototxt | 2 +- .../onnx/tests/models/missing_input.prototxt | 2 +- .../tests/models/missing_op_domain.prototxt | 2 +- .../onnx/tests/models/mm_nms_rotated.prototxt | 2 +- .../tests/models/mod_incorrect_fmod.prototxt | 2 +- .../onnx/tests/models/mod_sign.prototxt | 2 +- .../tests/models/mod_sign_broadcast.prototxt | 2 +- .../onnx/tests/models/mod_sign_f32.prototxt | 2 +- .../onnx/tests/models/mod_sign_fmod.prototxt | 2 +- .../models/mod_sign_fmod_broadcast.prototxt | 2 +- .../tests/models/mod_sign_fmod_f32.prototxt | 2 +- .../onnx/tests/models/mod_sign_i64.prototxt | 2 +- .../tests/models/model_editor/add_1D.prototxt | 2 +- .../model_editor/add_1D_invalid.prototxt | 2 +- .../add_1D_with_initializers.prototxt | 2 +- .../add_1D_with_initializers_only.prototxt | 2 +- .../tests/models/model_editor/add_ab.prototxt | 2 +- .../add_ab_duplicated_output.prototxt | 2 +- .../models/model_editor/add_abc.prototxt | 2 +- .../elem_type_missing_in_input.prototxt | 2 +- .../invalid_input_no_tensor_type.prototxt | 2 +- .../invalid_input_no_type.prototxt | 2 +- .../onnx_shape_infer_exception.prototxt | 2 +- ...e_source_and_merge_all_new_inputs.prototxt | 2 +- ..._sources_and_merge_all_new_inputs.prototxt | 2 +- ...her_edge_and_merge_all_new_inputs.prototxt | 2 +- ...one_edge_and_merge_all_new_inputs.prototxt | 2 +- ..._sources_and_merge_all_new_inputs.prototxt | 2 +- ...e_source_and_merge_all_new_inputs.prototxt | 2 +- ...puts_and_outputs_based_extraction.prototxt | 2 +- ..._initializer_to_input_replacement.prototxt | 2 +- ...r_without_matching_input_tail_cut.prototxt | 2 +- ...om_tensor_with_multiple_consumers.prototxt | 2 +- ..._tensor_with_multiple_consumers_2.prototxt | 2 +- ..._tensor_with_multiple_consumers_3.prototxt | 2 +- ..._tensor_with_multiple_consumers_4.prototxt | 2 +- ..._tensor_with_multiple_consumers_5.prototxt | 2 +- ...h_multiple_consumers_custom_names.prototxt | 2 +- ...aph__linear_model_deeper_head_cut.prototxt | 2 +- ...aph__linear_model_deeper_tail_cut.prototxt | 2 +- .../subgraph__linear_model_head_cut.prototxt | 2 +- .../subgraph__linear_model_tail_cut.prototxt | 2 +- ...r_model_with_initializer_tail_cut.prototxt | 2 +- ...subgraph__multiout_op_output_edge.prototxt | 2 +- ...le_consumers_of_graph_initializer.prototxt | 2 +- ..._graph_initializer_relu2_and_init.prototxt | 2 +- ...le_consumers_of_graph_input_relu2.prototxt | 2 +- ..._from_tensor_with_single_consumer.prototxt | 2 +- ...er_with_graph_cutter_custom_names.prototxt | 2 +- .../unknown_input_value_info.prototxt | 2 +- .../shapes__add_two_inputs.prototxt | 2 +- .../shapes__dynamic_rank_in_model.prototxt | 2 +- .../subgraph__inception_head.prototxt | 2 +- ...__inception_head_with_initializer.prototxt | 2 +- ...nitializer_without_matching_input.prototxt | 2 +- .../subgraph_extraction_tests.prototxt | 2 +- .../subgraph_extraction_tests_2.prototxt | 2 +- .../subgraph_extraction_tests_3.prototxt | 2 +- .../add_abc_const_node_unsorted.prototxt | 2 +- .../completely_unsorted.prototxt | 2 +- .../completely_unsorted_2.prototxt | 2 +- .../empty_input_name.prototxt | 2 +- .../multioutput_split_unsorted.prototxt | 2 +- ..._of_unsorted_node_and_initializer.prototxt | 2 +- .../topological_sort/two_nodes_swap.prototxt | 2 +- .../unknown_input_value_info.prototxt | 2 +- .../tests/models/model_with_metadata.prototxt | 2 +- .../onnx/tests/models/mul_v6.prototxt | 2 +- .../models/mul_v6_broadcast_axes_1_2.prototxt | 2 +- .../models/mul_v6_broadcast_axis_1.prototxt | 2 +- .../models/mul_v6_broadcast_no_axis.prototxt | 2 +- .../onnx/tests/models/mul_v7.prototxt | 2 +- .../tests/models/mul_v7_broadcast.prototxt | 2 +- .../multiple_slices_last_layer.prototxt | 2 +- .../onnx/tests/models/mvn_v6.prototxt | 2 +- .../negativelog_likelihood_loss.prototxt | 2 +- .../nms_default_score_threshold.prototxt | 2 +- .../onnx/tests/models/non_zero_1d.prototxt | 2 +- .../tests/models/non_zero_1d_float.prototxt | 2 +- .../tests/models/non_zero_2d_bool.prototxt | 2 +- .../onnx/tests/models/non_zero_3d.prototxt | 2 +- .../tests/models/non_zero_scalar.prototxt | 2 +- ...ppression_center_point_box_format.prototxt | 2 +- .../nonmaxsuppression_single_box.prototxt | 2 +- .../nonmaxsuppression_v9_single_box.prototxt | 2 +- .../onnx/tests/models/normalize.prototxt | 2 +- .../onnx/tests/models/not_supported.prototxt | 2 +- .../onnx/tests/models/one_hot_axis.prototxt | 2 +- .../tests/models/one_hot_no_axis.prototxt | 2 +- .../tests/models/onnx_external_data.prototxt | 2 +- .../deformable_conv_2d.prototxt | 2 +- .../detection_output.prototxt | 2 +- ...tection_output_most_attrs_default.prototxt | 2 +- .../generate_proposals_single_image.prototxt | 2 +- .../group_norm.prototxt | 2 +- .../prior_grid_generator.prototxt | 2 +- .../roi_feature_extractor.prototxt | 2 +- .../experimental_detectron/topk_rios.prototxt | 2 +- .../generate_proposals.prototxt | 2 +- .../generate_proposals_batch2.prototxt | 2 +- .../adaptive_avg_pooling2d_chw.prototxt | 2 +- .../adaptive_avg_pooling2d_nchw.prototxt | 2 +- .../onnx/tests/models/override_op.prototxt | 2 +- .../onnx/tests/models/pad_constant.prototxt | 2 +- .../models/pad_negative_begin_end.prototxt | 2 +- .../models/pad_non_scalar_values.prototxt | 2 +- .../models/pad_optional_constant.prototxt | 2 +- .../tests/models/pow_float32_float32.prototxt | 2 +- .../tests/models/pow_float32_int32.prototxt | 2 +- .../tests/models/pow_int32_float32.prototxt | 2 +- .../onnx/tests/models/prelu.prototxt | 2 +- .../onnx/tests/models/prelu_1d.prototxt | 2 +- .../onnx/tests/models/prelu_batch_nd.prototxt | 2 +- .../onnx/tests/models/prelu_c_1_1.prototxt | 2 +- .../onnx/tests/models/prior_box.prototxt | 2 +- .../tests/models/priorbox_clustered.prototxt | 2 +- ...x_clustered_first_input_bad_shape.prototxt | 2 +- ...rbox_clustered_most_attrs_default.prototxt | 2 +- ..._clustered_second_input_bad_shape.prototxt | 2 +- .../models/provenance_input_tags.prototxt | 2 +- .../provenance_multiple_outputs_op.prototxt | 2 +- .../provenance_node_name_and_outputs.prototxt | 2 +- .../models/provenance_only_outputs.prototxt | 2 +- .../tests/models/provenance_tag_add.prototxt | 2 +- .../tests/models/qlinear_conv_2d.prototxt | 2 +- .../tests/models/qlinear_conv_3d.prototxt | 2 +- .../onnx/tests/models/qlinear_matmul.prototxt | 2 +- .../tests/models/qlinear_matmul_3d.prototxt | 2 +- .../onnx/tests/models/quant_conv_lin.prototxt | 2 +- .../models/quant_dequant_pattern.prototxt | 2 +- .../quant_dequant_pattern_axis.prototxt | 2 +- .../dynamic_quantize_linear.prototxt | 2 +- .../dynamic_quantize_linear_3x4.prototxt | 2 +- .../fake_quantize_const_inputs.prototxt | 2 +- .../fake_quantize_nonconst_inputs.prototxt | 2 +- .../quant_conv_linear_onnx_example.prototxt | 2 +- .../tests/models/quantize_linear.prototxt | 2 +- .../quantize_linear_axis_negative.prototxt | 2 +- .../models/quantize_linear_axis_zero.prototxt | 2 +- .../models/quantize_linear_const.prototxt | 2 +- .../models/quantize_linear_opset10.prototxt | 2 +- ...ize_linear_opsets_10_and_13_axis0.prototxt | 2 +- ...ize_linear_opsets_10_and_13_axis1.prototxt | 2 +- ...uantize_linear_scalar_ignore_axis.prototxt | 2 +- .../tests/models/quantize_linear_u16.prototxt | 2 +- .../quantize_linear_zero_point.prototxt | 2 +- .../onnx/tests/models/random_normal.prototxt | 2 +- .../tests/models/random_normal_like.prototxt | 2 +- .../onnx/tests/models/random_uniform.prototxt | 2 +- .../tests/models/random_uniform_like.prototxt | 2 +- .../onnx/tests/models/range.prototxt | 2 +- .../onnx/tests/models/reciprocal.prototxt | 2 +- .../onnx/tests/models/reduce_l1.prototxt | 2 +- .../onnx/tests/models/reduce_l2.prototxt | 2 +- .../onnx/tests/models/reduce_log_sum.prototxt | 2 +- .../tests/models/reduce_log_sum_exp.prototxt | 2 +- .../onnx/tests/models/reduce_max.prototxt | 2 +- .../models/reduce_max_invalid_axes.prototxt | 2 +- .../onnx/tests/models/reduce_mean.prototxt | 2 +- .../onnx/tests/models/reduce_min.prototxt | 2 +- .../onnx/tests/models/reduce_prod.prototxt | 2 +- .../onnx/tests/models/reduce_sum.prototxt | 2 +- ...reduce_sum_13_axes_as_0_dim_input.prototxt | 2 +- .../reduce_sum_13_axes_as_constant.prototxt | 2 +- ..._13_axes_as_constant_keepdims_off.prototxt | 2 +- ...m_13_axes_as_constant_single_axis.prototxt | 2 +- .../reduce_sum_13_axes_as_input.prototxt | 2 +- .../models/reduce_sum_13_axes_empty.prototxt | 2 +- ..._13_axes_empty_dynamic_rank_input.prototxt | 2 +- ...educe_sum_13_axes_empty_with_noop.prototxt | 2 +- ...ce_sum_13_axes_empty_without_noop.prototxt | 2 +- .../reduce_sum_13_input_dynamic.prototxt | 2 +- .../reduce_sum_dynamic_rank_input.prototxt | 2 +- .../tests/models/reduce_sum_square.prototxt | 2 +- src/frontends/onnx/tests/models/relu.prototxt | 2 +- .../tests/models/relu_custom_domain.prototxt | 2 +- .../models/reshape_extended_dims.prototxt | 2 +- .../models/reshape_negative_dim.prototxt | 2 +- .../reshape_negative_with_zero_dims.prototxt | 2 +- .../reshape_output_shape_as_input.prototxt | 2 +- .../models/reshape_reduced_dims.prototxt | 2 +- .../models/reshape_reordered_dims.prototxt | 2 +- .../tests/models/reshape_single_dim.prototxt | 2 +- ...ize10_asymertic_dim_in_the_middle.prototxt | 2 +- .../resize10_asymertic_last_dim.prototxt | 2 +- ...resize10_down_scales_const_linear.prototxt | 2 +- ...esize10_down_scales_const_nearest.prototxt | 2 +- .../resize10_up_scales_const_linear.prototxt | 2 +- .../resize10_up_scales_const_nearest.prototxt | 2 +- ...e11_down_scales_linear_asymmetric.prototxt | 2 +- ...ize11_down_sizes_cubic_half_pixel.prototxt | 2 +- ...n_sizes_linear_pytorch_half_pixel.prototxt | 2 +- ...resize11_down_sizes_tf_half_pixel.prototxt | 2 +- .../resize11_empty_constant_as_input.prototxt | 2 +- ...1_scales_nearest_asymmetric_floor.prototxt | 2 +- ...t_asymmetric_floor_dynamic_scales.prototxt | 2 +- ...11_sizes_nearest_asymmetric_floor.prototxt | 2 +- ...e11_up_scales_cubic_align_corners.prototxt | 2 +- ...ize11_up_scales_linear_asymmetric.prototxt | 2 +- .../resize11_up_scales_tf_half_pixel.prototxt | 2 +- ...1_up_sizes_all_attributes_default.prototxt | 2 +- ...esize11_up_sizes_cubic_half_pixel.prototxt | 2 +- ...es_cubic_half_pixel_dynamic_sizes.prototxt | 2 +- ...size11_up_sizes_linear_asymmetric.prototxt | 2 +- ..._up_sizes_nearest_ceil_half_pixel.prototxt | 2 +- ...sizes_nearest_floor_align_corners.prototxt | 2 +- ...es_nearest_prefer_ceil_asymmetric.prototxt | 2 +- ...est_round_prefer_floor_half_pixel.prototxt | 2 +- ...rse_sequence_incorrect_batch_axis.prototxt | 2 +- ...erse_sequence_incorrect_time_axis.prototxt | 2 +- .../reverse_sequence_time_0_batch_1.prototxt | 2 +- .../reverse_sequence_time_1_batch_0.prototxt | 2 +- ...equence_time_and_batch_axis_equal.prototxt | 2 +- .../rnn_bidir_mixed_seq_len_const.prototxt | 2 +- .../tests/models/rnn_bidirectional.prototxt | 2 +- .../models/rnn_bidirectional_const.prototxt | 2 +- .../tests/models/rnn_defaults_fwd.prototxt | 2 +- .../models/rnn_defaults_fwd_const.prototxt | 2 +- .../tests/models/rnn_fwd_activations.prototxt | 2 +- .../models/rnn_fwd_activations_const.prototxt | 2 +- .../models/rnn_fwd_bias_initial_h.prototxt | 2 +- .../rnn_fwd_bias_initial_h_const.prototxt | 2 +- .../models/rnn_fwd_mixed_seq_len.prototxt | 2 +- .../rnn_fwd_mixed_seq_len_const.prototxt | 2 +- .../onnx/tests/models/rnn_rev_clip.prototxt | 2 +- .../tests/models/rnn_rev_clip_const.prototxt | 2 +- .../onnx/tests/models/rnn_reverse.prototxt | 2 +- .../tests/models/rnn_reverse_const.prototxt | 2 +- .../rnn_reverse_mixed_seq_len_const.prototxt | 2 +- .../onnx/tests/models/roi_align_f32.prototxt | 2 +- .../models/roialign16_avg_half_pixel.prototxt | 2 +- .../roialign16_avg_out_half_pixel.prototxt | 2 +- .../onnx/tests/models/round.prototxt | 2 +- .../models/round_half_nearest_even.prototxt | 2 +- .../models/scan15_ND_b4_input_rev.prototxt | 2 +- .../tests/models/scan15_ND_mixed.prototxt | 2 +- .../models/scan15_ND_mixed_neg_axes.prototxt | 2 +- .../tests/models/scan15_dyn_rank.prototxt | 2 +- .../models/scan15_dyn_rank_neg_axes.prototxt | 2 +- .../tests/models/scan15_fib_like.prototxt | 2 +- .../scan15_fib_like_input_out_rev.prototxt | 2 +- .../models/scan15_fib_like_input_rev.prototxt | 2 +- .../models/scan15_fib_like_out_rev.prototxt | 2 +- .../onnx/tests/models/scan8_ND_b4.prototxt | 2 +- .../models/scan8_ND_b4_input_rev.prototxt | 2 +- .../models/scan8_ND_b4_seq_lens.prototxt | 2 +- .../scatter_elements_add_opset18.prototxt | 2 +- .../scatter_elements_default_opset18.prototxt | 2 +- .../scatter_elements_max_opset18.prototxt | 2 +- .../scatter_elements_min_opset18.prototxt | 2 +- .../scatter_elements_mul_opset18.prototxt | 2 +- .../scatter_elements_none_opset18.prototxt | 2 +- .../models/scatter_elements_opset11.prototxt | 2 +- .../scatter_nd_const_i32_indices.prototxt | 2 +- .../scatter_nd_opset16_reduction_add.prototxt | 2 +- ...scatter_nd_opset16_reduction_none.prototxt | 2 +- .../scatter_nd_param_i64_indices.prototxt | 2 +- .../tests/models/scatter_opset10.prototxt | 2 +- src/frontends/onnx/tests/models/selu.prototxt | 2 +- .../onnx/tests/models/shape.prototxt | 2 +- .../onnx/tests/models/shrink_float.prototxt | 2 +- .../onnx/tests/models/shrink_int.prototxt | 2 +- .../onnx/tests/models/sigmoid.prototxt | 2 +- src/frontends/onnx/tests/models/sign.prototxt | 2 +- src/frontends/onnx/tests/models/sinh.prototxt | 2 +- .../tests/models/size_op_graph_end.prototxt | 2 +- .../models/size_op_graph_middle.prototxt | 2 +- .../size_op_on_input_graph_middle.prototxt | 2 +- .../onnx/tests/models/size_op_single.prototxt | 2 +- .../models/slice_const_axes_source.prototxt | 2 +- .../onnx/tests/models/softmax_0D.prototxt | 2 +- .../onnx/tests/models/softmax_1D.prototxt | 2 +- .../onnx/tests/models/softmax_axis_0.prototxt | 2 +- .../onnx/tests/models/softmax_axis_1.prototxt | 2 +- .../models/softmax_axis_1_opset11.prototxt | 2 +- .../onnx/tests/models/softmax_axis_2.prototxt | 2 +- .../softmax_axis_negative_1_opset11.prototxt | 2 +- .../softmax_axis_negative_1_opset13.prototxt | 2 +- .../softmax_crossentropy_loss_mean.prototxt | 2 +- .../models/softmax_invalid_axis_1D.prototxt | 2 +- .../models/softmax_invalid_axis_3D.prototxt | 2 +- .../onnx/tests/models/softplus.prototxt | 2 +- .../onnx/tests/models/softsign.prototxt | 2 +- .../onnx/tests/models/space_to_depth.prototxt | 2 +- .../space_to_depth_bad_blocksize.prototxt | 2 +- ...pace_to_depth_invalid_input_shape.prototxt | 2 +- .../space_to_depth_no_blocksize.prototxt | 2 +- .../models/split_equal_parts_2d.prototxt | 2 +- .../models/split_equal_parts_default.prototxt | 2 +- .../models/split_variable_parts_2d.prototxt | 2 +- .../onnx/tests/models/squeeze.prototxt | 2 +- .../squeeze_default_domain_opset13.prototxt | 2 +- .../squeeze_empty_axes_attribute.prototxt | 2 +- .../models/squeeze_opset13_no_axes.prototxt | 2 +- src/frontends/onnx/tests/models/sub.prototxt | 2 +- .../models/sub_v6_broadcast_axes_1_2.prototxt | 2 +- .../models/sub_v6_broadcast_axis_1.prototxt | 2 +- .../models/sub_v6_broadcast_no_axis.prototxt | 2 +- .../onnx/tests/models/sub_v7.prototxt | 2 +- .../tests/models/sub_v7_broadcast.prototxt | 2 +- src/frontends/onnx/tests/models/sum.prototxt | 2 +- .../onnx/tests/models/sum_one_input.prototxt | 2 +- .../onnx/tests/models/sum_opset1.prototxt | 2 +- .../onnx/tests/models/sum_opset8.prototxt | 2 +- .../support_test/supported/basic.prototxt | 2 +- .../tests/models/swish_with_beta.prototxt | 2 +- .../tests/models/swish_without_beta.prototxt | 2 +- src/frontends/onnx/tests/models/tanh.prototxt | 2 +- .../onnx/tests/models/tensor_names.prototxt | 2 +- .../tests/models/test_clip_inbounds.prototxt | 2 +- .../tests/models/thresholded_relu.prototxt | 2 +- src/frontends/onnx/tests/models/tile.prototxt | 2 +- .../onnx/tests/models/tile_static.prototxt | 2 +- .../onnx/tests/models/top_k.prototxt | 2 +- .../onnx/tests/models/top_k_opset_10.prototxt | 2 +- .../models/top_k_opset_10_const_k.prototxt | 2 +- .../top_k_opset_11_const_k_smallest.prototxt | 2 +- ...11_const_k_smallest_negative_axis.prototxt | 2 +- src/frontends/onnx/tests/models/topk.prototxt | 2 +- .../celu_with_initializers.prototxt | 2 +- .../transformations/greater_or_equal.prototxt | 2 +- .../greater_or_equal_inside_if.prototxt | 2 +- .../greater_or_equal_expanded.prototxt | 2 +- ...ax_crossentropy_consumed_expanded.prototxt | 2 +- .../softmax_crossentropy_consumed.prototxt | 2 +- .../onnx/tests/models/trilu_basic.prototxt | 2 +- .../onnx/tests/models/trilu_lower.prototxt | 2 +- .../onnx/tests/models/trilu_lower_4d.prototxt | 2 +- .../onnx/tests/models/trilu_upper.prototxt | 2 +- .../onnx/tests/models/trilu_upper_3d.prototxt | 2 +- .../onnx/tests/models/unknown_domain.prototxt | 2 +- .../tests/models/unknown_domain_add.prototxt | 2 +- .../onnx/tests/models/unsqueeze.prototxt | 2 +- .../models/unsqueeze_ai_onnx_domain.prototxt | 2 +- .../unsqueeze_ai_onnx_domain_opset13.prototxt | 2 +- .../models/unsqueeze_default_domain.prototxt | 2 +- .../unsqueeze_default_domain_opset13.prototxt | 2 +- .../models/unsqueeze_negative_axes.prototxt | 2 +- .../onnx/tests/models/unsupported_op.prototxt | 2 +- .../unsupported_ops/add_unsupported.prototxt | 2 +- .../two_unsupported_nodes.prototxt | 2 +- ...unsupported_add_and_incorrect_dts.prototxt | 2 +- ...rrect_dts_and_inst_norm_bad_scale.prototxt | 2 +- .../tests/models/upsample6_bilinear.prototxt | 2 +- .../tests/models/upsample6_dynamic.prototxt | 2 +- .../tests/models/upsample6_nearest.prototxt | 2 +- .../tests/models/upsample8_linear.prototxt | 2 +- .../tests/models/upsample8_nearest.prototxt | 2 +- .../upsample9_scales_const_linear.prototxt | 2 +- .../upsample9_scales_const_nearest.prototxt | 2 +- .../upsample9_scales_input_nearest.prototxt | 2 +- .../onnx/tests/models/where.prototxt | 2 +- .../tests_python/test_frontend_lib_close.py | 2 +- .../tests/tests_python/test_frontend_onnx.py | 12 +- .../tests_python/test_frontend_onnx_editor.py | 38 +-- .../tests/tests_python/test_onnx_import.py | 2 +- .../tests/tests_python/test_ops_binary.py | 2 +- .../tests/tests_python/test_ops_convpool.py | 2 +- .../tests/tests_python/test_ops_matmul.py | 4 +- .../tests/tests_python/test_ops_reduction.py | 2 +- .../tests/tests_python/test_ops_reshape.py | 2 +- .../onnx/tests/tests_python/test_ops_unary.py | 10 +- .../onnx/tests/tests_python/utils/__init__.py | 2 +- 784 files changed, 846 insertions(+), 1134 deletions(-) delete mode 100644 src/frontends/onnx/frontend/src/op/quant_conv.cpp delete mode 100644 src/frontends/onnx/frontend/src/op/quant_conv.hpp diff --git a/src/frontends/onnx/docs/how_to_add_op.md b/src/frontends/onnx/docs/how_to_add_op.md index 283292ba223cee..623f670ec2d726 100644 --- a/src/frontends/onnx/docs/how_to_add_op.md +++ b/src/frontends/onnx/docs/how_to_add_op.md @@ -9,50 +9,66 @@ The declaration in `.hpp` can look like: ```cpp #pragma once -#include "onnx_import/core/node.hpp" +#include "core/node.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector custom_add(const Node& node); +ov::OutputVector custom_add(const ov::frontend::onnx::Node& node); } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov ``` -The definition in `.cpp` contains an implementation of transformation from [ngraph::onnx_import::Node](../../../../src/frontends/onnx/frontend/include/onnx_import/core/node.hpp) to [ov::OutputVector](../../../../src/core/include/openvino/core/node_vector.hpp). Such implementation can look like: +The definition in `.cpp` contains an implementation of transformation from [ov::frontend::onnx::Node](../../../../src/frontends/onnx/frontend/include/onnx_import/core/node.hpp) to [ov::OutputVector](../../../../src/core/include/openvino/core/node_vector.hpp). Such implementation can look like: ```cpp #include "op/org.openvinotoolkit/custom_add.hpp" -#include - -#include "default_opset.hpp" +#include "exceptions.hpp" +#include "openvino/op/add.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convert.hpp" +#include "openvino/op/multiply.hpp" #include "utils/common.hpp" -namespace ngraph { -namespace onnx_import { +namespace ov { +namespace frontend { +namespace onnx { namespace op { namespace set_1 { -ov::OutputVector custom_add(const Node& node) { - const auto in1 = node.get_ng_inputs().at(0); - const auto in2 = node.get_ng_inputs().at(1); +ov::OutputVector custom_add(const ov::frontend::onnx::Node& node) { + const auto& inputs = node.get_ov_inputs(); + CHECK_VALID_NODE(node, + inputs.size() == 2, + "CustomAdd should have exactly 2 inputs, got: ", + inputs.size()); + const auto in1 = inputs[0]; + const auto in2 = inputs[1]; const auto alpha = node.get_attribute_value("alpha", 1); + + CHECK_VALID_NODE(node, + alpha >= 1 && alpha < 100, + "CustomAdd accepts alpha in a range [1, 100), got: ", + alpha); + const auto alpha_node = - std::make_shared(default_opset::Constant::create( ov::element::f32, {}, {alpha}), - in1.get_element_type()); + std::make_shared(v0::Constant::create(ov::element::f32, {}, {alpha}), in1.get_element_type()); - const auto add = std::make_shared(in1, in2); - return {std::make_shared(add, alpha_node)}; + const auto add = std::make_shared(in1, in2); + return {std::make_shared(add, alpha_node)}; } } // namespace set_1 } // namespace op -} // namespace onnx_import -} // namespace ngraph +} // namespace onnx +} // namespace frontend +} // namespace ov ``` The next step is to register a new op in [ops_bridge](../../../../src/frontends/onnx/frontend/src/ops_bridge.cpp). For `org.openvinotoolkit.CustomAdd`, the registration can look like: ```cpp diff --git a/src/frontends/onnx/frontend/src/core/operator_set.hpp b/src/frontends/onnx/frontend/src/core/operator_set.hpp index 60032edd133833..2221a055150861 100644 --- a/src/frontends/onnx/frontend/src/core/operator_set.hpp +++ b/src/frontends/onnx/frontend/src/core/operator_set.hpp @@ -13,7 +13,7 @@ namespace ov { namespace frontend { namespace onnx { -/// \brief Function which transforms single ONNX operator to nGraph sub-graph. +/// \brief Function which transforms single ONNX operator to OV sub-graph. using Operator = std::function; diff --git a/src/frontends/onnx/frontend/src/op/quant_conv.cpp b/src/frontends/onnx/frontend/src/op/quant_conv.cpp deleted file mode 100644 index a913399e378393..00000000000000 --- a/src/frontends/onnx/frontend/src/op/quant_conv.cpp +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -// Disabled in CMakeLists.txt -// Update to higher opset is required - -#if 0 - -# include "op/quant_conv.hpp" - -# include -# include -# include - -# include "default_opset.hpp" -# include "exceptions.hpp" -# include "ngraph/builder/quantization/quantized_linear_convolution.hpp" -# include "ngraph/frontend/utils/convpool.hpp" -# include "ngraph/op/util/attr_types.hpp" -# include "ngraph/opsets/opset0.hpp" -# include "ngraph/strides.hpp" - -namespace ngraph -{ - namespace onnx_import - { - namespace op - { - namespace set_1 - { - namespace - { - struct OpScale - { - Output data_scale; - Output filter_scale; - Output output_scale; - }; - - struct OpZeroPoint - { - Output data_zero_point; - Output filter_zero_point; - Output output_zero_point; - }; - - std::shared_ptr - make_ng_quant_conv(const Output& data, - const Output& filters, - const ov::Strides& strides, - const ov::Strides& filter_dilations, - const CoordinateDiff& padding_below, - const CoordinateDiff& padding_above, - const ov::Strides& data_dilations, - int groups, - const OpScale& op_scale, - const OpZeroPoint& op_zero_point, - const Output& bias = nullptr) - { - ngraph:: ov::element::Type output_type; - if (data.get_element_type() == ngraph:: ov::element::u8 && - filters.get_element_type() == ngraph:: ov::element::i8) - { - output_type = ngraph:: ov::element::i8; - } - else if (data.get_element_type() == ngraph:: ov::element::u8 && - filters.get_element_type() == ngraph:: ov::element::u8) - { - output_type = ngraph:: ov::element::u8; - } - if (groups > 1) - { - // Split one convolution op to N ops where N is the number of groups - // and concat results after computation. - std::size_t n_data_channels{data.get_shape().at(1)}; - std::size_t n_filters_channels{filters.get_shape().at(0)}; - - std::size_t data_group_size{n_data_channels / groups}; - std::size_t filters_group_size{n_filters_channels / groups}; - ov::OutputVector convolution_nodes; - - // initial bounds for splice - std::vector data_lower_bounds(data.get_shape().size()); - std::vector data_upper_bounds{data.get_shape()}; - std::vector filters_lower_bounds( - filters->get_shape().size()); - std::vector filters_upper_bounds{filters.get_shape()}; - - for (int64_t group{0}; group < groups; ++group) - { - // slice data - data_lower_bounds[1] = group * data_group_size; - data_upper_bounds[1] = (group + 1) * data_group_size; - auto sliced_data = std::make_shared( - data, data_lower_bounds, data_upper_bounds); - // slice filters - filters_lower_bounds[0] = group * filters_group_size; - filters_upper_bounds[0] = (group + 1) * filters_group_size; - auto sliced_filters = std::make_shared( - filters, filters_lower_bounds, filters_upper_bounds); - - if (bias.get_node()) - { - OPENVINO_THROW( - "Groups != 1 not supported for Quantized Convolution with " - "bias."); - } - else - { - convolution_nodes.push_back( - std::make_shared( - sliced_data, - sliced_filters, - strides, - filter_dilations, - padding_below, - padding_above, - data_dilations, - op_scale.data_scale, - op_zero_point.data_zero_point, - op_scale.filter_scale, - op_zero_point.filter_zero_point, - op_scale.output_scale, - op_zero_point.output_zero_point, - output_type, - ov::AxisSet{}, - ov::AxisSet{}, - ov::AxisSet{})); - } - } - std::size_t concatenation_axis = 1; - return std::make_shared(convolution_nodes, - concatenation_axis); - } - else - { - if (bias.get_node()) - { - return ngraph::builder::quantization:: - QuantizedLinearConvolutionBias(data, - filters, - bias, - strides, - filter_dilations, - padding_below, - padding_above, - data_dilations, - op_scale.data_scale, - op_scale.filter_scale, - op_scale.output_scale); - } - else - { - return std::make_shared( - data, - filters, - strides, - filter_dilations, - padding_below, - padding_above, - data_dilations, - op_scale.data_scale, - op_zero_point.data_zero_point, - op_scale.filter_scale, - op_zero_point.filter_zero_point, - op_scale.output_scale, - op_zero_point.output_zero_point, - output_type, - ov::AxisSet{}, - ov::AxisSet{}, - ov::AxisSet{}); - } - } - } - - } // namespace - - ov::OutputVector quant_conv(const ov::frontend::onnx::Node& node) - { - const ov::OutputVector& inputs = node.get_ng_inputs(); - auto data = inputs.at(0); - auto filters = inputs.at(3); - - int64_t groups{node.get_attribute_value("group", 1)}; - - auto data_scale = inputs.at(1); - auto data_zero_point = inputs.at(2); - auto filters_scale = inputs.at(4); - auto filters_zero_point = inputs.at(5); - auto output_scale = inputs.at(6); - auto output_zero_point = inputs.at(7); - - CHECK_VALID_NODE(node, - ((groups >= 0) && - (groups <= static_cast(data.get_shape().at(1))) && - (groups <= static_cast(filters.get_shape().at(0)))), - "incorrect value of 'group' attribute: ", - groups); - - std::size_t n_data_channels{data.get_shape().at(1)}; - std::size_t n_filters_channels{filters.get_shape().at(0)}; - - CHECK_VALID_NODE( - node, - n_data_channels % groups == 0, - "provided group attribute value must be a multiple of data channels " - "count."); - CHECK_VALID_NODE( - node, - n_filters_channels % groups == 0, - "provided group attribute value must be a multiple of filter channels " - "count."); - - ov::Strides strides = convpool::get_strides(node); - ov::Strides filter_dilations = convpool::get_dilations(node); - ov::Strides data_dilations = Strides(convpool::get_kernel_shape(node).size(), 1UL); - auto paddings = convpool::get_pads(node); - ngraph::op::PadType auto_pad_type = convpool::get_auto_pad(node); - CoordinateDiff& padding_below = paddings.first; - CoordinateDiff& padding_above = paddings.second; - convpool::calculate_auto_pads(data.get_shape(), - filters.get_shape(), - strides, - filter_dilations, - auto_pad_type, - padding_below, - padding_above); - - std::shared_ptr conv_node = nullptr; - - // no bias param - if (inputs.size() == 9 && !ngraph::op::is_null(inputs.at(8))) - { - auto bias = inputs.at(8); - conv_node = make_ng_quant_conv( - data, - filters, - strides, - filter_dilations, - padding_below, - padding_above, - data_dilations, - groups, - OpScale{data_scale, filters_scale, output_scale}, - OpZeroPoint{data_zero_point, filters_zero_point, output_zero_point}, - bias); - } - else - { - conv_node = make_ng_quant_conv( - data, - filters, - strides, - filter_dilations, - padding_below, - padding_above, - data_dilations, - groups, - OpScale{data_scale, filters_scale, output_scale}, - OpZeroPoint{data_zero_point, filters_zero_point, output_zero_point}); - } - - return {conv_node}; - } - - } // namespace set_1 - - } // namespace op - - } // namespace onnx -} // namespace frontend -} // namespace ov - -#endif diff --git a/src/frontends/onnx/frontend/src/op/quant_conv.hpp b/src/frontends/onnx/frontend/src/op/quant_conv.hpp deleted file mode 100644 index 38135b34649885..00000000000000 --- a/src/frontends/onnx/frontend/src/op/quant_conv.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -// Disabled in CMakeList -// Update to higher opset required - -#pragma once - -#include "core/node.hpp" - -namespace ov { -namespace frontend { -namespace onnx { -namespace op { -namespace set_1 { -/// \brief Performs ONNX Quant Conv operation. -/// -/// \param node The ONNX node object representing this operation. -/// -/// \return The vector containing Ngraph nodes producing output of ONNX quantizied -/// convolution operation. -ov::OutputVector quant_conv(const ov::frontend::onnx::Node& node); - -} // namespace set_1 -} // namespace op -} // namespace onnx -} // namespace frontend -} // namespace ov diff --git a/src/frontends/onnx/tests/models/abs.prototxt b/src/frontends/onnx/tests/models/abs.prototxt index 696681a4f83ea6..e2aecada24a461 100644 --- a/src/frontends/onnx/tests/models/abs.prototxt +++ b/src/frontends/onnx/tests/models/abs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/acosh.prototxt b/src/frontends/onnx/tests/models/acosh.prototxt index 7a8cdc1fa26d4d..8e4dbcd5594f3a 100644 --- a/src/frontends/onnx/tests/models/acosh.prototxt +++ b/src/frontends/onnx/tests/models/acosh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/add_abc.prototxt b/src/frontends/onnx/tests/models/add_abc.prototxt index 7f63b68ad216c0..a183712b670031 100644 --- a/src/frontends/onnx/tests/models/add_abc.prototxt +++ b/src/frontends/onnx/tests/models/add_abc.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_abc_3d.prototxt b/src/frontends/onnx/tests/models/add_abc_3d.prototxt index 4862444ea19bba..050b85a891f73e 100644 --- a/src/frontends/onnx/tests/models/add_abc_3d.prototxt +++ b/src/frontends/onnx/tests/models/add_abc_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_abc_initializers.prototxt b/src/frontends/onnx/tests/models/add_abc_initializers.prototxt index 8d8c441c088ed7..f88c61653ac0b8 100644 --- a/src/frontends/onnx/tests/models/add_abc_initializers.prototxt +++ b/src/frontends/onnx/tests/models/add_abc_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/add_bcast.prototxt b/src/frontends/onnx/tests/models/add_bcast.prototxt index e82ba065db541f..0b98e661113f0c 100644 --- a/src/frontends/onnx/tests/models/add_bcast.prototxt +++ b/src/frontends/onnx/tests/models/add_bcast.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/add_v6_broadcast_axes_1_2.prototxt b/src/frontends/onnx/tests/models/add_v6_broadcast_axes_1_2.prototxt index e72ff7f5c093cd..84468a58db9b0d 100644 --- a/src/frontends/onnx/tests/models/add_v6_broadcast_axes_1_2.prototxt +++ b/src/frontends/onnx/tests/models/add_v6_broadcast_axes_1_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_v6_broadcast_axis_1.prototxt b/src/frontends/onnx/tests/models/add_v6_broadcast_axis_1.prototxt index 77b12bc62aa32f..f5972379583ee3 100644 --- a/src/frontends/onnx/tests/models/add_v6_broadcast_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/add_v6_broadcast_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_v6_broadcast_dynamic.prototxt b/src/frontends/onnx/tests/models/add_v6_broadcast_dynamic.prototxt index fd9ffd19436098..9f69c5f5f007d8 100644 --- a/src/frontends/onnx/tests/models/add_v6_broadcast_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/add_v6_broadcast_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_v6_broadcast_no_axis.prototxt b/src/frontends/onnx/tests/models/add_v6_broadcast_no_axis.prototxt index 0be986d39f7fae..e633bf93704e74 100644 --- a/src/frontends/onnx/tests/models/add_v6_broadcast_no_axis.prototxt +++ b/src/frontends/onnx/tests/models/add_v6_broadcast_no_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/add_v7.prototxt b/src/frontends/onnx/tests/models/add_v7.prototxt index f308f85f7a4607..fe62ba66c3a11e 100644 --- a/src/frontends/onnx/tests/models/add_v7.prototxt +++ b/src/frontends/onnx/tests/models/add_v7.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/addmul_abc.prototxt b/src/frontends/onnx/tests/models/addmul_abc.prototxt index f9ec0c6d22a4b3..b7ff3bf670166b 100644 --- a/src/frontends/onnx/tests/models/addmul_abc.prototxt +++ b/src/frontends/onnx/tests/models/addmul_abc.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/affine.prototxt b/src/frontends/onnx/tests/models/affine.prototxt index da40173ae49ff8..c2560633a30254 100644 --- a/src/frontends/onnx/tests/models/affine.prototxt +++ b/src/frontends/onnx/tests/models/affine.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/argmax_float.prototxt b/src/frontends/onnx/tests/models/argmax_float.prototxt index 755c50af476c0c..c42fd2e9fe75ae 100644 --- a/src/frontends/onnx/tests/models/argmax_float.prototxt +++ b/src/frontends/onnx/tests/models/argmax_float.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmax_int32.prototxt b/src/frontends/onnx/tests/models/argmax_int32.prototxt index 95bc3bbd4e472d..49a95df7999d20 100644 --- a/src/frontends/onnx/tests/models/argmax_int32.prototxt +++ b/src/frontends/onnx/tests/models/argmax_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmax_select_last_index.prototxt b/src/frontends/onnx/tests/models/argmax_select_last_index.prototxt index d47a89d14a0a0e..d0d0998b5b888a 100644 --- a/src/frontends/onnx/tests/models/argmax_select_last_index.prototxt +++ b/src/frontends/onnx/tests/models/argmax_select_last_index.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmin_float.prototxt b/src/frontends/onnx/tests/models/argmin_float.prototxt index 6e8f970315993e..e6e59e9f3c2ecc 100644 --- a/src/frontends/onnx/tests/models/argmin_float.prototxt +++ b/src/frontends/onnx/tests/models/argmin_float.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmin_int32.prototxt b/src/frontends/onnx/tests/models/argmin_int32.prototxt index 5b8b6c848eef98..a0e0f39df1ece6 100644 --- a/src/frontends/onnx/tests/models/argmin_int32.prototxt +++ b/src/frontends/onnx/tests/models/argmin_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmin_no_keepdims.prototxt b/src/frontends/onnx/tests/models/argmin_no_keepdims.prototxt index 77fdf45df7d098..460200d5fb530a 100644 --- a/src/frontends/onnx/tests/models/argmin_no_keepdims.prototxt +++ b/src/frontends/onnx/tests/models/argmin_no_keepdims.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/argmin_select_last_index.prototxt b/src/frontends/onnx/tests/models/argmin_select_last_index.prototxt index 623bc96ef69445..ba822764d6894f 100644 --- a/src/frontends/onnx/tests/models/argmin_select_last_index.prototxt +++ b/src/frontends/onnx/tests/models/argmin_select_last_index.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/asinh.prototxt b/src/frontends/onnx/tests/models/asinh.prototxt index 2684a528d68503..1074a169427a94 100644 --- a/src/frontends/onnx/tests/models/asinh.prototxt +++ b/src/frontends/onnx/tests/models/asinh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/atanh.prototxt b/src/frontends/onnx/tests/models/atanh.prototxt index aeb293d797ebcc..c4ea43c57ea376 100644 --- a/src/frontends/onnx/tests/models/atanh.prototxt +++ b/src/frontends/onnx/tests/models/atanh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_many_outputs.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_many_outputs.prototxt index c89bd70373e8de..88d1373b3c0c37 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_many_outputs.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_many_outputs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_offset_3in.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_offset_3in.prototxt index be788ecde53b35..4aa3bceaff9c4c 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_offset_3in.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_offset_3in.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_offset_4in.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_offset_4in.prototxt index 5e2fe46532c696..9660b56344f2fc 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_offset_4in.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_offset_4in.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_2in.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_2in.prototxt index 72576cdcbe4684..04e2258e6e6d8a 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_2in.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_2in.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_3in_offset_none.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_3in_offset_none.prototxt index 6f25b45f6f25e6..62d876a9f43987 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_3in_offset_none.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_3in_offset_none.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_per_sample_weights.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_per_sample_weights.prototxt index bc15c5b616d401..764163ac6c8041 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_per_sample_weights.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_per_sample_weights.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_two_none.prototxt b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_two_none.prototxt index 74f0576e90e847..d08026bc1157a1 100644 --- a/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_two_none.prototxt +++ b/src/frontends/onnx/tests/models/aten_embedding_sum_packed_4in_two_none.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_unsupported_embedding_mode.prototxt b/src/frontends/onnx/tests/models/aten_unsupported_embedding_mode.prototxt index e83c561c2c61bb..8ab647ed6b83f4 100644 --- a/src/frontends/onnx/tests/models/aten_unsupported_embedding_mode.prototxt +++ b/src/frontends/onnx/tests/models/aten_unsupported_embedding_mode.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/aten_unsupported_operator.prototxt b/src/frontends/onnx/tests/models/aten_unsupported_operator.prototxt index 95139fef8509bb..0999490e66e886 100644 --- a/src/frontends/onnx/tests/models/aten_unsupported_operator.prototxt +++ b/src/frontends/onnx/tests/models/aten_unsupported_operator.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx_import_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "emb_tbl" diff --git a/src/frontends/onnx/tests/models/average_pool_2d.prototxt b/src/frontends/onnx/tests/models/average_pool_2d.prototxt index 4af495b55d905d..08db1163ec3aac 100644 --- a/src/frontends/onnx/tests/models/average_pool_2d.prototxt +++ b/src/frontends/onnx/tests/models/average_pool_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/average_pool_2d_pads.prototxt b/src/frontends/onnx/tests/models/average_pool_2d_pads.prototxt index 5ddc67997b9555..6223864e136bae 100644 --- a/src/frontends/onnx/tests/models/average_pool_2d_pads.prototxt +++ b/src/frontends/onnx/tests/models/average_pool_2d_pads.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/average_pool_empty_auto_pad.prototxt b/src/frontends/onnx/tests/models/average_pool_empty_auto_pad.prototxt index 4c62008bf5a785..8769f8c70fc48d 100644 --- a/src/frontends/onnx/tests/models/average_pool_empty_auto_pad.prototxt +++ b/src/frontends/onnx/tests/models/average_pool_empty_auto_pad.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/batchnorm_default.prototxt b/src/frontends/onnx/tests/models/batchnorm_default.prototxt index 2bda46d2920e4a..1f3effcfd2543d 100644 --- a/src/frontends/onnx/tests/models/batchnorm_default.prototxt +++ b/src/frontends/onnx/tests/models/batchnorm_default.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/bitwise_not.prototxt b/src/frontends/onnx/tests/models/bitwise_not.prototxt index 29e97d88172b18..dda00b819afa41 100644 --- a/src/frontends/onnx/tests/models/bitwise_not.prototxt +++ b/src/frontends/onnx/tests/models/bitwise_not.prototxt @@ -1,5 +1,5 @@ ir_version: 9 -producer_name: "BitwiseNotModel" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/blackmanwindow_periodic.prototxt b/src/frontends/onnx/tests/models/blackmanwindow_periodic.prototxt index f8759ce921028a..894905adf64bf7 100644 --- a/src/frontends/onnx/tests/models/blackmanwindow_periodic.prototxt +++ b/src/frontends/onnx/tests/models/blackmanwindow_periodic.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/blackmanwindow_symmetric.prototxt b/src/frontends/onnx/tests/models/blackmanwindow_symmetric.prototxt index 1d60e783ead99a..3b16815ad4de85 100644 --- a/src/frontends/onnx/tests/models/blackmanwindow_symmetric.prototxt +++ b/src/frontends/onnx/tests/models/blackmanwindow_symmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/bool_const_op.prototxt b/src/frontends/onnx/tests/models/bool_const_op.prototxt index 960a923137fe92..10d1990bf0f9c7 100644 --- a/src/frontends/onnx/tests/models/bool_const_op.prototxt +++ b/src/frontends/onnx/tests/models/bool_const_op.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_graph" node { diff --git a/src/frontends/onnx/tests/models/bool_init_and.prototxt b/src/frontends/onnx/tests/models/bool_init_and.prototxt index bfbcf19e653865..8a2134ddbb9f91 100644 --- a/src/frontends/onnx/tests/models/bool_init_and.prototxt +++ b/src/frontends/onnx/tests/models/bool_init_and.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_graph" node { diff --git a/src/frontends/onnx/tests/models/bool_init_raw.prototxt b/src/frontends/onnx/tests/models/bool_init_raw.prototxt index eb6f51e86650a6..e9af296994f359 100644 --- a/src/frontends/onnx/tests/models/bool_init_raw.prototxt +++ b/src/frontends/onnx/tests/models/bool_init_raw.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_graph" initializer { diff --git a/src/frontends/onnx/tests/models/bool_input_or.prototxt b/src/frontends/onnx/tests/models/bool_input_or.prototxt index 3615eec4a5ad1e..c42b863108d88f 100644 --- a/src/frontends/onnx/tests/models/bool_input_or.prototxt +++ b/src/frontends/onnx/tests/models/bool_input_or.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_graph" node { diff --git a/src/frontends/onnx/tests/models/castlike_bfloat16_to_float32.prototxt b/src/frontends/onnx/tests/models/castlike_bfloat16_to_float32.prototxt index bd932116f02c92..f454d0da8e814a 100644 --- a/src/frontends/onnx/tests/models/castlike_bfloat16_to_float32.prototxt +++ b/src/frontends/onnx/tests/models/castlike_bfloat16_to_float32.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_float16_to_int64.prototxt b/src/frontends/onnx/tests/models/castlike_float16_to_int64.prototxt index ec765ef052c231..7ef9dd2f5026fc 100644 --- a/src/frontends/onnx/tests/models/castlike_float16_to_int64.prototxt +++ b/src/frontends/onnx/tests/models/castlike_float16_to_int64.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_float16_to_uint32.prototxt b/src/frontends/onnx/tests/models/castlike_float16_to_uint32.prototxt index 01466c26fa11fa..54c55421f69b24 100644 --- a/src/frontends/onnx/tests/models/castlike_float16_to_uint32.prototxt +++ b/src/frontends/onnx/tests/models/castlike_float16_to_uint32.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_float32_to_bfloat16.prototxt b/src/frontends/onnx/tests/models/castlike_float32_to_bfloat16.prototxt index c99069ef646135..e30a95efb96662 100644 --- a/src/frontends/onnx/tests/models/castlike_float32_to_bfloat16.prototxt +++ b/src/frontends/onnx/tests/models/castlike_float32_to_bfloat16.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_float64_to_int32.prototxt b/src/frontends/onnx/tests/models/castlike_float64_to_int32.prototxt index 5020ff816bdae1..e0fdcc817770a3 100644 --- a/src/frontends/onnx/tests/models/castlike_float64_to_int32.prototxt +++ b/src/frontends/onnx/tests/models/castlike_float64_to_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_float64_to_int64.prototxt b/src/frontends/onnx/tests/models/castlike_float64_to_int64.prototxt index 383e3ca3df1ee5..9b90a87b43d208 100644 --- a/src/frontends/onnx/tests/models/castlike_float64_to_int64.prototxt +++ b/src/frontends/onnx/tests/models/castlike_float64_to_int64.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_int32_to_float64.prototxt b/src/frontends/onnx/tests/models/castlike_int32_to_float64.prototxt index 7bdfd6b64612ba..0ff8bb53244914 100644 --- a/src/frontends/onnx/tests/models/castlike_int32_to_float64.prototxt +++ b/src/frontends/onnx/tests/models/castlike_int32_to_float64.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_int8_to_float16.prototxt b/src/frontends/onnx/tests/models/castlike_int8_to_float16.prototxt index 213ebdf2f06df9..c4220f889222a3 100644 --- a/src/frontends/onnx/tests/models/castlike_int8_to_float16.prototxt +++ b/src/frontends/onnx/tests/models/castlike_int8_to_float16.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_int8_to_int16.prototxt b/src/frontends/onnx/tests/models/castlike_int8_to_int16.prototxt index ad950fdbfdd63c..e0a8ccdd284561 100644 --- a/src/frontends/onnx/tests/models/castlike_int8_to_int16.prototxt +++ b/src/frontends/onnx/tests/models/castlike_int8_to_int16.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/castlike_int8_to_uint16.prototxt b/src/frontends/onnx/tests/models/castlike_int8_to_uint16.prototxt index ef3dfc33a1bfb5..8820c83711a82f 100644 --- a/src/frontends/onnx/tests/models/castlike_int8_to_uint16.prototxt +++ b/src/frontends/onnx/tests/models/castlike_int8_to_uint16.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/clip_no_min_no_max.prototxt b/src/frontends/onnx/tests/models/clip_no_min_no_max.prototxt index 082bdf84123d0a..d21685ec4ee923 100644 --- a/src/frontends/onnx/tests/models/clip_no_min_no_max.prototxt +++ b/src/frontends/onnx/tests/models/clip_no_min_no_max.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_no_min_no_max_int64.prototxt b/src/frontends/onnx/tests/models/clip_no_min_no_max_int64.prototxt index 03300976a8ff9d..3d9c687900eac4 100644 --- a/src/frontends/onnx/tests/models/clip_no_min_no_max_int64.prototxt +++ b/src/frontends/onnx/tests/models/clip_no_min_no_max_int64.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_no_min_set_max.prototxt b/src/frontends/onnx/tests/models/clip_no_min_set_max.prototxt index e5e027600e581f..26c452ce53e004 100644 --- a/src/frontends/onnx/tests/models/clip_no_min_set_max.prototxt +++ b/src/frontends/onnx/tests/models/clip_no_min_set_max.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_no_min_set_max_int64.prototxt b/src/frontends/onnx/tests/models/clip_no_min_set_max_int64.prototxt index 08c4e2e709b6f2..ca88db6851cf05 100644 --- a/src/frontends/onnx/tests/models/clip_no_min_set_max_int64.prototxt +++ b/src/frontends/onnx/tests/models/clip_no_min_set_max_int64.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_set_min_no_max.prototxt b/src/frontends/onnx/tests/models/clip_set_min_no_max.prototxt index 10fcc2c46691ed..2e60e745806d24 100644 --- a/src/frontends/onnx/tests/models/clip_set_min_no_max.prototxt +++ b/src/frontends/onnx/tests/models/clip_set_min_no_max.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_set_min_no_max_initializers.prototxt b/src/frontends/onnx/tests/models/clip_set_min_no_max_initializers.prototxt index 0901b86fb7af73..25cfde0a147d5f 100644 --- a/src/frontends/onnx/tests/models/clip_set_min_no_max_initializers.prototxt +++ b/src/frontends/onnx/tests/models/clip_set_min_no_max_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_set_min_set_max.prototxt b/src/frontends/onnx/tests/models/clip_set_min_set_max.prototxt index a5ad023d81dfc6..5e9035309a591f 100644 --- a/src/frontends/onnx/tests/models/clip_set_min_set_max.prototxt +++ b/src/frontends/onnx/tests/models/clip_set_min_set_max.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/clip_set_min_set_max_initializers.prototxt b/src/frontends/onnx/tests/models/clip_set_min_set_max_initializers.prototxt index c09b604cee7e2a..c03250fd4eff07 100644 --- a/src/frontends/onnx/tests/models/clip_set_min_set_max_initializers.prototxt +++ b/src/frontends/onnx/tests/models/clip_set_min_set_max_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention.prototxt index 53ac350573b055..6b814172836876 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_dynamic_shapes.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_dynamic_shapes.prototxt index 97a4f3f1f9134a..e589f8c84660d6 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_dynamic_shapes.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_dynamic_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_extra_add.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_extra_add.prototxt index f8664f4507f459..71eac8a5255d33 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_extra_add.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_extra_add.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_1.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_1.prototxt index 56d4e1d1142a4e..fcbda837bd79f1 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_1.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_1.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_2.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_2.prototxt index 481d9ea86f5488..5ade4aea389e09 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_2.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_2.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_3.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_3.prototxt index 67558f33599282..add561937be59a 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_3.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_3.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_4.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_4.prototxt index 9b9387991a9c64..4b28b1d0f9ce03 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_4.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_mask_index_4.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_past.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_past.prototxt index 7625195fa044c8..5344a3d1b54dd1 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_past.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_past.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_qkv_hidden_sizes.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_qkv_hidden_sizes.prototxt index 5ee43aa5c3624a..987da932a18df6 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_qkv_hidden_sizes.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_qkv_hidden_sizes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/attention_unidirectional.prototxt b/src/frontends/onnx/tests/models/com.microsoft/attention_unidirectional.prototxt index 31a65b299d60ee..2e270740faa2b1 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/attention_unidirectional.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/attention_unidirectional.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/bias_gelu.prototxt b/src/frontends/onnx/tests/models/com.microsoft/bias_gelu.prototxt index f01a6ca2c42f0d..4ea969e6613828 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/bias_gelu.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/bias_gelu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization.prototxt b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization.prototxt index 1cd1bfcc1b3d70..ad2ebcf4d5e459 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_ids" diff --git a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes.prototxt b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes.prototxt index 577926c6d3114f..a01d3b5b465fff 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_ids" diff --git a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes_with_position_ids.prototxt b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes_with_position_ids.prototxt index 0cc8e8a3bd39cd..3a9b5ff330f474 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes_with_position_ids.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_dynamic_shapes_with_position_ids.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_ids" diff --git a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding.prototxt b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding.prototxt index 36b7a1deaaa870..de690034a914a3 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_ids" diff --git a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding_and_mask.prototxt b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding_and_mask.prototxt index 1181538c82ccaa..7fcfe40e290832 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding_and_mask.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/embed_layer_normalization_with_segment_embedding_and_mask.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_ids" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_clip.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_clip.prototxt index b7ebca736ec719..4895d9b79c8e1a 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_clip.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_clip.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_hard_sigmoid.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_hard_sigmoid.prototxt index eedf947bcafcb0..329b82a5db27a8 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_hard_sigmoid.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_hard_sigmoid.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_leaky_relu.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_leaky_relu.prototxt index 1da86f1513cb47..7ebc92f4dfc957 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_leaky_relu.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_leaky_relu.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu.prototxt index 7cb10b6e9daf46..e787ae89482148 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu_z_input.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu_z_input.prototxt index fe9462c1e7258e..0675e510d97603 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu_z_input.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_relu_z_input.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_sigmoid.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_sigmoid.prototxt index 53e8dfe7ecbd6f..67bc9c778a5350 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_sigmoid.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_sigmoid.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_tanh.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_tanh.prototxt index 12b9b8f4a10751..481ef6c2c8eab0 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fused_conv_tanh.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fused_conv_tanh.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/com.microsoft/fusedgemm.prototxt b/src/frontends/onnx/tests/models/com.microsoft/fusedgemm.prototxt index b381de9a1e5ae1..9935a704867a41 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/fusedgemm.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/fusedgemm.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "a" diff --git a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_dynamic_shapes.prototxt b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_dynamic_shapes.prototxt index dea7e08d9a6301..ce5c37fda326ea 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_dynamic_shapes.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_dynamic_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma.prototxt b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma.prototxt index 6d7dab3c676afe..d05e7406c47e63 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta.prototxt b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta.prototxt index 90e92553245f0b..b82536baa58fa4 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta_bias.prototxt b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta_bias.prototxt index 8d61aca7a57193..436f838f766235 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta_bias.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/skip_layer_normalization_with_gamma_beta_bias.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/com.microsoft/trilu_lower.prototxt b/src/frontends/onnx/tests/models/com.microsoft/trilu_lower.prototxt index d21fb8938e0de2..c5fea8c623c915 100644 --- a/src/frontends/onnx/tests/models/com.microsoft/trilu_lower.prototxt +++ b/src/frontends/onnx/tests/models/com.microsoft/trilu_lower.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/compress_0.prototxt b/src/frontends/onnx/tests/models/compress_0.prototxt index d3e34c188bf92e..21bf8dec67a7b8 100644 --- a/src/frontends/onnx/tests/models/compress_0.prototxt +++ b/src/frontends/onnx/tests/models/compress_0.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/compress_1.prototxt b/src/frontends/onnx/tests/models/compress_1.prototxt index e76930e5f79bc0..f0040b351766db 100644 --- a/src/frontends/onnx/tests/models/compress_1.prototxt +++ b/src/frontends/onnx/tests/models/compress_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/compress_default_axis.prototxt b/src/frontends/onnx/tests/models/compress_default_axis.prototxt index 825ebcb0d03c1d..44fb0171220b6d 100644 --- a/src/frontends/onnx/tests/models/compress_default_axis.prototxt +++ b/src/frontends/onnx/tests/models/compress_default_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/compress_negative_axis.prototxt b/src/frontends/onnx/tests/models/compress_negative_axis.prototxt index 51a05bc452f461..82ff05ade407a4 100644 --- a/src/frontends/onnx/tests/models/compress_negative_axis.prototxt +++ b/src/frontends/onnx/tests/models/compress_negative_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/concat.prototxt b/src/frontends/onnx/tests/models/concat.prototxt index 9195c5d93c5f10..3d87ced28768cd 100644 --- a/src/frontends/onnx/tests/models/concat.prototxt +++ b/src/frontends/onnx/tests/models/concat.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "value0" diff --git a/src/frontends/onnx/tests/models/concat_empty_init.prototxt b/src/frontends/onnx/tests/models/concat_empty_init.prototxt index 9d90c62ff00d40..fea396741b868d 100644 --- a/src/frontends/onnx/tests/models/concat_empty_init.prototxt +++ b/src/frontends/onnx/tests/models/concat_empty_init.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in_a" diff --git a/src/frontends/onnx/tests/models/concat_negative_axis.prototxt b/src/frontends/onnx/tests/models/concat_negative_axis.prototxt index 7634a1c2dc383f..307b3a9e2fedff 100644 --- a/src/frontends/onnx/tests/models/concat_negative_axis.prototxt +++ b/src/frontends/onnx/tests/models/concat_negative_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "value0" diff --git a/src/frontends/onnx/tests/models/constant_bfloat_tensor.prototxt b/src/frontends/onnx/tests/models/constant_bfloat_tensor.prototxt index 9f7e76623c9688..c43d6ac214fae6 100644 --- a/src/frontends/onnx/tests/models/constant_bfloat_tensor.prototxt +++ b/src/frontends/onnx/tests/models/constant_bfloat_tensor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_fill_extra_shape.prototxt b/src/frontends/onnx/tests/models/constant_fill_extra_shape.prototxt index c88ab27073ec5e..a365d50eef2c46 100644 --- a/src/frontends/onnx/tests/models/constant_fill_extra_shape.prototxt +++ b/src/frontends/onnx/tests/models/constant_fill_extra_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "target_shape" diff --git a/src/frontends/onnx/tests/models/constant_fill_input_as_shape_default_value.prototxt b/src/frontends/onnx/tests/models/constant_fill_input_as_shape_default_value.prototxt index 30fa0dfa08a061..f28c8f50f8c7cc 100644 --- a/src/frontends/onnx/tests/models/constant_fill_input_as_shape_default_value.prototxt +++ b/src/frontends/onnx/tests/models/constant_fill_input_as_shape_default_value.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "target_shape" diff --git a/src/frontends/onnx/tests/models/constant_fill_input_as_shape_u8_type.prototxt b/src/frontends/onnx/tests/models/constant_fill_input_as_shape_u8_type.prototxt index e0312efefa5a3c..39a067255d29f9 100644 --- a/src/frontends/onnx/tests/models/constant_fill_input_as_shape_u8_type.prototxt +++ b/src/frontends/onnx/tests/models/constant_fill_input_as_shape_u8_type.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "target_shape" diff --git a/src/frontends/onnx/tests/models/constant_fill_shape_attribute.prototxt b/src/frontends/onnx/tests/models/constant_fill_shape_attribute.prototxt index cdbbf99419a241..1253e8c4dc207a 100644 --- a/src/frontends/onnx/tests/models/constant_fill_shape_attribute.prototxt +++ b/src/frontends/onnx/tests/models/constant_fill_shape_attribute.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "output" diff --git a/src/frontends/onnx/tests/models/constant_float_array.prototxt b/src/frontends/onnx/tests/models/constant_float_array.prototxt index 237fc6e05dc9f9..d72b537c61073c 100644 --- a/src/frontends/onnx/tests/models/constant_float_array.prototxt +++ b/src/frontends/onnx/tests/models/constant_float_array.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_float_scalar.prototxt b/src/frontends/onnx/tests/models/constant_float_scalar.prototxt index 3a711965bc86b9..464c8643068885 100644 --- a/src/frontends/onnx/tests/models/constant_float_scalar.prototxt +++ b/src/frontends/onnx/tests/models/constant_float_scalar.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_float_tensor.prototxt b/src/frontends/onnx/tests/models/constant_float_tensor.prototxt index b37db9d453e34f..5948fb3147e3e2 100644 --- a/src/frontends/onnx/tests/models/constant_float_tensor.prototxt +++ b/src/frontends/onnx/tests/models/constant_float_tensor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_integer_array.prototxt b/src/frontends/onnx/tests/models/constant_integer_array.prototxt index 9aaa125ef6b61e..9af1f27ff5ed24 100644 --- a/src/frontends/onnx/tests/models/constant_integer_array.prototxt +++ b/src/frontends/onnx/tests/models/constant_integer_array.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_integer_scalar.prototxt b/src/frontends/onnx/tests/models/constant_integer_scalar.prototxt index 2b4f0f3d8b31f2..45425fa78fcf52 100644 --- a/src/frontends/onnx/tests/models/constant_integer_scalar.prototxt +++ b/src/frontends/onnx/tests/models/constant_integer_scalar.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "values" diff --git a/src/frontends/onnx/tests/models/constant_of_shape_empty_init.prototxt b/src/frontends/onnx/tests/models/constant_of_shape_empty_init.prototxt index 1bb3e6e2c3ec0f..01d83cae915331 100644 --- a/src/frontends/onnx/tests/models/constant_of_shape_empty_init.prototxt +++ b/src/frontends/onnx/tests/models/constant_of_shape_empty_init.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "onnx_frontend_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/constant_of_shape_null_node.prototxt b/src/frontends/onnx/tests/models/constant_of_shape_null_node.prototxt index ca72f775742ea9..9d634feeedff9f 100644 --- a/src/frontends/onnx/tests/models/constant_of_shape_null_node.prototxt +++ b/src/frontends/onnx/tests/models/constant_of_shape_null_node.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "onnx_frontend_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor.prototxt index b748e68bfd53cf..1bcc089ae0b573 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_bfloat16_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_bfloat16_3x4.prototxt index 90a0a550163f42..ad3b40068afa7e 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_bfloat16_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_bfloat16_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_boolean_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_boolean_3x4.prototxt index 75c65c837f64ed..ede069e2be43a5 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_boolean_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_boolean_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_double_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_double_3x4.prototxt index 2837c3dee7d6fc..60738d5593d439 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_double_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_double_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float16_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float16_3x4.prototxt index 8634d744a05e19..9506e5f8ac56a7 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float16_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float16_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x2x3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x2x3x4.prototxt index c0bb8420fc69e1..1118281fe1a99b 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x2x3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x2x3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x3x4.prototxt index ffc91155f6afe1..6b7f32b5e32047 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_2x3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4.prototxt index ff524d9b3f13c9..ae17b689dd9082 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4_linearized_indices.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4_linearized_indices.prototxt index 0be52a8685959e..d93539abcdecf7 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4_linearized_indices.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_3x4_linearized_indices.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_8x17.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_8x17.prototxt index a2a2b7feda0570..09f7332cb72882 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_float_8x17.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_float_8x17.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_int16_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_int16_3x4.prototxt index 54842011edd102..00873f715de436 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_int16_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_int16_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_int32_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_int32_3x4.prototxt index be963883b64c78..bf2c1ef588b40d 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_int32_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_int32_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_int64_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_int64_3x4.prototxt index f06104d3e854b0..12015fb5ec58d6 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_int64_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_int64_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_int8_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_int8_3x4.prototxt index 0ec44a02fbb9bf..973b80eaa7519e 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_int8_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_int8_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint16_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint16_3x4.prototxt index 13f5d3fe129506..e4cc9f6585445d 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint16_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint16_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint32_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint32_3x4.prototxt index b0ee0e78723ad1..2dcfee974915bf 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint32_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint32_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint64_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint64_3x4.prototxt index 1a6f821d58bf99..bcf16cbfbc38e7 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint64_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint64_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint8_3x4.prototxt b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint8_3x4.prototxt index da366bb7432d1b..70cc27ac0d6825 100644 --- a/src/frontends/onnx/tests/models/constant_sparse_tensor_uint8_3x4.prototxt +++ b/src/frontends/onnx/tests/models/constant_sparse_tensor_uint8_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "dense_constant" diff --git a/src/frontends/onnx/tests/models/controlflow/if_branches_with_different_inputs.prototxt b/src/frontends/onnx/tests/models/controlflow/if_branches_with_different_inputs.prototxt index 93933c39da7af0..297904a4db8177 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_branches_with_different_inputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_branches_with_different_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_branches_with_multiple_outputs.prototxt b/src/frontends/onnx/tests/models/controlflow/if_branches_with_multiple_outputs.prototxt index e0f721e7bfea3a..a2dc00e32e808a 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_branches_with_multiple_outputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_branches_with_multiple_outputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_branches_with_same_inputs.prototxt b/src/frontends/onnx/tests/models/controlflow/if_branches_with_same_inputs.prototxt index 28aa8a0eeb6ac5..431ce23e57d200 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_branches_with_same_inputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_branches_with_same_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_branches_without_inputs.prototxt b/src/frontends/onnx/tests/models/controlflow/if_branches_without_inputs.prototxt index 8224617781ee0d..cd87c275e776fd 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_branches_without_inputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_branches_without_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_dynamic_inputs.prototxt b/src/frontends/onnx/tests/models/controlflow/if_dynamic_inputs.prototxt index e3d2c2f1b3ec33..66096d1fb5b513 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_dynamic_inputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_dynamic_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_inside_if.prototxt b/src/frontends/onnx/tests/models/controlflow/if_inside_if.prototxt index afb79d0140278c..7b079f57e05601 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_inside_if.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_inside_if.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_inside_if_inside_loop.prototxt b/src/frontends/onnx/tests/models/controlflow/if_inside_if_inside_loop.prototxt index 1abaea478704a0..6ec80e6ec14cc0 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_inside_if_inside_loop.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_inside_if_inside_loop.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if inside if inside loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_inside_loop.prototxt b/src/frontends/onnx/tests/models/controlflow/if_inside_loop.prototxt index 544bb6b8602364..6851579d53c8fe 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_inside_loop.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_inside_loop.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if inside loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_missing_else_branch.prototxt b/src/frontends/onnx/tests/models/controlflow/if_missing_else_branch.prototxt index c7e8d9a9e36d68..cc88a2bdd79a37 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_missing_else_branch.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_missing_else_branch.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_missing_then_branch.prototxt b/src/frontends/onnx/tests/models/controlflow/if_missing_then_branch.prototxt index 5f8007a6dce8d6..044b600bb6c1eb 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_missing_then_branch.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_missing_then_branch.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/if_negative_mismatch_between_branches_output.prototxt b/src/frontends/onnx/tests/models/controlflow/if_negative_mismatch_between_branches_output.prototxt index 88515b28f92c3a..cac7cc18e548b5 100644 --- a/src/frontends/onnx/tests/models/controlflow/if_negative_mismatch_between_branches_output.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/if_negative_mismatch_between_branches_output.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add.prototxt index 3b0a0a8b966e3a..3eb41f59642af3 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs.prototxt index 9882c0eddd6ac6..953d45d6b8ca1e 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.prototxt index 09bd922b5e60fb..4005b31e51be5e 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_cond_and_trip_count_as_inputs_static_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_cond.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_cond.prototxt index c6780118825a6a..8e5934454ada3f 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_cond.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_cond.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond.prototxt index 41ea4ffd3d96fc..8e5a3f701f43aa 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond_static_shapes.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond_static_shapes.prototxt index 02de3522efb7b8..9cf10a501fa071 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond_static_shapes.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_const_no_identity_termination_cond_static_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_incorrect_access_body_scope.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_incorrect_access_body_scope.prototxt index bfab6ea5853dbe..9aa27b1e710cd4 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_incorrect_access_body_scope.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_incorrect_access_body_scope.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_initializer_from_parent_scope.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_initializer_from_parent_scope.prototxt index 8fdfe21b09ce85..9b83133bbdc911 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_initializer_from_parent_scope.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_initializer_from_parent_scope.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_input_from_parent_graph.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_input_from_parent_graph.prototxt index 46c928876d280e..ecbe4ac2531f21 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_input_from_parent_graph.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_input_from_parent_graph.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond.prototxt index edd40668d2df84..fb954819f7ba64 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_false.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_false.prototxt index 8bd963d07cb293..dd1d531d269ce3 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_false.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_false.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_static_shapes.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_static_shapes.prototxt index 4002e920993733..e4278601a4ef8a 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_static_shapes.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_no_identity_termination_cond_static_shapes.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_node_from_parent_scope.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_node_from_parent_scope.prototxt index d98cd7fa87fdf1..b2c8c6391978c7 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_node_from_parent_scope.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_node_from_parent_scope.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_the_same_name.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_the_same_name.prototxt index 343c56c666ad18..5c41c5ecef787b 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_the_same_name.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_the_same_name.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_and_cond_skipped.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_and_cond_skipped.prototxt index 7b750ece3c1866..a4fdc9a140f600 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_and_cond_skipped.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_and_cond_skipped.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_dynamic.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_dynamic.prototxt index ad6cd5868cece2..3a0e44b11dec22 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_max_int.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_max_int.prototxt index 227e00d9e56f7f..a56865d6f8891d 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_max_int.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_add_trip_count_max_int.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_2d_mul_opset1.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_2d_mul_opset1.prototxt index 7a52cee2f4ed5e..24e416ff745f09 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_2d_mul_opset1.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_2d_mul_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_infer_types.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_infer_types.prototxt index 0577bf5d0ef3fd..0e8d3c59599fd0 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_infer_types.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_infer_types.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_used_in_parent_and_in_body.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_used_in_parent_and_in_body.prototxt index ad594c795e41e1..6e1723413ed885 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_used_in_parent_and_in_body.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_add_node_from_parent_scope_used_in_parent_and_in_body.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_concat_values.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_concat_values.prototxt index 9f5f4dd4b75eb0..26490f0ba4f593 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_concat_values.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_concat_values.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "iter_count_init" diff --git a/src/frontends/onnx/tests/models/controlflow/loop_infinite.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_infinite.prototxt index 67f1d16b954a87..116caba8e97e52 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_infinite.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_infinite.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "trip_count" diff --git a/src/frontends/onnx/tests/models/controlflow/loop_pow.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_pow.prototxt index 34d4a02698dd36..8a5ccfe4f6e208 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_pow.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_pow.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "power calculation" node { diff --git a/src/frontends/onnx/tests/models/controlflow/loop_scalars_add.prototxt b/src/frontends/onnx/tests/models/controlflow/loop_scalars_add.prototxt index f6d9d33113e082..e5bdb655de90da 100644 --- a/src/frontends/onnx/tests/models/controlflow/loop_scalars_add.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/loop_scalars_add.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/controlflow/onnx_controlflow_loop_2d_infer_types.prototxt b/src/frontends/onnx/tests/models/controlflow/onnx_controlflow_loop_2d_infer_types.prototxt index a29f7d97980a20..d822b7046cfdc8 100644 --- a/src/frontends/onnx/tests/models/controlflow/onnx_controlflow_loop_2d_infer_types.prototxt +++ b/src/frontends/onnx/tests/models/controlflow/onnx_controlflow_loop_2d_infer_types.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "basic loop" node { diff --git a/src/frontends/onnx/tests/models/conv2d_dilation_assym_pads_strides.prototxt b/src/frontends/onnx/tests/models/conv2d_dilation_assym_pads_strides.prototxt index 078fa6b2ef9b70..9bc88dbfaf1938 100644 --- a/src/frontends/onnx/tests/models/conv2d_dilation_assym_pads_strides.prototxt +++ b/src/frontends/onnx/tests/models/conv2d_dilation_assym_pads_strides.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/conv3d_bias.prototxt b/src/frontends/onnx/tests/models/conv3d_bias.prototxt index 464608d935d47e..a9218cda630e63 100644 --- a/src/frontends/onnx/tests/models/conv3d_bias.prototxt +++ b/src/frontends/onnx/tests/models/conv3d_bias.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/conv_fp16_W_as_int32.prototxt b/src/frontends/onnx/tests/models/conv_fp16_W_as_int32.prototxt index cdb880ac42615a..ebb708648438dd 100644 --- a/src/frontends/onnx/tests/models/conv_fp16_W_as_int32.prototxt +++ b/src/frontends/onnx/tests/models/conv_fp16_W_as_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer.prototxt b/src/frontends/onnx/tests/models/conv_integer.prototxt index 59eaa27b097eab..2a3d28ce399c5f 100644 --- a/src/frontends/onnx/tests/models/conv_integer.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer_int8.prototxt b/src/frontends/onnx/tests/models/conv_integer_int8.prototxt index b0d9340f0d17ee..80e6c14a624dd6 100644 --- a/src/frontends/onnx/tests/models/conv_integer_int8.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer_int8.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer_no_zero_point.prototxt b/src/frontends/onnx/tests/models/conv_integer_no_zero_point.prototxt index c2f0ce533a8db9..20442aae8b1c62 100644 --- a/src/frontends/onnx/tests/models/conv_integer_no_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer_no_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer_overload.prototxt b/src/frontends/onnx/tests/models/conv_integer_overload.prototxt index 28f780e6edb0b5..fb8cfbc623ad6e 100644 --- a/src/frontends/onnx/tests/models/conv_integer_overload.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer_overload.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer_scalar_zp.prototxt b/src/frontends/onnx/tests/models/conv_integer_scalar_zp.prototxt index 6c5763ac68871d..b7c75d7ec29ef4 100644 --- a/src/frontends/onnx/tests/models/conv_integer_scalar_zp.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer_scalar_zp.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_integer_vector_w_zero_point.prototxt b/src/frontends/onnx/tests/models/conv_integer_vector_w_zero_point.prototxt index de26393029cc10..baff8ca90d486e 100644 --- a/src/frontends/onnx/tests/models/conv_integer_vector_w_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/conv_integer_vector_w_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_transpose_w_groups.prototxt b/src/frontends/onnx/tests/models/conv_transpose_w_groups.prototxt index e28aa5592257ea..b388a1f08bc0e1 100644 --- a/src/frontends/onnx/tests/models/conv_transpose_w_groups.prototxt +++ b/src/frontends/onnx/tests/models/conv_transpose_w_groups.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/conv_with_strides_and_asymmetric_padding.prototxt b/src/frontends/onnx/tests/models/conv_with_strides_and_asymmetric_padding.prototxt index da3ab6015e3d50..f2b5572122f4f1 100644 --- a/src/frontends/onnx/tests/models/conv_with_strides_and_asymmetric_padding.prototxt +++ b/src/frontends/onnx/tests/models/conv_with_strides_and_asymmetric_padding.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_with_strides_no_padding.prototxt b/src/frontends/onnx/tests/models/conv_with_strides_no_padding.prototxt index 00ef3fd7ed48c1..38349ec50705a2 100644 --- a/src/frontends/onnx/tests/models/conv_with_strides_no_padding.prototxt +++ b/src/frontends/onnx/tests/models/conv_with_strides_no_padding.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_with_strides_padding.prototxt b/src/frontends/onnx/tests/models/conv_with_strides_padding.prototxt index ba083d27bcd417..5a8cc52aa30abb 100644 --- a/src/frontends/onnx/tests/models/conv_with_strides_padding.prototxt +++ b/src/frontends/onnx/tests/models/conv_with_strides_padding.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/conv_with_strides_padding_bias.prototxt b/src/frontends/onnx/tests/models/conv_with_strides_padding_bias.prototxt index f62757b70df95c..2534f5e105741f 100644 --- a/src/frontends/onnx/tests/models/conv_with_strides_padding_bias.prototxt +++ b/src/frontends/onnx/tests/models/conv_with_strides_padding_bias.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/convtranspose_dyn_data.prototxt b/src/frontends/onnx/tests/models/convtranspose_dyn_data.prototxt index 3d8711649a6180..fe05361b8ee67e 100644 --- a/src/frontends/onnx/tests/models/convtranspose_dyn_data.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_dyn_data.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "Data" diff --git a/src/frontends/onnx/tests/models/convtranspose_dyn_filters.prototxt b/src/frontends/onnx/tests/models/convtranspose_dyn_filters.prototxt index 8962706816db50..8ff3225b8fb10a 100644 --- a/src/frontends/onnx/tests/models/convtranspose_dyn_filters.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_dyn_filters.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "Data" diff --git a/src/frontends/onnx/tests/models/convtranspose_groups_pads_bias.prototxt b/src/frontends/onnx/tests/models/convtranspose_groups_pads_bias.prototxt index b93a865a435558..4ab9e319afb950 100644 --- a/src/frontends/onnx/tests/models/convtranspose_groups_pads_bias.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_groups_pads_bias.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/convtranspose_groups_w_pads.prototxt b/src/frontends/onnx/tests/models/convtranspose_groups_w_pads.prototxt index f6dd6ef8c052fc..4273842e4c1f1f 100644 --- a/src/frontends/onnx/tests/models/convtranspose_groups_w_pads.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_groups_w_pads.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/convtranspose_output_shape.prototxt b/src/frontends/onnx/tests/models/convtranspose_output_shape.prototxt index 72ce82ed78d7c0..42f04d32ed7bb4 100644 --- a/src/frontends/onnx/tests/models/convtranspose_output_shape.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_output_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_lower.prototxt b/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_lower.prototxt index 9b62275b35bd36..dfa569a2b07415 100644 --- a/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_lower.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_lower.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_upper.prototxt b/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_upper.prototxt index e10067834be127..284403e6ba7886 100644 --- a/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_upper.prototxt +++ b/src/frontends/onnx/tests/models/convtranspose_output_shape_auto_pads_same_upper.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/cosh.prototxt b/src/frontends/onnx/tests/models/cosh.prototxt index c2c376eee1ce8b..93dd144edc255e 100644 --- a/src/frontends/onnx/tests/models/cosh.prototxt +++ b/src/frontends/onnx/tests/models/cosh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/crop.prototxt b/src/frontends/onnx/tests/models/crop.prototxt index c3ec30d4677bb4..d6e86ed29a63c4 100644 --- a/src/frontends/onnx/tests/models/crop.prototxt +++ b/src/frontends/onnx/tests/models/crop.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/crop_with_scale.prototxt b/src/frontends/onnx/tests/models/crop_with_scale.prototxt index a039c9e2a522c7..c16bf214e6e649 100644 --- a/src/frontends/onnx/tests/models/crop_with_scale.prototxt +++ b/src/frontends/onnx/tests/models/crop_with_scale.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/cum_sum_1d.prototxt b/src/frontends/onnx/tests/models/cum_sum_1d.prototxt index 6a09cfa51b34a2..90b7e830cc5838 100644 --- a/src/frontends/onnx/tests/models/cum_sum_1d.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_1d.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/cum_sum_2d_axis_input.prototxt b/src/frontends/onnx/tests/models/cum_sum_2d_axis_input.prototxt index 1585c29c6685d5..b1935051a5fe8a 100644 --- a/src/frontends/onnx/tests/models/cum_sum_2d_axis_input.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_2d_axis_input.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/cum_sum_2d_axis_input_1d.prototxt b/src/frontends/onnx/tests/models/cum_sum_2d_axis_input_1d.prototxt index 26653491426c08..16ea0328814b60 100644 --- a/src/frontends/onnx/tests/models/cum_sum_2d_axis_input_1d.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_2d_axis_input_1d.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "axis" diff --git a/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input.prototxt b/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input.prototxt index 6ee36ea10d3d07..da39376bdb8408 100644 --- a/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input_1d.prototxt b/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input_1d.prototxt index df0f0e13e989aa..456c764c54272b 100644 --- a/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input_1d.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_2d_dynamic_axis_input_1d.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/cum_sum_3d_exclusive_reverse.prototxt b/src/frontends/onnx/tests/models/cum_sum_3d_exclusive_reverse.prototxt index 921201bb94738a..cea01cf45fa1f4 100644 --- a/src/frontends/onnx/tests/models/cum_sum_3d_exclusive_reverse.prototxt +++ b/src/frontends/onnx/tests/models/cum_sum_3d_exclusive_reverse.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/custom_operator.prototxt b/src/frontends/onnx/tests/models/custom_operator.prototxt index 01c521469ad600..de89b6425557ec 100644 --- a/src/frontends/onnx/tests/models/custom_operator.prototxt +++ b/src/frontends/onnx/tests/models/custom_operator.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/custom_operator_default_domain.prototxt b/src/frontends/onnx/tests/models/custom_operator_default_domain.prototxt index c9eb4c00fc7f5a..5437f527cd84e6 100644 --- a/src/frontends/onnx/tests/models/custom_operator_default_domain.prototxt +++ b/src/frontends/onnx/tests/models/custom_operator_default_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/dangling_parameter.prototxt b/src/frontends/onnx/tests/models/dangling_parameter.prototxt index 1e07a93fef815e..20320bf1e8b97a 100644 --- a/src/frontends/onnx/tests/models/dangling_parameter.prototxt +++ b/src/frontends/onnx/tests/models/dangling_parameter.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "pytorch" +producer_name: "OpenVINO ONNX Frontend" producer_version: "1.2" graph { node { diff --git a/src/frontends/onnx/tests/models/depth_to_space.prototxt b/src/frontends/onnx/tests/models/depth_to_space.prototxt index c333504f2add72..db06467716ec08 100644 --- a/src/frontends/onnx/tests/models/depth_to_space.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_bad_blocksize.prototxt b/src/frontends/onnx/tests/models/depth_to_space_bad_blocksize.prototxt index 9d538068f9757e..d2dc5fadf01727 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_bad_blocksize.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_bad_blocksize.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_bad_input_shape.prototxt b/src/frontends/onnx/tests/models/depth_to_space_bad_input_shape.prototxt index 8e7f4b6de7f614..c2ca604b777ed8 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_bad_input_shape.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_bad_input_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_bad_mode.prototxt b/src/frontends/onnx/tests/models/depth_to_space_bad_mode.prototxt index f815683f355987..007da1be2eadc4 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_bad_mode.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_bad_mode.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_crd.prototxt b/src/frontends/onnx/tests/models/depth_to_space_crd.prototxt index 8a95eb42e1b44b..ddbfebbf1ad78e 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_crd.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_crd.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_no_blocksize.prototxt b/src/frontends/onnx/tests/models/depth_to_space_no_blocksize.prototxt index 3f5349cd2da2d2..732a856676fe81 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_no_blocksize.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_no_blocksize.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/depth_to_space_v1.prototxt b/src/frontends/onnx/tests/models/depth_to_space_v1.prototxt index 2d36e813ad68c8..45bc68e703f21f 100644 --- a/src/frontends/onnx/tests/models/depth_to_space_v1.prototxt +++ b/src/frontends/onnx/tests/models/depth_to_space_v1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/dequant_lin.prototxt b/src/frontends/onnx/tests/models/dequant_lin.prototxt index beda2709cfa952..ac056487c6ebb2 100644 --- a/src/frontends/onnx/tests/models/dequant_lin.prototxt +++ b/src/frontends/onnx/tests/models/dequant_lin.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_0.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_0.prototxt index 14471af9751921..c4c1ddff550615 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_0.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_0.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_1.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_1.prototxt index 0e0a5251860075..5a7972fb9c3681 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_1.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_2.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_2.prototxt index 4629456efdd909..4506d17b8e11df 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_2.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_3.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_3.prototxt index 112312fd08e596..75b1017ac54965 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_3.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_3.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_4.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_4.prototxt index 422046dea2c72f..30fd72ee9a7ea3 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_4.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_4.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_4_dynamic.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_4_dynamic.prototxt index 71f18163cc28df..5ed3fd5fb33cb2 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_4_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_4_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OpenVINO ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_5.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_5.prototxt index 2d9466c5af0818..9d9165618a60c4 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_5.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_5.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_no_zero_point.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_no_zero_point.prototxt index afadf5cdf231f7..a1e464846f0f04 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_no_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_no_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_scalar_ignore_axis.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_scalar_ignore_axis.prototxt index 1549feea81ba5f..1ab49258d8f551 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_scalar_ignore_axis.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_scalar_ignore_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_scalar_inputs.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_scalar_inputs.prototxt index def42280a7c40f..46e28e37b93b12 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_scalar_inputs.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_scalar_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale.prototxt index 8f6744ef56152e..8c8453a2ab62c7 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale_and_zero_point.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale_and_zero_point.prototxt index 1a1670cf8a80e8..e8a9cb001f89de 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale_and_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_scalar_scale_and_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_scalar_zero_point.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_scalar_zero_point.prototxt index f88ca13ad0c846..f1b835518d9305 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_scalar_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_scalar_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dequantize_linear_u16.prototxt b/src/frontends/onnx/tests/models/dequantize_linear_u16.prototxt index c7a5a2b9f80b72..975734ef8dc6cf 100644 --- a/src/frontends/onnx/tests/models/dequantize_linear_u16.prototxt +++ b/src/frontends/onnx/tests/models/dequantize_linear_u16.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/detection_output.prototxt b/src/frontends/onnx/tests/models/detection_output.prototxt index 3ce54672ee12e6..a3517d54de8202 100644 --- a/src/frontends/onnx/tests/models/detection_output.prototxt +++ b/src/frontends/onnx/tests/models/detection_output.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_graph" node { diff --git a/src/frontends/onnx/tests/models/div.prototxt b/src/frontends/onnx/tests/models/div.prototxt index d16b5205b0fddc..be2dd2e0682ea3 100644 --- a/src/frontends/onnx/tests/models/div.prototxt +++ b/src/frontends/onnx/tests/models/div.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/div_v6_broadcast_axes_1_2.prototxt b/src/frontends/onnx/tests/models/div_v6_broadcast_axes_1_2.prototxt index 272b0cf6c55c29..8b77e9a5b2542f 100644 --- a/src/frontends/onnx/tests/models/div_v6_broadcast_axes_1_2.prototxt +++ b/src/frontends/onnx/tests/models/div_v6_broadcast_axes_1_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/div_v6_broadcast_axis_1.prototxt b/src/frontends/onnx/tests/models/div_v6_broadcast_axis_1.prototxt index f38bfffc887154..7533d7e75e48f3 100644 --- a/src/frontends/onnx/tests/models/div_v6_broadcast_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/div_v6_broadcast_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/div_v6_broadcast_no_axis.prototxt b/src/frontends/onnx/tests/models/div_v6_broadcast_no_axis.prototxt index 4fe08f3c9c06d0..0e01ce7cc9d28b 100644 --- a/src/frontends/onnx/tests/models/div_v6_broadcast_no_axis.prototxt +++ b/src/frontends/onnx/tests/models/div_v6_broadcast_no_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/div_v7.prototxt b/src/frontends/onnx/tests/models/div_v7.prototxt index 7d1a553df0823d..faa398c097136c 100644 --- a/src/frontends/onnx/tests/models/div_v7.prototxt +++ b/src/frontends/onnx/tests/models/div_v7.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/div_v7_broadcast.prototxt b/src/frontends/onnx/tests/models/div_v7_broadcast.prototxt index 6b4d29c34effc2..a2bfdf61d71375 100644 --- a/src/frontends/onnx/tests/models/div_v7_broadcast.prototxt +++ b/src/frontends/onnx/tests/models/div_v7_broadcast.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/dropout12_no_training_no_return_mask.prototxt b/src/frontends/onnx/tests/models/dropout12_no_training_no_return_mask.prototxt index e28fb21b4e7bb5..120b16440d90eb 100644 --- a/src/frontends/onnx/tests/models/dropout12_no_training_no_return_mask.prototxt +++ b/src/frontends/onnx/tests/models/dropout12_no_training_no_return_mask.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout12_no_training_return_mask.prototxt b/src/frontends/onnx/tests/models/dropout12_no_training_return_mask.prototxt index 51046ebb8f4636..667a505e4ff35e 100644 --- a/src/frontends/onnx/tests/models/dropout12_no_training_return_mask.prototxt +++ b/src/frontends/onnx/tests/models/dropout12_no_training_return_mask.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout12_no_traning_no_const_rato.prototxt b/src/frontends/onnx/tests/models/dropout12_no_traning_no_const_rato.prototxt index a286df855933cc..cd671b13c21845 100644 --- a/src/frontends/onnx/tests/models/dropout12_no_traning_no_const_rato.prototxt +++ b/src/frontends/onnx/tests/models/dropout12_no_traning_no_const_rato.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "N" diff --git a/src/frontends/onnx/tests/models/dropout12_not_const_training_mode.prototxt b/src/frontends/onnx/tests/models/dropout12_not_const_training_mode.prototxt index 780f8f3d7246c8..f44b29cb0c73a6 100644 --- a/src/frontends/onnx/tests/models/dropout12_not_const_training_mode.prototxt +++ b/src/frontends/onnx/tests/models/dropout12_not_const_training_mode.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout12_training_mode.prototxt b/src/frontends/onnx/tests/models/dropout12_training_mode.prototxt index 518a0e1af4fff7..207bdcd84a1af0 100644 --- a/src/frontends/onnx/tests/models/dropout12_training_mode.prototxt +++ b/src/frontends/onnx/tests/models/dropout12_training_mode.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout1_no_training_no_return_mask.prototxt b/src/frontends/onnx/tests/models/dropout1_no_training_no_return_mask.prototxt index 9c106663844e9b..44bdffadf1ea15 100644 --- a/src/frontends/onnx/tests/models/dropout1_no_training_no_return_mask.prototxt +++ b/src/frontends/onnx/tests/models/dropout1_no_training_no_return_mask.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout1_no_training_return_mask.prototxt b/src/frontends/onnx/tests/models/dropout1_no_training_return_mask.prototxt index abc400dcdd175c..eb31d3368b772d 100644 --- a/src/frontends/onnx/tests/models/dropout1_no_training_return_mask.prototxt +++ b/src/frontends/onnx/tests/models/dropout1_no_training_return_mask.prototxt @@ -1,6 +1,6 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dropout7_no_return_mask.prototxt b/src/frontends/onnx/tests/models/dropout7_no_return_mask.prototxt index ced7fbca21ea13..11aa4c2a805c76 100644 --- a/src/frontends/onnx/tests/models/dropout7_no_return_mask.prototxt +++ b/src/frontends/onnx/tests/models/dropout7_no_return_mask.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/duplicated_more_output_names.prototxt b/src/frontends/onnx/tests/models/duplicated_more_output_names.prototxt index f6979b2729dc86..e2ef215c90c192 100644 --- a/src/frontends/onnx/tests/models/duplicated_more_output_names.prototxt +++ b/src/frontends/onnx/tests/models/duplicated_more_output_names.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx tests" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/duplicated_output_name.prototxt b/src/frontends/onnx/tests/models/duplicated_output_name.prototxt index 76d69797ea38f5..ffde38eca7297d 100644 --- a/src/frontends/onnx/tests/models/duplicated_output_name.prototxt +++ b/src/frontends/onnx/tests/models/duplicated_output_name.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx tests" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/a_plus_b_dyn_rank.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/a_plus_b_dyn_rank.prototxt index 667e94d22856d0..5520843ed3a36a 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/a_plus_b_dyn_rank.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/a_plus_b_dyn_rank.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/ab_plus_c.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/ab_plus_c.prototxt index 20f953c01434ca..dcefd14ee8a130 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/ab_plus_c.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/ab_plus_c.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/acosh_dyn_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/acosh_dyn_shape.prototxt index 33de42dd437e2c..9d86aa7c36c009 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/acosh_dyn_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/acosh_dyn_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/argmax_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/argmax_dyn.prototxt index c7661260bd6a0e..b2be02ae5675ee 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/argmax_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/argmax_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/argmin_no_keep_dims_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/argmin_no_keep_dims_dyn.prototxt index f8d6d85d102b9a..77901d95699d98 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/argmin_no_keep_dims_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/argmin_no_keep_dims_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/asinh_dyn_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/asinh_dyn_shape.prototxt index 3c423d44ecdc3f..e097c453fd3f41 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/asinh_dyn_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/asinh_dyn_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/atanh_dyn_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/atanh_dyn_shape.prototxt index 4045fea449b078..6ef04f57eff945 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/atanh_dyn_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/atanh_dyn_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/average_pool_2d_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/average_pool_2d_dyn.prototxt index 827c809446db7f..d418ab924e802a 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/average_pool_2d_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/average_pool_2d_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_float_zeros.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_float_zeros.prototxt index 385decebee0522..d38af7d76166ac 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_float_zeros.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_float_zeros.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_int_ones.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_int_ones.prototxt index 26be74f720ff27..84a149bc9ed5c5 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_int_ones.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/constant_of_shape_int_ones.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_batch.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_batch.prototxt index d1b385bbb0eb9f..956b79e582cb20 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_batch.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_batch.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_bias.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_bias.prototxt index c6d9444947d2e3..25dbc67c4ed723 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_bias.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/conv_with_dynamic_bias.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/depth_to_space.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/depth_to_space.prototxt index d2333b515de61a..ae6f904967f0ec 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/depth_to_space.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/depth_to_space.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/expand_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/expand_dyn.prototxt index 7cc67cd5f10ab5..3f831df7575135 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/expand_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/expand_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/expand_uint16_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/expand_uint16_dyn.prototxt index e4b077e075fdfe..5dc8cee94aec24 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/expand_uint16_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/expand_uint16_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_rank.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_rank.prototxt index e9879a570a6037..5a8d574e65e6aa 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_rank.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_rank.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_shape.prototxt index 64de955f629432..37155329dbe5bd 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/eye_like_dyn_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis.prototxt index 68d324cda8cd9a..c3a83ad4476298 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { name: "Dynamic Flatten" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis0.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis0.prototxt index 0e9d8bff3ccc56..d4e58887f7644f 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis0.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_axis0.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { name: "Dynamic Flatten" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_neg_axis.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_neg_axis.prototxt index 3105f2624c3322..ce835c0b41d96c 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_neg_axis.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/flatten_dyn_shape_neg_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { name: "Dynamic Flatten" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/global_average_pool_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/global_average_pool_dyn.prototxt index 01d6464464806c..824a2572979930 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/global_average_pool_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/global_average_pool_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/global_max_pool_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/global_max_pool_dyn.prototxt index 2fcbe53b016019..235b8beffa1778 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/global_max_pool_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/global_max_pool_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt index 30098cc9998f88..aec711a54a93e7 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/gru_defaults_fwd_const_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape.prototxt index 544a9c90bf980f..7deb2798b4a3fa 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape2.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape2.prototxt index 6974fa1fdaca0c..8e041bb2dc9280 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape2.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/instance_norm_dyn_shape2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq.prototxt index 6e182b3c5d519a..89ab4e74963114 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.prototxt index 3dc8eba455b0ab..ebc7b2243f370a 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/lstm_dyn_batch_seq_3_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_2d_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_2d_dyn.prototxt index 7651be7c812f86..4fd7fc519c2d9f 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_2d_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_2d_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.prototxt index 02977c439f6fb1..0c93add575ef05 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_dyn_rank_without_default_attrs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_with_indices_output.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_with_indices_output.prototxt index 6105d792f4582f..f07b350e0fcc6b 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_with_indices_output.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/max_pool_with_indices_output.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.prototxt index c9822ecb7327e8..37b4bbbaa14a40 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/reduce_max_dynamic_input_rank_negative_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt index 563ed354ffcb48..c1406fdb125ab5 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/rnn_defaults_fwd_const_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/scalar_initializers.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/scalar_initializers.prototxt index 240897589ae2e0..9a998ed004f8a2 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/scalar_initializers.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/scalar_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initializer_of_A" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/size_op_dyn.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/size_op_dyn.prototxt index 75b060ac3b86f2..f7dd0577c9504b 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/size_op_dyn.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/size_op_dyn.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.prototxt index cf3b161c72a076..b4446d0869fbcc 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_clamp_neg_ends_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.prototxt index 874efbe84f7305..9adeaf28111f55 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_default_steps_dyn_begin_end.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input.prototxt index 7b0bf299ba5941..804a061031e13a 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input_opset1.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input_opset1.prototxt index a58d74317a4c53..14a1b391ef91b5 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input_opset1.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_input_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_the_same_out_shape.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_the_same_out_shape.prototxt index 27970a8d98973f..244cecbf37679d 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_the_same_out_shape.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_2d_the_same_out_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input.prototxt index 70f84189cd2b97..506cff2ee56259 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_12_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_12_axes.prototxt index 57c0272c832c00..550cef3051db52 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_12_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_12_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_20_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_20_axes.prototxt index cafd3b1cdbb70f..00caf041afdb65 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_20_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_20_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.prototxt index cccfa008ad6021..ba4ae866a6b70d 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_21_axes_ends_max_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_neg_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_neg_axes.prototxt index cdaedbce493276..0fdd761af4259c 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_neg_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_3d_input_neg_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_0231_axes_ends_max.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_0231_axes_ends_max.prototxt index 312e4dc3c775f0..cb45ee6cc2150d 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_0231_axes_ends_max.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_0231_axes_ends_max.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_2103_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_2103_axes.prototxt index 1a9954201f003b..c0554c2e608d9c 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_2103_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_2103_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes.prototxt index 3bb61d8eb590bb..88979f5b2ec524 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes_21_steps.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes_21_steps.prototxt index 64f83b82c4b159..eee6e96fc981f2 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes_21_steps.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_4d_input_23_axes_21_steps.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_axes.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_axes.prototxt index 069060772bde4d..0ff817a63d119d 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_axes.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_steps.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_steps.prototxt index 73dd4f37ff895a..1d6cbb3c00403f 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_steps.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/slice_default_steps.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice" node { diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/space_to_depth.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/space_to_depth.prototxt index 0aab54f75ba971..34fd480fe14dac 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/space_to_depth.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/space_to_depth.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/transpose.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/transpose.prototxt index 0e953730a07cd6..65d2d6fedb1fb9 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/transpose.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/transpose.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { name: "Dynamic Transpose" diff --git a/src/frontends/onnx/tests/models/dynamic_shapes/trilu_lower.prototxt b/src/frontends/onnx/tests/models/dynamic_shapes/trilu_lower.prototxt index b1b5ce8efb5648..d03ec843ca9b14 100644 --- a/src/frontends/onnx/tests/models/dynamic_shapes/trilu_lower.prototxt +++ b/src/frontends/onnx/tests/models/dynamic_shapes/trilu_lower.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/einsum_sum.prototxt b/src/frontends/onnx/tests/models/einsum_sum.prototxt index 0f56b47d3abfe3..d805213a93413b 100644 --- a/src/frontends/onnx/tests/models/einsum_sum.prototxt +++ b/src/frontends/onnx/tests/models/einsum_sum.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/elu.prototxt b/src/frontends/onnx/tests/models/elu.prototxt index a1554bd2e53d49..70377d060f2823 100644 --- a/src/frontends/onnx/tests/models/elu.prototxt +++ b/src/frontends/onnx/tests/models/elu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/empty_initializers_handling.prototxt b/src/frontends/onnx/tests/models/empty_initializers_handling.prototxt index a91df89844ca69..d226fdc93917f3 100644 --- a/src/frontends/onnx/tests/models/empty_initializers_handling.prototxt +++ b/src/frontends/onnx/tests/models/empty_initializers_handling.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { initializer { dims: 0 diff --git a/src/frontends/onnx/tests/models/erf.prototxt b/src/frontends/onnx/tests/models/erf.prototxt index ec5604102046c2..156e7059e2eaf6 100644 --- a/src/frontends/onnx/tests/models/erf.prototxt +++ b/src/frontends/onnx/tests/models/erf.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/erf_int32.prototxt b/src/frontends/onnx/tests/models/erf_int32.prototxt index 7fe6547662bda4..ef44b2c129572a 100644 --- a/src/frontends/onnx/tests/models/erf_int32.prototxt +++ b/src/frontends/onnx/tests/models/erf_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/expand_failsafe_node.prototxt b/src/frontends/onnx/tests/models/expand_failsafe_node.prototxt index 3a0c9de1d2e582..1d51dced563981 100644 --- a/src/frontends/onnx/tests/models/expand_failsafe_node.prototxt +++ b/src/frontends/onnx/tests/models/expand_failsafe_node.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/expand_static_shape.prototxt b/src/frontends/onnx/tests/models/expand_static_shape.prototxt index 94c5b130747712..19156f9f432ecc 100644 --- a/src/frontends/onnx/tests/models/expand_static_shape.prototxt +++ b/src/frontends/onnx/tests/models/expand_static_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/external_data/external_data.prototxt b/src/frontends/onnx/tests/models/external_data/external_data.prototxt index 9500b33dcc5ffd..1768cb84e64869 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_different_paths.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_different_paths.prototxt index 82bb35912b5a10..9b4f30b28f30ff 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_different_paths.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_different_paths.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_a" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_file_not_found.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_file_not_found.prototxt index f65b8186aa8260..f573772f7e40a2 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_file_not_found.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_file_not_found.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_in_constant_node.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_in_constant_node.prototxt index d34eca94fbc9b6..ebe30c7d3ba280 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_in_constant_node.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_in_constant_node.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_incorrect_data_shape.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_incorrect_data_shape.prototxt index 967ab954886125..86f00e34eccc13 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_incorrect_data_shape.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_incorrect_data_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_invalid_data_length.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_invalid_data_length.prototxt index 2bc0d9fcf07d98..f80423b0c773a5 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_invalid_data_length.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_invalid_data_length.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_greater_than_page_size_with_length_provided.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_greater_than_page_size_with_length_provided.prototxt index 406b03f960ff6f..10be5a2b0f71c9 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_greater_than_page_size_with_length_provided.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_greater_than_page_size_with_length_provided.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_less_than_page_size_with_length_provided.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_less_than_page_size_with_length_provided.prototxt index 8296f1bb17bed1..779cb1ac18ff2a 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_less_than_page_size_with_length_provided.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_offset_not_aligned_with_page_and_less_than_page_size_with_length_provided.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_optional_fields.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_optional_fields.prototxt index 70f4b56e5dcdd0..dc32d26481304b 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_optional_fields.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_optional_fields.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_optional_fields_offset_not_aligned.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_optional_fields_offset_not_aligned.prototxt index 4a5359d0de42dd..134eef0bf36599 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_optional_fields_offset_not_aligned.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_optional_fields_offset_not_aligned.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_sanitize_test.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_sanitize_test.prototxt index 950b90071c5edd..43bdf20327eb6e 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_sanitize_test.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_sanitize_test.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/external_data/external_data_two_tensors_data_in_the_same_file.prototxt b/src/frontends/onnx/tests/models/external_data/external_data_two_tensors_data_in_the_same_file.prototxt index 2b9b3626e73705..77e77ea3ef8ba5 100644 --- a/src/frontends/onnx/tests/models/external_data/external_data_two_tensors_data_in_the_same_file.prototxt +++ b/src/frontends/onnx/tests/models/external_data/external_data_two_tensors_data_in_the_same_file.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_a" diff --git a/src/frontends/onnx/tests/models/external_data/inner_scope/external_data_file_in_up_dir.prototxt b/src/frontends/onnx/tests/models/external_data/inner_scope/external_data_file_in_up_dir.prototxt index aa98b3bce98b24..dcc4c33d0c6b5b 100644 --- a/src/frontends/onnx/tests/models/external_data/inner_scope/external_data_file_in_up_dir.prototxt +++ b/src/frontends/onnx/tests/models/external_data/inner_scope/external_data_file_in_up_dir.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/external_data/offset_not_aligned_with_page_in_two_pages_scope.prototxt b/src/frontends/onnx/tests/models/external_data/offset_not_aligned_with_page_in_two_pages_scope.prototxt index 5a1737dcc13b6f..29de3afac98120 100644 --- a/src/frontends/onnx/tests/models/external_data/offset_not_aligned_with_page_in_two_pages_scope.prototxt +++ b/src/frontends/onnx/tests/models/external_data/offset_not_aligned_with_page_in_two_pages_scope.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/eye_like.prototxt b/src/frontends/onnx/tests/models/eye_like.prototxt index becaff04e7490c..ba19606a4edb52 100644 --- a/src/frontends/onnx/tests/models/eye_like.prototxt +++ b/src/frontends/onnx/tests/models/eye_like.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/eye_like_wrong_shape.prototxt b/src/frontends/onnx/tests/models/eye_like_wrong_shape.prototxt index d252fe6877dc50..79979fb17eefff 100644 --- a/src/frontends/onnx/tests/models/eye_like_wrong_shape.prototxt +++ b/src/frontends/onnx/tests/models/eye_like_wrong_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/flatten.prototxt b/src/frontends/onnx/tests/models/flatten.prototxt index 53e7835dba9452..4e01dba50f52aa 100644 --- a/src/frontends/onnx/tests/models/flatten.prototxt +++ b/src/frontends/onnx/tests/models/flatten.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/gatherND_float.prototxt b/src/frontends/onnx/tests/models/gatherND_float.prototxt index 39a990a63a65b3..aaea95ce36f00f 100644 --- a/src/frontends/onnx/tests/models/gatherND_float.prototxt +++ b/src/frontends/onnx/tests/models/gatherND_float.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/gatherND_int32.prototxt b/src/frontends/onnx/tests/models/gatherND_int32.prototxt index a10e901a44a5fc..86e254203d07f3 100644 --- a/src/frontends/onnx/tests/models/gatherND_int32.prototxt +++ b/src/frontends/onnx/tests/models/gatherND_int32.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/gather_elements_float_1D.prototxt b/src/frontends/onnx/tests/models/gather_elements_float_1D.prototxt index 6973b9e5fa3744..f6a8a934d7d903 100644 --- a/src/frontends/onnx/tests/models/gather_elements_float_1D.prototxt +++ b/src/frontends/onnx/tests/models/gather_elements_float_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/gather_elements_float_3D_axis_2.prototxt b/src/frontends/onnx/tests/models/gather_elements_float_3D_axis_2.prototxt index 0e746696685610..dedc091bc12c6d 100644 --- a/src/frontends/onnx/tests/models/gather_elements_float_3D_axis_2.prototxt +++ b/src/frontends/onnx/tests/models/gather_elements_float_3D_axis_2.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/gather_elements_float_negative_axis.prototxt b/src/frontends/onnx/tests/models/gather_elements_float_negative_axis.prototxt index f09c7e9b5f01c8..8ed1b0a3db426c 100644 --- a/src/frontends/onnx/tests/models/gather_elements_float_negative_axis.prototxt +++ b/src/frontends/onnx/tests/models/gather_elements_float_negative_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/gather_elements_int32_axis_0.prototxt b/src/frontends/onnx/tests/models/gather_elements_int32_axis_0.prototxt index ee374991ca64bb..eba1513b45ae46 100644 --- a/src/frontends/onnx/tests/models/gather_elements_int32_axis_0.prototxt +++ b/src/frontends/onnx/tests/models/gather_elements_int32_axis_0.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/gather_elements_int8_axis_1.prototxt b/src/frontends/onnx/tests/models/gather_elements_int8_axis_1.prototxt index 494042f94d88e1..2a2202f1f47f14 100644 --- a/src/frontends/onnx/tests/models/gather_elements_int8_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/gather_elements_int8_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/gemm_abc.prototxt b/src/frontends/onnx/tests/models/gemm_abc.prototxt index a649dfb8ee1c85..fb5d3db79d9569 100644 --- a/src/frontends/onnx/tests/models/gemm_abc.prototxt +++ b/src/frontends/onnx/tests/models/gemm_abc.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "a" diff --git a/src/frontends/onnx/tests/models/global_lp_pool_dynamic_hw.prototxt b/src/frontends/onnx/tests/models/global_lp_pool_dynamic_hw.prototxt index aab38654dd6489..ad0226addf3e72 100644 --- a/src/frontends/onnx/tests/models/global_lp_pool_dynamic_hw.prototxt +++ b/src/frontends/onnx/tests/models/global_lp_pool_dynamic_hw.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/global_lp_pool_p0.prototxt b/src/frontends/onnx/tests/models/global_lp_pool_p0.prototxt index a5957073d63d2b..16a8c4a95f38a4 100644 --- a/src/frontends/onnx/tests/models/global_lp_pool_p0.prototxt +++ b/src/frontends/onnx/tests/models/global_lp_pool_p0.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/global_lp_pool_p1.prototxt b/src/frontends/onnx/tests/models/global_lp_pool_p1.prototxt index 5cbff0bbf65a68..d7effffc6b95a0 100644 --- a/src/frontends/onnx/tests/models/global_lp_pool_p1.prototxt +++ b/src/frontends/onnx/tests/models/global_lp_pool_p1.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/global_lp_pool_p2.prototxt b/src/frontends/onnx/tests/models/global_lp_pool_p2.prototxt index dbedca94310381..1ea4e799c6a2cd 100644 --- a/src/frontends/onnx/tests/models/global_lp_pool_p2.prototxt +++ b/src/frontends/onnx/tests/models/global_lp_pool_p2.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/global_lp_pool_p3.prototxt b/src/frontends/onnx/tests/models/global_lp_pool_p3.prototxt index b4bd9491280670..11a18157e95d82 100644 --- a/src/frontends/onnx/tests/models/global_lp_pool_p3.prototxt +++ b/src/frontends/onnx/tests/models/global_lp_pool_p3.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/greater_or_equal_float.prototxt b/src/frontends/onnx/tests/models/greater_or_equal_float.prototxt index 983efd96160bca..2acd66e9a84474 100644 --- a/src/frontends/onnx/tests/models/greater_or_equal_float.prototxt +++ b/src/frontends/onnx/tests/models/greater_or_equal_float.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/greater_or_equal_int.prototxt b/src/frontends/onnx/tests/models/greater_or_equal_int.prototxt index 16058fabd297e9..b8f54f34d54581 100644 --- a/src/frontends/onnx/tests/models/greater_or_equal_int.prototxt +++ b/src/frontends/onnx/tests/models/greater_or_equal_int.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/grid_sample.prototxt b/src/frontends/onnx/tests/models/grid_sample.prototxt index e8365b232e7adc..2e00e98e059185 100644 --- a/src/frontends/onnx/tests/models/grid_sample.prototxt +++ b/src/frontends/onnx/tests/models/grid_sample.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/group_norm.prototxt b/src/frontends/onnx/tests/models/group_norm.prototxt index e5f43cd7c3672c..21f271b3c6c6a8 100644 --- a/src/frontends/onnx/tests/models/group_norm.prototxt +++ b/src/frontends/onnx/tests/models/group_norm.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/group_norm_4D_bias_and_scale.prototxt b/src/frontends/onnx/tests/models/group_norm_4D_bias_and_scale.prototxt index 7138bf3bc395bd..74fb06c300851d 100644 --- a/src/frontends/onnx/tests/models/group_norm_4D_bias_and_scale.prototxt +++ b/src/frontends/onnx/tests/models/group_norm_4D_bias_and_scale.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/group_norm_5d.prototxt b/src/frontends/onnx/tests/models/group_norm_5d.prototxt index aced083efd2780..808dda22c63d1f 100644 --- a/src/frontends/onnx/tests/models/group_norm_5d.prototxt +++ b/src/frontends/onnx/tests/models/group_norm_5d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/group_normalization_2grp.prototxt b/src/frontends/onnx/tests/models/group_normalization_2grp.prototxt index 978ab918a2c521..65999939afe0df 100644 --- a/src/frontends/onnx/tests/models/group_normalization_2grp.prototxt +++ b/src/frontends/onnx/tests/models/group_normalization_2grp.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/group_normalization_3grp.prototxt b/src/frontends/onnx/tests/models/group_normalization_3grp.prototxt index 1711e41bd5d48f..5a6f53c8d8802a 100644 --- a/src/frontends/onnx/tests/models/group_normalization_3grp.prototxt +++ b/src/frontends/onnx/tests/models/group_normalization_3grp.prototxt @@ -3,7 +3,7 @@ opset_import { domain: "" version: 18 } -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/group_normalization_custom_eps.prototxt b/src/frontends/onnx/tests/models/group_normalization_custom_eps.prototxt index 083b5d8ecf5d0e..19924681b78d2e 100644 --- a/src/frontends/onnx/tests/models/group_normalization_custom_eps.prototxt +++ b/src/frontends/onnx/tests/models/group_normalization_custom_eps.prototxt @@ -3,7 +3,7 @@ opset_import { domain: "" version: 18 } -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/gru_bidir_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/gru_bidir_mixed_seq_len_const.prototxt index 4e3e9317868bc9..13805f931b0296 100644 --- a/src/frontends/onnx/tests/models/gru_bidir_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_bidir_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_bidirectional.prototxt b/src/frontends/onnx/tests/models/gru_bidirectional.prototxt index 66a4f47a0338f2..95c65aaf147597 100644 --- a/src/frontends/onnx/tests/models/gru_bidirectional.prototxt +++ b/src/frontends/onnx/tests/models/gru_bidirectional.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_bidirectional_const.prototxt b/src/frontends/onnx/tests/models/gru_bidirectional_const.prototxt index 746cdc2012c386..f432ad1dc319cd 100644 --- a/src/frontends/onnx/tests/models/gru_bidirectional_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_bidirectional_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_defaults_fwd.prototxt b/src/frontends/onnx/tests/models/gru_defaults_fwd.prototxt index 2858ba169a42dc..da52c7c923e061 100644 --- a/src/frontends/onnx/tests/models/gru_defaults_fwd.prototxt +++ b/src/frontends/onnx/tests/models/gru_defaults_fwd.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_defaults_fwd_const.prototxt b/src/frontends/onnx/tests/models/gru_defaults_fwd_const.prototxt index 68055158498088..2bb8588a0ced1b 100644 --- a/src/frontends/onnx/tests/models/gru_defaults_fwd_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_defaults_fwd_const.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_fwd_activations_relu_hardsigmoid.prototxt b/src/frontends/onnx/tests/models/gru_fwd_activations_relu_hardsigmoid.prototxt index 66537b43580f26..b32b143a0ad198 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_activations_relu_hardsigmoid.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_activations_relu_hardsigmoid.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_fwd_activations_relu_sigmoid_const.prototxt b/src/frontends/onnx/tests/models/gru_fwd_activations_relu_sigmoid_const.prototxt index 9c8f39879f8a78..33b6d6a7eaaff1 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_activations_relu_sigmoid_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_activations_relu_sigmoid_const.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h.prototxt b/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h.prototxt index adc6fa44d654b2..6406c2fe1fda36 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h_const.prototxt b/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h_const.prototxt index d8feb77aad9340..41871ef4b51361 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_bias_initial_h_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset.prototxt b/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset.prototxt index e4367ef3a9bdb5..f416cdfaf378a9 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset_const.prototxt b/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset_const.prototxt index 7a50debeb488fb..3086ea7a2f335c 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_linear_before_reset_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len.prototxt b/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len.prototxt index 88b77e245f3fec..43e55baad3a7fa 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len_const.prototxt index aeebe53c3189cb..93b8dd4b113b13 100644 --- a/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_fwd_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_rev_clip.prototxt b/src/frontends/onnx/tests/models/gru_rev_clip.prototxt index 3c1f7cee485cf3..65351ef876a60d 100644 --- a/src/frontends/onnx/tests/models/gru_rev_clip.prototxt +++ b/src/frontends/onnx/tests/models/gru_rev_clip.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_rev_clip_const.prototxt b/src/frontends/onnx/tests/models/gru_rev_clip_const.prototxt index ffe25b92e13ebc..b0d6465ce2abaa 100644 --- a/src/frontends/onnx/tests/models/gru_rev_clip_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_rev_clip_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_reverse.prototxt b/src/frontends/onnx/tests/models/gru_reverse.prototxt index c0504334c8fa09..73045ba350696a 100644 --- a/src/frontends/onnx/tests/models/gru_reverse.prototxt +++ b/src/frontends/onnx/tests/models/gru_reverse.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/gru_reverse_const.prototxt b/src/frontends/onnx/tests/models/gru_reverse_const.prototxt index 929d7dc19540fd..366896bb7a6b54 100644 --- a/src/frontends/onnx/tests/models/gru_reverse_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_reverse_const.prototxt @@ -1,6 +1,6 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/gru_reverse_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/gru_reverse_mixed_seq_len_const.prototxt index 1f83234810ca88..0326325cd8a174 100644 --- a/src/frontends/onnx/tests/models/gru_reverse_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/gru_reverse_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/hammingwindow_periodic.prototxt b/src/frontends/onnx/tests/models/hammingwindow_periodic.prototxt index 2bf75ed29fe7f6..75f5e6786fe5e5 100644 --- a/src/frontends/onnx/tests/models/hammingwindow_periodic.prototxt +++ b/src/frontends/onnx/tests/models/hammingwindow_periodic.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/hammingwindow_symmetric.prototxt b/src/frontends/onnx/tests/models/hammingwindow_symmetric.prototxt index 1c9a9019829383..8f8460d965b884 100644 --- a/src/frontends/onnx/tests/models/hammingwindow_symmetric.prototxt +++ b/src/frontends/onnx/tests/models/hammingwindow_symmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/hannwindow_periodic.prototxt b/src/frontends/onnx/tests/models/hannwindow_periodic.prototxt index 2895bf5ad9b4d9..3e1beefc186b51 100644 --- a/src/frontends/onnx/tests/models/hannwindow_periodic.prototxt +++ b/src/frontends/onnx/tests/models/hannwindow_periodic.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/hannwindow_symmetric.prototxt b/src/frontends/onnx/tests/models/hannwindow_symmetric.prototxt index ec2bc2b8e42bef..0a0da994569b30 100644 --- a/src/frontends/onnx/tests/models/hannwindow_symmetric.prototxt +++ b/src/frontends/onnx/tests/models/hannwindow_symmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "size" diff --git a/src/frontends/onnx/tests/models/hard_sigmoid.prototxt b/src/frontends/onnx/tests/models/hard_sigmoid.prototxt index ece9fd275a7835..45a6944d3a2d82 100644 --- a/src/frontends/onnx/tests/models/hard_sigmoid.prototxt +++ b/src/frontends/onnx/tests/models/hard_sigmoid.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/hardmax.prototxt b/src/frontends/onnx/tests/models/hardmax.prototxt index 045f3757db0e89..b3151f54760a2b 100644 --- a/src/frontends/onnx/tests/models/hardmax.prototxt +++ b/src/frontends/onnx/tests/models/hardmax.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/image_scaler.prototxt b/src/frontends/onnx/tests/models/image_scaler.prototxt index bc45e8a768bf7f..ee531a35bd4590 100644 --- a/src/frontends/onnx/tests/models/image_scaler.prototxt +++ b/src/frontends/onnx/tests/models/image_scaler.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/initializer_wo_input.prototxt b/src/frontends/onnx/tests/models/initializer_wo_input.prototxt index 75ca2ca826fe52..74e65313ac0719 100644 --- a/src/frontends/onnx/tests/models/initializer_wo_input.prototxt +++ b/src/frontends/onnx/tests/models/initializer_wo_input.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/instance_norm.prototxt b/src/frontends/onnx/tests/models/instance_norm.prototxt index 6e446c95e000a0..ac144be1484c04 100644 --- a/src/frontends/onnx/tests/models/instance_norm.prototxt +++ b/src/frontends/onnx/tests/models/instance_norm.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/instance_norm_bad_scale_type.prototxt b/src/frontends/onnx/tests/models/instance_norm_bad_scale_type.prototxt index 8a13b675ffb25c..eaf9add9efb8a4 100644 --- a/src/frontends/onnx/tests/models/instance_norm_bad_scale_type.prototxt +++ b/src/frontends/onnx/tests/models/instance_norm_bad_scale_type.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/instance_norm_dynamic.prototxt b/src/frontends/onnx/tests/models/instance_norm_dynamic.prototxt index 4d6a938ad5ee81..a29ebb79679b8c 100644 --- a/src/frontends/onnx/tests/models/instance_norm_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/instance_norm_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/is_finite.prototxt b/src/frontends/onnx/tests/models/is_finite.prototxt index f597e20d357a5f..868ebfc5e3703e 100644 --- a/src/frontends/onnx/tests/models/is_finite.prototxt +++ b/src/frontends/onnx/tests/models/is_finite.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/is_inf.prototxt b/src/frontends/onnx/tests/models/is_inf.prototxt index cfffa8c467df05..c8a6535da9fecf 100644 --- a/src/frontends/onnx/tests/models/is_inf.prototxt +++ b/src/frontends/onnx/tests/models/is_inf.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/is_inf_negative.prototxt b/src/frontends/onnx/tests/models/is_inf_negative.prototxt index 7a9d7e664c2f1c..4a316c6544e869 100644 --- a/src/frontends/onnx/tests/models/is_inf_negative.prototxt +++ b/src/frontends/onnx/tests/models/is_inf_negative.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/is_inf_none.prototxt b/src/frontends/onnx/tests/models/is_inf_none.prototxt index 30da35b865b688..03361400bdf25b 100644 --- a/src/frontends/onnx/tests/models/is_inf_none.prototxt +++ b/src/frontends/onnx/tests/models/is_inf_none.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/is_inf_positive.prototxt b/src/frontends/onnx/tests/models/is_inf_positive.prototxt index 6d25dc3df8d0b4..c58f20e8d996e4 100644 --- a/src/frontends/onnx/tests/models/is_inf_positive.prototxt +++ b/src/frontends/onnx/tests/models/is_inf_positive.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/is_nan.prototxt b/src/frontends/onnx/tests/models/is_nan.prototxt index f6915dac0aa3d2..271b683d9ae615 100644 --- a/src/frontends/onnx/tests/models/is_nan.prototxt +++ b/src/frontends/onnx/tests/models/is_nan.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/leaky_relu.prototxt b/src/frontends/onnx/tests/models/leaky_relu.prototxt index a673caf87a8214..ab5b863969c357 100644 --- a/src/frontends/onnx/tests/models/leaky_relu.prototxt +++ b/src/frontends/onnx/tests/models/leaky_relu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/logsoftmax13_1D.prototxt b/src/frontends/onnx/tests/models/logsoftmax13_1D.prototxt index b75dd3ff52484d..87a0ff0637e4e0 100644 --- a/src/frontends/onnx/tests/models/logsoftmax13_1D.prototxt +++ b/src/frontends/onnx/tests/models/logsoftmax13_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/logsoftmax13_2D.prototxt b/src/frontends/onnx/tests/models/logsoftmax13_2D.prototxt index 7117079cae2211..8c0b1e49210c7a 100644 --- a/src/frontends/onnx/tests/models/logsoftmax13_2D.prototxt +++ b/src/frontends/onnx/tests/models/logsoftmax13_2D.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/logsoftmax_0D.prototxt b/src/frontends/onnx/tests/models/logsoftmax_0D.prototxt index cd9526b3fbdc72..71ea091eaa5918 100644 --- a/src/frontends/onnx/tests/models/logsoftmax_0D.prototxt +++ b/src/frontends/onnx/tests/models/logsoftmax_0D.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/logsoftmax_1D.prototxt b/src/frontends/onnx/tests/models/logsoftmax_1D.prototxt index 46799d23e8430a..3d50287d7f226f 100644 --- a/src/frontends/onnx/tests/models/logsoftmax_1D.prototxt +++ b/src/frontends/onnx/tests/models/logsoftmax_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/lp_norm_default.prototxt b/src/frontends/onnx/tests/models/lp_norm_default.prototxt index 9fdbab7f040aca..6c23d670dd0949 100644 --- a/src/frontends/onnx/tests/models/lp_norm_default.prototxt +++ b/src/frontends/onnx/tests/models/lp_norm_default.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/lp_norm_default_dynamic.prototxt b/src/frontends/onnx/tests/models/lp_norm_default_dynamic.prototxt index 55d3bd3e705e09..e37e273fc1b7db 100644 --- a/src/frontends/onnx/tests/models/lp_norm_default_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/lp_norm_default_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/lp_norm_p1.prototxt b/src/frontends/onnx/tests/models/lp_norm_p1.prototxt index fd6993a8c83f7a..92e4e54b4cb33a 100644 --- a/src/frontends/onnx/tests/models/lp_norm_p1.prototxt +++ b/src/frontends/onnx/tests/models/lp_norm_p1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/lp_norm_p2.prototxt b/src/frontends/onnx/tests/models/lp_norm_p2.prototxt index 07d570ac8efb24..da25655e5dc859 100644 --- a/src/frontends/onnx/tests/models/lp_norm_p2.prototxt +++ b/src/frontends/onnx/tests/models/lp_norm_p2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/lstm_bidir_const.prototxt b/src/frontends/onnx/tests/models/lstm_bidir_const.prototxt index 0363f7ffaded85..938f9ab2dba349 100644 --- a/src/frontends/onnx/tests/models/lstm_bidir_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_bidir_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_bidir_mixed_seq_const.prototxt b/src/frontends/onnx/tests/models/lstm_bidir_mixed_seq_const.prototxt index 28ad3eed2199d1..cb9f4545ab435f 100644 --- a/src/frontends/onnx/tests/models/lstm_bidir_mixed_seq_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_bidir_mixed_seq_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_dynamic_batch_size_and_seq_len.prototxt b/src/frontends/onnx/tests/models/lstm_dynamic_batch_size_and_seq_len.prototxt index f05e32c39589d0..c9c51981f110bc 100644 --- a/src/frontends/onnx/tests/models/lstm_dynamic_batch_size_and_seq_len.prototxt +++ b/src/frontends/onnx/tests/models/lstm_dynamic_batch_size_and_seq_len.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_clip_const.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_clip_const.prototxt index fff265e3d0fcdf..076a5bccac3185 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_clip_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_clip_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_default_const.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_default_const.prototxt index c0a005698ee0f3..4d2e7dea7bab35 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_default_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_default_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_hardsigmoid_activation.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_hardsigmoid_activation.prototxt index 0866e3b679a202..dc35d1f737b6bd 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_hardsigmoid_activation.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_hardsigmoid_activation.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_large_batch_no_clip.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_large_batch_no_clip.prototxt index 1ba0544ebe760a..22e473ac66e6ec 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_large_batch_no_clip.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_large_batch_no_clip.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq.prototxt index c7e4f3565c3585..89400006b88cf6 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq_const.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq_const.prototxt index 0f5dfa2e567193..3586851bec7444 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_mixed_seq_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt b/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt index 4c59b0d39fbc0f..2a218f089240a5 100644 --- a/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt +++ b/src/frontends/onnx/tests/models/lstm_fwd_with_clip_peepholes.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/lstm_reverse_const.prototxt b/src/frontends/onnx/tests/models/lstm_reverse_const.prototxt index 5bf316b788cd91..b4e3d70338d421 100644 --- a/src/frontends/onnx/tests/models/lstm_reverse_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_reverse_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/lstm_reverse_mixed_seq_const.prototxt b/src/frontends/onnx/tests/models/lstm_reverse_mixed_seq_const.prototxt index eae833aad33ae0..e6c65b092f20f8 100644 --- a/src/frontends/onnx/tests/models/lstm_reverse_mixed_seq_const.prototxt +++ b/src/frontends/onnx/tests/models/lstm_reverse_mixed_seq_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/matmul.prototxt b/src/frontends/onnx/tests/models/matmul.prototxt index 2988c24577bd82..f68d68e189dd1d 100644 --- a/src/frontends/onnx/tests/models/matmul.prototxt +++ b/src/frontends/onnx/tests/models/matmul.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "a" diff --git a/src/frontends/onnx/tests/models/matmul_integer.prototxt b/src/frontends/onnx/tests/models/matmul_integer.prototxt index 813f4920ce7db0..1f7bad1d56c5e7 100644 --- a/src/frontends/onnx/tests/models/matmul_integer.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_2d_x_3d.prototxt b/src/frontends/onnx/tests/models/matmul_integer_2d_x_3d.prototxt index dcac5092c5a206..d6e1f69acbb550 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_2d_x_3d.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_2d_x_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_3d.prototxt b/src/frontends/onnx/tests/models/matmul_integer_3d.prototxt index e640c7714d4a86..2c7df7ca8c808d 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_3d.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_3d_x_2d.prototxt b/src/frontends/onnx/tests/models/matmul_integer_3d_x_2d.prototxt index e359be5d04d20e..2861cc22fbcbbc 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_3d_x_2d.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_3d_x_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_4d.prototxt b/src/frontends/onnx/tests/models/matmul_integer_4d.prototxt index a1c29d86d62a21..07775ad17429da 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_4d.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_4d.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_4d_no_zero_point.prototxt b/src/frontends/onnx/tests/models/matmul_integer_4d_no_zero_point.prototxt index 6f14518837ba1f..5767a64177b47e 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_4d_no_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_4d_no_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_int8.prototxt b/src/frontends/onnx/tests/models/matmul_integer_int8.prototxt index e28705d03b8790..6fcbd8e5170dc7 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_int8.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_int8.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_matrix_zero_point.prototxt b/src/frontends/onnx/tests/models/matmul_integer_matrix_zero_point.prototxt index 31bfa2e775da4d..8dac6d79c79b09 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_matrix_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_matrix_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_no_zero_point.prototxt b/src/frontends/onnx/tests/models/matmul_integer_no_zero_point.prototxt index aefb304823cd3a..037e46e063d80a 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_no_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_no_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_integer_vectorized_zero_point.prototxt b/src/frontends/onnx/tests/models/matmul_integer_vectorized_zero_point.prototxt index 12974e6b4caf9f..37ccb6dadd897f 100644 --- a/src/frontends/onnx/tests/models/matmul_integer_vectorized_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/matmul_integer_vectorized_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/matmul_vec_ten3d.prototxt b/src/frontends/onnx/tests/models/matmul_vec_ten3d.prototxt index b21be7e48a6ea4..2747c2709da2b4 100644 --- a/src/frontends/onnx/tests/models/matmul_vec_ten3d.prototxt +++ b/src/frontends/onnx/tests/models/matmul_vec_ten3d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/max.prototxt b/src/frontends/onnx/tests/models/max.prototxt index 84e8e8a45a8fc2..3c5d418d20a3e0 100644 --- a/src/frontends/onnx/tests/models/max.prototxt +++ b/src/frontends/onnx/tests/models/max.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/max_opset1.prototxt b/src/frontends/onnx/tests/models/max_opset1.prototxt index 2a69d5fe49859b..c8577a0ee9b19b 100644 --- a/src/frontends/onnx/tests/models/max_opset1.prototxt +++ b/src/frontends/onnx/tests/models/max_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/max_pool_2d_pads.prototxt b/src/frontends/onnx/tests/models/max_pool_2d_pads.prototxt index 06263b9247437f..6ee7522500e108 100644 --- a/src/frontends/onnx/tests/models/max_pool_2d_pads.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_2d_pads.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_3d.prototxt b/src/frontends/onnx/tests/models/max_pool_3d.prototxt index d84830a05d30ec..caddbf9eb9b62e 100644 --- a/src/frontends/onnx/tests/models/max_pool_3d.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_4d_ceil_mode.prototxt b/src/frontends/onnx/tests/models/max_pool_4d_ceil_mode.prototxt index 456aa6df3c4773..2fef073d539368 100644 --- a/src/frontends/onnx/tests/models/max_pool_4d_ceil_mode.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_4d_ceil_mode.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_4d_ceil_strides.prototxt b/src/frontends/onnx/tests/models/max_pool_4d_ceil_strides.prototxt index dab7cfdb0908f3..0e3c18aaa45f19 100644 --- a/src/frontends/onnx/tests/models/max_pool_4d_ceil_strides.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_4d_ceil_strides.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_4d_dilations.prototxt b/src/frontends/onnx/tests/models/max_pool_4d_dilations.prototxt index 12cfdbe162bb2f..cd240f961ae064 100644 --- a/src/frontends/onnx/tests/models/max_pool_4d_dilations.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_4d_dilations.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_4d_strides.prototxt b/src/frontends/onnx/tests/models/max_pool_4d_strides.prototxt index 2c207a1a9c0cc7..9dcec584effb62 100644 --- a/src/frontends/onnx/tests/models/max_pool_4d_strides.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_4d_strides.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_empty_auto_pad.prototxt b/src/frontends/onnx/tests/models/max_pool_empty_auto_pad.prototxt index bad6c74769c13c..6316de97fc5e48 100644 --- a/src/frontends/onnx/tests/models/max_pool_empty_auto_pad.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_empty_auto_pad.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_simple.prototxt b/src/frontends/onnx/tests/models/max_pool_simple.prototxt index dd433805e538ef..e567eba5b20229 100644 --- a/src/frontends/onnx/tests/models/max_pool_simple.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_simple.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_simple_named.prototxt b/src/frontends/onnx/tests/models/max_pool_simple_named.prototxt index 6e28e294bff7cc..3266a1a560411e 100644 --- a/src/frontends/onnx/tests/models/max_pool_simple_named.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_simple_named.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_transposed.prototxt b/src/frontends/onnx/tests/models/max_pool_transposed.prototxt index 6f177a18165448..ee4fafbb74324d 100644 --- a/src/frontends/onnx/tests/models/max_pool_transposed.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_transposed.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/max_pool_transposed_named.prototxt b/src/frontends/onnx/tests/models/max_pool_transposed_named.prototxt index f67e1aa47efc6f..7b62f47deb5926 100644 --- a/src/frontends/onnx/tests/models/max_pool_transposed_named.prototxt +++ b/src/frontends/onnx/tests/models/max_pool_transposed_named.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/mean.prototxt b/src/frontends/onnx/tests/models/mean.prototxt index 6a4db643940b24..ebf589982a0d22 100644 --- a/src/frontends/onnx/tests/models/mean.prototxt +++ b/src/frontends/onnx/tests/models/mean.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/mean_opset1.prototxt b/src/frontends/onnx/tests/models/mean_opset1.prototxt index 06a1da0223e3a8..38655e931f0fd6 100644 --- a/src/frontends/onnx/tests/models/mean_opset1.prototxt +++ b/src/frontends/onnx/tests/models/mean_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/min_two_inputs.prototxt b/src/frontends/onnx/tests/models/min_two_inputs.prototxt index 7fb836420d32c6..eff51e9b29cced 100644 --- a/src/frontends/onnx/tests/models/min_two_inputs.prototxt +++ b/src/frontends/onnx/tests/models/min_two_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/min_two_inputs_opset1.prototxt b/src/frontends/onnx/tests/models/min_two_inputs_opset1.prototxt index 9d02bfa4907fc7..c02ac401d169f5 100644 --- a/src/frontends/onnx/tests/models/min_two_inputs_opset1.prototxt +++ b/src/frontends/onnx/tests/models/min_two_inputs_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/missing_input.prototxt b/src/frontends/onnx/tests/models/missing_input.prototxt index a430045de04d3d..e11df36039e2fb 100644 --- a/src/frontends/onnx/tests/models/missing_input.prototxt +++ b/src/frontends/onnx/tests/models/missing_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "I0" diff --git a/src/frontends/onnx/tests/models/missing_op_domain.prototxt b/src/frontends/onnx/tests/models/missing_op_domain.prototxt index 943b19dd0ce23f..b5c9dc21f256e3 100644 --- a/src/frontends/onnx/tests/models/missing_op_domain.prototxt +++ b/src/frontends/onnx/tests/models/missing_op_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mm_nms_rotated.prototxt b/src/frontends/onnx/tests/models/mm_nms_rotated.prototxt index feda742ec9a805..ddbf255f2b35d9 100644 --- a/src/frontends/onnx/tests/models/mm_nms_rotated.prototxt +++ b/src/frontends/onnx/tests/models/mm_nms_rotated.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx_frontend_test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "boxes" diff --git a/src/frontends/onnx/tests/models/mod_incorrect_fmod.prototxt b/src/frontends/onnx/tests/models/mod_incorrect_fmod.prototxt index 86305d5bd90b5b..3ab41092ebc261 100644 --- a/src/frontends/onnx/tests/models/mod_incorrect_fmod.prototxt +++ b/src/frontends/onnx/tests/models/mod_incorrect_fmod.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign.prototxt b/src/frontends/onnx/tests/models/mod_sign.prototxt index 50be1dfb479d4b..dcd46e0974c153 100644 --- a/src/frontends/onnx/tests/models/mod_sign.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_broadcast.prototxt b/src/frontends/onnx/tests/models/mod_sign_broadcast.prototxt index 55c5f1f7414b05..68fd66f568caed 100644 --- a/src/frontends/onnx/tests/models/mod_sign_broadcast.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_broadcast.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_f32.prototxt b/src/frontends/onnx/tests/models/mod_sign_f32.prototxt index 2a86ca082bd885..6246cef9053aa7 100644 --- a/src/frontends/onnx/tests/models/mod_sign_f32.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_f32.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_fmod.prototxt b/src/frontends/onnx/tests/models/mod_sign_fmod.prototxt index 84dd4aac3cf51f..7846d95ab1fd61 100644 --- a/src/frontends/onnx/tests/models/mod_sign_fmod.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_fmod.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_fmod_broadcast.prototxt b/src/frontends/onnx/tests/models/mod_sign_fmod_broadcast.prototxt index 826583b48b4a42..a494a72ff55959 100644 --- a/src/frontends/onnx/tests/models/mod_sign_fmod_broadcast.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_fmod_broadcast.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_fmod_f32.prototxt b/src/frontends/onnx/tests/models/mod_sign_fmod_f32.prototxt index f8bfc3621b0877..05d2710c7f4e98 100644 --- a/src/frontends/onnx/tests/models/mod_sign_fmod_f32.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_fmod_f32.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mod_sign_i64.prototxt b/src/frontends/onnx/tests/models/mod_sign_i64.prototxt index 8043c896d1514e..a540a840fd8c1e 100644 --- a/src/frontends/onnx/tests/models/mod_sign_i64.prototxt +++ b/src/frontends/onnx/tests/models/mod_sign_i64.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_1D.prototxt b/src/frontends/onnx/tests/models/model_editor/add_1D.prototxt index 42725b13d1ac85..234cf4563e8374 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_1D.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_1D_invalid.prototxt b/src/frontends/onnx/tests/models/model_editor/add_1D_invalid.prototxt index df86c29455b8fe..d65ec118e8ca5e 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_1D_invalid.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_1D_invalid.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers.prototxt b/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers.prototxt index 138c345cdf0b37..b894a3f5673162 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers_only.prototxt b/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers_only.prototxt index 2b0a72a8dfb2ba..51bec7b4080adb 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers_only.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_1D_with_initializers_only.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_ab.prototxt b/src/frontends/onnx/tests/models/model_editor/add_ab.prototxt index b614b84c379dd9..8b55dcca2ae021 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_ab.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_ab.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_ab_duplicated_output.prototxt b/src/frontends/onnx/tests/models/model_editor/add_ab_duplicated_output.prototxt index d1645c130640a9..01f72d3895886a 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_ab_duplicated_output.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_ab_duplicated_output.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/add_abc.prototxt b/src/frontends/onnx/tests/models/model_editor/add_abc.prototxt index 05c3e997f28193..b663f698df5040 100644 --- a/src/frontends/onnx/tests/models/model_editor/add_abc.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/add_abc.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/elem_type_missing_in_input.prototxt b/src/frontends/onnx/tests/models/model_editor/elem_type_missing_in_input.prototxt index 2d7b7780562010..92cb6dda869a95 100644 --- a/src/frontends/onnx/tests/models/model_editor/elem_type_missing_in_input.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/elem_type_missing_in_input.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/invalid_input_no_tensor_type.prototxt b/src/frontends/onnx/tests/models/model_editor/invalid_input_no_tensor_type.prototxt index e1df2b561419a7..bdc1dc73daad60 100644 --- a/src/frontends/onnx/tests/models/model_editor/invalid_input_no_tensor_type.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/invalid_input_no_tensor_type.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/invalid_input_no_type.prototxt b/src/frontends/onnx/tests/models/model_editor/invalid_input_no_type.prototxt index 81f895d945c158..55ff962cea904e 100644 --- a/src/frontends/onnx/tests/models/model_editor/invalid_input_no_type.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/invalid_input_no_type.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/onnx_shape_infer_exception.prototxt b/src/frontends/onnx/tests/models/model_editor/onnx_shape_infer_exception.prototxt index 7577695024bb24..728b9c12d04714 100644 --- a/src/frontends/onnx/tests/models/model_editor/onnx_shape_infer_exception.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/onnx_shape_infer_exception.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_all_edges_from_one_source_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_all_edges_from_one_source_and_merge_all_new_inputs.prototxt index e17c6ebb21c9bb..50e621ddba6e8e 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_all_edges_from_one_source_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_all_edges_from_one_source_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "relu1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_custom_edges_from_different_sources_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_custom_edges_from_different_sources_and_merge_all_new_inputs.prototxt index e3dae07e497263..6be942b1cad458 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_custom_edges_from_different_sources_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_custom_edges_from_different_sources_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_another_edge_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_another_edge_and_merge_all_new_inputs.prototxt index 7525788f9f7376..8295b27ff01a60 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_another_edge_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_another_edge_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_edge_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_edge_and_merge_all_new_inputs.prototxt index 89bc4b02ac59a7..acfc4a50fa167e 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_edge_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_one_edge_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_different_sources_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_different_sources_and_merge_all_new_inputs.prototxt index df1845bae0389a..0ebee88d7bd36b 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_different_sources_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_different_sources_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_one_source_and_merge_all_new_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_one_source_and_merge_all_new_inputs.prototxt index 435aff8fbb7c2b..68fe8f5bb5fc86 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_one_source_and_merge_all_new_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__cut_two_edges_from_one_source_and_merge_all_new_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__existing_inputs_and_outputs_based_extraction.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__existing_inputs_and_outputs_based_extraction.prototxt index 535ab6a83b4dff..8dfeffeb86db7d 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__existing_inputs_and_outputs_based_extraction.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__existing_inputs_and_outputs_based_extraction.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt index 64d29267fb6aca..14a5cf24a24a02 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_to_input_replacement.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_without_matching_input_tail_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_without_matching_input_tail_cut.prototxt index a26c205ebc8af2..f0dfcfcd1d916b 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_without_matching_input_tail_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__initializer_without_matching_input_tail_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers.prototxt index 689ddab137aef9..6f579f193ef2b0 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_2.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_2.prototxt index f971386f7bb21e..f389ea0044a3d1 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_2.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_2.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_3.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_3.prototxt index 314cb096a9b2e7..2b1b754972ae91 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_3.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_3.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_4.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_4.prototxt index dc7c3b7c91db03..26b12ea574687f 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_4.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_4.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_5.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_5.prototxt index e2afe1ff1e2702..2ecb08363769b1 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_5.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_5.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.prototxt index bc8894f9cd2f29..2452ce13ba66cc 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__input_edge_from_tensor_with_multiple_consumers_custom_names.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_head_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_head_cut.prototxt index bbd569818b26c4..26126ecc6aa2cd 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_head_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_head_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_tail_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_tail_cut.prototxt index dd42e019cfbf01..9dbbaa2ff032b6 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_tail_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_deeper_tail_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_head_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_head_cut.prototxt index 41984db10eac71..5d3b959ebeca10 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_head_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_head_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_tail_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_tail_cut.prototxt index 59efc1294d5d30..6db92acc8108b7 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_tail_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_tail_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.prototxt index ad845070c8362d..67fc71d3de2289 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__linear_model_with_initializer_tail_cut.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiout_op_output_edge.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiout_op_output_edge.prototxt index ccd953073ceaa4..236e6bf25f54fc 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiout_op_output_edge.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiout_op_output_edge.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer.prototxt index 9f70d286c5c3a6..3a1be902eb4bf9 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.prototxt index 5c5083fb84a36e..3b70bb8686c6c6 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_initializer_relu2_and_init.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_input_relu2.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_input_relu2.prototxt index 1319a560db2892..a20881202de4d1 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_input_relu2.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__multiple_consumers_of_graph_input_relu2.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt index 12cbda0da5d621..47ef5a664a6fa0 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__twice_input_edge_from_tensor_with_single_consumer.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__use_edge_mapper_with_graph_cutter_custom_names.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__use_edge_mapper_with_graph_cutter_custom_names.prototxt index 1a30240a8543ac..54c6b2b8cf3d1a 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/subgraph__use_edge_mapper_with_graph_cutter_custom_names.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/subgraph__use_edge_mapper_with_graph_cutter_custom_names.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/reference/unknown_input_value_info.prototxt b/src/frontends/onnx/tests/models/model_editor/reference/unknown_input_value_info.prototxt index c6f6674d03ec04..550b24332dde18 100644 --- a/src/frontends/onnx/tests/models/model_editor/reference/unknown_input_value_info.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/reference/unknown_input_value_info.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { name: "No name" node { diff --git a/src/frontends/onnx/tests/models/model_editor/shapes__add_two_inputs.prototxt b/src/frontends/onnx/tests/models/model_editor/shapes__add_two_inputs.prototxt index 295cd01185af6c..c0ab4ae86b6521 100644 --- a/src/frontends/onnx/tests/models/model_editor/shapes__add_two_inputs.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/shapes__add_two_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/shapes__dynamic_rank_in_model.prototxt b/src/frontends/onnx/tests/models/model_editor/shapes__dynamic_rank_in_model.prototxt index 7b50a839113a0b..c649c81b3428c7 100644 --- a/src/frontends/onnx/tests/models/model_editor/shapes__dynamic_rank_in_model.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/shapes__dynamic_rank_in_model.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head.prototxt index 1b024156b0e825..73a4236595863e 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head_with_initializer.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head_with_initializer.prototxt index ca779cb9fffca6..c1c75193fb5d0a 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head_with_initializer.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph__inception_head_with_initializer.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph__initializer_without_matching_input.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph__initializer_without_matching_input.prototxt index 06fd4c315b35bc..0a44e133d7b6d0 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph__initializer_without_matching_input.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph__initializer_without_matching_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" doc_string: "This model contains the first few nodes of the ONNX Inception V1 model" graph { name: "Inception V1 fragment" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests.prototxt index fe8972df10c98d..8f21fa8044160f 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_2.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_2.prototxt index a5fbee597db549..dfbae0a92ea14f 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_2.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_2.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_3.prototxt b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_3.prototxt index 486ed999b0aad9..8441771ecb0fbb 100644 --- a/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_3.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/subgraph_extraction_tests_3.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input1" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/add_abc_const_node_unsorted.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/add_abc_const_node_unsorted.prototxt index 73a89b213390ab..d1892a952f371a 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/add_abc_const_node_unsorted.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/add_abc_const_node_unsorted.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted.prototxt index 3a20867479a2f2..47d864d39a9284 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "relu2" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted_2.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted_2.prototxt index 3053e0950b349a..7eaea81ceb5386 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted_2.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/completely_unsorted_2.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input1" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/empty_input_name.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/empty_input_name.prototxt index 40e7132c5d9148..411ff57b5959a6 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/empty_input_name.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/empty_input_name.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/multioutput_split_unsorted.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/multioutput_split_unsorted.prototxt index 930753aadf458c..aa39617a19f9c4 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/multioutput_split_unsorted.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/multioutput_split_unsorted.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "split_out_0" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/same_name_of_unsorted_node_and_initializer.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/same_name_of_unsorted_node_and_initializer.prototxt index 4ed1c9f618106e..7ac39f6a0b195f 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/same_name_of_unsorted_node_and_initializer.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/same_name_of_unsorted_node_and_initializer.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/model_editor/topological_sort/two_nodes_swap.prototxt b/src/frontends/onnx/tests/models/model_editor/topological_sort/two_nodes_swap.prototxt index 1751e631246133..5de4aa7f8501d9 100644 --- a/src/frontends/onnx/tests/models/model_editor/topological_sort/two_nodes_swap.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/topological_sort/two_nodes_swap.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/model_editor/unknown_input_value_info.prototxt b/src/frontends/onnx/tests/models/model_editor/unknown_input_value_info.prototxt index 7c983d31347594..66ae08a2383293 100644 --- a/src/frontends/onnx/tests/models/model_editor/unknown_input_value_info.prototxt +++ b/src/frontends/onnx/tests/models/model_editor/unknown_input_value_info.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_data_generator" +producer_name: "OpenVINO ONNX Frontend" graph { name: "No_name" node { diff --git a/src/frontends/onnx/tests/models/model_with_metadata.prototxt b/src/frontends/onnx/tests/models/model_with_metadata.prototxt index 6ca942ab0dadbf..9ba58b895a57f2 100644 --- a/src/frontends/onnx/tests/models/model_with_metadata.prototxt +++ b/src/frontends/onnx/tests/models/model_with_metadata.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v6.prototxt b/src/frontends/onnx/tests/models/mul_v6.prototxt index d4c73e8f11ea12..7740de67f46c06 100644 --- a/src/frontends/onnx/tests/models/mul_v6.prototxt +++ b/src/frontends/onnx/tests/models/mul_v6.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v6_broadcast_axes_1_2.prototxt b/src/frontends/onnx/tests/models/mul_v6_broadcast_axes_1_2.prototxt index 0a0b40fb60dfb8..482669c9d82279 100644 --- a/src/frontends/onnx/tests/models/mul_v6_broadcast_axes_1_2.prototxt +++ b/src/frontends/onnx/tests/models/mul_v6_broadcast_axes_1_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v6_broadcast_axis_1.prototxt b/src/frontends/onnx/tests/models/mul_v6_broadcast_axis_1.prototxt index a6b797d54d2288..227ec2b5c2e5b2 100644 --- a/src/frontends/onnx/tests/models/mul_v6_broadcast_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/mul_v6_broadcast_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v6_broadcast_no_axis.prototxt b/src/frontends/onnx/tests/models/mul_v6_broadcast_no_axis.prototxt index 044f25294bbc76..73626c82deaee1 100644 --- a/src/frontends/onnx/tests/models/mul_v6_broadcast_no_axis.prototxt +++ b/src/frontends/onnx/tests/models/mul_v6_broadcast_no_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v7.prototxt b/src/frontends/onnx/tests/models/mul_v7.prototxt index 2ce131bc51b91d..ba47c61720ce73 100644 --- a/src/frontends/onnx/tests/models/mul_v7.prototxt +++ b/src/frontends/onnx/tests/models/mul_v7.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/mul_v7_broadcast.prototxt b/src/frontends/onnx/tests/models/mul_v7_broadcast.prototxt index e790d44adbe65f..4bc9057312ae5d 100644 --- a/src/frontends/onnx/tests/models/mul_v7_broadcast.prototxt +++ b/src/frontends/onnx/tests/models/mul_v7_broadcast.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/multiple_slices_last_layer.prototxt b/src/frontends/onnx/tests/models/multiple_slices_last_layer.prototxt index 6804369b77c35d..036af81ffb6a18 100644 --- a/src/frontends/onnx/tests/models/multiple_slices_last_layer.prototxt +++ b/src/frontends/onnx/tests/models/multiple_slices_last_layer.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "643" diff --git a/src/frontends/onnx/tests/models/mvn_v6.prototxt b/src/frontends/onnx/tests/models/mvn_v6.prototxt index 8dc05acc8d4910..94cec588094836 100644 --- a/src/frontends/onnx/tests/models/mvn_v6.prototxt +++ b/src/frontends/onnx/tests/models/mvn_v6.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/negativelog_likelihood_loss.prototxt b/src/frontends/onnx/tests/models/negativelog_likelihood_loss.prototxt index 0383bb878bac13..576676073b7741 100644 --- a/src/frontends/onnx/tests/models/negativelog_likelihood_loss.prototxt +++ b/src/frontends/onnx/tests/models/negativelog_likelihood_loss.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/nms_default_score_threshold.prototxt b/src/frontends/onnx/tests/models/nms_default_score_threshold.prototxt index 550da618065b37..caa865bbf40395 100644 --- a/src/frontends/onnx/tests/models/nms_default_score_threshold.prototxt +++ b/src/frontends/onnx/tests/models/nms_default_score_threshold.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "ONNX Frontend" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "max_output_boxes" diff --git a/src/frontends/onnx/tests/models/non_zero_1d.prototxt b/src/frontends/onnx/tests/models/non_zero_1d.prototxt index 1eb28756d29271..1c678d696278e9 100644 --- a/src/frontends/onnx/tests/models/non_zero_1d.prototxt +++ b/src/frontends/onnx/tests/models/non_zero_1d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/non_zero_1d_float.prototxt b/src/frontends/onnx/tests/models/non_zero_1d_float.prototxt index 33c67dd722b13a..7a50c4ea329fae 100644 --- a/src/frontends/onnx/tests/models/non_zero_1d_float.prototxt +++ b/src/frontends/onnx/tests/models/non_zero_1d_float.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/non_zero_2d_bool.prototxt b/src/frontends/onnx/tests/models/non_zero_2d_bool.prototxt index 90d9bd8462bcbe..185dcc59f36007 100644 --- a/src/frontends/onnx/tests/models/non_zero_2d_bool.prototxt +++ b/src/frontends/onnx/tests/models/non_zero_2d_bool.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/non_zero_3d.prototxt b/src/frontends/onnx/tests/models/non_zero_3d.prototxt index 0fcb9e8507e847..d76a3fdf130dac 100644 --- a/src/frontends/onnx/tests/models/non_zero_3d.prototxt +++ b/src/frontends/onnx/tests/models/non_zero_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/non_zero_scalar.prototxt b/src/frontends/onnx/tests/models/non_zero_scalar.prototxt index 4addc79758077f..9f88e407b777a0 100644 --- a/src/frontends/onnx/tests/models/non_zero_scalar.prototxt +++ b/src/frontends/onnx/tests/models/non_zero_scalar.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/nonmaxsuppression_center_point_box_format.prototxt b/src/frontends/onnx/tests/models/nonmaxsuppression_center_point_box_format.prototxt index 18ae732026ded7..044dd6babac9f7 100644 --- a/src/frontends/onnx/tests/models/nonmaxsuppression_center_point_box_format.prototxt +++ b/src/frontends/onnx/tests/models/nonmaxsuppression_center_point_box_format.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "boxes" diff --git a/src/frontends/onnx/tests/models/nonmaxsuppression_single_box.prototxt b/src/frontends/onnx/tests/models/nonmaxsuppression_single_box.prototxt index 6ded770ea25778..7bf95c1bc4e7ac 100644 --- a/src/frontends/onnx/tests/models/nonmaxsuppression_single_box.prototxt +++ b/src/frontends/onnx/tests/models/nonmaxsuppression_single_box.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "boxes" diff --git a/src/frontends/onnx/tests/models/nonmaxsuppression_v9_single_box.prototxt b/src/frontends/onnx/tests/models/nonmaxsuppression_v9_single_box.prototxt index f92e3eaf22a22e..5514c7ef75d6b3 100644 --- a/src/frontends/onnx/tests/models/nonmaxsuppression_v9_single_box.prototxt +++ b/src/frontends/onnx/tests/models/nonmaxsuppression_v9_single_box.prototxt @@ -1,5 +1,5 @@ ir_version: 10 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "boxes" diff --git a/src/frontends/onnx/tests/models/normalize.prototxt b/src/frontends/onnx/tests/models/normalize.prototxt index c86713ea6a4879..ca4709c628189b 100644 --- a/src/frontends/onnx/tests/models/normalize.prototxt +++ b/src/frontends/onnx/tests/models/normalize.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test" node { diff --git a/src/frontends/onnx/tests/models/not_supported.prototxt b/src/frontends/onnx/tests/models/not_supported.prototxt index eed00351629d68..8a1fce1e1cf3ce 100644 --- a/src/frontends/onnx/tests/models/not_supported.prototxt +++ b/src/frontends/onnx/tests/models/not_supported.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/one_hot_axis.prototxt b/src/frontends/onnx/tests/models/one_hot_axis.prototxt index 93353739765926..adc4f28ca6db06 100644 --- a/src/frontends/onnx/tests/models/one_hot_axis.prototxt +++ b/src/frontends/onnx/tests/models/one_hot_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "indices" diff --git a/src/frontends/onnx/tests/models/one_hot_no_axis.prototxt b/src/frontends/onnx/tests/models/one_hot_no_axis.prototxt index bfa176e9d6ca59..32e529cbf45693 100644 --- a/src/frontends/onnx/tests/models/one_hot_no_axis.prototxt +++ b/src/frontends/onnx/tests/models/one_hot_no_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "indices" diff --git a/src/frontends/onnx/tests/models/onnx_external_data.prototxt b/src/frontends/onnx/tests/models/onnx_external_data.prototxt index ac9bb40a30f610..d396a05460be99 100644 --- a/src/frontends/onnx/tests/models/onnx_external_data.prototxt +++ b/src/frontends/onnx/tests/models/onnx_external_data.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/deformable_conv_2d.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/deformable_conv_2d.prototxt index 7c211c034e68a3..5e2c70650456d2 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/deformable_conv_2d.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/deformable_conv_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output.prototxt index 12175ba15a2197..5d0bce8d0ecaca 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "rois" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output_most_attrs_default.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output_most_attrs_default.prototxt index 01bd66b10b0476..fc6db1fb4cac49 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output_most_attrs_default.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/detection_output_most_attrs_default.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "rois" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.prototxt index 1863687d27215c..aa8470bdb67b94 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/generate_proposals_single_image.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "im_info" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/group_norm.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/group_norm.prototxt index ea2106b5621be4..1a6dbb12d88a88 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/group_norm.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/group_norm.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/prior_grid_generator.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/prior_grid_generator.prototxt index 987f308761a041..6973c428dec9b8 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/prior_grid_generator.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/prior_grid_generator.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.prototxt index c761983667135f..e3ad8745e7358a 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/roi_feature_extractor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "rois" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/topk_rios.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/topk_rios.prototxt index 67627a0743e5e1..153b531f273cf8 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/topk_rios.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/experimental_detectron/topk_rios.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals.prototxt index 4214bdd1ea2c95..e8c0ee4bdb4aac 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "OpenVINO" +producer_name: "OpenVINO ONNX Frontend" graph { name: "just GenerateProposals" node { diff --git a/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals_batch2.prototxt b/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals_batch2.prototxt index 7c393bba887ca0..b3bce7e5c2af56 100644 --- a/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals_batch2.prototxt +++ b/src/frontends/onnx/tests/models/org.openvinotoolkit/generate_proposals_batch2.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "OpenVINO" +producer_name: "OpenVINO ONNX Frontend" graph { name: "just GenerateProposals" node { diff --git a/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_chw.prototxt b/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_chw.prototxt index 72f439dbbd0262..33faa4ef104247 100644 --- a/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_chw.prototxt +++ b/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_chw.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_nchw.prototxt b/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_nchw.prototxt index 0c0253b4e7a1b8..01aa1e0ef54a71 100644 --- a/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_nchw.prototxt +++ b/src/frontends/onnx/tests/models/org.pytorch/adaptive_avg_pooling2d_nchw.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/override_op.prototxt b/src/frontends/onnx/tests/models/override_op.prototxt index 5f9534f2715322..9dbf7b022d86ee 100644 --- a/src/frontends/onnx/tests/models/override_op.prototxt +++ b/src/frontends/onnx/tests/models/override_op.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/pad_constant.prototxt b/src/frontends/onnx/tests/models/pad_constant.prototxt index 394f0926451fb0..4fecf1b765ca85 100644 --- a/src/frontends/onnx/tests/models/pad_constant.prototxt +++ b/src/frontends/onnx/tests/models/pad_constant.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/pad_negative_begin_end.prototxt b/src/frontends/onnx/tests/models/pad_negative_begin_end.prototxt index 5b3124e939b84c..a53141dd14775b 100644 --- a/src/frontends/onnx/tests/models/pad_negative_begin_end.prototxt +++ b/src/frontends/onnx/tests/models/pad_negative_begin_end.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/pad_non_scalar_values.prototxt b/src/frontends/onnx/tests/models/pad_non_scalar_values.prototxt index 2d91ad0bdb0534..cf4b4d8ef83645 100644 --- a/src/frontends/onnx/tests/models/pad_non_scalar_values.prototxt +++ b/src/frontends/onnx/tests/models/pad_non_scalar_values.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/pad_optional_constant.prototxt b/src/frontends/onnx/tests/models/pad_optional_constant.prototxt index 3c996f9291e9e1..f7a6dba5475296 100644 --- a/src/frontends/onnx/tests/models/pad_optional_constant.prototxt +++ b/src/frontends/onnx/tests/models/pad_optional_constant.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/pow_float32_float32.prototxt b/src/frontends/onnx/tests/models/pow_float32_float32.prototxt index 4fb1c23b15a53e..e2557d5b6dd5b3 100644 --- a/src/frontends/onnx/tests/models/pow_float32_float32.prototxt +++ b/src/frontends/onnx/tests/models/pow_float32_float32.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/pow_float32_int32.prototxt b/src/frontends/onnx/tests/models/pow_float32_int32.prototxt index 8100a447a07f70..9e420fbdbac9ce 100644 --- a/src/frontends/onnx/tests/models/pow_float32_int32.prototxt +++ b/src/frontends/onnx/tests/models/pow_float32_int32.prototxt @@ -1,4 +1,4 @@ -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/pow_int32_float32.prototxt b/src/frontends/onnx/tests/models/pow_int32_float32.prototxt index 901164cf8e69aa..dff6d3997ce206 100644 --- a/src/frontends/onnx/tests/models/pow_int32_float32.prototxt +++ b/src/frontends/onnx/tests/models/pow_int32_float32.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/prelu.prototxt b/src/frontends/onnx/tests/models/prelu.prototxt index 4eb3f3eda5e050..b346a6a5ffbec8 100644 --- a/src/frontends/onnx/tests/models/prelu.prototxt +++ b/src/frontends/onnx/tests/models/prelu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/prelu_1d.prototxt b/src/frontends/onnx/tests/models/prelu_1d.prototxt index 9034d1d42f6137..c06db24f635cf6 100644 --- a/src/frontends/onnx/tests/models/prelu_1d.prototxt +++ b/src/frontends/onnx/tests/models/prelu_1d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/prelu_batch_nd.prototxt b/src/frontends/onnx/tests/models/prelu_batch_nd.prototxt index cf693db83c379e..e2a76ee60582f6 100644 --- a/src/frontends/onnx/tests/models/prelu_batch_nd.prototxt +++ b/src/frontends/onnx/tests/models/prelu_batch_nd.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/prelu_c_1_1.prototxt b/src/frontends/onnx/tests/models/prelu_c_1_1.prototxt index 83f2a748860578..d8e3ad85415516 100644 --- a/src/frontends/onnx/tests/models/prelu_c_1_1.prototxt +++ b/src/frontends/onnx/tests/models/prelu_c_1_1.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/prior_box.prototxt b/src/frontends/onnx/tests/models/prior_box.prototxt index 9788d2aa82ee0c..9c06d1a9e6b88e 100644 --- a/src/frontends/onnx/tests/models/prior_box.prototxt +++ b/src/frontends/onnx/tests/models/prior_box.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test" node { diff --git a/src/frontends/onnx/tests/models/priorbox_clustered.prototxt b/src/frontends/onnx/tests/models/priorbox_clustered.prototxt index 68941b51d9e82d..36250bde74f39b 100644 --- a/src/frontends/onnx/tests/models/priorbox_clustered.prototxt +++ b/src/frontends/onnx/tests/models/priorbox_clustered.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { domain: "org.openvinotoolkit" diff --git a/src/frontends/onnx/tests/models/priorbox_clustered_first_input_bad_shape.prototxt b/src/frontends/onnx/tests/models/priorbox_clustered_first_input_bad_shape.prototxt index 48d4076d4e4b7e..40a6d5e585070e 100644 --- a/src/frontends/onnx/tests/models/priorbox_clustered_first_input_bad_shape.prototxt +++ b/src/frontends/onnx/tests/models/priorbox_clustered_first_input_bad_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { domain: "org.openvinotoolkit" diff --git a/src/frontends/onnx/tests/models/priorbox_clustered_most_attrs_default.prototxt b/src/frontends/onnx/tests/models/priorbox_clustered_most_attrs_default.prototxt index ac7c62bdf3663a..3a2fbc38a099f5 100644 --- a/src/frontends/onnx/tests/models/priorbox_clustered_most_attrs_default.prototxt +++ b/src/frontends/onnx/tests/models/priorbox_clustered_most_attrs_default.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { domain: "org.openvinotoolkit" diff --git a/src/frontends/onnx/tests/models/priorbox_clustered_second_input_bad_shape.prototxt b/src/frontends/onnx/tests/models/priorbox_clustered_second_input_bad_shape.prototxt index 8d53532b3742b0..d0231926a9bbbc 100644 --- a/src/frontends/onnx/tests/models/priorbox_clustered_second_input_bad_shape.prototxt +++ b/src/frontends/onnx/tests/models/priorbox_clustered_second_input_bad_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { domain: "org.openvinotoolkit" diff --git a/src/frontends/onnx/tests/models/provenance_input_tags.prototxt b/src/frontends/onnx/tests/models/provenance_input_tags.prototxt index add3b00f15acce..24a3ad4c553836 100644 --- a/src/frontends/onnx/tests/models/provenance_input_tags.prototxt +++ b/src/frontends/onnx/tests/models/provenance_input_tags.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initializer_of_A" diff --git a/src/frontends/onnx/tests/models/provenance_multiple_outputs_op.prototxt b/src/frontends/onnx/tests/models/provenance_multiple_outputs_op.prototxt index 0369588e46b7f6..18825d001fa077 100644 --- a/src/frontends/onnx/tests/models/provenance_multiple_outputs_op.prototxt +++ b/src/frontends/onnx/tests/models/provenance_multiple_outputs_op.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/provenance_node_name_and_outputs.prototxt b/src/frontends/onnx/tests/models/provenance_node_name_and_outputs.prototxt index 784a17a4129b49..5b3767361c46e1 100644 --- a/src/frontends/onnx/tests/models/provenance_node_name_and_outputs.prototxt +++ b/src/frontends/onnx/tests/models/provenance_node_name_and_outputs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_A" diff --git a/src/frontends/onnx/tests/models/provenance_only_outputs.prototxt b/src/frontends/onnx/tests/models/provenance_only_outputs.prototxt index b8dc775c67ce57..f3d0e2bbe7474a 100644 --- a/src/frontends/onnx/tests/models/provenance_only_outputs.prototxt +++ b/src/frontends/onnx/tests/models/provenance_only_outputs.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input_A" diff --git a/src/frontends/onnx/tests/models/provenance_tag_add.prototxt b/src/frontends/onnx/tests/models/provenance_tag_add.prototxt index 7f63b68ad216c0..a183712b670031 100644 --- a/src/frontends/onnx/tests/models/provenance_tag_add.prototxt +++ b/src/frontends/onnx/tests/models/provenance_tag_add.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/qlinear_conv_2d.prototxt b/src/frontends/onnx/tests/models/qlinear_conv_2d.prototxt index 8ba8cbf5b27ba4..0af10f8bd9e819 100644 --- a/src/frontends/onnx/tests/models/qlinear_conv_2d.prototxt +++ b/src/frontends/onnx/tests/models/qlinear_conv_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/qlinear_conv_3d.prototxt b/src/frontends/onnx/tests/models/qlinear_conv_3d.prototxt index 792001aaaf8a97..64eb8ad949bb2f 100644 --- a/src/frontends/onnx/tests/models/qlinear_conv_3d.prototxt +++ b/src/frontends/onnx/tests/models/qlinear_conv_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/qlinear_matmul.prototxt b/src/frontends/onnx/tests/models/qlinear_matmul.prototxt index 2c9b008d5d37a2..c04f8da78b0a5f 100644 --- a/src/frontends/onnx/tests/models/qlinear_matmul.prototxt +++ b/src/frontends/onnx/tests/models/qlinear_matmul.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "T1" diff --git a/src/frontends/onnx/tests/models/qlinear_matmul_3d.prototxt b/src/frontends/onnx/tests/models/qlinear_matmul_3d.prototxt index 14e80c71bef5b2..3f6aa836872253 100644 --- a/src/frontends/onnx/tests/models/qlinear_matmul_3d.prototxt +++ b/src/frontends/onnx/tests/models/qlinear_matmul_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "T1" diff --git a/src/frontends/onnx/tests/models/quant_conv_lin.prototxt b/src/frontends/onnx/tests/models/quant_conv_lin.prototxt index 18f7b044104e9c..5b6f9184bda320 100644 --- a/src/frontends/onnx/tests/models/quant_conv_lin.prototxt +++ b/src/frontends/onnx/tests/models/quant_conv_lin.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/quant_dequant_pattern.prototxt b/src/frontends/onnx/tests/models/quant_dequant_pattern.prototxt index 73b2728787a7aa..d01aa786ccca7e 100644 --- a/src/frontends/onnx/tests/models/quant_dequant_pattern.prototxt +++ b/src/frontends/onnx/tests/models/quant_dequant_pattern.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/quant_dequant_pattern_axis.prototxt b/src/frontends/onnx/tests/models/quant_dequant_pattern_axis.prototxt index 2a92566398e4fc..f7aa39b901513f 100644 --- a/src/frontends/onnx/tests/models/quant_dequant_pattern_axis.prototxt +++ b/src/frontends/onnx/tests/models/quant_dequant_pattern_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear.prototxt b/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear.prototxt index 75f904fcf3c635..956337f736f7cd 100644 --- a/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear.prototxt +++ b/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear_3x4.prototxt b/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear_3x4.prototxt index 8db343b670bc8e..80ae2793af984f 100644 --- a/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear_3x4.prototxt +++ b/src/frontends/onnx/tests/models/quantization/dynamic_quantize_linear_3x4.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/quantization/fake_quantize_const_inputs.prototxt b/src/frontends/onnx/tests/models/quantization/fake_quantize_const_inputs.prototxt index 8b465857707e53..2ea4f6f7f30479 100644 --- a/src/frontends/onnx/tests/models/quantization/fake_quantize_const_inputs.prototxt +++ b/src/frontends/onnx/tests/models/quantization/fake_quantize_const_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "input_low" diff --git a/src/frontends/onnx/tests/models/quantization/fake_quantize_nonconst_inputs.prototxt b/src/frontends/onnx/tests/models/quantization/fake_quantize_nonconst_inputs.prototxt index ce9de0f3292f11..2b918776ef6c8f 100644 --- a/src/frontends/onnx/tests/models/quantization/fake_quantize_nonconst_inputs.prototxt +++ b/src/frontends/onnx/tests/models/quantization/fake_quantize_nonconst_inputs.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { domain: "org.openvinotoolkit" diff --git a/src/frontends/onnx/tests/models/quantization/quant_conv_linear_onnx_example.prototxt b/src/frontends/onnx/tests/models/quantization/quant_conv_linear_onnx_example.prototxt index 94cf76c2b95775..4221eb1f910a07 100644 --- a/src/frontends/onnx/tests/models/quantization/quant_conv_linear_onnx_example.prototxt +++ b/src/frontends/onnx/tests/models/quantization/quant_conv_linear_onnx_example.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "onnx-examples" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/quantize_linear.prototxt b/src/frontends/onnx/tests/models/quantize_linear.prototxt index 8739189db251ed..bb2a040badb6f8 100644 --- a/src/frontends/onnx/tests/models/quantize_linear.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_axis_negative.prototxt b/src/frontends/onnx/tests/models/quantize_linear_axis_negative.prototxt index e953eef06d461e..3673c7f47617d0 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_axis_negative.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_axis_negative.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_axis_zero.prototxt b/src/frontends/onnx/tests/models/quantize_linear_axis_zero.prototxt index 0d10dd83f86398..2dde954fdd8046 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_axis_zero.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_axis_zero.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_const.prototxt b/src/frontends/onnx/tests/models/quantize_linear_const.prototxt index b4bf9f72ff0451..e8aa11e2a3f383 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_const.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_const.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_opset10.prototxt b/src/frontends/onnx/tests/models/quantize_linear_opset10.prototxt index 2ee5691173f76e..469d507c39b478 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_opset10.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_opset10.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis0.prototxt b/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis0.prototxt index dce9d8a179f1d8..81d175ecf3db0a 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis0.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis0.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis1.prototxt b/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis1.prototxt index 4c0bc111667cfe..af812152696f88 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis1.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_opsets_10_and_13_axis1.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_scalar_ignore_axis.prototxt b/src/frontends/onnx/tests/models/quantize_linear_scalar_ignore_axis.prototxt index 7ce1578322ac8c..d9f248fbd2e9d8 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_scalar_ignore_axis.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_scalar_ignore_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/quantize_linear_u16.prototxt b/src/frontends/onnx/tests/models/quantize_linear_u16.prototxt index 1595fd9b481199..0b3391a0713f13 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_u16.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_u16.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/quantize_linear_zero_point.prototxt b/src/frontends/onnx/tests/models/quantize_linear_zero_point.prototxt index 5640ea40ceffe0..503d092a878622 100644 --- a/src/frontends/onnx/tests/models/quantize_linear_zero_point.prototxt +++ b/src/frontends/onnx/tests/models/quantize_linear_zero_point.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "ngraph ONNXImporter" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/random_normal.prototxt b/src/frontends/onnx/tests/models/random_normal.prototxt index bebf03d10d8163..7c459f35aa6502 100644 --- a/src/frontends/onnx/tests/models/random_normal.prototxt +++ b/src/frontends/onnx/tests/models/random_normal.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "y" diff --git a/src/frontends/onnx/tests/models/random_normal_like.prototxt b/src/frontends/onnx/tests/models/random_normal_like.prototxt index eb901eb33a3607..6c313a277fcce6 100644 --- a/src/frontends/onnx/tests/models/random_normal_like.prototxt +++ b/src/frontends/onnx/tests/models/random_normal_like.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/random_uniform.prototxt b/src/frontends/onnx/tests/models/random_uniform.prototxt index ce8e57b867e22c..d27b926efd3c48 100644 --- a/src/frontends/onnx/tests/models/random_uniform.prototxt +++ b/src/frontends/onnx/tests/models/random_uniform.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "y" diff --git a/src/frontends/onnx/tests/models/random_uniform_like.prototxt b/src/frontends/onnx/tests/models/random_uniform_like.prototxt index 92b6904700e4eb..9682eee18b9e5c 100644 --- a/src/frontends/onnx/tests/models/random_uniform_like.prototxt +++ b/src/frontends/onnx/tests/models/random_uniform_like.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/range.prototxt b/src/frontends/onnx/tests/models/range.prototxt index efeb883047c92e..ee0ac4d40bb490 100644 --- a/src/frontends/onnx/tests/models/range.prototxt +++ b/src/frontends/onnx/tests/models/range.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "start" diff --git a/src/frontends/onnx/tests/models/reciprocal.prototxt b/src/frontends/onnx/tests/models/reciprocal.prototxt index 0b65e895256c29..354b322434da12 100644 --- a/src/frontends/onnx/tests/models/reciprocal.prototxt +++ b/src/frontends/onnx/tests/models/reciprocal.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/reduce_l1.prototxt b/src/frontends/onnx/tests/models/reduce_l1.prototxt index b294b3ea474de4..2a97250cb7001e 100644 --- a/src/frontends/onnx/tests/models/reduce_l1.prototxt +++ b/src/frontends/onnx/tests/models/reduce_l1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_l2.prototxt b/src/frontends/onnx/tests/models/reduce_l2.prototxt index 9397e1c2d0982b..c862b09b1b8ac8 100644 --- a/src/frontends/onnx/tests/models/reduce_l2.prototxt +++ b/src/frontends/onnx/tests/models/reduce_l2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_log_sum.prototxt b/src/frontends/onnx/tests/models/reduce_log_sum.prototxt index 4a2c0d38d194a0..b34a1295056950 100644 --- a/src/frontends/onnx/tests/models/reduce_log_sum.prototxt +++ b/src/frontends/onnx/tests/models/reduce_log_sum.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_log_sum_exp.prototxt b/src/frontends/onnx/tests/models/reduce_log_sum_exp.prototxt index 6c53973467d6c5..54efa7618f81ef 100644 --- a/src/frontends/onnx/tests/models/reduce_log_sum_exp.prototxt +++ b/src/frontends/onnx/tests/models/reduce_log_sum_exp.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_max.prototxt b/src/frontends/onnx/tests/models/reduce_max.prototxt index eae393b2f31d23..7c3f1b7705a013 100644 --- a/src/frontends/onnx/tests/models/reduce_max.prototxt +++ b/src/frontends/onnx/tests/models/reduce_max.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_max_invalid_axes.prototxt b/src/frontends/onnx/tests/models/reduce_max_invalid_axes.prototxt index 98bfe21bd080e0..e0006802771c7d 100644 --- a/src/frontends/onnx/tests/models/reduce_max_invalid_axes.prototxt +++ b/src/frontends/onnx/tests/models/reduce_max_invalid_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_mean.prototxt b/src/frontends/onnx/tests/models/reduce_mean.prototxt index 8afa941e77a1cf..bee7ce7423c879 100644 --- a/src/frontends/onnx/tests/models/reduce_mean.prototxt +++ b/src/frontends/onnx/tests/models/reduce_mean.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_min.prototxt b/src/frontends/onnx/tests/models/reduce_min.prototxt index 9f4825c2a294ef..11ce7911493c5c 100644 --- a/src/frontends/onnx/tests/models/reduce_min.prototxt +++ b/src/frontends/onnx/tests/models/reduce_min.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_prod.prototxt b/src/frontends/onnx/tests/models/reduce_prod.prototxt index 2155f6020be80e..68b307d8850017 100644 --- a/src/frontends/onnx/tests/models/reduce_prod.prototxt +++ b/src/frontends/onnx/tests/models/reduce_prod.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_sum.prototxt b/src/frontends/onnx/tests/models/reduce_sum.prototxt index c697f9d01b6580..69e15f13d0e934 100644 --- a/src/frontends/onnx/tests/models/reduce_sum.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_0_dim_input.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_0_dim_input.prototxt index a840a9e35dd2c6..7b01dcba43ed00 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_0_dim_input.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_0_dim_input.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant.prototxt index f3f2dd09c59914..f16fbb4c89128c 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "axes" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_keepdims_off.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_keepdims_off.prototxt index 066d22727b6e1b..fda17f6a03e32d 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_keepdims_off.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_keepdims_off.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "axes" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_single_axis.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_single_axis.prototxt index 4fe71a1dd07b47..a649adaba7ab16 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_single_axis.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_constant_single_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "axes" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_input.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_input.prototxt index 273e436803a42a..b2561b4e3ef479 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_input.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_as_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty.prototxt index 44d655723cf8ae..605f4191fbc7a0 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_dynamic_rank_input.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_dynamic_rank_input.prototxt index 61bb13255b4c9e..a55740a16bfdbb 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_dynamic_rank_input.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_dynamic_rank_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_with_noop.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_with_noop.prototxt index e44b67dcd83839..26c54b0c67e7bb 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_with_noop.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_with_noop.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_without_noop.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_without_noop.prototxt index 73c22f7739c0ae..441db546f2d7b0 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_without_noop.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_axes_empty_without_noop.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reduce_sum_13_input_dynamic.prototxt b/src/frontends/onnx/tests/models/reduce_sum_13_input_dynamic.prototxt index bacf4619341bbc..bc0a93590a7201 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_13_input_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_13_input_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "B" diff --git a/src/frontends/onnx/tests/models/reduce_sum_dynamic_rank_input.prototxt b/src/frontends/onnx/tests/models/reduce_sum_dynamic_rank_input.prototxt index 3a9f2fd52ffcbf..16c855f65ebc33 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_dynamic_rank_input.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_dynamic_rank_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reduce_sum_square.prototxt b/src/frontends/onnx/tests/models/reduce_sum_square.prototxt index 4c667de83e0437..f4460e7bccf250 100644 --- a/src/frontends/onnx/tests/models/reduce_sum_square.prototxt +++ b/src/frontends/onnx/tests/models/reduce_sum_square.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/relu.prototxt b/src/frontends/onnx/tests/models/relu.prototxt index da8d0c01396aac..b53972ed303639 100644 --- a/src/frontends/onnx/tests/models/relu.prototxt +++ b/src/frontends/onnx/tests/models/relu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/relu_custom_domain.prototxt b/src/frontends/onnx/tests/models/relu_custom_domain.prototxt index dc51e8299305fe..c4097cb9d9d2ef 100644 --- a/src/frontends/onnx/tests/models/relu_custom_domain.prototxt +++ b/src/frontends/onnx/tests/models/relu_custom_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reshape_extended_dims.prototxt b/src/frontends/onnx/tests/models/reshape_extended_dims.prototxt index 423e0075019224..03ed1689c13074 100644 --- a/src/frontends/onnx/tests/models/reshape_extended_dims.prototxt +++ b/src/frontends/onnx/tests/models/reshape_extended_dims.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reshape_negative_dim.prototxt b/src/frontends/onnx/tests/models/reshape_negative_dim.prototxt index 7e5e3cc0dcbeb1..ea22688265de90 100644 --- a/src/frontends/onnx/tests/models/reshape_negative_dim.prototxt +++ b/src/frontends/onnx/tests/models/reshape_negative_dim.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/reshape_negative_with_zero_dims.prototxt b/src/frontends/onnx/tests/models/reshape_negative_with_zero_dims.prototxt index cd7e5b985725bf..939894100cf376 100644 --- a/src/frontends/onnx/tests/models/reshape_negative_with_zero_dims.prototxt +++ b/src/frontends/onnx/tests/models/reshape_negative_with_zero_dims.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reshape_output_shape_as_input.prototxt b/src/frontends/onnx/tests/models/reshape_output_shape_as_input.prototxt index 514d9768ed718c..9f8e2983efce33 100644 --- a/src/frontends/onnx/tests/models/reshape_output_shape_as_input.prototxt +++ b/src/frontends/onnx/tests/models/reshape_output_shape_as_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "const_shape" diff --git a/src/frontends/onnx/tests/models/reshape_reduced_dims.prototxt b/src/frontends/onnx/tests/models/reshape_reduced_dims.prototxt index 60fe04c3581449..c3e6049f9daa23 100644 --- a/src/frontends/onnx/tests/models/reshape_reduced_dims.prototxt +++ b/src/frontends/onnx/tests/models/reshape_reduced_dims.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reshape_reordered_dims.prototxt b/src/frontends/onnx/tests/models/reshape_reordered_dims.prototxt index 0bce195afa248a..6797fc93006e33 100644 --- a/src/frontends/onnx/tests/models/reshape_reordered_dims.prototxt +++ b/src/frontends/onnx/tests/models/reshape_reordered_dims.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/reshape_single_dim.prototxt b/src/frontends/onnx/tests/models/reshape_single_dim.prototxt index d2a888f0c838ac..ab649fe9732328 100644 --- a/src/frontends/onnx/tests/models/reshape_single_dim.prototxt +++ b/src/frontends/onnx/tests/models/reshape_single_dim.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/resize10_asymertic_dim_in_the_middle.prototxt b/src/frontends/onnx/tests/models/resize10_asymertic_dim_in_the_middle.prototxt index 8210aa156d199e..4bf604b109332c 100644 --- a/src/frontends/onnx/tests/models/resize10_asymertic_dim_in_the_middle.prototxt +++ b/src/frontends/onnx/tests/models/resize10_asymertic_dim_in_the_middle.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { diff --git a/src/frontends/onnx/tests/models/resize10_asymertic_last_dim.prototxt b/src/frontends/onnx/tests/models/resize10_asymertic_last_dim.prototxt index 94b02e762b335d..057a1fa1b3822f 100644 --- a/src/frontends/onnx/tests/models/resize10_asymertic_last_dim.prototxt +++ b/src/frontends/onnx/tests/models/resize10_asymertic_last_dim.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { diff --git a/src/frontends/onnx/tests/models/resize10_down_scales_const_linear.prototxt b/src/frontends/onnx/tests/models/resize10_down_scales_const_linear.prototxt index 469afcbd4443bc..9a6dd1f7cd1db6 100644 --- a/src/frontends/onnx/tests/models/resize10_down_scales_const_linear.prototxt +++ b/src/frontends/onnx/tests/models/resize10_down_scales_const_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize10_down_scales_const_nearest.prototxt b/src/frontends/onnx/tests/models/resize10_down_scales_const_nearest.prototxt index 0003f1abd35285..0e08edad9a3a26 100644 --- a/src/frontends/onnx/tests/models/resize10_down_scales_const_nearest.prototxt +++ b/src/frontends/onnx/tests/models/resize10_down_scales_const_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize10_up_scales_const_linear.prototxt b/src/frontends/onnx/tests/models/resize10_up_scales_const_linear.prototxt index d21da6c4ae5d88..e6aa2afdcdcb02 100644 --- a/src/frontends/onnx/tests/models/resize10_up_scales_const_linear.prototxt +++ b/src/frontends/onnx/tests/models/resize10_up_scales_const_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize10_up_scales_const_nearest.prototxt b/src/frontends/onnx/tests/models/resize10_up_scales_const_nearest.prototxt index ce88aea4ae7c3a..d09ef898105da8 100644 --- a/src/frontends/onnx/tests/models/resize10_up_scales_const_nearest.prototxt +++ b/src/frontends/onnx/tests/models/resize10_up_scales_const_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_down_scales_linear_asymmetric.prototxt b/src/frontends/onnx/tests/models/resize11_down_scales_linear_asymmetric.prototxt index b0e90078ffefb9..fd8fe95f95068c 100644 --- a/src/frontends/onnx/tests/models/resize11_down_scales_linear_asymmetric.prototxt +++ b/src/frontends/onnx/tests/models/resize11_down_scales_linear_asymmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_down_sizes_cubic_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_down_sizes_cubic_half_pixel.prototxt index 86674e5473da48..189fe7a17157a1 100644 --- a/src/frontends/onnx/tests/models/resize11_down_sizes_cubic_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_down_sizes_cubic_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_down_sizes_linear_pytorch_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_down_sizes_linear_pytorch_half_pixel.prototxt index cf7bf96885d160..4fae291b3ed8a4 100644 --- a/src/frontends/onnx/tests/models/resize11_down_sizes_linear_pytorch_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_down_sizes_linear_pytorch_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_down_sizes_tf_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_down_sizes_tf_half_pixel.prototxt index 4f06a18310ea10..0431fa20a22214 100644 --- a/src/frontends/onnx/tests/models/resize11_down_sizes_tf_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_down_sizes_tf_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_empty_constant_as_input.prototxt b/src/frontends/onnx/tests/models/resize11_empty_constant_as_input.prototxt index b4e397bc1801a6..a56d75e7a68f4e 100644 --- a/src/frontends/onnx/tests/models/resize11_empty_constant_as_input.prototxt +++ b/src/frontends/onnx/tests/models/resize11_empty_constant_as_input.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "empty_const" diff --git a/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor.prototxt b/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor.prototxt index 03d6c0508ba209..9fb96a40d57f90 100644 --- a/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor.prototxt +++ b/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor_dynamic_scales.prototxt b/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor_dynamic_scales.prototxt index 3c837791fdd756..f611a78cf1388e 100644 --- a/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor_dynamic_scales.prototxt +++ b/src/frontends/onnx/tests/models/resize11_scales_nearest_asymmetric_floor_dynamic_scales.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/resize11_sizes_nearest_asymmetric_floor.prototxt b/src/frontends/onnx/tests/models/resize11_sizes_nearest_asymmetric_floor.prototxt index f3ce3308c0d7d7..0c0828a6cc5d76 100644 --- a/src/frontends/onnx/tests/models/resize11_sizes_nearest_asymmetric_floor.prototxt +++ b/src/frontends/onnx/tests/models/resize11_sizes_nearest_asymmetric_floor.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_up_scales_cubic_align_corners.prototxt b/src/frontends/onnx/tests/models/resize11_up_scales_cubic_align_corners.prototxt index 9ed0556113e795..a653e462a257b5 100644 --- a/src/frontends/onnx/tests/models/resize11_up_scales_cubic_align_corners.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_scales_cubic_align_corners.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_up_scales_linear_asymmetric.prototxt b/src/frontends/onnx/tests/models/resize11_up_scales_linear_asymmetric.prototxt index 9a0a7ded8d6c06..20e178423aa3d2 100644 --- a/src/frontends/onnx/tests/models/resize11_up_scales_linear_asymmetric.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_scales_linear_asymmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_up_scales_tf_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_up_scales_tf_half_pixel.prototxt index 39d3eea3b7c605..ab760058936e40 100644 --- a/src/frontends/onnx/tests/models/resize11_up_scales_tf_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_scales_tf_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_all_attributes_default.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_all_attributes_default.prototxt index afbb84874978d3..fa33edd24cfef3 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_all_attributes_default.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_all_attributes_default.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel.prototxt index 91a0041ca2782e..5b710fcf791654 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel_dynamic_sizes.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel_dynamic_sizes.prototxt index ece1eaf97d17b9..27f74db4ede2ed 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel_dynamic_sizes.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_cubic_half_pixel_dynamic_sizes.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_linear_asymmetric.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_linear_asymmetric.prototxt index 6de38295973910..0038ce2a445860 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_linear_asymmetric.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_linear_asymmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_ceil_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_ceil_half_pixel.prototxt index 475b42dee85d22..e8a88a463e0315 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_ceil_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_ceil_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_floor_align_corners.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_floor_align_corners.prototxt index 0d2651bbdfb64a..f4142d3b658502 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_floor_align_corners.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_floor_align_corners.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_prefer_ceil_asymmetric.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_prefer_ceil_asymmetric.prototxt index f3b6c6a62072b3..0596f3ab4ab4a0 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_prefer_ceil_asymmetric.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_prefer_ceil_asymmetric.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_round_prefer_floor_half_pixel.prototxt b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_round_prefer_floor_half_pixel.prototxt index 91a48780261752..e535a2be530934 100644 --- a/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_round_prefer_floor_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/resize11_up_sizes_nearest_round_prefer_floor_half_pixel.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "sizes" diff --git a/src/frontends/onnx/tests/models/reverse_sequence_incorrect_batch_axis.prototxt b/src/frontends/onnx/tests/models/reverse_sequence_incorrect_batch_axis.prototxt index 506f3cfe7bdc1d..3bad8090343735 100644 --- a/src/frontends/onnx/tests/models/reverse_sequence_incorrect_batch_axis.prototxt +++ b/src/frontends/onnx/tests/models/reverse_sequence_incorrect_batch_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/reverse_sequence_incorrect_time_axis.prototxt b/src/frontends/onnx/tests/models/reverse_sequence_incorrect_time_axis.prototxt index 07c87d796672e5..9c1ba0a823d05f 100644 --- a/src/frontends/onnx/tests/models/reverse_sequence_incorrect_time_axis.prototxt +++ b/src/frontends/onnx/tests/models/reverse_sequence_incorrect_time_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/reverse_sequence_time_0_batch_1.prototxt b/src/frontends/onnx/tests/models/reverse_sequence_time_0_batch_1.prototxt index d13a33472612d9..7b3c8d1ae7d364 100644 --- a/src/frontends/onnx/tests/models/reverse_sequence_time_0_batch_1.prototxt +++ b/src/frontends/onnx/tests/models/reverse_sequence_time_0_batch_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/reverse_sequence_time_1_batch_0.prototxt b/src/frontends/onnx/tests/models/reverse_sequence_time_1_batch_0.prototxt index 0591d327e53d02..e06fef3e1de161 100644 --- a/src/frontends/onnx/tests/models/reverse_sequence_time_1_batch_0.prototxt +++ b/src/frontends/onnx/tests/models/reverse_sequence_time_1_batch_0.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/reverse_sequence_time_and_batch_axis_equal.prototxt b/src/frontends/onnx/tests/models/reverse_sequence_time_and_batch_axis_equal.prototxt index 7f1b81a3d307fe..b9a9ca7e79d2fa 100644 --- a/src/frontends/onnx/tests/models/reverse_sequence_time_and_batch_axis_equal.prototxt +++ b/src/frontends/onnx/tests/models/reverse_sequence_time_and_batch_axis_equal.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/rnn_bidir_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/rnn_bidir_mixed_seq_len_const.prototxt index 2a335fc717de50..8314e451413d51 100644 --- a/src/frontends/onnx/tests/models/rnn_bidir_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_bidir_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_bidirectional.prototxt b/src/frontends/onnx/tests/models/rnn_bidirectional.prototxt index 392e0d00c81155..852be149e3c841 100644 --- a/src/frontends/onnx/tests/models/rnn_bidirectional.prototxt +++ b/src/frontends/onnx/tests/models/rnn_bidirectional.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_bidirectional_const.prototxt b/src/frontends/onnx/tests/models/rnn_bidirectional_const.prototxt index f6ca7d04e70b0d..8447694c7ec99f 100644 --- a/src/frontends/onnx/tests/models/rnn_bidirectional_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_bidirectional_const.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_defaults_fwd.prototxt b/src/frontends/onnx/tests/models/rnn_defaults_fwd.prototxt index 54eba881ccfe54..fb9b3da7aa051e 100644 --- a/src/frontends/onnx/tests/models/rnn_defaults_fwd.prototxt +++ b/src/frontends/onnx/tests/models/rnn_defaults_fwd.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_defaults_fwd_const.prototxt b/src/frontends/onnx/tests/models/rnn_defaults_fwd_const.prototxt index bfec5fd52d8f95..9f3d163c8c8cb5 100644 --- a/src/frontends/onnx/tests/models/rnn_defaults_fwd_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_defaults_fwd_const.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_activations.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_activations.prototxt index b5a4d93318dd59..e39f88b8326fb5 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_activations.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_activations.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_activations_const.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_activations_const.prototxt index 4b2633092b18c6..3c0e90701a5c78 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_activations_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_activations_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h.prototxt index ead02b7d4462f5..0f6af98b99750d 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h_const.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h_const.prototxt index a4d2716483bcd6..98da85509dff10 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_bias_initial_h_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len.prototxt index 615a65d994aa93..16b30aeb69980b 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len_const.prototxt index 1a7eb67fc46a66..bfd8eacaf3038f 100644 --- a/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_fwd_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_rev_clip.prototxt b/src/frontends/onnx/tests/models/rnn_rev_clip.prototxt index 4699aeaa2cd2bf..1ada935751d159 100644 --- a/src/frontends/onnx/tests/models/rnn_rev_clip.prototxt +++ b/src/frontends/onnx/tests/models/rnn_rev_clip.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_rev_clip_const.prototxt b/src/frontends/onnx/tests/models/rnn_rev_clip_const.prototxt index 9bcfc22f8b4265..12226799aaec82 100644 --- a/src/frontends/onnx/tests/models/rnn_rev_clip_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_rev_clip_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_reverse.prototxt b/src/frontends/onnx/tests/models/rnn_reverse.prototxt index a06bdea0ae4abf..d2231a0a27e97d 100644 --- a/src/frontends/onnx/tests/models/rnn_reverse.prototxt +++ b/src/frontends/onnx/tests/models/rnn_reverse.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/rnn_reverse_const.prototxt b/src/frontends/onnx/tests/models/rnn_reverse_const.prototxt index d67f2a5b6c45a9..ae60c97e3cc00b 100644 --- a/src/frontends/onnx/tests/models/rnn_reverse_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_reverse_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/rnn_reverse_mixed_seq_len_const.prototxt b/src/frontends/onnx/tests/models/rnn_reverse_mixed_seq_len_const.prototxt index 98d390f02e0a2f..ff0e0c8317b95b 100644 --- a/src/frontends/onnx/tests/models/rnn_reverse_mixed_seq_len_const.prototxt +++ b/src/frontends/onnx/tests/models/rnn_reverse_mixed_seq_len_const.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "W" diff --git a/src/frontends/onnx/tests/models/roi_align_f32.prototxt b/src/frontends/onnx/tests/models/roi_align_f32.prototxt index ed8ec2285b719f..c36dc9323009b7 100644 --- a/src/frontends/onnx/tests/models/roi_align_f32.prototxt +++ b/src/frontends/onnx/tests/models/roi_align_f32.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node{ input: "feature_maps" diff --git a/src/frontends/onnx/tests/models/roialign16_avg_half_pixel.prototxt b/src/frontends/onnx/tests/models/roialign16_avg_half_pixel.prototxt index aebc8cf94bbf0e..513bceb1c34a4a 100644 --- a/src/frontends/onnx/tests/models/roialign16_avg_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/roialign16_avg_half_pixel.prototxt @@ -1,6 +1,6 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/roialign16_avg_out_half_pixel.prototxt b/src/frontends/onnx/tests/models/roialign16_avg_out_half_pixel.prototxt index 0c98525f2c9430..3a1cf9783b43d4 100644 --- a/src/frontends/onnx/tests/models/roialign16_avg_out_half_pixel.prototxt +++ b/src/frontends/onnx/tests/models/roialign16_avg_out_half_pixel.prototxt @@ -1,6 +1,6 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/round.prototxt b/src/frontends/onnx/tests/models/round.prototxt index 888e56a2714e1a..841eb1aa7e5284 100644 --- a/src/frontends/onnx/tests/models/round.prototxt +++ b/src/frontends/onnx/tests/models/round.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/round_half_nearest_even.prototxt b/src/frontends/onnx/tests/models/round_half_nearest_even.prototxt index 13981ba2a1df2e..c2deefb973d506 100644 --- a/src/frontends/onnx/tests/models/round_half_nearest_even.prototxt +++ b/src/frontends/onnx/tests/models/round_half_nearest_even.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/scan15_ND_b4_input_rev.prototxt b/src/frontends/onnx/tests/models/scan15_ND_b4_input_rev.prototxt index 2e9d472ff23d11..7d4e36e4c30dc4 100644 --- a/src/frontends/onnx/tests/models/scan15_ND_b4_input_rev.prototxt +++ b/src/frontends/onnx/tests/models/scan15_ND_b4_input_rev.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_ND_mixed.prototxt b/src/frontends/onnx/tests/models/scan15_ND_mixed.prototxt index 68d7bb700e845f..cc673cf8e0cbd4 100644 --- a/src/frontends/onnx/tests/models/scan15_ND_mixed.prototxt +++ b/src/frontends/onnx/tests/models/scan15_ND_mixed.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_ND_mixed_neg_axes.prototxt b/src/frontends/onnx/tests/models/scan15_ND_mixed_neg_axes.prototxt index 2a38e87ea44dce..e53bf53a5237df 100644 --- a/src/frontends/onnx/tests/models/scan15_ND_mixed_neg_axes.prototxt +++ b/src/frontends/onnx/tests/models/scan15_ND_mixed_neg_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_dyn_rank.prototxt b/src/frontends/onnx/tests/models/scan15_dyn_rank.prototxt index 6ffd873dba4c39..43cc9a6d39ae4f 100644 --- a/src/frontends/onnx/tests/models/scan15_dyn_rank.prototxt +++ b/src/frontends/onnx/tests/models/scan15_dyn_rank.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_dyn_rank_neg_axes.prototxt b/src/frontends/onnx/tests/models/scan15_dyn_rank_neg_axes.prototxt index 41742a239985c3..8f570fd9b7f46c 100644 --- a/src/frontends/onnx/tests/models/scan15_dyn_rank_neg_axes.prototxt +++ b/src/frontends/onnx/tests/models/scan15_dyn_rank_neg_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_fib_like.prototxt b/src/frontends/onnx/tests/models/scan15_fib_like.prototxt index aac869f689395f..884de3d84b96e6 100644 --- a/src/frontends/onnx/tests/models/scan15_fib_like.prototxt +++ b/src/frontends/onnx/tests/models/scan15_fib_like.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_fib_like_input_out_rev.prototxt b/src/frontends/onnx/tests/models/scan15_fib_like_input_out_rev.prototxt index db0f1f4b8ded66..dc0278c1a3e7f6 100644 --- a/src/frontends/onnx/tests/models/scan15_fib_like_input_out_rev.prototxt +++ b/src/frontends/onnx/tests/models/scan15_fib_like_input_out_rev.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_fib_like_input_rev.prototxt b/src/frontends/onnx/tests/models/scan15_fib_like_input_rev.prototxt index eb817dc6882d37..a024ebb5ed7987 100644 --- a/src/frontends/onnx/tests/models/scan15_fib_like_input_rev.prototxt +++ b/src/frontends/onnx/tests/models/scan15_fib_like_input_rev.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan15_fib_like_out_rev.prototxt b/src/frontends/onnx/tests/models/scan15_fib_like_out_rev.prototxt index a8b9c0b75aad6b..f85d9e7fbc57cc 100644 --- a/src/frontends/onnx/tests/models/scan15_fib_like_out_rev.prototxt +++ b/src/frontends/onnx/tests/models/scan15_fib_like_out_rev.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "initial" diff --git a/src/frontends/onnx/tests/models/scan8_ND_b4.prototxt b/src/frontends/onnx/tests/models/scan8_ND_b4.prototxt index 661e60db173d50..55b0a10f4e4713 100644 --- a/src/frontends/onnx/tests/models/scan8_ND_b4.prototxt +++ b/src/frontends/onnx/tests/models/scan8_ND_b4.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "" diff --git a/src/frontends/onnx/tests/models/scan8_ND_b4_input_rev.prototxt b/src/frontends/onnx/tests/models/scan8_ND_b4_input_rev.prototxt index 383f959c896217..94f8d0a97bb61d 100644 --- a/src/frontends/onnx/tests/models/scan8_ND_b4_input_rev.prototxt +++ b/src/frontends/onnx/tests/models/scan8_ND_b4_input_rev.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "" diff --git a/src/frontends/onnx/tests/models/scan8_ND_b4_seq_lens.prototxt b/src/frontends/onnx/tests/models/scan8_ND_b4_seq_lens.prototxt index c2fb5871cbc8fb..917ada32833a01 100644 --- a/src/frontends/onnx/tests/models/scan8_ND_b4_seq_lens.prototxt +++ b/src/frontends/onnx/tests/models/scan8_ND_b4_seq_lens.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "sequence_lens" diff --git a/src/frontends/onnx/tests/models/scatter_elements_add_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_add_opset18.prototxt index 80e80a864fe83d..8df62e62ee61e4 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_add_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_add_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_default_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_default_opset18.prototxt index a8493dd96e6fff..318e8882486ed4 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_default_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_default_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_max_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_max_opset18.prototxt index 0833773cc4fff0..064afa3538f295 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_max_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_max_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_min_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_min_opset18.prototxt index 5a448521ce282c..e4c1af5f956853 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_min_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_min_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_mul_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_mul_opset18.prototxt index b0dce69e3ecf41..082cb561b6367e 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_mul_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_mul_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_none_opset18.prototxt b/src/frontends/onnx/tests/models/scatter_elements_none_opset18.prototxt index e970075cf0fc7f..67d0efe1d6f4b6 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_none_opset18.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_none_opset18.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-frontend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "DATA" diff --git a/src/frontends/onnx/tests/models/scatter_elements_opset11.prototxt b/src/frontends/onnx/tests/models/scatter_elements_opset11.prototxt index 20f62a5fbbb165..c0f481bf1f4de0 100644 --- a/src/frontends/onnx/tests/models/scatter_elements_opset11.prototxt +++ b/src/frontends/onnx/tests/models/scatter_elements_opset11.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "test_model" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/scatter_nd_const_i32_indices.prototxt b/src/frontends/onnx/tests/models/scatter_nd_const_i32_indices.prototxt index c9aa29782e7443..637bb6c45f0ce9 100644 --- a/src/frontends/onnx/tests/models/scatter_nd_const_i32_indices.prototxt +++ b/src/frontends/onnx/tests/models/scatter_nd_const_i32_indices.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_add.prototxt b/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_add.prototxt index 35fb5ab1a7c9e5..b1caee21246698 100644 --- a/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_add.prototxt +++ b/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_add.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_none.prototxt b/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_none.prototxt index 81c896149dc426..80f7a2e8a38220 100644 --- a/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_none.prototxt +++ b/src/frontends/onnx/tests/models/scatter_nd_opset16_reduction_none.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/scatter_nd_param_i64_indices.prototxt b/src/frontends/onnx/tests/models/scatter_nd_param_i64_indices.prototxt index 8d382d7aa5edd8..42ce458a2033cd 100644 --- a/src/frontends/onnx/tests/models/scatter_nd_param_i64_indices.prototxt +++ b/src/frontends/onnx/tests/models/scatter_nd_param_i64_indices.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/scatter_opset10.prototxt b/src/frontends/onnx/tests/models/scatter_opset10.prototxt index 02ead411597144..3cf55c04afe64b 100644 --- a/src/frontends/onnx/tests/models/scatter_opset10.prototxt +++ b/src/frontends/onnx/tests/models/scatter_opset10.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "test_model" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data" diff --git a/src/frontends/onnx/tests/models/selu.prototxt b/src/frontends/onnx/tests/models/selu.prototxt index 0d4abdf8e52b0e..c597eacae14c7a 100644 --- a/src/frontends/onnx/tests/models/selu.prototxt +++ b/src/frontends/onnx/tests/models/selu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/shape.prototxt b/src/frontends/onnx/tests/models/shape.prototxt index 187ba05be80e6e..091bf87ce28307 100644 --- a/src/frontends/onnx/tests/models/shape.prototxt +++ b/src/frontends/onnx/tests/models/shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/shrink_float.prototxt b/src/frontends/onnx/tests/models/shrink_float.prototxt index 8de6fd2598279d..4126a92afb7384 100644 --- a/src/frontends/onnx/tests/models/shrink_float.prototxt +++ b/src/frontends/onnx/tests/models/shrink_float.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/shrink_int.prototxt b/src/frontends/onnx/tests/models/shrink_int.prototxt index a0f5a4756aeb5a..a5ffcff2847015 100644 --- a/src/frontends/onnx/tests/models/shrink_int.prototxt +++ b/src/frontends/onnx/tests/models/shrink_int.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/sigmoid.prototxt b/src/frontends/onnx/tests/models/sigmoid.prototxt index 1687f8c2433223..d7932167050184 100644 --- a/src/frontends/onnx/tests/models/sigmoid.prototxt +++ b/src/frontends/onnx/tests/models/sigmoid.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/sign.prototxt b/src/frontends/onnx/tests/models/sign.prototxt index 13744291b8611c..2ad00a2ed10fe1 100644 --- a/src/frontends/onnx/tests/models/sign.prototxt +++ b/src/frontends/onnx/tests/models/sign.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/sinh.prototxt b/src/frontends/onnx/tests/models/sinh.prototxt index 2276d61290ab01..569331520ae6d0 100644 --- a/src/frontends/onnx/tests/models/sinh.prototxt +++ b/src/frontends/onnx/tests/models/sinh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/size_op_graph_end.prototxt b/src/frontends/onnx/tests/models/size_op_graph_end.prototxt index c082bd045653e8..51ec3cda7bdd0c 100644 --- a/src/frontends/onnx/tests/models/size_op_graph_end.prototxt +++ b/src/frontends/onnx/tests/models/size_op_graph_end.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "N" diff --git a/src/frontends/onnx/tests/models/size_op_graph_middle.prototxt b/src/frontends/onnx/tests/models/size_op_graph_middle.prototxt index 293a8535ee9733..173f313a551e0e 100644 --- a/src/frontends/onnx/tests/models/size_op_graph_middle.prototxt +++ b/src/frontends/onnx/tests/models/size_op_graph_middle.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "N" diff --git a/src/frontends/onnx/tests/models/size_op_on_input_graph_middle.prototxt b/src/frontends/onnx/tests/models/size_op_on_input_graph_middle.prototxt index 2faed09ea624da..87a237d1d9ecfd 100644 --- a/src/frontends/onnx/tests/models/size_op_on_input_graph_middle.prototxt +++ b/src/frontends/onnx/tests/models/size_op_on_input_graph_middle.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "N" diff --git a/src/frontends/onnx/tests/models/size_op_single.prototxt b/src/frontends/onnx/tests/models/size_op_single.prototxt index fb05474b66f7c9..74a23fe2429454 100644 --- a/src/frontends/onnx/tests/models/size_op_single.prototxt +++ b/src/frontends/onnx/tests/models/size_op_single.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/slice_const_axes_source.prototxt b/src/frontends/onnx/tests/models/slice_const_axes_source.prototxt index e6da15faddbd81..00fa260c588021 100644 --- a/src/frontends/onnx/tests/models/slice_const_axes_source.prototxt +++ b/src/frontends/onnx/tests/models/slice_const_axes_source.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { name: "test_slice_with_unsqueeze_axes" initializer { diff --git a/src/frontends/onnx/tests/models/softmax_0D.prototxt b/src/frontends/onnx/tests/models/softmax_0D.prototxt index becdd7e49bde66..4a3d53a78a5468 100644 --- a/src/frontends/onnx/tests/models/softmax_0D.prototxt +++ b/src/frontends/onnx/tests/models/softmax_0D.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_1D.prototxt b/src/frontends/onnx/tests/models/softmax_1D.prototxt index f88e8cef49fccc..541631d46b0da9 100644 --- a/src/frontends/onnx/tests/models/softmax_1D.prototxt +++ b/src/frontends/onnx/tests/models/softmax_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_0.prototxt b/src/frontends/onnx/tests/models/softmax_axis_0.prototxt index 21b9ae9ab5e4ea..eb1c5e3c8b1956 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_0.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_0.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_1.prototxt b/src/frontends/onnx/tests/models/softmax_axis_1.prototxt index 8b2ca9fa802e10..5cee1f9f334f7a 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_1_opset11.prototxt b/src/frontends/onnx/tests/models/softmax_axis_1_opset11.prototxt index 947b381db0b029..5fc26124b3b87a 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_1_opset11.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_1_opset11.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_2.prototxt b/src/frontends/onnx/tests/models/softmax_axis_2.prototxt index 4d4311462e5088..7655d24ae7104e 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_2.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset11.prototxt b/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset11.prototxt index ad9a4b726033dd..1703eb493816b0 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset11.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset11.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset13.prototxt b/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset13.prototxt index aff3afc2c527e5..4c7f779a1689ce 100644 --- a/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset13.prototxt +++ b/src/frontends/onnx/tests/models/softmax_axis_negative_1_opset13.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_crossentropy_loss_mean.prototxt b/src/frontends/onnx/tests/models/softmax_crossentropy_loss_mean.prototxt index 89b569ec158fe1..c23f51278ad23d 100644 --- a/src/frontends/onnx/tests/models/softmax_crossentropy_loss_mean.prototxt +++ b/src/frontends/onnx/tests/models/softmax_crossentropy_loss_mean.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_invalid_axis_1D.prototxt b/src/frontends/onnx/tests/models/softmax_invalid_axis_1D.prototxt index da639c1b2bcc13..66a42013c73a5c 100644 --- a/src/frontends/onnx/tests/models/softmax_invalid_axis_1D.prototxt +++ b/src/frontends/onnx/tests/models/softmax_invalid_axis_1D.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softmax_invalid_axis_3D.prototxt b/src/frontends/onnx/tests/models/softmax_invalid_axis_3D.prototxt index b07e7903e05d9c..6fd0a7d64dde96 100644 --- a/src/frontends/onnx/tests/models/softmax_invalid_axis_3D.prototxt +++ b/src/frontends/onnx/tests/models/softmax_invalid_axis_3D.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/softplus.prototxt b/src/frontends/onnx/tests/models/softplus.prototxt index 62a7fc54c55239..c27b3d3196dfcc 100644 --- a/src/frontends/onnx/tests/models/softplus.prototxt +++ b/src/frontends/onnx/tests/models/softplus.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/softsign.prototxt b/src/frontends/onnx/tests/models/softsign.prototxt index 21db6242583392..98143833e21ae8 100644 --- a/src/frontends/onnx/tests/models/softsign.prototxt +++ b/src/frontends/onnx/tests/models/softsign.prototxt @@ -1,5 +1,5 @@ ir_version: 11 -producer_name: "OV ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/space_to_depth.prototxt b/src/frontends/onnx/tests/models/space_to_depth.prototxt index 2d0a2abc6ac109..843039e1fb10a2 100644 --- a/src/frontends/onnx/tests/models/space_to_depth.prototxt +++ b/src/frontends/onnx/tests/models/space_to_depth.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/space_to_depth_bad_blocksize.prototxt b/src/frontends/onnx/tests/models/space_to_depth_bad_blocksize.prototxt index 2b4ac7a4874824..bd2ec95fbedfd3 100644 --- a/src/frontends/onnx/tests/models/space_to_depth_bad_blocksize.prototxt +++ b/src/frontends/onnx/tests/models/space_to_depth_bad_blocksize.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/space_to_depth_invalid_input_shape.prototxt b/src/frontends/onnx/tests/models/space_to_depth_invalid_input_shape.prototxt index 8cb7db89894761..03dda326ddec1a 100644 --- a/src/frontends/onnx/tests/models/space_to_depth_invalid_input_shape.prototxt +++ b/src/frontends/onnx/tests/models/space_to_depth_invalid_input_shape.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/space_to_depth_no_blocksize.prototxt b/src/frontends/onnx/tests/models/space_to_depth_no_blocksize.prototxt index f6804a248b1ac6..96b09ba9ca8079 100644 --- a/src/frontends/onnx/tests/models/space_to_depth_no_blocksize.prototxt +++ b/src/frontends/onnx/tests/models/space_to_depth_no_blocksize.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/split_equal_parts_2d.prototxt b/src/frontends/onnx/tests/models/split_equal_parts_2d.prototxt index bef846d3dfd3e5..9e94942e907cf4 100644 --- a/src/frontends/onnx/tests/models/split_equal_parts_2d.prototxt +++ b/src/frontends/onnx/tests/models/split_equal_parts_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/split_equal_parts_default.prototxt b/src/frontends/onnx/tests/models/split_equal_parts_default.prototxt index 0069a532d6f411..1b0e9fcdd95507 100644 --- a/src/frontends/onnx/tests/models/split_equal_parts_default.prototxt +++ b/src/frontends/onnx/tests/models/split_equal_parts_default.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/split_variable_parts_2d.prototxt b/src/frontends/onnx/tests/models/split_variable_parts_2d.prototxt index 9b787c1ef79c63..0d6be1f0b05de6 100644 --- a/src/frontends/onnx/tests/models/split_variable_parts_2d.prototxt +++ b/src/frontends/onnx/tests/models/split_variable_parts_2d.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/squeeze.prototxt b/src/frontends/onnx/tests/models/squeeze.prototxt index 02b32affe4d67a..da0523c70c4f36 100644 --- a/src/frontends/onnx/tests/models/squeeze.prototxt +++ b/src/frontends/onnx/tests/models/squeeze.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/squeeze_default_domain_opset13.prototxt b/src/frontends/onnx/tests/models/squeeze_default_domain_opset13.prototxt index 14063ea1610e90..969e2e64028aab 100644 --- a/src/frontends/onnx/tests/models/squeeze_default_domain_opset13.prototxt +++ b/src/frontends/onnx/tests/models/squeeze_default_domain_opset13.prototxt @@ -1,6 +1,6 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "AXIS" diff --git a/src/frontends/onnx/tests/models/squeeze_empty_axes_attribute.prototxt b/src/frontends/onnx/tests/models/squeeze_empty_axes_attribute.prototxt index 982a0082c70878..1c951444786231 100644 --- a/src/frontends/onnx/tests/models/squeeze_empty_axes_attribute.prototxt +++ b/src/frontends/onnx/tests/models/squeeze_empty_axes_attribute.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/squeeze_opset13_no_axes.prototxt b/src/frontends/onnx/tests/models/squeeze_opset13_no_axes.prototxt index 919ad6eb9ba2d7..025fc11842a9a2 100644 --- a/src/frontends/onnx/tests/models/squeeze_opset13_no_axes.prototxt +++ b/src/frontends/onnx/tests/models/squeeze_opset13_no_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/sub.prototxt b/src/frontends/onnx/tests/models/sub.prototxt index 6cfdd9cbf84b68..f5444d5d2518ac 100644 --- a/src/frontends/onnx/tests/models/sub.prototxt +++ b/src/frontends/onnx/tests/models/sub.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/sub_v6_broadcast_axes_1_2.prototxt b/src/frontends/onnx/tests/models/sub_v6_broadcast_axes_1_2.prototxt index 50cd26ab6cfaf9..25ac429b84d3cf 100644 --- a/src/frontends/onnx/tests/models/sub_v6_broadcast_axes_1_2.prototxt +++ b/src/frontends/onnx/tests/models/sub_v6_broadcast_axes_1_2.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/sub_v6_broadcast_axis_1.prototxt b/src/frontends/onnx/tests/models/sub_v6_broadcast_axis_1.prototxt index 32b374d28ee11c..626515c8d952cb 100644 --- a/src/frontends/onnx/tests/models/sub_v6_broadcast_axis_1.prototxt +++ b/src/frontends/onnx/tests/models/sub_v6_broadcast_axis_1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/sub_v6_broadcast_no_axis.prototxt b/src/frontends/onnx/tests/models/sub_v6_broadcast_no_axis.prototxt index a7fb7d8c3c551e..adbdffba4d0983 100644 --- a/src/frontends/onnx/tests/models/sub_v6_broadcast_no_axis.prototxt +++ b/src/frontends/onnx/tests/models/sub_v6_broadcast_no_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/sub_v7.prototxt b/src/frontends/onnx/tests/models/sub_v7.prototxt index ec0006d44356bf..7429ed05af5290 100644 --- a/src/frontends/onnx/tests/models/sub_v7.prototxt +++ b/src/frontends/onnx/tests/models/sub_v7.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/sub_v7_broadcast.prototxt b/src/frontends/onnx/tests/models/sub_v7_broadcast.prototxt index 8bb4fcab479ba6..0a4b96b178371d 100644 --- a/src/frontends/onnx/tests/models/sub_v7_broadcast.prototxt +++ b/src/frontends/onnx/tests/models/sub_v7_broadcast.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" model_version: 1 graph { node { diff --git a/src/frontends/onnx/tests/models/sum.prototxt b/src/frontends/onnx/tests/models/sum.prototxt index c04a369f4d9403..b5da4e36d16b36 100644 --- a/src/frontends/onnx/tests/models/sum.prototxt +++ b/src/frontends/onnx/tests/models/sum.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/sum_one_input.prototxt b/src/frontends/onnx/tests/models/sum_one_input.prototxt index e381fe91f9ff82..e404838e501f3c 100644 --- a/src/frontends/onnx/tests/models/sum_one_input.prototxt +++ b/src/frontends/onnx/tests/models/sum_one_input.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/sum_opset1.prototxt b/src/frontends/onnx/tests/models/sum_opset1.prototxt index 4fda39b5c7377a..b8d445c4db7ac5 100644 --- a/src/frontends/onnx/tests/models/sum_opset1.prototxt +++ b/src/frontends/onnx/tests/models/sum_opset1.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/sum_opset8.prototxt b/src/frontends/onnx/tests/models/sum_opset8.prototxt index 3a3a831b7b4fb7..c4f3bce072cc24 100644 --- a/src/frontends/onnx/tests/models/sum_opset8.prototxt +++ b/src/frontends/onnx/tests/models/sum_opset8.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "data_0" diff --git a/src/frontends/onnx/tests/models/support_test/supported/basic.prototxt b/src/frontends/onnx/tests/models/support_test/supported/basic.prototxt index 7f63b68ad216c0..a183712b670031 100644 --- a/src/frontends/onnx/tests/models/support_test/supported/basic.prototxt +++ b/src/frontends/onnx/tests/models/support_test/supported/basic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/swish_with_beta.prototxt b/src/frontends/onnx/tests/models/swish_with_beta.prototxt index 170fd43ca6f8d1..e2727dd846e033 100644 --- a/src/frontends/onnx/tests/models/swish_with_beta.prototxt +++ b/src/frontends/onnx/tests/models/swish_with_beta.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "beta" diff --git a/src/frontends/onnx/tests/models/swish_without_beta.prototxt b/src/frontends/onnx/tests/models/swish_without_beta.prototxt index 23cb188dd7af25..15d039d52d0f63 100644 --- a/src/frontends/onnx/tests/models/swish_without_beta.prototxt +++ b/src/frontends/onnx/tests/models/swish_without_beta.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/tanh.prototxt b/src/frontends/onnx/tests/models/tanh.prototxt index 45c9fb1d6b8b19..edf015137eb618 100644 --- a/src/frontends/onnx/tests/models/tanh.prototxt +++ b/src/frontends/onnx/tests/models/tanh.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/tensor_names.prototxt b/src/frontends/onnx/tests/models/tensor_names.prototxt index 6b5b521220e375..f6cc444fdb4892 100644 --- a/src/frontends/onnx/tests/models/tensor_names.prototxt +++ b/src/frontends/onnx/tests/models/tensor_names.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "test_model" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/test_clip_inbounds.prototxt b/src/frontends/onnx/tests/models/test_clip_inbounds.prototxt index 7329f8e7754141..d3d101c7b5c0ee 100644 --- a/src/frontends/onnx/tests/models/test_clip_inbounds.prototxt +++ b/src/frontends/onnx/tests/models/test_clip_inbounds.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/thresholded_relu.prototxt b/src/frontends/onnx/tests/models/thresholded_relu.prototxt index d3c682f390ea84..368591c0b54aa1 100644 --- a/src/frontends/onnx/tests/models/thresholded_relu.prototxt +++ b/src/frontends/onnx/tests/models/thresholded_relu.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/tile.prototxt b/src/frontends/onnx/tests/models/tile.prototxt index ef738e213e5f60..5b78b641ea33dd 100644 --- a/src/frontends/onnx/tests/models/tile.prototxt +++ b/src/frontends/onnx/tests/models/tile.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/tile_static.prototxt b/src/frontends/onnx/tests/models/tile_static.prototxt index d8a998e95c71c4..0ff606f91dc3aa 100644 --- a/src/frontends/onnx/tests/models/tile_static.prototxt +++ b/src/frontends/onnx/tests/models/tile_static.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "input" diff --git a/src/frontends/onnx/tests/models/top_k.prototxt b/src/frontends/onnx/tests/models/top_k.prototxt index 97882ce2c1ad79..2fef72912df5fa 100644 --- a/src/frontends/onnx/tests/models/top_k.prototxt +++ b/src/frontends/onnx/tests/models/top_k.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/top_k_opset_10.prototxt b/src/frontends/onnx/tests/models/top_k_opset_10.prototxt index 6f37ee615f7544..8b10cf01cb7848 100644 --- a/src/frontends/onnx/tests/models/top_k_opset_10.prototxt +++ b/src/frontends/onnx/tests/models/top_k_opset_10.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/top_k_opset_10_const_k.prototxt b/src/frontends/onnx/tests/models/top_k_opset_10_const_k.prototxt index d4b1bd4bdaf6c4..89fb47e7041c08 100644 --- a/src/frontends/onnx/tests/models/top_k_opset_10_const_k.prototxt +++ b/src/frontends/onnx/tests/models/top_k_opset_10_const_k.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest.prototxt b/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest.prototxt index 7f737fbef0ec93..e37676668bc116 100644 --- a/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest.prototxt +++ b/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest_negative_axis.prototxt b/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest_negative_axis.prototxt index 18d2440497122d..3edb40b815f370 100644 --- a/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest_negative_axis.prototxt +++ b/src/frontends/onnx/tests/models/top_k_opset_11_const_k_smallest_negative_axis.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/topk.prototxt b/src/frontends/onnx/tests/models/topk.prototxt index 7f737fbef0ec93..e37676668bc116 100644 --- a/src/frontends/onnx/tests/models/topk.prototxt +++ b/src/frontends/onnx/tests/models/topk.prototxt @@ -1,5 +1,5 @@ ir_version: 5 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/transformations/celu_with_initializers.prototxt b/src/frontends/onnx/tests/models/transformations/celu_with_initializers.prototxt index 05f58f22de1d5d..7b390e9f179f87 100644 --- a/src/frontends/onnx/tests/models/transformations/celu_with_initializers.prototxt +++ b/src/frontends/onnx/tests/models/transformations/celu_with_initializers.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/transformations/greater_or_equal.prototxt b/src/frontends/onnx/tests/models/transformations/greater_or_equal.prototxt index 04c33addc8f420..ef5cad8f0ea7a3 100644 --- a/src/frontends/onnx/tests/models/transformations/greater_or_equal.prototxt +++ b/src/frontends/onnx/tests/models/transformations/greater_or_equal.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/transformations/greater_or_equal_inside_if.prototxt b/src/frontends/onnx/tests/models/transformations/greater_or_equal_inside_if.prototxt index e804fdc88cbc70..4de1359b8a3c1f 100644 --- a/src/frontends/onnx/tests/models/transformations/greater_or_equal_inside_if.prototxt +++ b/src/frontends/onnx/tests/models/transformations/greater_or_equal_inside_if.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { name: "if graph" node { diff --git a/src/frontends/onnx/tests/models/transformations/reference/greater_or_equal_expanded.prototxt b/src/frontends/onnx/tests/models/transformations/reference/greater_or_equal_expanded.prototxt index 5056cd2cc99e2c..bb624deb942bc6 100644 --- a/src/frontends/onnx/tests/models/transformations/reference/greater_or_equal_expanded.prototxt +++ b/src/frontends/onnx/tests/models/transformations/reference/greater_or_equal_expanded.prototxt @@ -1,5 +1,5 @@ ir_version: 6 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "in1" diff --git a/src/frontends/onnx/tests/models/transformations/reference/softmax_crossentropy_consumed_expanded.prototxt b/src/frontends/onnx/tests/models/transformations/reference/softmax_crossentropy_consumed_expanded.prototxt index 70214b9957b5fe..ff324c8bb7f4cc 100644 --- a/src/frontends/onnx/tests/models/transformations/reference/softmax_crossentropy_consumed_expanded.prototxt +++ b/src/frontends/onnx/tests/models/transformations/reference/softmax_crossentropy_consumed_expanded.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "Func_SoftmaxCrossEntropyLoss0x7ffe150df640Shape3D" diff --git a/src/frontends/onnx/tests/models/transformations/softmax_crossentropy_consumed.prototxt b/src/frontends/onnx/tests/models/transformations/softmax_crossentropy_consumed.prototxt index db75da69ae4911..9f4e01607fd4a1 100644 --- a/src/frontends/onnx/tests/models/transformations/softmax_crossentropy_consumed.prototxt +++ b/src/frontends/onnx/tests/models/transformations/softmax_crossentropy_consumed.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/trilu_basic.prototxt b/src/frontends/onnx/tests/models/trilu_basic.prototxt index 84eed05a184f78..dc122e5f69810d 100644 --- a/src/frontends/onnx/tests/models/trilu_basic.prototxt +++ b/src/frontends/onnx/tests/models/trilu_basic.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/trilu_lower.prototxt b/src/frontends/onnx/tests/models/trilu_lower.prototxt index e13915dd898e9c..45b1b82396ed3a 100644 --- a/src/frontends/onnx/tests/models/trilu_lower.prototxt +++ b/src/frontends/onnx/tests/models/trilu_lower.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/trilu_lower_4d.prototxt b/src/frontends/onnx/tests/models/trilu_lower_4d.prototxt index 5268d52e788b54..fa728e7b3b9445 100644 --- a/src/frontends/onnx/tests/models/trilu_lower_4d.prototxt +++ b/src/frontends/onnx/tests/models/trilu_lower_4d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/trilu_upper.prototxt b/src/frontends/onnx/tests/models/trilu_upper.prototxt index d5c3f7ded8449d..150a1e924781f4 100644 --- a/src/frontends/onnx/tests/models/trilu_upper.prototxt +++ b/src/frontends/onnx/tests/models/trilu_upper.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/trilu_upper_3d.prototxt b/src/frontends/onnx/tests/models/trilu_upper_3d.prototxt index bdbec5ffcb01a6..f31f92554cf4bd 100644 --- a/src/frontends/onnx/tests/models/trilu_upper_3d.prototxt +++ b/src/frontends/onnx/tests/models/trilu_upper_3d.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "backend-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/unknown_domain.prototxt b/src/frontends/onnx/tests/models/unknown_domain.prototxt index e7966940586d48..52348af7dd8039 100644 --- a/src/frontends/onnx/tests/models/unknown_domain.prototxt +++ b/src/frontends/onnx/tests/models/unknown_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unknown_domain_add.prototxt b/src/frontends/onnx/tests/models/unknown_domain_add.prototxt index 52f9fe366282c1..958e0de2a785cf 100644 --- a/src/frontends/onnx/tests/models/unknown_domain_add.prototxt +++ b/src/frontends/onnx/tests/models/unknown_domain_add.prototxt @@ -1,5 +1,5 @@ ir_version: 4 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unsqueeze.prototxt b/src/frontends/onnx/tests/models/unsqueeze.prototxt index 3eb0a3c8a7075d..1ce6a66820afcc 100644 --- a/src/frontends/onnx/tests/models/unsqueeze.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain.prototxt b/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain.prototxt index b8693e7f30e446..3eb9a03dba4d69 100644 --- a/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain_opset13.prototxt b/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain_opset13.prototxt index 44cc45907ad1ba..e3e11c6dbb777a 100644 --- a/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain_opset13.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze_ai_onnx_domain_opset13.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "AXIS" diff --git a/src/frontends/onnx/tests/models/unsqueeze_default_domain.prototxt b/src/frontends/onnx/tests/models/unsqueeze_default_domain.prototxt index 448c2056247b76..507ba8080bfccd 100644 --- a/src/frontends/onnx/tests/models/unsqueeze_default_domain.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze_default_domain.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/unsqueeze_default_domain_opset13.prototxt b/src/frontends/onnx/tests/models/unsqueeze_default_domain_opset13.prototxt index 461fcd13f144ca..dd13c6f89728ea 100644 --- a/src/frontends/onnx/tests/models/unsqueeze_default_domain_opset13.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze_default_domain_opset13.prototxt @@ -1,5 +1,5 @@ ir_version: 8 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "AXIS" diff --git a/src/frontends/onnx/tests/models/unsqueeze_negative_axes.prototxt b/src/frontends/onnx/tests/models/unsqueeze_negative_axes.prototxt index 84cac44c3fd096..9323b017808296 100644 --- a/src/frontends/onnx/tests/models/unsqueeze_negative_axes.prototxt +++ b/src/frontends/onnx/tests/models/unsqueeze_negative_axes.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "x" diff --git a/src/frontends/onnx/tests/models/unsupported_op.prototxt b/src/frontends/onnx/tests/models/unsupported_op.prototxt index 67543a4e24f391..2cce84890b1f7b 100644 --- a/src/frontends/onnx/tests/models/unsupported_op.prototxt +++ b/src/frontends/onnx/tests/models/unsupported_op.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unsupported_ops/add_unsupported.prototxt b/src/frontends/onnx/tests/models/unsupported_ops/add_unsupported.prototxt index 898670a5214db2..701f82a1816c3a 100644 --- a/src/frontends/onnx/tests/models/unsupported_ops/add_unsupported.prototxt +++ b/src/frontends/onnx/tests/models/unsupported_ops/add_unsupported.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unsupported_ops/two_unsupported_nodes.prototxt b/src/frontends/onnx/tests/models/unsupported_ops/two_unsupported_nodes.prototxt index 210275148616d3..145385c64c9cc2 100644 --- a/src/frontends/onnx/tests/models/unsupported_ops/two_unsupported_nodes.prototxt +++ b/src/frontends/onnx/tests/models/unsupported_ops/two_unsupported_nodes.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "OV ONNX FE" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_and_incorrect_dts.prototxt b/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_and_incorrect_dts.prototxt index 37f3ff6c370a5a..afef670b6bfd94 100644 --- a/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_and_incorrect_dts.prototxt +++ b/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_and_incorrect_dts.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_incorrect_dts_and_inst_norm_bad_scale.prototxt b/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_incorrect_dts_and_inst_norm_bad_scale.prototxt index cdeb2551edf9c4..9be63bfb596c85 100644 --- a/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_incorrect_dts_and_inst_norm_bad_scale.prototxt +++ b/src/frontends/onnx/tests/models/unsupported_ops/unsupported_add_incorrect_dts_and_inst_norm_bad_scale.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "A" diff --git a/src/frontends/onnx/tests/models/upsample6_bilinear.prototxt b/src/frontends/onnx/tests/models/upsample6_bilinear.prototxt index 6c987d81c0f69e..3b088b5a4244fa 100644 --- a/src/frontends/onnx/tests/models/upsample6_bilinear.prototxt +++ b/src/frontends/onnx/tests/models/upsample6_bilinear.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/upsample6_dynamic.prototxt b/src/frontends/onnx/tests/models/upsample6_dynamic.prototxt index ca7d6485c01820..fab38829f7845e 100644 --- a/src/frontends/onnx/tests/models/upsample6_dynamic.prototxt +++ b/src/frontends/onnx/tests/models/upsample6_dynamic.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/upsample6_nearest.prototxt b/src/frontends/onnx/tests/models/upsample6_nearest.prototxt index 699c6516c462c9..ee8cefc786ce51 100644 --- a/src/frontends/onnx/tests/models/upsample6_nearest.prototxt +++ b/src/frontends/onnx/tests/models/upsample6_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/upsample8_linear.prototxt b/src/frontends/onnx/tests/models/upsample8_linear.prototxt index 3a547223ca628d..c34ba97ae44248 100644 --- a/src/frontends/onnx/tests/models/upsample8_linear.prototxt +++ b/src/frontends/onnx/tests/models/upsample8_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/upsample8_nearest.prototxt b/src/frontends/onnx/tests/models/upsample8_nearest.prototxt index bdf3e44add2c7d..d65cac64251b72 100644 --- a/src/frontends/onnx/tests/models/upsample8_nearest.prototxt +++ b/src/frontends/onnx/tests/models/upsample8_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/upsample9_scales_const_linear.prototxt b/src/frontends/onnx/tests/models/upsample9_scales_const_linear.prototxt index a54f78c49ab47a..a2029f9afed7d4 100644 --- a/src/frontends/onnx/tests/models/upsample9_scales_const_linear.prototxt +++ b/src/frontends/onnx/tests/models/upsample9_scales_const_linear.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/upsample9_scales_const_nearest.prototxt b/src/frontends/onnx/tests/models/upsample9_scales_const_nearest.prototxt index cbd563f1d447f4..908244d9921b15 100644 --- a/src/frontends/onnx/tests/models/upsample9_scales_const_nearest.prototxt +++ b/src/frontends/onnx/tests/models/upsample9_scales_const_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { output: "scales" diff --git a/src/frontends/onnx/tests/models/upsample9_scales_input_nearest.prototxt b/src/frontends/onnx/tests/models/upsample9_scales_input_nearest.prototxt index cf99d01d257a63..2e9248fb858aa4 100644 --- a/src/frontends/onnx/tests/models/upsample9_scales_input_nearest.prototxt +++ b/src/frontends/onnx/tests/models/upsample9_scales_input_nearest.prototxt @@ -1,5 +1,5 @@ ir_version: 7 -producer_name: "onnx-importer-test" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "X" diff --git a/src/frontends/onnx/tests/models/where.prototxt b/src/frontends/onnx/tests/models/where.prototxt index af9fe1f6c581fc..0e0ced21930d64 100644 --- a/src/frontends/onnx/tests/models/where.prototxt +++ b/src/frontends/onnx/tests/models/where.prototxt @@ -1,5 +1,5 @@ ir_version: 3 -producer_name: "nGraph ONNX Importer" +producer_name: "OpenVINO ONNX Frontend" graph { node { input: "cond" diff --git a/src/frontends/onnx/tests/tests_python/test_frontend_lib_close.py b/src/frontends/onnx/tests/tests_python/test_frontend_lib_close.py index 73679e60a8ad07..89955ffa1c572c 100644 --- a/src/frontends/onnx/tests/tests_python/test_frontend_lib_close.py +++ b/src/frontends/onnx/tests/tests_python/test_frontend_lib_close.py @@ -22,7 +22,7 @@ def make_onnx_model(model_name: str) -> None: make_tensor_value_info("out1", onnx.TensorProto.FLOAT, (1, 2)), ] graph = make_graph([add], "test_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="ONNX Importer", opset_imports=[onnx.helper.make_opsetid("", 13)]) + model = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) onnx.save_model(model, model_name) diff --git a/src/frontends/onnx/tests/tests_python/test_frontend_onnx.py b/src/frontends/onnx/tests/tests_python/test_frontend_onnx.py index b21fa33453919c..18776168028ee1 100644 --- a/src/frontends/onnx/tests/tests_python/test_frontend_onnx.py +++ b/src/frontends/onnx/tests/tests_python/test_frontend_onnx.py @@ -30,7 +30,7 @@ def create_onnx_model(): ] output_tensors = [make_tensor_value_info("out", onnx.TensorProto.FLOAT, (2, 2))] graph = make_graph([add, const_node, mul], "graph", input_tensors, output_tensors) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def create_onnx_model_2(): @@ -42,7 +42,7 @@ def create_onnx_model_2(): make_tensor_value_info("out", onnx.TensorProto.FLOAT, (1, 2)), ] graph = make_graph([relu], "test_graph", input_tensors, output_tensors) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def create_onnx_model_with_subgraphs(): @@ -68,7 +68,7 @@ def create_onnx_model_with_subgraphs(): res = onnx.helper.make_tensor_value_info("res", onnx.TensorProto.FLOAT, [3]) graph = make_graph([if_node], "graph", [cond, x1, x2], [res]) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def create_onnx_model_with_custom_attributes(): @@ -104,7 +104,7 @@ def create_onnx_model_with_custom_attributes(): ] output_tensors = [make_tensor_value_info("out", onnx.TensorProto.FLOAT, (2, 2))] graph = make_graph([add, const_node, mul], "graph", input_tensors, output_tensors) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def create_onnx_model_for_op_extension(): @@ -155,7 +155,7 @@ def create_onnx_model_for_op_extension(): input_tensors, output_tensors, ) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def create_onnx_model_extension_with_custom_domain(): @@ -175,7 +175,7 @@ def create_onnx_model_extension_with_custom_domain(): ] output_tensors = [make_tensor_value_info("out", onnx.TensorProto.FLOAT, (2, 2))] graph = make_graph([add, const_node, mul], "graph", input_tensors, output_tensors) - return make_model(graph, producer_name="ONNX Frontend") + return make_model(graph, producer_name="OpenVINO ONNX Frontend") def run_model(model, *inputs, expected): diff --git a/src/frontends/onnx/tests/tests_python/test_frontend_onnx_editor.py b/src/frontends/onnx/tests/tests_python/test_frontend_onnx_editor.py index 62fa37f3ee104a..2f9ea673476dd4 100644 --- a/src/frontends/onnx/tests/tests_python/test_frontend_onnx_editor.py +++ b/src/frontends/onnx/tests/tests_python/test_frontend_onnx_editor.py @@ -83,7 +83,7 @@ def create_test_onnx_models(): make_tensor_value_info("out4", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add, split, relu, mul], "test_graph", input_tensors, output_tensors) - models["input_model.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["input_model.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Input model 2 @@ -101,7 +101,7 @@ def create_test_onnx_models(): make_tensor_value_info("out2", onnx.TensorProto.FLOAT, (1, 2)), ] graph = make_graph([add, split_2, absolute, sin], "test_graph_2", input_tensors, output_tensors) - models["input_model_2.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["input_model_2.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Input model 3 @@ -118,7 +118,7 @@ def create_test_onnx_models(): make_tensor_value_info("out2", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add_2, relu_2], "test_graph_3", input_tensors, output_tensors) - models["input_model_3.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["input_model_3.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for extract_subgraph @@ -130,7 +130,7 @@ def create_test_onnx_models(): make_tensor_value_info("add_out", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add], "test_graph", input_tensors, output_tensors) - models["extract_subgraph.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["extract_subgraph.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for extract_subgraph 2 @@ -144,7 +144,7 @@ def create_test_onnx_models(): make_tensor_value_info("add_out", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add, relu], "test_graph", input_tensors, output_tensors) - models["extract_subgraph_2.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["extract_subgraph_2.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for extract_subgraph 3 @@ -158,7 +158,7 @@ def create_test_onnx_models(): expected_split = onnx.helper.make_node("Split", inputs=["out1/placeholder_port_0"], outputs=["out1", "out2"], name="split1", axis=0) graph = make_graph([expected_split], "test_graph", input_tensors, output_tensors) - models["extract_subgraph_3.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["extract_subgraph_3.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for extract_subgraph 4 @@ -177,7 +177,7 @@ def create_test_onnx_models(): expected_mul = onnx.helper.make_node("Mul", inputs=["out4/placeholder_port_0", "out4/placeholder_port_1"], outputs=["out4"]) graph = make_graph([expected_split, expected_mul], "test_graph", input_tensors, output_tensors) - models["extract_subgraph_4.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["extract_subgraph_4.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for extract_subgraph 5 @@ -189,7 +189,7 @@ def create_test_onnx_models(): make_tensor_value_info("add_out", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add], "test_graph", input_tensors, output_tensors) - models["extract_subgraph_5.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["extract_subgraph_5.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for test_override_all_outputs @@ -203,7 +203,7 @@ def create_test_onnx_models(): make_tensor_value_info("add_out", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add, relu], "test_graph", input_tensors, output_tensors) - models["test_override_all_outputs.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_override_all_outputs.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for test_override_all_outputs 2 @@ -215,7 +215,7 @@ def create_test_onnx_models(): make_tensor_value_info("out4", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add, mul], "test_graph", input_tensors, output_tensors) - models["test_override_all_outputs_2.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_override_all_outputs_2.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for test_override_all_outputs 3 @@ -228,7 +228,7 @@ def create_test_onnx_models(): make_tensor_value_info("out1", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add_2], "test_graph_3", input_tensors, output_tensors) - models["test_override_all_outputs_3.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_override_all_outputs_3.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for test_override_all_inputs @@ -249,7 +249,7 @@ def create_test_onnx_models(): expected_mul = onnx.helper.make_node("Mul", inputs=["out4/placeholder_port_0", "out4/placeholder_port_1"], outputs=["out4"]) graph = make_graph([expected_split, relu, expected_mul], "test_graph", input_tensors, output_tensors) - models["test_override_all_inputs.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_override_all_inputs.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for cut_and_add_new_input_edge @@ -267,7 +267,7 @@ def create_test_onnx_models(): ] new_mul = onnx.helper.make_node("Mul", inputs=["new_input", "add_out"], outputs=["out4"]) graph = make_graph([add, split, relu, new_mul], "test_graph", input_tensors, output_tensors) - models["cut_and_add_new_input_edge.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["cut_and_add_new_input_edge.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for cut_and_add_new_input_place @@ -285,7 +285,7 @@ def create_test_onnx_models(): new_split = onnx.helper.make_node("Split", inputs=["new_input"], outputs=["out1", "out2"], name="split1", axis=0) graph = make_graph([new_split, relu, new_mul], "test_graph", input_tensors, output_tensors) - models["cut_and_add_new_input_place.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["cut_and_add_new_input_place.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Expected for remove_output @@ -300,7 +300,7 @@ def create_test_onnx_models(): make_tensor_value_info("out3", onnx.TensorProto.FLOAT, (2, 2)), ] graph = make_graph([add, relu, split], "test_graph", input_tensors, output_tensors) - models["remove_output.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["remove_output.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # test partial shape @@ -316,7 +316,7 @@ def create_test_onnx_models(): make_tensor_value_info("out4", onnx.TensorProto.FLOAT, (8, 16)), ] graph = make_graph([add, split, relu, mul], "test_graph", input_tensors, output_tensors) - models["test_partial_shape.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_partial_shape.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # test place names model @@ -343,7 +343,7 @@ def create_test_onnx_models(): ] graph = make_graph([add, sub, split, mul], "test_graph", input_tensors, output_tensors, value_info=value_infos, initializer=initializers) - models["test_place_names.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["test_place_names.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) # Input model with integer types @@ -361,7 +361,7 @@ def create_test_onnx_models(): ] output_tensors = [make_tensor_value_info("out", onnx.TensorProto.FLOAT, (2, 2))] graph = make_graph([add, const_node, mul], "graph", input_tensors, output_tensors) - models["input_model_int32.onnx"] = make_model(graph, producer_name="ONNX Importer", + models["input_model_int32.onnx"] = make_model(graph, producer_name="OpenVINO ONNX Frontend", opset_imports=[onnx.helper.make_opsetid("", 13)]) return models @@ -390,7 +390,7 @@ def skip_if_onnx_frontend_is_disabled(): pytest.skip() -# Function to compare ng Functions (ops names, types and shapes). +# Function to compare OV Models (ops names, types and shapes). # Note that the functions uses get_ordered_ops, so the topological order of ops should be also preserved. def compare_models(current, expected): # noqa: C901 the function is too complex result = True diff --git a/src/frontends/onnx/tests/tests_python/test_onnx_import.py b/src/frontends/onnx/tests/tests_python/test_onnx_import.py index a2059cd3a628e3..4bca1a7d44c947 100644 --- a/src/frontends/onnx/tests/tests_python/test_onnx_import.py +++ b/src/frontends/onnx/tests/tests_python/test_onnx_import.py @@ -42,7 +42,7 @@ def test_simple_graph(): ], [make_tensor_value_info("Y", onnx.TensorProto.FLOAT, [1])], ) - model = make_model(graph, producer_name="ngraph ONNX Importer") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") graph_model_function = import_onnx_model(model) diff --git a/src/frontends/onnx/tests/tests_python/test_ops_binary.py b/src/frontends/onnx/tests/tests_python/test_ops_binary.py index 42e593ce161dc9..6f7cd4706f783e 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_binary.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_binary.py @@ -21,7 +21,7 @@ def import_and_compute(op_type, input_data_left, input_data_right, opset=7, **no output_tensors = [make_tensor_value_info(name, onnx.TensorProto.FLOAT, ()) for name in onnx_node.output] graph = make_graph([onnx_node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="ngraph ONNX Importer") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") model.opset_import[0].version = opset inputs = [i.astype(np.float32) for i in inputs] # WA for new Python API return run_model(model, inputs)[0] diff --git a/src/frontends/onnx/tests/tests_python/test_ops_convpool.py b/src/frontends/onnx/tests/tests_python/test_ops_convpool.py index e4dd96c05d1b6c..1a242f947097dc 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_convpool.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_convpool.py @@ -37,7 +37,7 @@ def make_onnx_model_for_conv_op(x_shape, weights_shape, transpose=False, **attri ], [make_tensor_value_info("Y", onnx.TensorProto.FLOAT, output_shape)], ) - model = make_model(graph, producer_name="ngraph ONNXImporter") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") return model diff --git a/src/frontends/onnx/tests/tests_python/test_ops_matmul.py b/src/frontends/onnx/tests/tests_python/test_ops_matmul.py index 4eec4e4580805a..33a4d15374df5d 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_matmul.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_matmul.py @@ -23,7 +23,7 @@ def make_onnx_model_for_matmul_op(input_left, input_right): ], [make_tensor_value_info("Z", onnx.TensorProto.FLOAT, output_shape)], ) - model = make_model(graph, producer_name="ngraph ONNXImporter") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") return model @@ -70,7 +70,7 @@ def make_onnx_model_for_gemm_op(input_a, input_b, input_c, **kwargs): ], [make_tensor_value_info("Y", onnx.TensorProto.FLOAT, output_shape)], ) - model = make_model(graph, producer_name="ngraph ONNXImporter") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") return model diff --git a/src/frontends/onnx/tests/tests_python/test_ops_reduction.py b/src/frontends/onnx/tests/tests_python/test_ops_reduction.py index 408a5d3a546fba..9435fc1ab564ae 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_reduction.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_reduction.py @@ -64,7 +64,7 @@ def import_and_compute_with_axes_as_const(op_type, data, axes, **node_attrs): [onnx.helper.make_tensor_value_info("y", onnx.TensorProto.FLOAT, ())], ) - model = onnx.helper.make_model(graph, producer_name="ngraph ONNX Importer") + model = onnx.helper.make_model(graph, producer_name="OpenVINO ONNX Frontend") model.opset_import[0].version = 13 graph_model = import_onnx_model(model) runtime = get_runtime() diff --git a/src/frontends/onnx/tests/tests_python/test_ops_reshape.py b/src/frontends/onnx/tests/tests_python/test_ops_reshape.py index 952983c0c5385a..3337358400b356 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_reshape.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_reshape.py @@ -64,7 +64,7 @@ def test_reshape_opset5(): [make_tensor_value_info("reshaped", onnx.TensorProto.FLOAT, ())], ) - model = make_model(graph, producer_name="ngraph ONNX Importer") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") model.opset_import[0].version = 5 graph_model_function = import_onnx_model(model) runtime = get_runtime() diff --git a/src/frontends/onnx/tests/tests_python/test_ops_unary.py b/src/frontends/onnx/tests/tests_python/test_ops_unary.py index 71c7cacab5cb66..b1741b2ba94591 100644 --- a/src/frontends/onnx/tests/tests_python/test_ops_unary.py +++ b/src/frontends/onnx/tests/tests_python/test_ops_unary.py @@ -313,7 +313,7 @@ def test_identity(): ], [make_tensor_value_info("Y", onnx.TensorProto.FLOAT, shape)], ) - model = make_model(graph, producer_name="ngraph ONNX Importer") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") graph_model = import_onnx_model(model) runtime = get_runtime() computation = runtime.computation(graph_model) @@ -394,7 +394,7 @@ def test_cast_errors(): output_tensors = [make_tensor_value_info(node.output[0], onnx.TensorProto.FLOAT16, input_data.shape)] # type: ignore graph = make_graph([node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="NgraphBackend") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") with pytest.raises(ValidationError): import_onnx_model(model) @@ -407,7 +407,7 @@ def test_cast_errors(): output_tensors = [make_tensor_value_info(node.output[0], onnx.TensorProto.INT32, input_data.shape)] # type: ignore graph = make_graph([node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="NgraphBackend") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") with pytest.raises(ValidationError): import_onnx_model(model) @@ -420,7 +420,7 @@ def test_cast_errors(): output_tensors = [make_tensor_value_info(node.output[0], onnx.TensorProto.INT32, input_data.shape)] # type: ignore graph = make_graph([node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="NgraphBackend") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") with pytest.raises((RuntimeError, OVTypeError)): import_onnx_model(model) @@ -433,7 +433,7 @@ def test_cast_errors(): output_tensors = [make_tensor_value_info(node.output[0], onnx.TensorProto.COMPLEX128, input_data.shape)] # type: ignore graph = make_graph([node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="NgraphBackend") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") with pytest.raises(RuntimeError): import_onnx_model(model) diff --git a/src/frontends/onnx/tests/tests_python/utils/__init__.py b/src/frontends/onnx/tests/tests_python/utils/__init__.py index a0923d9bbff3ec..1bfc383f971d9b 100644 --- a/src/frontends/onnx/tests/tests_python/utils/__init__.py +++ b/src/frontends/onnx/tests/tests_python/utils/__init__.py @@ -69,7 +69,7 @@ def get_node_model(op_type, *input_data, opset=1, num_outputs=1, **node_attribut ] # type: ignore graph = make_graph([onnx_node], "compute_graph", input_tensors, output_tensors) - model = make_model(graph, producer_name="Ngraph ONNX Importer") + model = make_model(graph, producer_name="OpenVINO ONNX Frontend") model.opset_import[0].version = opset return model From 1e865b3b41651e22c0cadbf81ce9af4a683c9939 Mon Sep 17 00:00:00 2001 From: "Min, Byungil" Date: Wed, 7 Feb 2024 03:29:20 -0800 Subject: [PATCH 35/55] [GPU] Fix issues from unexecuted func tests (#22488) ### Details: - Failed smoke_CLDNN_FP32/StridedSliceLayerTest.Inference/IS=([])_TS={(1.12.100)}_modelType=f32_begin=(0.n6.0)_end=(0.n8.0)_stride=(n1.n2.n1)_begin_m=(1.0.1)_end_m=(1.0.1)_new_axis_m=(0.0.0)_shrink_m=(0.0.0)_ellipsis_m=(0.0.0)_trgDev=GPU - *...* ### Tickets: - 128235 --------- Signed-off-by: Min, Byungil --- .../src/graph/impls/ocl/strided_slice.cpp | 81 +++++++++++-------- .../single_layer_tests/strided_slice.cpp | 32 +++++++- .../common_test_utils/common_utils.hpp | 15 ++++ 3 files changed, 91 insertions(+), 37 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp index df46aa9799f8f3..7fee15c92a271c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp @@ -9,6 +9,7 @@ #include "strided_slice/strided_slice_kernel_ref.h" #include "strided_slice/strided_slice_kernel_selector.h" + namespace { template ::value>::type> std::vector& pad_vector_to_size(std::vector& data, size_t size, DT value) { @@ -141,6 +142,7 @@ struct strided_slice_impl : typed_primitive_impl_ocl { std::vector out_shape; for (const auto& dim : logical_dims) out_shape.push_back(static_cast(dim)); + if (params.striding_params.size() == 3) { // If the ith bit of begin_mask is not set, begin[i] is ignored and the range of the appropriate dimension starts from 0. vector_assign_if_not_mask(params.striding_params[0], 0, params.begin_mask); @@ -148,44 +150,53 @@ struct strided_slice_impl : typed_primitive_impl_ocl { // instead. vector_assign_if_not_mask(params.striding_params[1], out_shape, params.end_mask); for (size_t dim = 0; dim < params.striding_params[2].size(); dim++) { - auto begin_org = params.striding_params[0][dim]; - auto end_org = params.striding_params[1][dim]; - if (params.striding_params[0][dim] < 0) - params.striding_params[0][dim] = std::max(out_shape[dim] + params.striding_params[0][dim], (int32_t)0); - if (params.striding_params[1][dim] < 0) - params.striding_params[1][dim] = std::max(out_shape[dim] + params.striding_params[1][dim], (int32_t)0); - - params.striding_params[0][dim] = std::min(params.striding_params[0][dim], out_shape[dim]); - params.striding_params[1][dim] = std::min(params.striding_params[1][dim], out_shape[dim]); - - auto& begin = params.striding_params[0][dim]; - auto& end = params.striding_params[1][dim]; - auto& stride = params.striding_params[2][dim]; - bool is_clamp_begin = begin_org != begin; - bool is_clamp_end = end_org != end; - bool is_reverse = stride < 0; - // If begin > end && is_reverse, then we don't need to adjust begin/end values, the kernel will process it correctly - // However, in case of out-of-bounds begin/end values, it will be clamped, so we subtract 1 from each of them manually - // E.g. out_shape[dim] = 100; begin=10000; end=-10000; stride=-1 - // clamp: begin=100; end=0; - // sub: begin=99; end=-1; - // If begin <= end, then we swap begin/end values and subtruct 1 from each of them - // E.g. out_shape[dim] = 100; begin=0; end=100; stride=-1 - // swap: begin=100; end=0; - // sub: begin=99; end=-1; - // So the kernel will put the slices [99, 0] in reversed order as expected. - if (is_reverse) { - if (begin <= end) { - std::swap(begin, end); + auto begin = params.striding_params[0][dim]; + auto end = params.striding_params[1][dim]; + auto stride = params.striding_params[2][dim]; + + // Check out of bounds values for Clamping + auto check_out_of_bounds = [&](int32_t value) -> bool { + auto size = out_shape[dim]; + if (value >= size || value < (size * -1)) + return true; + else + return false; + }; + bool should_clamp_begin = check_out_of_bounds(begin); + bool should_clamp_end = check_out_of_bounds(end); + + // Convert a negative value which means reverse indexing from the end + if (begin < 0) + begin += out_shape[dim]; // converted value can be negative if the original one was out of bounds + if (end < 0) + end += out_shape[dim]; + bool is_stride_reverse = (stride < 0) ? true : false; + + // Clamping + begin = std::min(std::max(begin, (int32_t)0), out_shape[dim]); + end = std::min(std::max(end, (int32_t)0), out_shape[dim]); + + if (is_stride_reverse) { + // If begin > end && is_reverse, then we don't need to adjust begin/end values, the kernel will process it correctly + // However, in case of out-of-bounds begin/end values, it will be clamped, so we subtract 1 from each of them manually + // E.g. out_shape[dim] = 100; begin=10000; end=-10000; stride=-1 + // clamp: begin=100; end=0; + // sub: begin=99; end=-1; + // If begin <= end, then we swap begin/end values and subtruct 1 from each of them + // E.g. out_shape[dim] = 100; begin=-100; end=100; stride=-1 + // sub: begin=-1; end=100; + // swap: begin=100; end=-1; + // So the kernel will put the slices [99, 0] in reversed order as expected. + if (should_clamp_begin) begin--; + if (should_clamp_end) end--; - } else if (begin_org != -1) { // If begin is -1 with negative stride, clamping begin is already expected value - if (is_clamp_begin) - begin--; - if (is_clamp_end) - end--; - } + if (begin <= end) + std::swap(begin, end); } + + params.striding_params[0][dim] = begin; + params.striding_params[1][dim] = end; } } return {params, op_params}; diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/strided_slice.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/strided_slice.cpp index 98384ef39cfd7b..be437518430e99 100644 --- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/strided_slice.cpp +++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/strided_slice.cpp @@ -64,6 +64,14 @@ std::vector ss_only_test_cases_fp32 = { { 1, 12, 100 }})), { 0, -6, 0 }, { 0, -8, 0 }, { -1, -2, -1 }, { 1, 0, 1 }, { 1, 0, 1 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 1, 12, 100 }})), + { 0, 6, 0 }, { 0, 4, 0 }, { -1, -2, -1 }, + { 1, 0, 1 }, { 1, 0, 1 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 1, 12, 100 }})), + { 0, -8, 0 }, { 0, -4, 0 }, { -1, 2, -1 }, + { 1, 0, 1 }, { 1, 0, 1 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }, StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ { 1, 12, 100, 1, 1 }})), { 0, -1, 0, 0 }, { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, @@ -109,8 +117,28 @@ std::vector ss_only_test_cases_fp32 = { { 0, 0, 0, 0, 0 }, { 0, 0, 29, 29, 29 }, { 1, 1, 1, 1, 1 }, {1, 1, 1, 1, 1}, {1, 1, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ - { 10, 12 }})), - { -1, 1 }, { -9999, 0 }, { -1, 1 }, + { 10, 10 }})), + { 0, 0 }, { 1000, 2 }, { 1, 1 }, + { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 10, 10 }})), + { -1000, 0 }, { 1000, 2 }, { 1, 1 }, + { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 10, 10 }})), + { 1000, 1 }, { -1000, 2 }, { -1, 1 }, + { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 10, 10 }})), + { -1, 1 }, { -1000, 2 }, { -1, 1 }, + { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 10, 10 }})), + { -1, 1 }, { 0, 2 }, { -1, 1 }, + { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, + StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ + { 10, 10 }})), + { -4, 1 }, { -8, 0 }, { -1, 1 }, { 0, 1 }, { 0, 1 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, StridedSliceSpecificParams{ ov::test::static_shapes_to_test_representation(std::vector({ { 5, 5, 5, 5 }})), diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/common_utils.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/common_utils.hpp index 600a3c62eb9b1b..972d0c84bfe639 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/common_utils.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/common_utils.hpp @@ -36,6 +36,21 @@ inline std::string vec2str(const std::vector& vec) { } return std::string("()"); } + +template <> +inline std::string vec2str(const std::vector& vec) { + if (!vec.empty()) { + std::ostringstream result; + result << "("; + std::copy(vec.begin(), vec.end() - 1, std::ostream_iterator(result, ".")); + result << vec.back() << ")"; + auto ret = result.str(); + std::replace(ret.begin(), ret.end(), '-', '_'); + return ret; + } + return std::string("()"); +} + inline void replaceSubstringInString(std::string& str, const std::string& from, const std::string& to) { size_t pos; while ((pos = str.find(from)) != std::string::npos) { From a8debd02c79fbb0774dcf8cb7908ef738ab899f4 Mon Sep 17 00:00:00 2001 From: Tingqian Li Date: Wed, 7 Feb 2024 20:49:16 +0800 Subject: [PATCH 36/55] [CPU] Share reorders (#18865) ### Details: - redundant reorders (from same source node with same destination layout & precision) are frequently observed in real models, `ShareReorders()` is introduced into `ApplyImplSpecificGraphOptimizations` to optimize them. - with above change, reorder node now can have multiple children which fails `MergeTransposeAndReorder()` transformation's assumption, so enhance `MergeTransposeAndReorder()` to handle cases where the [transpose+reorder] operation has multiple children. - this PR also allows @jane-intel 's PR https://github.com/openvinotoolkit/openvino/pull/18775 to pass CPU functional test: `FuseTransposeAndReorderTest4`, to further optimize the performance for cases where transpose nodes (before reorder node) can be also shared. ### Tickets: - CVS-127706 --------- Co-authored-by: Luo Cheng Co-authored-by: Evgenya Nugmanova --- src/plugins/intel_cpu/src/graph.cpp | 187 ++++---------- src/plugins/intel_cpu/src/graph.h | 3 +- src/plugins/intel_cpu/src/graph_optimizer.cpp | 231 +++++++++++++----- src/plugins/intel_cpu/src/graph_optimizer.h | 1 + src/plugins/intel_cpu/src/node.cpp | 120 +++++++++ src/plugins/intel_cpu/src/node.h | 1 + .../src/utils/debug_capabilities.cpp | 23 +- .../intel_cpu/src/utils/debug_capabilities.h | 3 + .../include/fuse_transpose_reorder.hpp | 6 + .../src/fuse_transpose_reorder.cpp | 46 ++++ .../graph/merge_transpose_reorder_test.cpp | 87 ++++--- 11 files changed, 461 insertions(+), 247 deletions(-) diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp index a4c7477a5a04bb..6c7bea35144f65 100644 --- a/src/plugins/intel_cpu/src/graph.cpp +++ b/src/plugins/intel_cpu/src/graph.cpp @@ -235,6 +235,11 @@ void Graph::InitGraph(bool optimize) { ResolveEdgeConflicts(); + optimizer.ShareReorders(*this); + RemoveDroppedNodes(); + + ResolveComplexInplaceConflicts(); + optimizer.ApplyImplSpecificGraphOptimizations(*this); SortTopologically(); @@ -309,7 +314,7 @@ void Graph::ResolveInplaceDirections() { OV_ITT_SCOPED_TASK(itt::domains::intel_cpu, "Graph::ResolveInplaceDirections"); for (auto& node : graphNodes) { - resolveInPlaceDirection(node); + node->resolveInPlaceDirection(); } } @@ -424,6 +429,22 @@ static bool isReorderAvailable(const MemoryDescPtr& parentDesc, const MemoryDesc return dnnl_success == status; } +void Graph::insertReorder(EdgePtr& edge, bool isOptimized, std::unordered_set& uniqueLayerNames) { + std::string basicLayerName = edge->getParent()->getName() + "_" + + node::Reorder::getReorderArgs(edge->getInputDesc(), edge->getOutputDesc()) + "_" + + edge->getChild()->getName(); + std::string layerName = basicLayerName; + int idx = 0; + while (uniqueLayerNames.find(layerName) != uniqueLayerNames.end()) { + idx++; + layerName = basicLayerName + "_" + std::to_string(idx); + } + uniqueLayerNames.insert(layerName); + + // optimized flag indicate that just desc update w/o actual physical memory movement. + InsertReorder(edge, layerName, edge->getInputDesc(), edge->getOutputDesc(), isOptimized); +} + void Graph::ResolveEdgeConflicts() { OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ResolveEdgeConflicts"); @@ -434,22 +455,6 @@ void Graph::ResolveEdgeConflicts() { uniqueLayerNames.insert(node->getName()); } - auto insertReorder = [&](EdgePtr& edge, bool isOptimized) { - std::string basicLayerName = edge->getParent()->getName() + "_" + - node::Reorder::getReorderArgs(edge->getInputDesc(), edge->getOutputDesc()) + "_" + - edge->getChild()->getName(); - std::string layerName = basicLayerName; - int idx = 0; - while (uniqueLayerNames.find(layerName) != uniqueLayerNames.end()) { - idx++; - layerName = basicLayerName + "_" + std::to_string(idx); - } - uniqueLayerNames.insert(layerName); - - // optimized flag indicate that just desc update w/o actual physical memory movement. - InsertReorder(edge, layerName, edge->getInputDesc(), edge->getOutputDesc(), isOptimized); - }; - auto updateEdge = [&](ptrdiff_t& i) { graphEdges.erase(graphEdges.begin() + i); i--; @@ -485,14 +490,31 @@ void Graph::ResolveEdgeConflicts() { edge = convertNode->getChildEdgeAt(0); } if (reorderStatusInternal != Edge::ReorderStatus::No) { - insertReorder(edge, reorderStatusInternal == Edge::ReorderStatus::Optimized); + insertReorder(edge, reorderStatusInternal == Edge::ReorderStatus::Optimized, uniqueLayerNames); } updateEdge(i); } else if (reorderStatus == Edge::ReorderStatus::Optimized) { - insertReorder(edge, true); + insertReorder(edge, true, uniqueLayerNames); updateEdge(i); } } +} + +void Graph::ResolveComplexInplaceConflicts() { + OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::intel_cpu_LT, "Graph::ResolveComplexInplaceConflicts"); + + ptrdiff_t numberOfEdges = static_cast(graphEdges.size()); + + std::unordered_set uniqueLayerNames; + for (auto node : graphNodes) { + uniqueLayerNames.insert(node->getName()); + } + + auto updateEdge = [&](ptrdiff_t& i) { + graphEdges.erase(graphEdges.begin() + i); + i--; + numberOfEdges--; + }; // secondary pass to eliminate complex inplace conflicts auto needReorder = [](const EdgePtr& edge) -> bool { @@ -519,13 +541,10 @@ void Graph::ResolveEdgeConflicts() { return false; }; - numberOfEdges = graphEdges.size(); //update the total number - for (ptrdiff_t i = 0; i < numberOfEdges; i++) { auto edge = graphEdges[i]; if (needReorder(edge)) { - constexpr bool optimizedReorder = false; - insertReorder(edge, optimizedReorder); + insertReorder(edge, false, uniqueLayerNames); updateEdge(i); } } @@ -1553,10 +1572,9 @@ bool Graph::InsertNode(NodePtr parent, NodePtr child, NodePtr node, int parentPo node->initSupportedPrimitiveDescriptors(); node->filterSupportedPrimitiveDescriptors(); node->selectOptimalPrimitiveDescriptor(); - resolveInPlaceDirection(node); + node->resolveInPlaceDirection(); node->initOptimalPrimitiveDescriptor(); } - return true; } @@ -1707,125 +1725,6 @@ std::shared_ptr Graph::dump() const { return dump_graph_as_ie_ngraph_net(*this); } -void Graph::resolveInPlaceDirection(const NodePtr& node) const { - enum InplaceDirectionType {UP, DOWN, CYCLIC, NONE}; - enum PortType {INPUT, OUTPUT}; - - auto inPlaceDirection = [](const NodePtr& node, PortType portType, int portNum) -> InplaceDirectionType { - if (PortType::INPUT == portType) { - auto inPlaceInpPort = node->inPlaceInputPort(portNum); - if (inPlaceInpPort >= 0) { - auto inPlaceOutPort = node->inPlaceOutPort(inPlaceInpPort); - if (inPlaceOutPort == inPlaceInpPort) { - return InplaceDirectionType::CYCLIC; - } else if (inPlaceOutPort < 0) { - return InplaceDirectionType::DOWN; - } else { - OPENVINO_THROW("Non trivial inPlace memory dependency has been detected"); - } - } - // the requested port has a negative inPlace tag, let's check whether it is referenced from the output - auto& config = node->getSelectedPrimitiveDescriptor()->getConfig(); - for (auto& portConf : config.outConfs) { - if (portConf.inPlace() == portNum) { - return InplaceDirectionType::UP; - } - } - } else if (PortType::OUTPUT == portType) { - auto inPlaceOutPort = node->inPlaceOutPort(portNum); - if (inPlaceOutPort >= 0) { - auto inPlaceInpPort = node->inPlaceInputPort(inPlaceOutPort); - if (inPlaceOutPort == inPlaceInpPort) { - return InplaceDirectionType::CYCLIC; - } else if (inPlaceInpPort < 0) { - return InplaceDirectionType::UP; - } else { - OPENVINO_THROW("Non trivial inPlace memory dependency has been detected"); - } - } - // the requested port has a negative inPlace tag, let's check whether it is referenced from the input - auto& config = node->getSelectedPrimitiveDescriptor()->getConfig(); - for (auto& portConf : config.inConfs) { - if (portConf.inPlace() == portNum) { - return InplaceDirectionType::DOWN; - } - } - } - return InplaceDirectionType::NONE; - }; - - auto& inpEdges = node->getParentEdges(); - for (auto& wEdge : inpEdges) { - if (auto pEdge = wEdge.lock()) { - auto inpPort = pEdge->getOutputNum(); - auto inPlaceInpPort = node->inPlaceInputPort(inpPort); - if (inPlaceInpPort < 0 || inPlaceDirection(node, PortType::INPUT, inpPort) != InplaceDirectionType::CYCLIC) { - continue; - } - // inPlace memory cyclic dependency detected, need to resolve - // let's check the parent node first - auto pParent = pEdge->getParent(); - auto parentInPlaceDirection = inPlaceDirection(pParent, PortType::OUTPUT, pEdge->getInputNum()); - if (parentInPlaceDirection == InplaceDirectionType::UP) { - auto config = node->getSelectedPrimitiveDescriptor()->getConfig(); - config.inConfs[inpPort].inPlace(-1); - node->initDescriptor(config); - } else if (parentInPlaceDirection == InplaceDirectionType::DOWN) { - //search if siblings already have downstream direction - auto downstreamPeers = [&] { - for (auto& peerEdge : pParent->getChildEdgesAtPort(pEdge->getInputNum())) { - auto peerNode = peerEdge->getChild(); - if (peerNode == node) continue; - if (inPlaceDirection(peerNode, PortType::INPUT, peerEdge->getOutputNum()) == InplaceDirectionType::DOWN) { - return true; - } - } - return false; - }(); - if (downstreamPeers) { - // when there is an downstream peer we have to resolve upstream inplace for the node - // to avoid inplace conflict - auto config = node->getSelectedPrimitiveDescriptor()->getConfig(); - config.inConfs[inpPort].inPlace(-1); - node->initDescriptor(config); - } else { - auto config = node->getSelectedPrimitiveDescriptor()->getConfig(); - config.outConfs[inPlaceInpPort].inPlace(-1); - node->initDescriptor(config); - } - } else { - // the parent node does not use inPlace memory, let's check children - std::function searchNonCyclicDirection; - searchNonCyclicDirection = [&](const NodePtr& node, int portIdx) -> InplaceDirectionType { - auto childEdges = node->getChildEdgesAtPort(portIdx); - for (auto& edge : childEdges) { - auto pChild = edge->getChild(); - auto result = inPlaceDirection(pChild, PortType::INPUT, edge->getOutputNum()); - if (InplaceDirectionType::UP == result || InplaceDirectionType::DOWN == result) { - return result; - } else if (InplaceDirectionType::CYCLIC == result) { - return searchNonCyclicDirection(pChild, pChild->inPlaceInputPort(edge->getOutputNum())); - } - } - return InplaceDirectionType::NONE; - }; - auto result = searchNonCyclicDirection(node, inPlaceInpPort); - if (one_of(result, InplaceDirectionType::UP, InplaceDirectionType::NONE)) { - auto config = node->getSelectedPrimitiveDescriptor()->getConfig(); - config.inConfs[inpPort].inPlace(-1); - node->initDescriptor(config); - } else if (InplaceDirectionType::DOWN == result) { - auto config = node->getSelectedPrimitiveDescriptor()->getConfig(); - config.outConfs[inPlaceInpPort].inPlace(-1); - node->initDescriptor(config); - } else { - OPENVINO_THROW("A node without an inPlace memory cyclic dependency has not been found"); - } - } - } - } -} - void Graph::SearchInternalStateNodes() { for (auto&& node : graphNodes) { if (node->getType() == Type::MemoryInput) { diff --git a/src/plugins/intel_cpu/src/graph.h b/src/plugins/intel_cpu/src/graph.h index 4c19e2c20443ec..17a820dcca0ca4 100644 --- a/src/plugins/intel_cpu/src/graph.h +++ b/src/plugins/intel_cpu/src/graph.h @@ -227,6 +227,7 @@ class Graph { void ResolveInplaceDirections(); void InitOptimalPrimitiveDescriptors(); void ResolveEdgeConflicts(); + void ResolveComplexInplaceConflicts(); bool ProcessDynNodes(); void Allocate(); void AllocateWithReuse(); @@ -259,7 +260,7 @@ class Graph { void EnforceInferencePrecision(); void EnforceBF16(); - void resolveInPlaceDirection(const NodePtr& node) const; + void insertReorder(EdgePtr& edge, bool isOptimized, std::unordered_set& uniqueLayerNames); }; using GraphPtr = std::shared_ptr; diff --git a/src/plugins/intel_cpu/src/graph_optimizer.cpp b/src/plugins/intel_cpu/src/graph_optimizer.cpp index b0fa76a845e5b4..a4622853f6977c 100644 --- a/src/plugins/intel_cpu/src/graph_optimizer.cpp +++ b/src/plugins/intel_cpu/src/graph_optimizer.cpp @@ -2212,6 +2212,69 @@ void GraphOptimizer::FuseEltwiseAndSimple(Graph &graph) { } } +void GraphOptimizer::ShareReorders(Graph& graph) { + auto getSuitableReorder = [](NodePtr node) -> Reorder* { + if (node->getType() != Type::Reorder) + return nullptr; + Reorder* reorder = dynamic_cast(node.get()); + if (reorder == nullptr) + OPENVINO_THROW("Cannot get reorder layer ", node->getName()); + + // inplace children cannot be safely shared with each other + auto reorderConsumers = reorder->getChildEdgesAtPort(0); + if (std::any_of(reorderConsumers.begin(), reorderConsumers.end(), [](EdgePtr e) { + return e->inPlace(Edge::LOOK_DOWN); + })) + return nullptr; + return reorder; + }; + + std::set dropped; + for (const auto& node : graph.GetNodes()) { + if (dropped.find(node) != dropped.end()) + continue; + + Reorder* reorder = getSuitableReorder(node); + if (!reorder) + continue; + + // find shareable sibling + auto dataEdge = reorder->getParentEdgeAt(0); + auto parentNode = dataEdge->getParent(); + auto parentPort = dataEdge->getInputNum(); + for (auto& edge : parentNode->getChildEdgesAtPort(parentPort)) { + auto siblingNode = edge->getChild(); + if (siblingNode == node) + continue; + Reorder* siblingReorder = getSuitableReorder(siblingNode); + if (!siblingReorder) + continue; + if (!reorder->getOutput().isCompatible(siblingReorder->getOutput())) + continue; + + DEBUG_LOG(node->getName(), " is shared by ", siblingNode->getName()); + + // siblingReorder can share output with current reorder + for (auto pwEdge : siblingReorder->getParentEdges()) { + auto pEdge = pwEdge.lock(); + if (pEdge) + graph.RemoveEdge(pEdge); + } + + for (auto pwEdge : siblingReorder->getChildEdges()) { + auto pEdge = pwEdge.lock(); + if (pEdge) { + graph.RemoveEdge(pEdge); + if (pEdge->getInputNum() == 0) + graph.CreateEdge(node, pEdge->getChild(), 0, pEdge->getOutputNum()); + } + } + + dropped.insert(siblingNode); + } + } +} + void GraphOptimizer::DropDoubleReorders(Graph &graph) { std::set processed; @@ -2512,7 +2575,6 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) { auto isSuitableChildNode = [](NodePtr node) { return node->getType() == Type::Reorder - && node->getChildEdges().size() == 1 && !node->isDynamicNode(); // TODO [DS]: enable for dynamic shapes when inPlace in the dynamic case is available (CVS-74863) }; @@ -2589,92 +2651,127 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) { // As in the first case, we also replace Transpose+Reorder pattern with a new Reorder. // Additionally, we insert another Reorder that performs the conversion from the input precision (inPrec) // to the output precision (outPrec) - auto mergeTransposeAndReorder = [&](std::shared_ptr& parentNode, std::shared_ptr& childNode) { - auto parentParentNode = parentNode->getParentEdgeAt(0)->getParent(); - auto parentParentConstNode = parentNode->getParentEdgeAt(1)->getParent(); - auto childChildNode = childNode->getChildEdgeAt(0)->getChild(); - - auto remEdge = parentNode->getParentEdgeAt(1); + auto mergeTransposeAndReorder = [&](std::shared_ptr& trans_node, std::shared_ptr& reorder_node) { + // parentParentNode ===> trans_node ===> reorder_node ===> cc0, cc1, ... + // is transfomed into + // parentParentNode ===> reorder_nop ===> [reorder_convert] ==> cc0, cc1, ... + auto parentParentNode = trans_node->getParentEdgeAt(0)->getParent(); + auto parentParenPort = trans_node->getParentEdgeAt(0)->getInputNum(); + auto parentParentConstNode = trans_node->getParentEdgeAt(1)->getParent(); + + auto remEdge = trans_node->getParentEdgeAt(1); graph.RemoveEdge(remEdge); // to prevent inPlace conflict we must check that the memory reference is unidirectional or // inPlace memory is not used - const auto parentInPlace = parentNode->getParentEdgeAt(0)->inPlace(Edge::LOOK_UP); - const auto& childEdges = childNode->getChildEdgesAtPort(0); + const auto parentInPlace = trans_node->getParentEdgeAt(0)->inPlace(Edge::LOOK_UP); + const auto& childEdges = reorder_node->getChildEdgesAtPort(0); + const auto childInPlace = std::any_of(childEdges.begin(), childEdges.end(), [](const EdgePtr& edge){ return edge->inPlace(Edge::LOOK_DOWN); }); bool isOptimized = !(parentInPlace && childInPlace); - graph.DropNode(parentNode); - graph.DropNode(childNode); - - auto inDesc = parentNode->getSelectedPrimitiveDescriptor()->getConfig().inConfs[0].getMemDesc(); - auto outDesc = childNode->getSelectedPrimitiveDescriptor()->getConfig().outConfs[0].getMemDesc(); - - auto inPrec = inDesc->getPrecision(); - auto outPrec = outDesc->getPrecision(); + // hold references to all children before dropping reorder_node + std::vector> reorderChildren; + for (auto ccEdge : childEdges) + reorderChildren.emplace_back(ccEdge->getChild(), ccEdge->getOutputNum()); + + // detach trans_node and reorder_node from graph by remove all of their edges + // they will be removed in future graph.RemoveDroppedNodes() call + auto detachNode = [&](std::shared_ptr& node) { + std::vector edges; + edges = node->getParentEdges(); + for (auto& edge : edges) + graph.RemoveEdge(edge.lock()); + edges = node->getChildEdges(); + for (auto& edge : edges) + graph.RemoveEdge(edge.lock()); + }; + detachNode(trans_node); + detachNode(reorder_node); - auto reorderInDesc = inDesc; - auto reorderOutDesc = outDesc->cloneWithNewPrecision(inPrec); + auto reorderInDesc = trans_node->getSelectedPrimitiveDescriptor()->getConfig().inConfs[0].getMemDesc(); + auto finalDesc = reorder_node->getSelectedPrimitiveDescriptor()->getConfig().outConfs[0].getMemDesc(); + auto reorderOutDesc = finalDesc->cloneWithNewPrecision(reorderInDesc->getPrecision()); std::string reorderlayerName = parentParentNode->getName() + "_" + Reorder::getReorderArgs(*reorderInDesc, *reorderOutDesc) + "_" + "fake"; - DEBUG_LOG("mergeTransposeAndReorder ", parentNode->getName(), " and ", childNode->getName(), " -> ", reorderlayerName); - - EdgePtr edge; - for (auto &childEdge : parentParentNode->getChildEdges()) { - if (childEdge.lock()->getChild() == childChildNode) { - edge = childEdge.lock(); - break; - } - } - if (!edge) { - OPENVINO_THROW("Transpose node '", parentNode->getName(), "' has invalid edges."); - } + DEBUG_LOG("mergeTransposeAndReorder ", trans_node->getName(), " and ", reorder_node->getName(), " -> ", reorderlayerName); std::vector srcPerm; - auto configReorder = [&]() { - // case 1. transposeNode support blocked input & non-blocked output, in the case, the reorder - // cannot be optimized - // case 2. Transpose and Reorder do opposite permutation to each other as expected, but isOptimized is already set false - // due to some preliminarily checks. We need to reinterpret layout Transpose input without physical change of the memory. - auto* transposeNode = dynamic_cast(parentNode.get()); - if (transposeNode == nullptr) { - OPENVINO_THROW("[CPU] parent node of type:", - parentNode->getTypeStr(), - " with name: ", - parentNode->getName(), - " is not a transpose node"); + // case 1. transposeNode support blocked input & non-blocked output, in the case, the reorder + // cannot be optimized + // case 2. Transpose and Reorder do opposite permutation to each other as expected, but isOptimized is already set false + // due to some preliminarily checks. We need to reinterpret layout Transpose input without physical change of the memory. + auto* transposeNode = dynamic_cast(trans_node.get()); + if (transposeNode == nullptr) { + OPENVINO_THROW("[CPU] parent node of type:", + trans_node->getTypeStr(), + " with name: ", + trans_node->getName(), + " is not a transpose node"); + } + const auto& inOrder = transposeNode->getSelectedPrimitiveDescriptor()->getConfig().inConfs[0].getMemDesc()->as()->getOrder(); + const auto& outOrder = reorderOutDesc->as()->getOrder(); + if (!isOptimized || inOrder.size() > outOrder.size()) { + isOptimized = false; + // inDesc should be permuted before calling reorder + auto & ord = transposeNode->getOrder(); + srcPerm = std::vector(ord.size()); + for (size_t i = 0; i < ord.size(); i++) { + srcPerm[ord[i]] = i; } - auto inOrder = transposeNode->getSelectedPrimitiveDescriptor()->getConfig().inConfs[0].getMemDesc()->as()->getOrder(); - auto outOrder = reorderOutDesc->as()->getOrder(); - if (!isOptimized || inOrder.size() > outOrder.size()) { - isOptimized = false; - // inDesc should be permuted before calling reorder - auto & ord = transposeNode->getOrder(); - srcPerm = std::vector(ord.size()); - for (size_t i = 0; i < ord.size(); i++) { - srcPerm[ord[i]] = i; - } - } - }; - - configReorder(); + } + auto reorder_layout = + std::make_shared(*reorderInDesc, *reorderOutDesc, reorderlayerName, graph.getGraphContext()); + reorder_layout->setOptimized(isOptimized); + reorder_layout->setSrcPermutation(srcPerm); - auto reorderNode = graph.InsertReorder(edge, reorderlayerName, *reorderInDesc, *reorderOutDesc, isOptimized, srcPerm); + graph.CreateEdge(parentParentNode, reorder_layout, parentParenPort, 0); // case 2 - if (inPrec != outPrec) { - auto reorderInDesc2 = reorderOutDesc; - auto reorderOutDesc2 = outDesc; - - std::string reorderLayerName2 = reorderNode->getName() + "_" + - Reorder::getReorderArgs(*reorderInDesc2, *reorderOutDesc2) + "_" + childChildNode->getName(); - - graph.InsertReorder(reorderNode->getChildEdgeAt(0), reorderLayerName2, *reorderInDesc2, *reorderOutDesc2, false); - } + auto reorder_last = reorder_layout; + if (reorderOutDesc->getPrecision() != finalDesc->getPrecision()) { + std::string reorderLayerName2 = reorder_layout->getName() + "_" + + Reorder::getReorderArgs(*reorderOutDesc, *finalDesc) + "_x_" + + reorderChildren[0].first->getName(); + reorder_last = std::make_shared(*reorderOutDesc, + *finalDesc, + reorderLayerName2, + graph.getGraphContext()); + reorder_last->setOptimized(false); + reorder_last->setSrcPermutation(srcPerm); + graph.CreateEdge(reorder_layout, reorder_last, 0, 0); + } + + for (auto& cc : reorderChildren) + graph.CreateEdge(reorder_last, cc.first, 0, cc.second); + + // initialize and add nodes into graph + std::vector new_nodes; + new_nodes.push_back(reorder_layout); + if (reorder_last != reorder_layout) { + new_nodes.push_back(reorder_last); + } + for (auto& node : new_nodes) + graph.AddNode(node); + + // multiple nodes must be initialized in specific order + for (auto& node : new_nodes) + node->init(); + for (auto& node : new_nodes) { + node->getSupportedDescriptors(); + node->initSupportedPrimitiveDescriptors(); + node->filterSupportedPrimitiveDescriptors(); + } + for (auto& node : new_nodes) + node->selectOptimalPrimitiveDescriptor(); + for (auto& node : new_nodes) + node->resolveInPlaceDirection(); + for (auto& node : new_nodes) + node->initOptimalPrimitiveDescriptor(); }; for (size_t i = 0; i < graphNodes.size(); i++) { diff --git a/src/plugins/intel_cpu/src/graph_optimizer.h b/src/plugins/intel_cpu/src/graph_optimizer.h index 0716bedc802c73..181866562d5afb 100644 --- a/src/plugins/intel_cpu/src/graph_optimizer.h +++ b/src/plugins/intel_cpu/src/graph_optimizer.h @@ -16,6 +16,7 @@ class GraphOptimizer { public: void ApplyCommonGraphOptimizations(Graph& graph); void ApplyImplSpecificGraphOptimizations(Graph& graph); + void ShareReorders(Graph &graph); private: void FuseConvMatmulFCDeconvAndDQScales(Graph &graph); diff --git a/src/plugins/intel_cpu/src/node.cpp b/src/plugins/intel_cpu/src/node.cpp index fbefc74a076d65..c7bdfcfbc5f00a 100644 --- a/src/plugins/intel_cpu/src/node.cpp +++ b/src/plugins/intel_cpu/src/node.cpp @@ -1722,5 +1722,125 @@ int Node::inPlaceOutPort(int portIdx) const { return conf.outConfs[portIdx].inPlace(); } + +void Node::resolveInPlaceDirection() { + enum InplaceDirectionType {UP, DOWN, CYCLIC, NONE}; + enum PortType {INPUT, OUTPUT}; + + auto inPlaceDirection = [](const Node* node, PortType portType, int portNum) -> InplaceDirectionType { + if (PortType::INPUT == portType) { + auto inPlaceInpPort = node->inPlaceInputPort(portNum); + if (inPlaceInpPort >= 0) { + auto inPlaceOutPort = node->inPlaceOutPort(inPlaceInpPort); + if (inPlaceOutPort == inPlaceInpPort) { + return InplaceDirectionType::CYCLIC; + } else if (inPlaceOutPort < 0) { + return InplaceDirectionType::DOWN; + } else { + OPENVINO_THROW("Non trivial inPlace memory dependency has been detected"); + } + } + // the requested port has a negative inPlace tag, let's check whether it is referenced from the output + auto& config = node->getSelectedPrimitiveDescriptor()->getConfig(); + for (auto& portConf : config.outConfs) { + if (portConf.inPlace() == portNum) { + return InplaceDirectionType::UP; + } + } + } else if (PortType::OUTPUT == portType) { + auto inPlaceOutPort = node->inPlaceOutPort(portNum); + if (inPlaceOutPort >= 0) { + auto inPlaceInpPort = node->inPlaceInputPort(inPlaceOutPort); + if (inPlaceOutPort == inPlaceInpPort) { + return InplaceDirectionType::CYCLIC; + } else if (inPlaceInpPort < 0) { + return InplaceDirectionType::UP; + } else { + OPENVINO_THROW("Non trivial inPlace memory dependency has been detected"); + } + } + // the requested port has a negative inPlace tag, let's check whether it is referenced from the input + auto& config = node->getSelectedPrimitiveDescriptor()->getConfig(); + for (auto& portConf : config.inConfs) { + if (portConf.inPlace() == portNum) { + return InplaceDirectionType::DOWN; + } + } + } + return InplaceDirectionType::NONE; + }; + + auto& inpEdges = getParentEdges(); + for (auto& wEdge : inpEdges) { + if (auto pEdge = wEdge.lock()) { + auto inpPort = pEdge->getOutputNum(); + auto inPlaceInpPort = inPlaceInputPort(inpPort); + if (inPlaceInpPort < 0 || inPlaceDirection(this, PortType::INPUT, inpPort) != InplaceDirectionType::CYCLIC) { + continue; + } + // inPlace memory cyclic dependency detected, need to resolve + // let's check the parent node first + auto pParent = pEdge->getParent().get(); + auto parentInPlaceDirection = inPlaceDirection(pParent, PortType::OUTPUT, pEdge->getInputNum()); + if (parentInPlaceDirection == InplaceDirectionType::UP) { + auto config = getSelectedPrimitiveDescriptor()->getConfig(); + config.inConfs[inpPort].inPlace(-1); + initDescriptor(config); + } else if (parentInPlaceDirection == InplaceDirectionType::DOWN) { + //search if siblings already have downstream direction + auto downstreamPeers = [&] { + for (auto& peerEdge : pParent->getChildEdgesAtPort(pEdge->getInputNum())) { + auto peerNode = peerEdge->getChild().get(); + if (peerNode == this) continue; + if (inPlaceDirection(peerNode, PortType::INPUT, peerEdge->getOutputNum()) == InplaceDirectionType::DOWN) { + return true; + } + } + return false; + }(); + if (downstreamPeers) { + // when there is an downstream peer we have to resolve upstream inplace for the node + // to avoid inplace conflict + auto config = getSelectedPrimitiveDescriptor()->getConfig(); + config.inConfs[inpPort].inPlace(-1); + initDescriptor(config); + } else { + auto config = getSelectedPrimitiveDescriptor()->getConfig(); + config.outConfs[inPlaceInpPort].inPlace(-1); + initDescriptor(config); + } + } else { + // the parent node does not use inPlace memory, let's check children + std::function searchNonCyclicDirection; + searchNonCyclicDirection = [&](const Node* node, int portIdx) -> InplaceDirectionType { + auto childEdges = node->getChildEdgesAtPort(portIdx); + for (auto& edge : childEdges) { + auto pChild = edge->getChild().get(); + auto result = inPlaceDirection(pChild, PortType::INPUT, edge->getOutputNum()); + if (InplaceDirectionType::UP == result || InplaceDirectionType::DOWN == result) { + return result; + } else if (InplaceDirectionType::CYCLIC == result) { + return searchNonCyclicDirection(pChild, pChild->inPlaceInputPort(edge->getOutputNum())); + } + } + return InplaceDirectionType::NONE; + }; + auto result = searchNonCyclicDirection(this, inPlaceInpPort); + if (one_of(result, InplaceDirectionType::UP, InplaceDirectionType::NONE)) { + auto config = getSelectedPrimitiveDescriptor()->getConfig(); + config.inConfs[inpPort].inPlace(-1); + initDescriptor(config); + } else if (InplaceDirectionType::DOWN == result) { + auto config = getSelectedPrimitiveDescriptor()->getConfig(); + config.outConfs[inPlaceInpPort].inPlace(-1); + initDescriptor(config); + } else { + OPENVINO_THROW("A node without an inPlace memory cyclic dependency has not been found"); + } + } + } + } +} + } // namespace intel_cpu } // namespace ov diff --git a/src/plugins/intel_cpu/src/node.h b/src/plugins/intel_cpu/src/node.h index e80800086dec2b..bc429fb12b00c2 100644 --- a/src/plugins/intel_cpu/src/node.h +++ b/src/plugins/intel_cpu/src/node.h @@ -452,6 +452,7 @@ class Node { virtual void selectOptimalPrimitiveDescriptor(); virtual void initOptimalPrimitiveDescriptor(); + void resolveInPlaceDirection(); virtual void getSupportedDescriptors() = 0; // TODO [DS]: Should be moved into Node derivative class diff --git a/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp b/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp index 4968528677cbdb..6e29e04c8aa8d8 100644 --- a/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp +++ b/src/plugins/intel_cpu/src/utils/debug_capabilities.cpp @@ -8,6 +8,7 @@ #include "debug_capabilities.h" #include "node.h" #include "edge.h" +#include "graph.h" #include #include "nodes/input.h" #include "nodes/eltwise.h" @@ -213,7 +214,7 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) { leftside << comma << desc->getPrecision().get_type_name() << "_" << desc->serializeFormat() << "_" << shape_str - << "_" << getData(ptr); + << "&" << getData(ptr); b_ouputed = true; } else { leftside << "(empty)"; @@ -289,22 +290,24 @@ std::ostream & operator<<(std::ostream & os, const Node &c_node) { comma = ""; for (size_t port = 0; port < node.getParentEdges().size(); ++port) { // find the Parent edge connecting to port + os << comma; + const char * sep2 = ""; for (const auto & e : node.getParentEdges()) { auto edge = e.lock(); if (!edge) continue; if (edge->getOutputNum() != static_cast(port)) continue; auto n = edge->getParent(); - os << comma; + os << sep2; os << node_id(*edge->getParent()); auto ptr = edge->getMemoryPtr(); if (ptr) { - os << "_" << getData(ptr); + os << "&" << getData(ptr); } if (!is_single_output_port(*n)) os << "[" << edge->getInputNum() << "]"; - comma = ","; - break; + sep2 = "|"; // show all edges at single port(usually indicating bugs) } + comma = ","; } if (node.getType() == intel_cpu::Type::Input && node.isConstant()) { @@ -386,6 +389,16 @@ std::ostream & operator<<(std::ostream & os, const Shape& shape) { return os; } +// Print complex data structures in a textualized form to the console is an efficient way to investigate them +std::ostream & operator<<(std::ostream & os, const Graph& g) { + os << "ov::intel_cpu::Graph " << g.GetName() << " {" << std::endl; + for (auto &graphNode : g.GetNodes()) { + std::cout << *graphNode << std::endl; + } + os << "};" << std::endl; + return os; +} + class OstreamAttributeVisitor : public ov::AttributeVisitor { std::ostream & os; diff --git a/src/plugins/intel_cpu/src/utils/debug_capabilities.h b/src/plugins/intel_cpu/src/utils/debug_capabilities.h index 01c78c043b4122..724871209924ef 100644 --- a/src/plugins/intel_cpu/src/utils/debug_capabilities.h +++ b/src/plugins/intel_cpu/src/utils/debug_capabilities.h @@ -47,7 +47,9 @@ class NodeDesc; class MemoryDesc; class Node; class Edge; +class Graph; class IMemory; + class PrintableModel { public: PrintableModel(const ov::Model& model, std::string tag = "", std::string prefix = "") : model(model), tag(tag), prefix(prefix) {} @@ -96,6 +98,7 @@ std::ostream & operator<<(std::ostream & os, const PortConfig& desc); std::ostream & operator<<(std::ostream & os, const NodeConfig& desc); std::ostream & operator<<(std::ostream & os, const NodeDesc& desc); std::ostream & operator<<(std::ostream & os, const Node& node); +std::ostream & operator<<(std::ostream & os, const ov::intel_cpu::Graph& graph); std::ostream & operator<<(std::ostream & os, const Shape& shape); std::ostream & operator<<(std::ostream & os, const MemoryDesc& desc); std::ostream & operator<<(std::ostream & os, const IMemory& mem); diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/include/fuse_transpose_reorder.hpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/include/fuse_transpose_reorder.hpp index 2dcfbcda3cb6f9..ae97903d87c64b 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/include/fuse_transpose_reorder.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/include/fuse_transpose_reorder.hpp @@ -54,5 +54,11 @@ class FuseTransposeAndReorderTest4 : public FuseTransposeAndReorderTest { protected: void create_model() override; }; + +class FuseTransposeAndReorderTest5 : public FuseTransposeAndReorderTest { +protected: + void create_model() override; +}; + } // namespace test } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp index 0610dcda662bcd..e13d8783b10d23 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fuse_transpose_reorder.cpp @@ -354,6 +354,52 @@ TEST_P(FuseTransposeAndReorderTest4, CompareWithRefs) { INSTANTIATE_TEST_SUITE_P(smoke_Basic, FuseTransposeAndReorderTest4, convSumTranposeParams, FuseTransposeAndReorderTest::getTestCaseName); +void FuseTransposeAndReorderTest5::create_model() { + OPENVINO_ASSERT(input_shape.size() == 4); + const ov::Shape kernel = {1, 1}; + const ov::Shape stride = {1, 1}; + const ov::Shape dilation = {1, 1}; + const std::vector padBegin = {0, 0}; + const std::vector padEnd = {0, 0}; + const size_t convOutChannels = 4; + auto memFmt = nhwc; + + ov::ParameterVector inputParams{std::make_shared(in_prec, ov::Shape(input_shape))}; + const auto relu = std::make_shared(inputParams[0]); + const auto transposeOrder = ov::op::v0::Constant::create(ov::element::i32, {4}, {0, 3, 1, 2}); + const auto transpose_shared = std::make_shared(relu, transposeOrder); + const auto conv1 = ov::test::utils::make_convolution(transpose_shared, + in_prec, + kernel, + stride, + padBegin, + padEnd, + dilation, + ov::op::PadType::AUTO, + convOutChannels); + conv1->get_rt_info() = makeCPUInfo({memFmt}, {memFmt}, {}); + const auto conv2 = ov::test::utils::make_convolution(transpose_shared, + in_prec, + kernel, + stride, + padBegin, + padEnd, + dilation, + ov::op::PadType::AUTO, + convOutChannels); + conv2->get_rt_info() = makeCPUInfo({memFmt}, {memFmt}, {}); + const auto add = std::make_shared(conv1, conv2); + + ov::ResultVector results{std::make_shared(add->output(0))}; + function = std::make_shared(results, inputParams, "TransposeReorder"); +} + +TEST_P(FuseTransposeAndReorderTest5, CompareWithRefs) { + run(); + check_transpose_count(0); +} +INSTANTIATE_TEST_SUITE_P(smoke_Basic, FuseTransposeAndReorderTest5, convSumTranposeParams, FuseTransposeAndReorderTest::getTestCaseName); + TEST(smoke_Basic, FuseDynamicTransposeAndReorderTest) { auto model = ov::builder::preprocess::create_preprocess_1input(ov::element::u8, ov::PartialShape{1, 3, 224, 224}); auto p = ov::preprocess::PrePostProcessor(model); diff --git a/src/plugins/intel_cpu/tests/unit/graph/merge_transpose_reorder_test.cpp b/src/plugins/intel_cpu/tests/unit/graph/merge_transpose_reorder_test.cpp index 1dd1c177e16813..731b3dd91208f4 100644 --- a/src/plugins/intel_cpu/tests/unit/graph/merge_transpose_reorder_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/graph/merge_transpose_reorder_test.cpp @@ -17,22 +17,7 @@ using namespace ov::intel_cpu; -/* - * MergeTransposeReorderIsOptimizedCPUTest to test the CPU plugin-in MergeTransposeReorder graph optimizer - * under the circumstance that the upstream node or downstream node is inPlaced thereby the inserted Reorder - * cannot be optimized. - */ -class MergeTransposeReorderIsOptimizedCPUTest : public ::testing::Test { -public: - void Validate() const { - CheckTransposeCount(0); - CheckReorderOptimized(std::string("_fake"), false); // the fused node is of name "reshape_abcd_acdb_fake" - } - - void SetUp() override { - CreateGraph(); - } - +class MergeTransposeReordersCPUTest : public ::testing::Test { protected: /* graph typology --------- @@ -61,7 +46,7 @@ class MergeTransposeReorderIsOptimizedCPUTest : public ::testing::Test { |Output | --------- */ - void CreateGraph() { + void CreateGraph(int num_consumers, int consumer_in_place_direction) { // Config conf; conf.rtCacheCapacity = 100; @@ -75,7 +60,9 @@ class MergeTransposeReorderIsOptimizedCPUTest : public ::testing::Test { auto order = std::vector{0, 3, 1, 2}; auto constOrder = ov::test::utils::deprecated::make_constant(ov::element::i32, {order.size()}, order); auto transpose = std::make_shared(params[0], constOrder); - ov::ResultVector results{std::make_shared(transpose)}; + ov::ResultVector results; + for (int i = 0; i < num_consumers; i++) + results.push_back(std::make_shared(transpose)); // Replicate auto replicate = [&](std::vector &nodes, std::vector &edges) -> void { @@ -99,18 +86,28 @@ class MergeTransposeReorderIsOptimizedCPUTest : public ::testing::Test { auto transposeNode = std::make_shared(transpose, context); transposeNode->filterSupportedPrimitiveDescriptors(); - // dummy nspc + inPlace LOOK_DOWN - const ov::Shape shape_tranpose{testShape[0], testShape[3], testShape[1], testShape[2]}; // shape after transpose - auto dummyNode2 = std::make_shared( - shape_tranpose, testPrec, "multiply", "DummyNode", context, LayoutType::nspc, Edge::LOOK::LOOK_DOWN); - - auto outputNode = std::make_shared(results[0], context); addEdge(inputNode, dummyNode1, 0, 0); addEdge(dummyNode1, transposeNode, 0, 0); addEdge(orderNode, transposeNode, 0, 1); - addEdge(transposeNode, dummyNode2, 0, 0); - addEdge(dummyNode2, outputNode, 0, 0); + + // dummy nspc + inPlace LOOK_DOWN + const ov::Shape shape_tranpose{testShape[0], + testShape[3], + testShape[1], + testShape[2]}; // shape after transpose + for (int i = 0; i < num_consumers; i++) { + auto dummyConsumer = std::make_shared(shape_tranpose, + testPrec, + "multiply", + "DummyNode", + context, + LayoutType::nspc, + consumer_in_place_direction); + auto outputNode = std::make_shared(results[i], context); + addEdge(transposeNode, dummyConsumer, 0, 0); + addEdge(dummyConsumer, outputNode, 0, 0); + } for (auto &node : nodesSet) nodes.emplace_back(node); }; @@ -150,13 +147,43 @@ class MergeTransposeReorderIsOptimizedCPUTest : public ::testing::Test { ASSERT_EQ(1, actualCount); } -private: +protected: const ov::element::Type_t testPrec = ov::element::Type_t::f32; const ov::Shape testShape{1, 3, 8, 16}; std::unique_ptr m_graph; -}; // class MergeTransposeReorderIsOptimizedCPUTest +}; // class MergeTransposeReordersCPUTest + +// upstream node or downstream node is inPlaced thereby the inserted Reorder cannot be optimized. +TEST_F(MergeTransposeReordersCPUTest, smoke_Run_MergeTransposeReorders_isOptimized) { + CreateGraph(1, Edge::LOOK::LOOK_DOWN); + CheckTransposeCount(0); + CheckReorderOptimized(std::string("_fake"), false); // the fused node is of name "reshape_abcd_acdb_fake" +} + +// 3 non-inplace consumers share a single optimized reorder fused with Transpose +TEST_F(MergeTransposeReordersCPUTest, smoke_Run_MergeTransposeReorders_shared) { + CreateGraph(3, 0); + CheckTransposeCount(0); + CheckReorderOptimized(std::string("_fake"), true); +} + +// 3 inplace consumers cannot share reorders thus transpose is not fused with reorders +// there will be also 3 reorders between 3 dummyNode-consumers and 3 Result nodes +TEST_F(MergeTransposeReordersCPUTest, smoke_Run_MergeTransposeReorders_notFused) { + CreateGraph(3, Edge::LOOK::LOOK_DOWN); + CheckTransposeCount(1); + size_t reorderCount = 0; + for (auto& node : m_graph->GetNodes()) { + auto reorder_node = std::dynamic_pointer_cast(node); + if (reorder_node) { + // there should be no "_fake" reorders generated by merging transpose + reorder + ASSERT_EQ(node->getName().find("_fake"), std::string::npos); + reorderCount++; + } + } -TEST_F(MergeTransposeReorderIsOptimizedCPUTest, smoke_Run_MergeTransposeReorder_isOptimized) { - Validate(); + // 3 for layout conflist between [transpose => dummyConsumer] + // 3 for layout conflist between [dummyConsumer => result] + ASSERT_EQ(6, reorderCount); } From 7764042cea4c0ea2688a9595f63e5d1ad6420ffd Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Wed, 7 Feb 2024 16:53:54 +0400 Subject: [PATCH 37/55] [Core][IR FE] Support (de)serialization of string type Constant (#22578) **Details:** Support (de)serialization of string type Constant **Ticket:** 126525 --------- Signed-off-by: Kazantsev, Roman --- .../runtime/string_aligned_buffer.hpp | 55 +++++++- src/core/src/op/constant.cpp | 28 +++- src/core/src/pass/serialize.cpp | 50 +++++++ .../src/runtime/string_aligned_buffer.cpp | 130 ++++++++++++++++++ src/core/tests/models/ir/const_string.bin | Bin 0 -> 60 bytes src/core/tests/models/ir/const_string.xml | 26 ++++ .../tests/pass/serialization/serialize.cpp | 3 +- src/core/tests/visitors/op/constant.cpp | 12 +- src/core/tests/visitors/visitors.hpp | 56 ++++++++ src/frontends/ir/src/ir_deserializer.cpp | 38 ++++- .../common_test_utils/graph_comparator.hpp | 8 +- .../src/graph_comparator.cpp | 33 +++++ 12 files changed, 421 insertions(+), 18 deletions(-) create mode 100644 src/core/tests/models/ir/const_string.bin create mode 100644 src/core/tests/models/ir/const_string.xml diff --git a/src/core/dev_api/openvino/runtime/string_aligned_buffer.hpp b/src/core/dev_api/openvino/runtime/string_aligned_buffer.hpp index 689b0b680c7c2c..1133a8b5897c01 100644 --- a/src/core/dev_api/openvino/runtime/string_aligned_buffer.hpp +++ b/src/core/dev_api/openvino/runtime/string_aligned_buffer.hpp @@ -10,11 +10,16 @@ namespace ov { /// \brief StringAlignedBuffer class to store pointer to pre-allocated buffer with std::string objects /// it is responsible for deallocation of std::string objects that will be stored in the buffer -class StringAlignedBuffer : public ov::AlignedBuffer { +class OPENVINO_API StringAlignedBuffer : public ov::AlignedBuffer { public: StringAlignedBuffer() = default; + StringAlignedBuffer(size_t num_elements, size_t byte_size, size_t alignment, bool initialize); + virtual size_t get_num_elements() const { + return m_num_elements; + } + virtual ~StringAlignedBuffer(); private: @@ -25,4 +30,52 @@ class StringAlignedBuffer : public ov::AlignedBuffer { size_t m_num_elements; }; +/// \brief SharedStringAlignedBuffer class to store pointer to shared pre-allocated buffer with std::string objects +/// it must not be responsible for deallocation of std::string objects +class OPENVINO_API SharedStringAlignedBuffer : public ov::StringAlignedBuffer { +public: + SharedStringAlignedBuffer(char* ptr, size_t size); + + virtual ~SharedStringAlignedBuffer() { + m_allocated_buffer = nullptr; + m_aligned_buffer = nullptr; + m_byte_size = 0; + m_num_elements = 0; + } +}; + +template <> +class OPENVINO_API AttributeAdapter> + : public DirectValueAccessor> { +public: + AttributeAdapter(std::shared_ptr& value); + + OPENVINO_RTTI("AttributeAdapter"); + + static std::shared_ptr unpack_string_tensor(const char* packed_string_tensor_ptr, + size_t packed_string_tensor_size); + void get_header(std::shared_ptr& header, size_t& header_size); + void get_raw_string_by_index(const char*& raw_string_ptr, size_t& raw_string_size, size_t string_ind); + +protected: + std::shared_ptr m_header; + size_t m_header_size; +}; + +template <> +class OPENVINO_API AttributeAdapter> + : public DirectValueAccessor> { +public: + AttributeAdapter(std::shared_ptr& value); + + OPENVINO_RTTI("AttributeAdapter"); + + void get_header(std::shared_ptr& header, size_t& header_size); + void get_raw_string_by_index(const char*& raw_string_ptr, size_t& raw_string_size, size_t string_ind); + +protected: + std::shared_ptr m_header; + size_t m_header_size; +}; + } // namespace ov diff --git a/src/core/src/op/constant.cpp b/src/core/src/op/constant.cpp index 98cdfd9cc4104e..a32df53042b016 100644 --- a/src/core/src/op/constant.cpp +++ b/src/core/src/op/constant.cpp @@ -368,10 +368,32 @@ bool Constant::visit_attributes(AttributeVisitor& visitor) { const auto need_to_reallocate = (m_shape != prev_shape) || (prev_type != m_element_type); if (m_alloc_buffer_on_visit_attributes && need_to_reallocate) { - // Filling in a fresh constant - allocate_buffer(false); + if (m_element_type == ov::element::string) { + // string objects initialization is required + allocate_buffer(true); + } else { + // Filling in a fresh constant + allocate_buffer(false); + } + } + + if (m_element_type == ov::element::string) { + if (auto string_aligned_buffer = std::dynamic_pointer_cast(m_data)) { + visitor.on_attribute("value", string_aligned_buffer); + } else if (auto shared_string_tensor = std::dynamic_pointer_cast>(m_data)) { + auto shared_string_buffer = + std::make_shared(static_cast(shared_string_tensor->get_ptr()), + shared_string_tensor->size()); + visitor.on_attribute("value", shared_string_buffer); + } else { + // deserialization case when buffer does not exist yet + std::shared_ptr string_aligned_buffer; + visitor.on_attribute("value", string_aligned_buffer); + m_data = string_aligned_buffer; + } + } else { + visitor.on_attribute("value", m_data); } - visitor.on_attribute("value", m_data); update_identical_flags(false, false); return true; } diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index e3d133ee545d05..187dfe9691d977 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -22,6 +22,7 @@ #include "openvino/pass/constant_folding.hpp" #include "openvino/reference/convert.hpp" #include "openvino/runtime/aligned_buffer.hpp" +#include "openvino/runtime/string_aligned_buffer.hpp" #include "openvino/util/file_util.hpp" #include "pugixml.hpp" #include "transformations/hash.hpp" @@ -511,6 +512,55 @@ class XmlSerializer : public ov::AttributeVisitor { } else if (const auto& a = ov::as_type>>(&adapter)) { m_xml_node.append_attribute(name.c_str()).set_value(a->get()->get_info().variable_id.c_str()); + } else if (ov::is_type>>(&adapter) || + ov::is_type>>(&adapter)) { + if (name == "value" && translate_type_name(m_node_type_name) == "Const") { + auto a1 = ov::as_type>>(&adapter); + auto a2 = ov::as_type>>(&adapter); + size_t new_size = 0; + size_t inter_size = 0; + // write a header of packed string tensor + std::shared_ptr header_ptr = nullptr; + size_t header_size = 0; + if (a1) { + a1->get_header(header_ptr, header_size); + } else { + a2->get_header(header_ptr, header_size); + } + + int64_t offset = m_constant_write_handler.write(reinterpret_cast(header_ptr.get()), + header_size, + &inter_size, + m_compress_to_fp16, + m_output_element_type); + new_size += inter_size; + + // write raw strings part + size_t num_elements = 0; + if (a1) { + num_elements = a1->get()->get_num_elements(); + } else { + num_elements = a2->get()->get_num_elements(); + } + for (size_t ind = 0; ind < num_elements; ++ind) { + const char* raw_string_ptr; + size_t raw_string_size; + if (a1) { + a1->get_raw_string_by_index(raw_string_ptr, raw_string_size, ind); + } else { + a2->get_raw_string_by_index(raw_string_ptr, raw_string_size, ind); + } + + m_constant_write_handler.write(raw_string_ptr, + raw_string_size, + &inter_size, + m_compress_to_fp16, + m_output_element_type); + new_size += inter_size; + } + m_xml_node.append_attribute("offset").set_value(static_cast(offset)); + m_xml_node.append_attribute("size").set_value(static_cast(new_size)); + } } else if (const auto& a = ov::as_type>>(&adapter)) { if (name == "value" && translate_type_name(m_node_type_name) == "Const") { const int64_t size = a->get()->size(); diff --git a/src/core/src/runtime/string_aligned_buffer.cpp b/src/core/src/runtime/string_aligned_buffer.cpp index 1410dbd6dc6fbf..28c4c82d0b5ab2 100644 --- a/src/core/src/runtime/string_aligned_buffer.cpp +++ b/src/core/src/runtime/string_aligned_buffer.cpp @@ -4,8 +4,80 @@ #include "openvino/runtime/string_aligned_buffer.hpp" +#include + +#include "openvino/core/type/element_type.hpp" #include "openvino/runtime/aligned_buffer.hpp" +namespace { +void aux_unpack_string_tensor(const char* data, size_t size, std::shared_ptr& string_buffer) { + // unpack string tensor + // packed format is the following: + // , <1st string offset>,..., , <1st string raw format>,..., + // check the format of the input bitstream representing the string tensor + OPENVINO_ASSERT(size >= 4, "Incorrect packed string tensor format: no batch size in the packed string tensor"); + const int32_t* pindices = reinterpret_cast(data); + int32_t num_strings = pindices[0]; + OPENVINO_ASSERT(int32_t(size) >= 4 + 4 + 4 * num_strings, + "Incorrect packed string tensor format: the packed string tensor must contain first " + "string offset and end indices"); + const int32_t* begin_ids = pindices + 1; + const int32_t* end_ids = pindices + 2; + const char* symbols = reinterpret_cast(pindices + 2 + num_strings); + + // allocate StringAlignedBuffer to store unpacked strings in std::string objects + // SharedBuffer to read byte stream is not applicable because we need unpacked format for strings + string_buffer = std::make_shared( + num_strings, + ov::element::string.size() * num_strings, + 64, // host alignment used the same as in creation of buffer for Constant + true); + std::string* src_strings = static_cast(string_buffer->get_ptr()); + for (int32_t idx = 0; idx < num_strings; ++idx) { + src_strings[idx] = std::string(symbols + begin_ids[idx], symbols + end_ids[idx]); + } +} + +void aux_get_header(const std::shared_ptr& string_aligned_buffer_ptr, + std::shared_ptr& header, + size_t& header_size) { + OPENVINO_ASSERT(string_aligned_buffer_ptr, "StringAlignedBuffer pointer is nullptr"); + // packed format is the following: + // , <1st string offset>,..., , <1st string raw format>,..., + auto num_elements = string_aligned_buffer_ptr->get_num_elements(); + auto strings = reinterpret_cast(string_aligned_buffer_ptr->get_ptr()); + + // first run over all elements: calculate total memory required to hold all strings + header_size = sizeof(int32_t) * (1 + 1 + num_elements); + header = std::shared_ptr(new uint8_t[header_size], std::default_delete()); + + int32_t* pindices = reinterpret_cast(header.get()); + pindices[0] = int32_t(num_elements); + pindices[1] = 0; + pindices += 2; + size_t current_symbols_pos = 0; + + for (size_t ind = 0; ind < num_elements; ++ind) { + auto str = strings[ind]; + current_symbols_pos += str.size(); + *pindices = int32_t(current_symbols_pos); + ++pindices; + } +} + +void aux_get_raw_string_by_index(const std::shared_ptr& string_aligned_buffer_ptr, + const char*& raw_string_ptr, + size_t& raw_string_size, + size_t string_ind) { + OPENVINO_ASSERT(string_aligned_buffer_ptr, "StringAlignedBuffer pointer is nullptr"); + OPENVINO_ASSERT(string_ind < string_aligned_buffer_ptr->get_num_elements(), + "Incorrect packed string tensor format: no batch size in the packed string tensor"); + const std::string* strings = reinterpret_cast(string_aligned_buffer_ptr->get_ptr()); + raw_string_ptr = strings[string_ind].data(); + raw_string_size = strings[string_ind].size(); +} +} // namespace + namespace ov { StringAlignedBuffer::StringAlignedBuffer(size_t num_elements, size_t byte_size, size_t alignment, bool initialize) : AlignedBuffer(byte_size, alignment), @@ -29,4 +101,62 @@ StringAlignedBuffer::~StringAlignedBuffer() { } } +SharedStringAlignedBuffer::SharedStringAlignedBuffer(char* ptr, size_t size) { + m_allocated_buffer = ptr; + m_aligned_buffer = ptr; + m_byte_size = size; + m_num_elements = size / ov::element::string.size(); +} + +AttributeAdapter>::AttributeAdapter( + std::shared_ptr& value) + : DirectValueAccessor>(value), + m_header(nullptr), + m_header_size(0) {} + +std::shared_ptr +AttributeAdapter>::unpack_string_tensor(const char* packed_string_tensor_ptr, + size_t packed_string_tensor_size) { + std::shared_ptr string_aligned_buffer; + aux_unpack_string_tensor(packed_string_tensor_ptr, packed_string_tensor_size, string_aligned_buffer); + return string_aligned_buffer; +} + +void AttributeAdapter>::get_header(std::shared_ptr& header, + size_t& header_size) { + if (!m_header) { + aux_get_header(m_ref, m_header, m_header_size); + } + header = m_header; + header_size = m_header_size; +} + +void AttributeAdapter>::get_raw_string_by_index(const char*& raw_string_ptr, + size_t& raw_string_size, + size_t string_ind) { + aux_get_raw_string_by_index(m_ref, raw_string_ptr, raw_string_size, string_ind); +} + +AttributeAdapter>::AttributeAdapter( + std::shared_ptr& value) + : DirectValueAccessor>(value), + m_header(nullptr), + m_header_size(0) {} + +void AttributeAdapter>::get_header(std::shared_ptr& header, + size_t& header_size) { + if (!m_header) { + aux_get_header(m_ref, m_header, m_header_size); + } + header = m_header; + header_size = m_header_size; +} + +void AttributeAdapter>::get_raw_string_by_index( + const char*& raw_string_ptr, + size_t& raw_string_size, + size_t string_ind) { + aux_get_raw_string_by_index(m_ref, raw_string_ptr, raw_string_size, string_ind); +} + } // namespace ov diff --git a/src/core/tests/models/ir/const_string.bin b/src/core/tests/models/ir/const_string.bin new file mode 100644 index 0000000000000000000000000000000000000000..4cebb8d07996853d64cb49ce5c69032af58cb688 GIT binary patch literal 60 zcmZQ$fB9U$;Bx^PI+odN_lZ=T6rn}nm`Jb literal 0 HcmV?d00001 diff --git a/src/core/tests/models/ir/const_string.xml b/src/core/tests/models/ir/const_string.xml new file mode 100644 index 00000000000000..ab65a631ac6903 --- /dev/null +++ b/src/core/tests/models/ir/const_string.xml @@ -0,0 +1,26 @@ + + + + + + + + 2 + 3 + + + + + + + 2 + 3 + + + + + + + + + diff --git a/src/core/tests/pass/serialization/serialize.cpp b/src/core/tests/pass/serialization/serialize.cpp index d4531b1e029f98..d33a8701b45b0f 100644 --- a/src/core/tests/pass/serialization/serialize.cpp +++ b/src/core/tests/pass/serialization/serialize.cpp @@ -99,7 +99,8 @@ INSTANTIATE_TEST_SUITE_P( std::make_tuple("nms5_dynamism.xml", "nms5_dynamism.bin"), std::make_tuple("if_diff_case.xml", "if_diff_case.bin"), std::make_tuple("if_body_without_parameters.xml", "if_body_without_parameters.bin"), - std::make_tuple("string_parameter.xml", "string_parameter.bin"))); + std::make_tuple("string_parameter.xml", "string_parameter.bin"), + std::make_tuple("const_string.xml", "const_string.bin"))); #ifdef ENABLE_OV_ONNX_FRONTEND diff --git a/src/core/tests/visitors/op/constant.cpp b/src/core/tests/visitors/op/constant.cpp index 7022869d8ba395..beb5fe6cb95674 100644 --- a/src/core/tests/visitors/op/constant.cpp +++ b/src/core/tests/visitors/op/constant.cpp @@ -86,8 +86,7 @@ TEST(attributes, constant_op_from_host_tensor_identical_elements) { ASSERT_TRUE(g_k->get_all_data_elements_bitwise_identical()); } -// TODO: implement (de)serialization string constants -TEST(attributes, DISABLED_constant_op_string) { +TEST(attributes, constant_op_string) { vector data{"abc", "de fc qq", "", "123 abc", "0112 3 ", "&&&"}; auto k = make_shared(element::string, Shape{2, 3}, data); NodeBuilder builder(k); @@ -101,8 +100,7 @@ TEST(attributes, DISABLED_constant_op_string) { ASSERT_FALSE(g_k->get_all_data_elements_bitwise_identical()); } -// TODO: implement (de)serialization string constants -TEST(attributes, DISABLED_constant_op_identical_elements_string) { +TEST(attributes, constant_op_identical_elements_string) { vector data{"abc edfg", "abc edfg", "abc edfg", "abc edfg", "abc edfg", "abc edfg"}; auto k = make_shared(element::string, Shape{2, 3}, data); NodeBuilder builder(k); @@ -116,8 +114,7 @@ TEST(attributes, DISABLED_constant_op_identical_elements_string) { ASSERT_TRUE(g_k->get_all_data_elements_bitwise_identical()); } -// TODO: implement (de)serialization string constants -TEST(attributes, DISABLED_constant_op_from_host_tensor_different_elements_string) { +TEST(attributes, constant_op_from_host_tensor_different_elements_string) { vector data{"abc", "de fc qq", "", "123 abc", "0112 3 ", "&&&"}; auto tensor = ov::Tensor(element::string, Shape{2, 3}, &data[0]); auto k = make_shared(tensor); @@ -133,8 +130,7 @@ TEST(attributes, DISABLED_constant_op_from_host_tensor_different_elements_string ASSERT_FALSE(g_k->get_all_data_elements_bitwise_identical()); } -// TODO: implement (de)serialization string constants -TEST(attributes, DISABLED_constant_op_from_host_tensor_identical_elements_string) { +TEST(attributes, constant_op_from_host_tensor_identical_elements_string) { vector data{"abc edfg", "abc edfg", "abc edfg", "abc edfg", "abc edfg", "abc edfg"}; auto tensor = ov::Tensor(element::string, Shape{2, 3}, &data[0]); auto k = make_shared(tensor); diff --git a/src/core/tests/visitors/visitors.hpp b/src/core/tests/visitors/visitors.hpp index 7fb6d1999f66d3..6b47bcfdd7f55b 100644 --- a/src/core/tests/visitors/visitors.hpp +++ b/src/core/tests/visitors/visitors.hpp @@ -15,6 +15,7 @@ #include "openvino/op/util/variable.hpp" #include "openvino/opsets/opset.hpp" #include "openvino/runtime/aligned_buffer.hpp" +#include "openvino/runtime/string_aligned_buffer.hpp" #include "openvino/runtime/tensor.hpp" namespace ov { @@ -217,6 +218,19 @@ class DeserializeAttributeVisitor : public AttributeVisitor { if (auto a = ::ov::as_type<::ov::AttributeAdapter>>(&adapter)) { auto& data = m_values.get(name); std::memcpy(a->get()->get_ptr(), data.data(), a->get()->size()); + } else if (auto a = ov::as_type<::ov::AttributeAdapter>>(&adapter)) { + // get a data that is ov::Tensor of u8 type representing packed string tensor + auto& data = m_values.get(name); + auto src_string_aligned_buffer = + ov::AttributeAdapter>::unpack_string_tensor(data.data(), + data.get_size()); + std::string* src_strings = static_cast(src_string_aligned_buffer->get_ptr()); + auto dst_string_aligned = a->get(); + auto num_elements = dst_string_aligned->get_num_elements(); + auto dst_strings = static_cast(dst_string_aligned->get_ptr()); + for (size_t ind = 0; ind < num_elements; ++ind) { + dst_strings[ind] = src_strings[ind]; + } } else if (auto a = ov::as_type< ov::AttributeAdapter>>>( &adapter)) { @@ -306,6 +320,48 @@ class SerializeAttributeVisitor : public AttributeVisitor { ov::Tensor data(element::u8, Shape{a->get()->size()}); std::memcpy(data.data(), a->get()->get_ptr(), a->get()->size()); m_values.insert(name, data); + } else if (ov::is_type<::ov::AttributeAdapter>>(&adapter) || + ov::is_type<::ov::AttributeAdapter>>(&adapter)) { + auto a1 = ov::as_type<::ov::AttributeAdapter>>(&adapter); + auto a2 = ov::as_type<::ov::AttributeAdapter>>(&adapter); + // write packed string tensor into ov::Tensor of u8 type + std::vector packed_string_tensor; + std::shared_ptr header; + size_t header_size; + if (a1) { + a1->get_header(header, header_size); + } else { + a2->get_header(header, header_size); + } + for (size_t ind = 0; ind < header_size; ++ind) { + packed_string_tensor.push_back(header.get()[ind]); + } + + // write raw strings into packed format + size_t num_elements = 0; + if (a1) { + num_elements = a1->get()->get_num_elements(); + } else { + num_elements = a2->get()->get_num_elements(); + } + for (size_t string_ind = 0; string_ind < num_elements; ++string_ind) { + const char* string_ptr; + size_t string_size; + if (a1) { + a1->get_raw_string_by_index(string_ptr, string_size, string_ind); + } else { + a2->get_raw_string_by_index(string_ptr, string_size, string_ind); + } + + for (size_t ind = 0; ind < string_size; ++ind) { + packed_string_tensor.push_back(static_cast(string_ptr[ind])); + } + } + + size_t packed_string_tensor_size = packed_string_tensor.size(); + ov::Tensor data(element::u8, Shape{packed_string_tensor_size}); + std::memcpy(data.data(), packed_string_tensor.data(), packed_string_tensor_size); + m_values.insert(name, data); } else if (auto a = ov::as_type< ov::AttributeAdapter>>>( &adapter)) { diff --git a/src/frontends/ir/src/ir_deserializer.cpp b/src/frontends/ir/src/ir_deserializer.cpp index 5dfa4a755b7426..926d4c4c17f21d 100644 --- a/src/frontends/ir/src/ir_deserializer.cpp +++ b/src/frontends/ir/src/ir_deserializer.cpp @@ -21,6 +21,7 @@ #include "openvino/op/util/variable.hpp" #include "openvino/runtime/aligned_buffer.hpp" #include "openvino/runtime/shared_buffer.hpp" +#include "openvino/runtime/string_aligned_buffer.hpp" #include "openvino/util/xml_parse_utils.hpp" #include "rt_info_deserializer.hpp" #include "transformations/rt_info/attributes.hpp" @@ -351,11 +352,42 @@ void ov::XmlDeserializer::on_adapter(const std::string& name, ov::ValueAccessor< OPENVINO_THROW("Empty weights data in bin file or bin file cannot be found!"); if (m_weights->size() < offset + size) OPENVINO_THROW("Incorrect weights in bin file!"); - if (size < ((ov::shape_size(shape) * el_type.bitwidth() + 7) >> 3)) - OPENVINO_THROW("Attribute and shape size are inconsistent for ", type, " op!"); + char* data = m_weights->get_ptr() + offset; + + if (el_type == element::string) { + auto buffer = + ov::AttributeAdapter>::unpack_string_tensor(data, size); + a->set(buffer); + } else { + if (size < ((ov::shape_size(shape) * el_type.bitwidth() + 7) >> 3)) + OPENVINO_THROW("Attribute and shape size are inconsistent for ", type, " op!"); + auto buffer = + std::make_shared>>(data, size, m_weights); + a->set(buffer); + } + } + } else if (auto a = ov::as_type>>(&adapter)) { + pugi::xml_node dn = m_node.child("data"); + const auto& type = pugixml::get_str_attr(m_node, "type"); + if (name == "value" && type == "Const") { + std::vector shape; + std::string el_type_str; + + size_t offset = static_cast(pugixml::get_uint64_attr(dn, "offset")); + size_t size = static_cast(pugixml::get_uint64_attr(dn, "size")); + if (!getStrAttribute(dn, "element_type", el_type_str)) + return; + if (!getParameters(dn, "shape", shape)) + return; + + if (!m_weights) + OPENVINO_THROW("Empty weights data in bin file or bin file cannot be found!"); + if (m_weights->size() < offset + size) + OPENVINO_THROW("Incorrect weights in bin file!"); char* data = m_weights->get_ptr() + offset; - auto buffer = std::make_shared>>(data, size, m_weights); + auto buffer = + ov::AttributeAdapter>::unpack_string_tensor(data, size); a->set(buffer); } } else if (auto a = ov::as_type>(&adapter)) { diff --git a/src/tests/test_utils/common_test_utils/include/common_test_utils/graph_comparator.hpp b/src/tests/test_utils/common_test_utils/include/common_test_utils/graph_comparator.hpp index f4d62900dec31b..14aff0703fab29 100644 --- a/src/tests/test_utils/common_test_utils/include/common_test_utils/graph_comparator.hpp +++ b/src/tests/test_utils/common_test_utils/include/common_test_utils/graph_comparator.hpp @@ -15,6 +15,7 @@ #include "openvino/op/util/framework_node.hpp" #include "openvino/op/util/sub_graph_base.hpp" #include "openvino/runtime/aligned_buffer.hpp" +#include "openvino/runtime/string_aligned_buffer.hpp" class FunctionsComparator { public: @@ -470,7 +471,8 @@ class Storage : private AttributeStorage, private AttributeStorage, private AttributeStorage>, private AttributeStorage, - private AttributeStorage { + private AttributeStorage, + private AttributeStorage> { public: template const AttributeStorage& storage() const { @@ -504,7 +506,8 @@ class Storage : private AttributeStorage, storage().get_attributes_number() + storage().get_attributes_number() + storage>().get_attributes_number() + - storage().get_attributes_number() + storage().get_attributes_number(); + storage().get_attributes_number() + storage().get_attributes_number() + + storage>().get_attributes_number(); } }; @@ -966,6 +969,7 @@ class ReadAndCompareAttributes : public ov::AttributeVisitor { void verify(const std::string& name, const AttrValue& attr_value); void verify_mem_buf(const std::string& name, const std::shared_ptr& buffer); + void verify_string_aligned_buffer(const std::string& name, const std::shared_ptr& buffer); using ModelAccessor = ov::ValueAccessor>; diff --git a/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp b/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp index b5e4c2d116b528..5c57b171dc5fda 100644 --- a/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp +++ b/src/tests/test_utils/common_test_utils/src/graph_comparator.cpp @@ -12,6 +12,7 @@ #include "openvino/op/tensor_iterator.hpp" #include "openvino/op/util/op_types.hpp" #include "openvino/op/util/sub_graph_base.hpp" +#include "openvino/runtime/string_aligned_buffer.hpp" #include "ov_models/utils/ov_helpers.hpp" #include "precomp.hpp" @@ -916,6 +917,9 @@ void ReadAndStoreAttributes::on_adapter(const std::string& name, ov::ValueAccess insert(name, shape_ptr->get()); } else if (auto dim_ptr = ov::as_type>(&adapter)) { insert(name, dim_ptr->get()); + } else if (auto string_aligned_buffer = + ov::as_type>>(&adapter)) { + insert(name, string_aligned_buffer->get()); } else { m_read_result += "store attr [ ERR ]: " + name + " [drop `void` comparison which is '" + adapter.get_type_info().name + "']"; @@ -958,6 +962,32 @@ void ReadAndCompareAttributes::verify_mem_buf(const std::string& name, } } +void ReadAndCompareAttributes::verify_string_aligned_buffer(const std::string& name, + const std::shared_ptr& buffer) { + if (should_return()) { + return; + } + m_visited_attributes.insert(name); + const auto ref_value = *(m_attr_ref.get>(name)); + if (!ref_value) { + m_cmp_result += "missing attribute name: '" + name + "'"; + return; + } + auto num_elements = buffer->get_num_elements(); + if (num_elements != buffer->get_num_elements()) { + m_cmp_result += "number of string elements mismatch"; + return; + } + std::string* ref_strings = static_cast(ref_value->get_ptr()); + std::string* cmp_strings = static_cast(buffer->get_ptr()); + for (size_t ind = 0; ind < num_elements; ++ind) { + if (ref_strings[ind].compare(cmp_strings[ind])) { + m_cmp_result += "string elements mismatch"; + return; + } + } +} + void ReadAndCompareAttributes::verify_function(const std::string& name, ModelAccessor& adapter) { if (should_return()) { return; @@ -994,6 +1024,9 @@ void ReadAndCompareAttributes::verify_others(const std::string& name, ov::ValueA verify(name, shape_ptr->get()); } else if (auto dim_ptr = ov::as_type>(&adapter)) { verify(name, dim_ptr->get()); + } else if (auto string_aligned_buffer_ptr = + ov::as_type>>(&adapter)) { + verify_string_aligned_buffer(name, string_aligned_buffer_ptr->get()); } else { m_cmp_result += "compare attr [ ERR ]: " + name + " [drop `void` comparison which is '" + adapter.get_type_info().name + "']"; From 52ee006f9bc59a764badcffd4f3b085de24e8210 Mon Sep 17 00:00:00 2001 From: Anastasiia Pnevskaia Date: Wed, 7 Feb 2024 13:58:17 +0100 Subject: [PATCH 38/55] [PyTorch FE] Common prefix in PyTorch exceptions. (#22655) ### Details: - Added a new macro with PyTorch prefix for PyTorch exceptions. - Added sending of error information telemetry from PyTorch. ### Tickets: - 127906 --- src/frontends/pytorch/src/op/add.cpp | 2 +- src/frontends/pytorch/src/op/arange.cpp | 8 +-- src/frontends/pytorch/src/op/as_strided.cpp | 8 +-- src/frontends/pytorch/src/op/as_tensor.cpp | 2 +- src/frontends/pytorch/src/op/avg_poolnd.cpp | 4 +- src/frontends/pytorch/src/op/batch_norm.cpp | 4 +- src/frontends/pytorch/src/op/cat.cpp | 4 +- .../pytorch/src/op/conv_transposend.cpp | 2 +- src/frontends/pytorch/src/op/elu.cpp | 8 +-- .../pytorch/src/op/embedding_bag.cpp | 4 +- src/frontends/pytorch/src/op/expand.cpp | 8 +-- src/frontends/pytorch/src/op/eye.cpp | 2 +- src/frontends/pytorch/src/op/full.cpp | 2 +- src/frontends/pytorch/src/op/gelu.cpp | 2 +- src/frontends/pytorch/src/op/get_attr.cpp | 6 +-- src/frontends/pytorch/src/op/getitem.cpp | 26 +++++----- src/frontends/pytorch/src/op/grid_sampler.cpp | 8 +-- src/frontends/pytorch/src/op/if.cpp | 52 +++++++++---------- src/frontends/pytorch/src/op/im2col.cpp | 8 +-- src/frontends/pytorch/src/op/index.cpp | 4 +- src/frontends/pytorch/src/op/layer_norm.cpp | 6 +-- src/frontends/pytorch/src/op/linspace.cpp | 2 +- .../pytorch/src/op/list_construct.cpp | 2 +- src/frontends/pytorch/src/op/list_unpack.cpp | 2 +- src/frontends/pytorch/src/op/loop.cpp | 12 ++--- src/frontends/pytorch/src/op/lstm.cpp | 20 +++---- src/frontends/pytorch/src/op/multinomial.cpp | 4 +- .../src/op/native_multi_head_attention.cpp | 2 +- src/frontends/pytorch/src/op/norm.cpp | 15 +++--- src/frontends/pytorch/src/op/pad.cpp | 8 +-- src/frontends/pytorch/src/op/pythonop.cpp | 7 ++- .../pytorch/src/op/quantized_convnd.cpp | 14 ++--- .../pytorch/src/op/quantized_linear.cpp | 14 ++--- src/frontends/pytorch/src/op/rand.cpp | 34 ++++++------ src/frontends/pytorch/src/op/scatter.cpp | 6 +-- src/frontends/pytorch/src/op/slice.cpp | 2 +- src/frontends/pytorch/src/op/to.cpp | 2 +- src/frontends/pytorch/src/op/tuple_index.cpp | 4 +- src/frontends/pytorch/src/op/upsample.cpp | 4 +- src/frontends/pytorch/src/op/where.cpp | 2 +- .../pytorch/src/translate_session.cpp | 7 +++ src/frontends/pytorch/src/utils.cpp | 4 ++ src/frontends/pytorch/src/utils.hpp | 15 ++++++ .../telemetry/test_pytorch_telemetry.py | 47 +++++++++++++++++ 44 files changed, 235 insertions(+), 164 deletions(-) create mode 100644 tests/layer_tests/ovc_python_api_tests/telemetry/test_pytorch_telemetry.py diff --git a/src/frontends/pytorch/src/op/add.cpp b/src/frontends/pytorch/src/op/add.cpp index ab2933bd6f7910..8ea9782838e9ff 100644 --- a/src/frontends/pytorch/src/op/add.cpp +++ b/src/frontends/pytorch/src/op/add.cpp @@ -26,7 +26,7 @@ OutputVector translate_add_common(const NodeContext& context, bool inplace) { if (dtype0.is() && dtype1.is()) { // aten::add.t(t[] a, t[] b) -> t[] // Case when two lists gets concatenated - FRONT_END_OP_CONVERSION_CHECK(false, "aten::add is used for concatenation of lists, not possible to convert"); + PYTORCH_OP_CONVERSION_CHECK(false, "aten::add is used for concatenation of lists, not possible to convert"); } if (inplace) { if (lhs.get_element_type().is_dynamic() || lhs.get_element_type() != rhs.get_element_type()) diff --git a/src/frontends/pytorch/src/op/arange.cpp b/src/frontends/pytorch/src/op/arange.cpp index 8a6f05b9ba689d..f7b8b409db4ef7 100644 --- a/src/frontends/pytorch/src/op/arange.cpp +++ b/src/frontends/pytorch/src/op/arange.cpp @@ -60,7 +60,7 @@ OutputVector translate_arange(const NodeContext& context) { dtype_port = 3; dtype_applied = true; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Not expected number of inputs for ", context.get_op_type()); + PYTORCH_OP_CONVERSION_CHECK(false, "Not expected number of inputs for ", context.get_op_type()); } if (dtype_port >= 0 && !context.input_is_none(dtype_port)) { if (std::dynamic_pointer_cast( @@ -72,7 +72,7 @@ OutputVector translate_arange(const NodeContext& context) { out_tensor = fw_node->input_value(0); dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto range = context.mark_node(std::make_shared(start, end, step, dtype)); @@ -130,7 +130,7 @@ OutputVector translate_arange_fx(const NodeContext& context) { dtype_port = 3; dtype_applied = true; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Not expected number of inputs for ", context.get_op_type()); + PYTORCH_OP_CONVERSION_CHECK(false, "Not expected number of inputs for ", context.get_op_type()); } if (dtype_port >= 0 && !context.input_is_none(dtype_port)) { if (std::dynamic_pointer_cast( @@ -142,7 +142,7 @@ OutputVector translate_arange_fx(const NodeContext& context) { out_tensor = fw_node->input_value(0); dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto r_end = context.mark_node(std::make_shared(end, dtype)); diff --git a/src/frontends/pytorch/src/op/as_strided.cpp b/src/frontends/pytorch/src/op/as_strided.cpp index 5d1dfe38bdaa17..6bcaed8bfd49e3 100644 --- a/src/frontends/pytorch/src/op/as_strided.cpp +++ b/src/frontends/pytorch/src/op/as_strided.cpp @@ -32,8 +32,8 @@ OutputVector translate_as_strided(const NodeContext& context) { auto const_0 = context.mark_node(v0::Constant::create(element::i32, Shape{}, {0})); auto const_neg_1 = context.mark_node(v0::Constant::create(element::i32, Shape{1}, {-1})); auto input_strides = decoder->get_input_strides(0); - FRONT_END_OP_CONVERSION_CHECK(input_strides.size() != 0, - "aten::as_strided: Couldn't retrive input stride information from torchscript."); + PYTORCH_OP_CONVERSION_CHECK(input_strides.size() != 0, + "aten::as_strided: Couldn't retrive input stride information from torchscript."); std::vector idxs(input_strides.size()); iota(idxs.begin(), idxs.end(), 0); @@ -77,8 +77,8 @@ OutputVector translate_as_strided(const NodeContext& context) { if (!context.input_is_none(3)) { offset = context.get_input(3); } - FRONT_END_OP_CONVERSION_CHECK(sizes.size() == strides.size(), - "aten::as_strided: Vector for strides and sizes need to have equal length."); + PYTORCH_OP_CONVERSION_CHECK(sizes.size() == strides.size(), + "aten::as_strided: Vector for strides and sizes need to have equal length."); auto strides_size = strides.size() - 1; auto i = 0; auto strides_length_const = context.mark_node(v0::Constant::create(element::i32, Shape{1}, {strides.size()})); diff --git a/src/frontends/pytorch/src/op/as_tensor.cpp b/src/frontends/pytorch/src/op/as_tensor.cpp index 93c4a647fb3ce7..6a97af6671303f 100644 --- a/src/frontends/pytorch/src/op/as_tensor.cpp +++ b/src/frontends/pytorch/src/op/as_tensor.cpp @@ -55,7 +55,7 @@ OutputVector translate_as_tensor(const NodeContext& context) { return {context.mark_node(std::make_shared(OutputVector(list_elems.begin(), list_elems.end()), 0))}; } else { // Input is already a tensor - FRONT_END_OP_CONVERSION_CHECK(list_elems.size() == 1, "Input must be single tensor."); + PYTORCH_OP_CONVERSION_CHECK(list_elems.size() == 1, "Input must be single tensor."); return {list_elems[0]}; } }; diff --git a/src/frontends/pytorch/src/op/avg_poolnd.cpp b/src/frontends/pytorch/src/op/avg_poolnd.cpp index e497256f1c6205..4a90db23a67c1e 100644 --- a/src/frontends/pytorch/src/op/avg_poolnd.cpp +++ b/src/frontends/pytorch/src/op/avg_poolnd.cpp @@ -45,8 +45,8 @@ OutputVector translate_avg_poolnd(const NodeContext& context) { if (!(context.input_is_none(5))) { count_include_pad = context.const_input(5); } - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(6), - "Translation for aten::avg_pool2d do not support divisor_override input."); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(6), + "Translation for aten::avg_pool2d do not support divisor_override input."); // Although ov::AvgPool provides exclude_pad=false, // The corner case of Average Pooling with ceil_mode on // PyTorch allows sliding window go off bound, which leads to this accommodation. diff --git a/src/frontends/pytorch/src/op/batch_norm.cpp b/src/frontends/pytorch/src/op/batch_norm.cpp index 5d10222eceb890..092e95ff38a290 100644 --- a/src/frontends/pytorch/src/op/batch_norm.cpp +++ b/src/frontends/pytorch/src/op/batch_norm.cpp @@ -139,8 +139,8 @@ OutputVector translate_batch_norm_legit_no_stats_fx(const NodeContext& context) bias = context.get_input(2); } auto training = context.const_input(3); - FRONT_END_OP_CONVERSION_CHECK(training, - "aten._native_batch_norm_legit.no_stats can only be used when training=True."); + PYTORCH_OP_CONVERSION_CHECK(training, + "aten._native_batch_norm_legit.no_stats can only be used when training=True."); // index 4 momentum is used during training only auto eps = context.const_input(5); auto output = make_batch_norm(context, context.get_input(0), weight, bias, {}, {}, eps); diff --git a/src/frontends/pytorch/src/op/cat.cpp b/src/frontends/pytorch/src/op/cat.cpp index 9476979a118bd7..5b873193157cda 100644 --- a/src/frontends/pytorch/src/op/cat.cpp +++ b/src/frontends/pytorch/src/op/cat.cpp @@ -35,7 +35,7 @@ OutputVector translate_cat_common(const NodeContext& context, return {context.mark_node(fw_node)}; } auto first_node = list_elems.front().get_node_shared_ptr(); - FRONT_END_OP_CONVERSION_CHECK( + PYTORCH_OP_CONVERSION_CHECK( list_elems.size() > 1 || !ov::as_type_ptr(first_node), "::cat is located inside body while inputs are located outside of the body. " "This case is not supported."); @@ -86,7 +86,7 @@ OutputVector translate_quantized_cat(const NodeContext& context) { num_inputs_check(context, 4, 4); const auto&& list_elems = get_list_as_outputs(context.get_input(0)); auto axis = context.const_input(1); - FRONT_END_OP_CONVERSION_CHECK(!list_elems.empty(), "Couldn't find quantized input for quantized::cat operation."); + PYTORCH_OP_CONVERSION_CHECK(!list_elems.empty(), "Couldn't find quantized input for quantized::cat operation."); return {quantize(context, translate_cat_common(context, list_elems, axis, false)[0], context.get_input(2), diff --git a/src/frontends/pytorch/src/op/conv_transposend.cpp b/src/frontends/pytorch/src/op/conv_transposend.cpp index 1f281f90486fad..079df5703e08ca 100644 --- a/src/frontends/pytorch/src/op/conv_transposend.cpp +++ b/src/frontends/pytorch/src/op/conv_transposend.cpp @@ -24,7 +24,7 @@ OutputVector translate_conv_transposend(const NodeContext& context) { auto pad_type = ov::op::PadType::EXPLICIT; auto dilations = context.const_input(7); auto groups = context.const_input(6); - FRONT_END_OP_CONVERSION_CHECK(groups > 0, "Number of groups for convolution_transpose should be >= 1"); + PYTORCH_OP_CONVERSION_CHECK(groups > 0, "Number of groups for convolution_transpose should be >= 1"); std::shared_ptr conv; if (groups == 1) { diff --git a/src/frontends/pytorch/src/op/elu.cpp b/src/frontends/pytorch/src/op/elu.cpp index 4f96371ee83ebd..fee33345436e1c 100644 --- a/src/frontends/pytorch/src/op/elu.cpp +++ b/src/frontends/pytorch/src/op/elu.cpp @@ -18,10 +18,10 @@ OutputVector translate_elu(const NodeContext& context) { auto x = context.get_input(0); auto alpha = context.const_input(1); // TODO: Figure out what scale and input_scale do - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == 1, - "Unexpected value of scale input for elu operation"); - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(3) || context.const_input(3) == 1, - "Unexpected value of input_scale input for elu operation"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == 1, + "Unexpected value of scale input for elu operation"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(3) || context.const_input(3) == 1, + "Unexpected value of input_scale input for elu operation"); return {context.mark_node(std::make_shared(x, alpha))}; }; diff --git a/src/frontends/pytorch/src/op/embedding_bag.cpp b/src/frontends/pytorch/src/op/embedding_bag.cpp index ee1cba3d1cff08..4560ea2a09db4f 100644 --- a/src/frontends/pytorch/src/op/embedding_bag.cpp +++ b/src/frontends/pytorch/src/op/embedding_bag.cpp @@ -21,7 +21,7 @@ OutputVector translate_embedding_bag(const NodeContext& context) { num_inputs_check(context, 9, 9); // we have only EmbeddingBagSum case support, check it before translation auto mode = context.const_input(4); - FRONT_END_OP_CONVERSION_CHECK(mode == 0, "Only sum mode supported for aten::embedding_bag translation"); + PYTORCH_OP_CONVERSION_CHECK(mode == 0, "Only sum mode supported for aten::embedding_bag translation"); auto weight = context.get_input(0); auto indices = context.get_input(1); indices = context.mark_node(std::make_shared(indices, element::i32)); @@ -44,7 +44,7 @@ OutputVector translate_embedding_bag(const NodeContext& context) { auto offsets = context.get_input(2); offsets = context.mark_node(std::make_shared(offsets, element::i32)); auto include_last_offset = context.const_input(7); - FRONT_END_OP_CONVERSION_CHECK(!include_last_offset, "Inclusion last offset is not supported"); + PYTORCH_OP_CONVERSION_CHECK(!include_last_offset, "Inclusion last offset is not supported"); // no per_sample_wights if (context.input_is_none(6)) { result = context.mark_node(std::make_shared(weight, indices, offsets)); diff --git a/src/frontends/pytorch/src/op/expand.cpp b/src/frontends/pytorch/src/op/expand.cpp index 7fcb7a898a48bc..2966436355a757 100644 --- a/src/frontends/pytorch/src/op/expand.cpp +++ b/src/frontends/pytorch/src/op/expand.cpp @@ -28,8 +28,8 @@ OutputVector translate_expand(const NodeContext& context) { auto x = context.get_input(0); auto sizes = context.get_input(1); // TODO: figure out what implicit means - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == false, - "Unexpected value of implicit for expand operation"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == false, + "Unexpected value of implicit for expand operation"); return base_expand(context, x, sizes); }; @@ -54,8 +54,8 @@ OutputVector translate_expand_fx(const NodeContext& context) { } auto sizes = context.get_input(1); // TODO: figure out what implicit means - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == false, - "Unexpected value of implicit for expand operation"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(2) || context.const_input(2) == false, + "Unexpected value of implicit for expand operation"); return base_expand(context, x, sizes); }; diff --git a/src/frontends/pytorch/src/op/eye.cpp b/src/frontends/pytorch/src/op/eye.cpp index 9b7f7ef8c3bc29..2a4be73a6ef500 100644 --- a/src/frontends/pytorch/src/op/eye.cpp +++ b/src/frontends/pytorch/src/op/eye.cpp @@ -36,7 +36,7 @@ OutputVector translate_eye(const NodeContext& context) { y = context.mark_node(std::make_shared(y, element::i32)); dtype_id = 2; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported number of inputs: ", num_inputs, " for aten::eye"); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported number of inputs: ", num_inputs, " for aten::eye"); } if (!context.input_is_none(dtype_id)) { dtype = convert_dtype(context.const_input(dtype_id)); diff --git a/src/frontends/pytorch/src/op/full.cpp b/src/frontends/pytorch/src/op/full.cpp index defcbab7095089..b87ec7867c96aa 100644 --- a/src/frontends/pytorch/src/op/full.cpp +++ b/src/frontends/pytorch/src/op/full.cpp @@ -264,7 +264,7 @@ OutputVector translate_fill_diagonal(const NodeContext& context) { auto const_zero_s = context.mark_node(v0::Constant::create(element::i32, Shape{}, {0})); auto const_neg_one = context.mark_node(v0::Constant::create(element::i32, Shape{1}, {-1})); if (input_rank.is_dynamic() || input_rank.get_length() < 2) { - FRONT_END_OP_CONVERSION_CHECK(false, "aten::fill_diagonal_ required tensor with static rank >= 2 "); + PYTORCH_OP_CONVERSION_CHECK(false, "aten::fill_diagonal_ required tensor with static rank >= 2 "); } auto flatten_input = context.mark_node(std::make_shared(input_tensor, const_neg_one, false)); auto wrap = context.const_input(2); diff --git a/src/frontends/pytorch/src/op/gelu.cpp b/src/frontends/pytorch/src/op/gelu.cpp index 64afb511b31dc3..ac38e41b93a0ed 100644 --- a/src/frontends/pytorch/src/op/gelu.cpp +++ b/src/frontends/pytorch/src/op/gelu.cpp @@ -21,7 +21,7 @@ OutputVector translate_gelu_common(const NodeContext& context, const std::string if (approximate == "tanh") { return {context.mark_node(std::make_shared(x, ov::op::GeluApproximationMode::TANH))}; } - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported approximate for Gelu: ", approximate); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported approximate for Gelu: ", approximate); }; } // namespace diff --git a/src/frontends/pytorch/src/op/get_attr.cpp b/src/frontends/pytorch/src/op/get_attr.cpp index 58bc63e60a700e..c28da30cf17ef3 100644 --- a/src/frontends/pytorch/src/op/get_attr.cpp +++ b/src/frontends/pytorch/src/op/get_attr.cpp @@ -13,9 +13,9 @@ namespace op { OutputVector translate_get_attr(const NodeContext& context) { auto res = context.get_decoder()->try_decode_get_attr(); - FRONT_END_OP_CONVERSION_CHECK(res.size() > 0, - "Failed to obtain data from GetAttr with output tensor name: ", - context.get_decoder()->get_output_debug_name(0)); + PYTORCH_OP_CONVERSION_CHECK(res.size() > 0, + "Failed to obtain data from GetAttr with output tensor name: ", + context.get_decoder()->get_output_debug_name(0)); if (res.size() == 1) { auto node = res[0].get_node(); if (node->get_friendly_name() != node->get_name()) { diff --git a/src/frontends/pytorch/src/op/getitem.cpp b/src/frontends/pytorch/src/op/getitem.cpp index 58d3639cc8aa92..1aab3e765d237f 100644 --- a/src/frontends/pytorch/src/op/getitem.cpp +++ b/src/frontends/pytorch/src/op/getitem.cpp @@ -20,29 +20,29 @@ OutputVector translate_getitem(const NodeContext& context) { num_inputs_check(context, 2, 2); auto input = context.get_input(0); const auto idx_type = context.get_input_type(1); - FRONT_END_OP_CONVERSION_CHECK(!idx_type.is(), - "String index in aten::__getitem__ means dict input, this is not supported."); + PYTORCH_OP_CONVERSION_CHECK(!idx_type.is(), + "String index in aten::__getitem__ means dict input, this is not supported."); if (ov::as_type_ptr(input.get_node_shared_ptr())) { - FRONT_END_OP_CONVERSION_CHECK(!cast_fw_node(input.get_node_shared_ptr(), "aten::split"), - "special case for aten::__getitem__"); - FRONT_END_OP_CONVERSION_CHECK(!cast_fw_node(input.get_node_shared_ptr(), "aten::chunk"), - "special case for aten::__getitem__"); + PYTORCH_OP_CONVERSION_CHECK(!cast_fw_node(input.get_node_shared_ptr(), "aten::split"), + "special case for aten::__getitem__"); + PYTORCH_OP_CONVERSION_CHECK(!cast_fw_node(input.get_node_shared_ptr(), "aten::chunk"), + "special case for aten::__getitem__"); const auto&& list_elems = get_list_as_outputs(input); auto getitem_idx = context.const_input(1); if (getitem_idx < 0) { getitem_idx += list_elems.size(); } - FRONT_END_OP_CONVERSION_CHECK(getitem_idx < static_cast(list_elems.size()), - "Index: ", - getitem_idx, - " is out of bounds of input list of len: ", - list_elems.size()); + PYTORCH_OP_CONVERSION_CHECK(getitem_idx < static_cast(list_elems.size()), + "Index: ", + getitem_idx, + " is out of bounds of input list of len: ", + list_elems.size()); return {list_elems.at(getitem_idx)}; } if (ov::as_type_ptr(input.get_node_shared_ptr())) { const auto& outside_input_node = context.get_input_from_visible_context(0).get_node_shared_ptr(); - FRONT_END_OP_CONVERSION_CHECK(!ov::as_type_ptr(outside_input_node), - "Unsupported case: aten::__getitem__ is inside the body, and input is Loop."); + PYTORCH_OP_CONVERSION_CHECK(!ov::as_type_ptr(outside_input_node), + "Unsupported case: aten::__getitem__ is inside the body, and input is Loop."); } auto getitem_idx = context.get_input(1); auto zero = context.mark_node(v0::Constant::create(element::i32, Shape{}, {0})); diff --git a/src/frontends/pytorch/src/op/grid_sampler.cpp b/src/frontends/pytorch/src/op/grid_sampler.cpp index 8c603813d888f7..d9b268d7aa4b3e 100644 --- a/src/frontends/pytorch/src/op/grid_sampler.cpp +++ b/src/frontends/pytorch/src/op/grid_sampler.cpp @@ -28,12 +28,12 @@ OutputVector translate_grid_sampler(const NodeContext& context) { {1, v9::GridSample::PaddingMode::BORDER}, {2, v9::GridSample::PaddingMode::REFLECTION}}; auto mode = context.const_input(2); - FRONT_END_OP_CONVERSION_CHECK(grid_sample_mode_map.count(mode), "Unknown interpolation mode: ", mode); + PYTORCH_OP_CONVERSION_CHECK(grid_sample_mode_map.count(mode), "Unknown interpolation mode: ", mode); attrs.mode = grid_sample_mode_map.at(mode); auto padding_mode = context.const_input(3); - FRONT_END_OP_CONVERSION_CHECK(grid_sample_padding_mode_map.count(padding_mode), - "Unknown padding mode: ", - padding_mode); + PYTORCH_OP_CONVERSION_CHECK(grid_sample_padding_mode_map.count(padding_mode), + "Unknown padding mode: ", + padding_mode); attrs.padding_mode = grid_sample_padding_mode_map.at(padding_mode); bool align_corners = false; if (!context.input_is_none(4)) { diff --git a/src/frontends/pytorch/src/op/if.cpp b/src/frontends/pytorch/src/op/if.cpp index 15d1c5e24c1873..5b5e07ab1bb7da 100644 --- a/src/frontends/pytorch/src/op/if.cpp +++ b/src/frontends/pytorch/src/op/if.cpp @@ -51,7 +51,7 @@ OutputVector translate_if(const NodeContext& context) { auto if_node = std::make_shared(context.get_input(0)); context.mark_node(if_node); auto decoder = context.get_decoder(); - FRONT_END_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 2, "If must have 2 subgraphs."); + PYTORCH_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 2, "If must have 2 subgraphs."); auto then_decoder = decoder->get_subgraph_decoder(0); auto then_body = context.convert_subgraph(0); @@ -72,13 +72,13 @@ OutputVector translate_if(const NodeContext& context) { auto session = context.get_session(); for (const auto& param : then_body->get_parameters()) { auto input_idx = session->decode_tensor_name(param->output(0)); - FRONT_END_OP_CONVERSION_CHECK(inputs_map.count(input_idx) == 0, - "More than one then_body input with same tensor name: ", - input_idx, - "; existing: ", - inputs_map.at(input_idx)[0], - " adding: ", - param); + PYTORCH_OP_CONVERSION_CHECK(inputs_map.count(input_idx) == 0, + "More than one then_body input with same tensor name: ", + input_idx, + "; existing: ", + inputs_map.at(input_idx)[0], + " adding: ", + param); inputs_map[input_idx] = {param, nullptr}; } for (const auto& param : else_body->get_parameters()) { @@ -93,8 +93,8 @@ OutputVector translate_if(const NodeContext& context) { const auto num_outs = context.get_output_size(); const auto then_results = then_body->get_results(); const auto else_results = else_body->get_results(); - FRONT_END_OP_CONVERSION_CHECK(then_results.size() >= num_outs && else_results.size() >= num_outs, - "Else or then body have less outputs than prim::If requires."); + PYTORCH_OP_CONVERSION_CHECK(then_results.size() >= num_outs && else_results.size() >= num_outs, + "Else or then body have less outputs than prim::If requires."); for (size_t i = 0; i < num_outs; i++) { align_result_types(context, then_results[i], else_results[i]); res.push_back(if_node->set_output(then_results[i], else_results[i])); @@ -106,26 +106,26 @@ OutputVector translate_if(const NodeContext& context) { for (size_t i = num_outs; i < then_results.size(); i++) { const auto result = then_results[i]; auto output_idx = session->decode_tensor_name(result->input(0).get_source_output()); - FRONT_END_OP_CONVERSION_CHECK(extra_then_body_results.count(output_idx) == 0, - "More than one then_body output with same tensor name: ", - output_idx, - "; existing: ", - extra_then_body_results.at(output_idx), - " adding: ", - result); + PYTORCH_OP_CONVERSION_CHECK(extra_then_body_results.count(output_idx) == 0, + "More than one then_body output with same tensor name: ", + output_idx, + "; existing: ", + extra_then_body_results.at(output_idx), + " adding: ", + result); extra_then_body_results[output_idx] = result; extra_output_idxs.insert(output_idx); } for (size_t i = num_outs; i < else_results.size(); i++) { const auto result = else_results[i]; auto output_idx = session->decode_tensor_name(result->input(0).get_source_output()); - FRONT_END_OP_CONVERSION_CHECK(extra_else_body_results.count(output_idx) == 0, - "More than one else_body output with same tensor name: ", - output_idx, - "; existing: ", - extra_else_body_results.at(output_idx), - " adding: ", - result); + PYTORCH_OP_CONVERSION_CHECK(extra_else_body_results.count(output_idx) == 0, + "More than one else_body output with same tensor name: ", + output_idx, + "; existing: ", + extra_else_body_results.at(output_idx), + " adding: ", + result); extra_else_body_results[output_idx] = result; extra_output_idxs.insert(output_idx); } @@ -140,7 +140,7 @@ OutputVector translate_if(const NodeContext& context) { then_body->add_parameters({new_parameter}); then_body->add_results({new_result}); then_body->validate_nodes_and_infer_types(); - FRONT_END_OP_CONVERSION_CHECK(inputs_map.count(output_idx), "Input must exist in else body: ", output_idx); + PYTORCH_OP_CONVERSION_CHECK(inputs_map.count(output_idx), "Input must exist in else body: ", output_idx); inputs_map[output_idx][0] = new_parameter; extra_then_body_results[output_idx] = new_result; OPENVINO_DEBUG << "Modified then body: " << if_node << '\n'; @@ -152,7 +152,7 @@ OutputVector translate_if(const NodeContext& context) { else_body->add_parameters({new_parameter}); else_body->add_results({new_result}); else_body->validate_nodes_and_infer_types(); - FRONT_END_OP_CONVERSION_CHECK(inputs_map.count(output_idx), "Input must exist in then body: ", output_idx); + PYTORCH_OP_CONVERSION_CHECK(inputs_map.count(output_idx), "Input must exist in then body: ", output_idx); inputs_map[output_idx][1] = new_parameter; extra_else_body_results[output_idx] = new_result; OPENVINO_DEBUG << "Modified else body: " << if_node << '\n'; diff --git a/src/frontends/pytorch/src/op/im2col.cpp b/src/frontends/pytorch/src/op/im2col.cpp index 718e0eadaa4ca0..56545bc3270ff6 100644 --- a/src/frontends/pytorch/src/op/im2col.cpp +++ b/src/frontends/pytorch/src/op/im2col.cpp @@ -60,13 +60,13 @@ OutputVector translate_im2col(const NodeContext& context) { num_inputs_check(context, 5, 5); auto input = context.get_input(0); auto kernel_size = context.const_input>(1); - FRONT_END_OP_CONVERSION_CHECK(kernel_size.size() == 2, "kernel size should contains 2 elements"); + PYTORCH_OP_CONVERSION_CHECK(kernel_size.size() == 2, "kernel size should contains 2 elements"); auto dilation = context.const_input>(2); - FRONT_END_OP_CONVERSION_CHECK(kernel_size.size() == 2, "dilation should contains 2 elements"); + PYTORCH_OP_CONVERSION_CHECK(kernel_size.size() == 2, "dilation should contains 2 elements"); auto padding = context.const_input>(3); - FRONT_END_OP_CONVERSION_CHECK(kernel_size.size() == 2, "padding should contains 2 elements"); + PYTORCH_OP_CONVERSION_CHECK(kernel_size.size() == 2, "padding should contains 2 elements"); auto stride = context.const_input>(4); - FRONT_END_OP_CONVERSION_CHECK(kernel_size.size() == 2, "stride should contains 2 elements"); + PYTORCH_OP_CONVERSION_CHECK(kernel_size.size() == 2, "stride should contains 2 elements"); auto zero = context.mark_node(v0::Constant::create(element::i32, Shape{}, {0})); auto input_shape = context.mark_node(std::make_shared(input, element::i32)); auto zero_f = context.mark_node(v0::Constant::create(element::f32, Shape{}, {0})); diff --git a/src/frontends/pytorch/src/op/index.cpp b/src/frontends/pytorch/src/op/index.cpp index a9aaf62257d71b..6030dd557deae3 100644 --- a/src/frontends/pytorch/src/op/index.cpp +++ b/src/frontends/pytorch/src/op/index.cpp @@ -224,7 +224,7 @@ OutputVector translate_index(const NodeContext& context) { ov::pass::NodeRegistry rg; auto rank = x.get_partial_shape().rank(); // index transformation supports only tensors with static rank - FRONT_END_OP_CONVERSION_CHECK(rank.is_static(), "Dynamic rank for aten::index input is not supported."); + PYTORCH_OP_CONVERSION_CHECK(rank.is_static(), "Dynamic rank for aten::index input is not supported."); auto res = index_on_list(rg, x, list_elems, rank.get_length()); context.mark_nodes(rg.get()); return res; @@ -266,7 +266,7 @@ OutputVector translate_index_fx(const NodeContext& context) { rank = context.get_decoder()->get_input_shape(0).rank(); } // index transformation supports only tensors with static rank - FRONT_END_OP_CONVERSION_CHECK(rank.is_static(), "Dynamic rank for aten::index input is not supported."); + PYTORCH_OP_CONVERSION_CHECK(rank.is_static(), "Dynamic rank for aten::index input is not supported."); auto res = index_on_list(rg, x, list_elems, rank.get_length()); context.mark_nodes(rg.get()); return res; diff --git a/src/frontends/pytorch/src/op/layer_norm.cpp b/src/frontends/pytorch/src/op/layer_norm.cpp index 974106e3aabe5d..9bcdd0c1bdd6f3 100644 --- a/src/frontends/pytorch/src/op/layer_norm.cpp +++ b/src/frontends/pytorch/src/op/layer_norm.cpp @@ -21,9 +21,9 @@ OutputVector translate_layer_norm(const NodeContext& context) { num_inputs_check(context, 5, 6); auto eps = context.const_input(4); auto normalized_shape = context.const_input(1); - FRONT_END_OP_CONVERSION_CHECK(normalized_shape.size() == 1, - "Translation for aten::layer_norm supports only single normalized_shape value, " - "which means normalizing over the last dimension."); + PYTORCH_OP_CONVERSION_CHECK(normalized_shape.size() == 1, + "Translation for aten::layer_norm supports only single normalized_shape value, " + "which means normalizing over the last dimension."); // TODO: support any dimension auto axes = context.mark_node(v0::Constant::create(element::i32, Shape{1}, {-1})); auto out_node = diff --git a/src/frontends/pytorch/src/op/linspace.cpp b/src/frontends/pytorch/src/op/linspace.cpp index c2233bee15ee24..5bdf489d297566 100644 --- a/src/frontends/pytorch/src/op/linspace.cpp +++ b/src/frontends/pytorch/src/op/linspace.cpp @@ -44,7 +44,7 @@ OutputVector translate_linspace(const NodeContext& context) { out_tensor = fw_node->input_value(0); apply_dtype = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } else if (!context.input_is_none(3) && context.get_input_size() == 4) { // Case where dtype is inherited from out tensor. diff --git a/src/frontends/pytorch/src/op/list_construct.cpp b/src/frontends/pytorch/src/op/list_construct.cpp index e58a3c4744ff61..cc17aae928e37d 100644 --- a/src/frontends/pytorch/src/op/list_construct.cpp +++ b/src/frontends/pytorch/src/op/list_construct.cpp @@ -22,7 +22,7 @@ OutputVector translate_list_construct(const NodeContext& context) { for (size_t i = 0; i < context.get_input_size(); i++) { auto input = context.get_input_from_visible_context(i); auto c_node = std::dynamic_pointer_cast(input.get_node_shared_ptr()); - FRONT_END_OP_CONVERSION_CHECK(c_node, "Translation for prim::ListConstruct support only constant inputs"); + PYTORCH_OP_CONVERSION_CHECK(c_node, "Translation for prim::ListConstruct support only constant inputs"); if (c_node->get_shape().size() == 0) { c_node = std::make_shared(c_node->get_element_type(), Shape{1}, c_node->get_data_ptr()); consts.push_back(c_node); diff --git a/src/frontends/pytorch/src/op/list_unpack.cpp b/src/frontends/pytorch/src/op/list_unpack.cpp index 3a960f842352ed..30fe2d2ed5e8bd 100644 --- a/src/frontends/pytorch/src/op/list_unpack.cpp +++ b/src/frontends/pytorch/src/op/list_unpack.cpp @@ -31,7 +31,7 @@ OutputVector translate_list_unpack(const NodeContext& context) { } return res; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported operation type."); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported operation type."); } } else { return outputs; diff --git a/src/frontends/pytorch/src/op/loop.cpp b/src/frontends/pytorch/src/op/loop.cpp index 99c59b46f342a1..4aaf56b081f5b4 100644 --- a/src/frontends/pytorch/src/op/loop.cpp +++ b/src/frontends/pytorch/src/op/loop.cpp @@ -15,10 +15,10 @@ namespace op { OutputVector translate_loop(const NodeContext& context) { const auto& inputs = context.inputs(); - FRONT_END_OP_CONVERSION_CHECK(inputs.size() >= 2, "Loop must have at least 2 inputs."); + PYTORCH_OP_CONVERSION_CHECK(inputs.size() >= 2, "Loop must have at least 2 inputs."); auto loop = std::make_shared(inputs[0], inputs[1]); auto decoder = context.get_decoder(); - FRONT_END_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 1, "Loop must have 1 subgraph."); + PYTORCH_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 1, "Loop must have 1 subgraph."); auto subgraph_decoder = decoder->get_subgraph_decoder(0); auto body = context.convert_subgraph(0); loop->set_function(body); @@ -28,20 +28,20 @@ OutputVector translate_loop(const NodeContext& context) { // process outputs first auto session = context.get_session(); auto body_results = body->get_results(); - FRONT_END_OP_CONVERSION_CHECK(body_results.size() > 0, "At least one output from loop is required - condition."); + PYTORCH_OP_CONVERSION_CHECK(body_results.size() > 0, "At least one output from loop is required - condition."); std::map> output_idxs; // 0 output is condition, do not need to connect it for (size_t i = 1; i < body_results.size(); i++) { auto result = body_results[i]; auto out_idx = session->decode_tensor_name(result->input(0).get_source_output()); - FRONT_END_OP_CONVERSION_CHECK(output_idxs.count(out_idx) == 0, - "More then one body output with same tensor name."); + PYTORCH_OP_CONVERSION_CHECK(output_idxs.count(out_idx) == 0, + "More then one body output with same tensor name."); output_idxs[out_idx] = result; } auto body_parameters = body->get_parameters(); // #0 body parameter is counter; - FRONT_END_OP_CONVERSION_CHECK(body_parameters.size() > 0, "At least one input to Loop body is required"); + PYTORCH_OP_CONVERSION_CHECK(body_parameters.size() > 0, "At least one input to Loop body is required"); // Set counter type and shape body_parameters[0]->set_element_type(element::i32); body_parameters[0]->set_partial_shape(PartialShape{}); diff --git a/src/frontends/pytorch/src/op/lstm.cpp b/src/frontends/pytorch/src/op/lstm.cpp index 1ec859e5e7b8c5..a845229a17b314 100644 --- a/src/frontends/pytorch/src/op/lstm.cpp +++ b/src/frontends/pytorch/src/op/lstm.cpp @@ -95,12 +95,12 @@ OutputVector generic_rnn(ov::pass::NodeRegistry& rg, bidirectional ? RecurrentSequenceDirection::BIDIRECTIONAL : RecurrentSequenceDirection::FORWARD; int64_t weights_per_layer = has_biases ? 4 : 2; int64_t mult = bidirectional ? 2 : 1; - FRONT_END_OP_CONVERSION_CHECK(static_cast(all_weights.size()) == num_layers * weights_per_layer * mult, - "Unexpected length of list with weights for rnn operation."); + PYTORCH_OP_CONVERSION_CHECK(static_cast(all_weights.size()) == num_layers * weights_per_layer * mult, + "Unexpected length of list with weights for rnn operation."); const auto w_hh = all_weights[1]; const auto w_hh_pshape = w_hh.get_partial_shape(); - FRONT_END_OP_CONVERSION_CHECK(w_hh_pshape.rank().is_static() && w_hh_pshape[1].is_static(), ""); + PYTORCH_OP_CONVERSION_CHECK(w_hh_pshape.rank().is_static() && w_hh_pshape[1].is_static(), ""); const auto hidden_size = w_hh_pshape[1].get_length(); const auto zero = v0::Constant::create(element::i32, Shape{}, {0}); @@ -119,7 +119,7 @@ OutputVector generic_rnn(ov::pass::NodeRegistry& rg, h0 = initial_states[0]; c0 = initial_states[1]; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported rnn variant."); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported rnn variant."); } Output prev_output = input; @@ -269,7 +269,7 @@ OutputVector generic_rnn(ov::pass::NodeRegistry& rg, c_res = rg.make(c_res, order_102); return {prev_output, h_res, c_res}; } - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported rnn variant."); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported rnn variant."); } } // namespace @@ -289,7 +289,7 @@ OutputVector translate_lstm(const NodeContext& context) { const auto num_layers = context.const_input(5); // const auto dropout = context.const_input(6); - skip const auto train = context.const_input(7); - FRONT_END_OP_CONVERSION_CHECK(!train, "LSTM in train mode is not supported."); + PYTORCH_OP_CONVERSION_CHECK(!train, "LSTM in train mode is not supported."); const auto bidirectional = context.const_input(8); const auto initial_states = get_list_as_outputs(hx); @@ -316,7 +316,7 @@ OutputVector translate_lstm(const NodeContext& context) { const auto num_layers = context.const_input(4); // const auto dropout = context.const_input(5); - skip const auto train = context.const_input(6); - FRONT_END_OP_CONVERSION_CHECK(!train, "LSTM in train mode is not supported."); + PYTORCH_OP_CONVERSION_CHECK(!train, "LSTM in train mode is not supported."); const auto bidirectional = context.const_input(7); const auto batch_first = context.const_input(8); @@ -348,7 +348,7 @@ OutputVector translate_gru(const NodeContext& context) { const auto num_layers = context.const_input(4); // const auto dropout = context.const_input(5); - skip const auto train = context.const_input(6); - FRONT_END_OP_CONVERSION_CHECK(!train, "GRU in train mode is not supported."); + PYTORCH_OP_CONVERSION_CHECK(!train, "GRU in train mode is not supported."); const auto bidirectional = context.const_input(7); const auto batch_first = context.const_input(8); @@ -378,13 +378,13 @@ OutputVector translate_rnn(const NodeContext& context) { const auto num_layers = context.const_input(4); // const auto dropout = context.const_input(5); - skip const auto train = context.const_input(6); - FRONT_END_OP_CONVERSION_CHECK(!train, "RNN in train mode is not supported."); + PYTORCH_OP_CONVERSION_CHECK(!train, "RNN in train mode is not supported."); const auto bidirectional = context.const_input(7); const auto batch_first = context.const_input(8); const auto weight = get_list_as_outputs(weight_v); const auto variant_it = RNN_VARIANT_MAP.find(context.get_op_type()); - FRONT_END_OP_CONVERSION_CHECK(variant_it != RNN_VARIANT_MAP.end(), "Unsupported RNN variant."); + PYTORCH_OP_CONVERSION_CHECK(variant_it != RNN_VARIANT_MAP.end(), "Unsupported RNN variant."); const auto res = generic_rnn(rg, variant_it->second, input, diff --git a/src/frontends/pytorch/src/op/multinomial.cpp b/src/frontends/pytorch/src/op/multinomial.cpp index c359c34bbcb657..bba2b045063f47 100644 --- a/src/frontends/pytorch/src/op/multinomial.cpp +++ b/src/frontends/pytorch/src/op/multinomial.cpp @@ -27,8 +27,8 @@ OutputVector translate_multinomial(const NodeContext& context) { auto input = context.get_input(0); auto num_samples = context.mark_node(std::make_shared(context.get_input(1), const_1, false)); auto replacement = context.const_input(2); - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(3), - "aten::multinomial conversion with generator is not supported"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(3), + "aten::multinomial conversion with generator is not supported"); // Torch multinomial accept input of [class_probs] or [bs, class_probs], convert always to [bs, class_probs] for OV. auto input_shape = context.mark_node(std::make_shared(input, element::i32)); diff --git a/src/frontends/pytorch/src/op/native_multi_head_attention.cpp b/src/frontends/pytorch/src/op/native_multi_head_attention.cpp index 6ecc798b439394..e70fae3976d7b8 100644 --- a/src/frontends/pytorch/src/op/native_multi_head_attention.cpp +++ b/src/frontends/pytorch/src/op/native_multi_head_attention.cpp @@ -132,7 +132,7 @@ OutputVector translate_native_multi_head_attention(const NodeContext& context) { } else { // Once int/float mask type is supported in PyTorch, // remove this assert to allow for such masks in OV - FRONT_END_OP_CONVERSION_CHECK(1, "Non-boolean masks are not supported."); + PYTORCH_OP_CONVERSION_CHECK(1, "Non-boolean masks are not supported."); atten_mask = context.mark_node(std::make_shared(atten_mask, scaled_dot_product)); } diff --git a/src/frontends/pytorch/src/op/norm.cpp b/src/frontends/pytorch/src/op/norm.cpp index cd0311972dd0dd..73ec824ddd6059 100644 --- a/src/frontends/pytorch/src/op/norm.cpp +++ b/src/frontends/pytorch/src/op/norm.cpp @@ -53,8 +53,8 @@ Output norm_vector(const NodeContext& context, res = context.mark_node(std::make_shared(abs, dim, keep_dim)); } else if (p == 0) { auto input_rank = input_tensor.get_partial_shape().rank(); - FRONT_END_OP_CONVERSION_CHECK(input_rank.is_dynamic() || input_rank.get_length() == 1, - "ord=0 supported only for vector norm"); + PYTORCH_OP_CONVERSION_CHECK(input_rank.is_dynamic() || input_rank.get_length() == 1, + "ord=0 supported only for vector norm"); auto zero = context.mark_node(v0::Constant::create(element::f32, Shape{}, {0})); zero = context.mark_node(std::make_shared(zero, input_tensor)); auto cond = context.mark_node(std::make_shared(input_tensor, zero)); @@ -100,7 +100,7 @@ Output norm_matrix(const NodeContext& context, auto sum = context.mark_node(std::make_shared(abs, first_dim, true)); res = context.mark_node(std::make_shared(sum, second_dim, true)); } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported ord ", p, " for matrix norm"); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported ord ", p, " for matrix norm"); } if (!keep_dim) { res = context.mark_node(std::make_shared(res, dim)); @@ -139,7 +139,7 @@ OutputVector translate_norm(const NodeContext& context) { if (p_str == "fro") { res = frobenius_norm(context, input_tensor, dim, keep_dim); } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); } } else { auto p = context.const_input(1); @@ -230,7 +230,7 @@ OutputVector translate_linalg_matrix_norm(const NodeContext& context) { if (p_str == "fro") { result = frobenius_norm(context, x, dim, keep_dim); } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); } } else { auto p = context.const_input(1); @@ -272,8 +272,7 @@ OutputVector translate_linalg_norm(const NodeContext& context) { } else if (input_rank.is_dynamic() || input_rank.get_length() == 1) { result = norm_vector(context, x, dim, 2, keep_dim); } else { - FRONT_END_OP_CONVERSION_CHECK(false, - "linalg norm for tensor rank > 2 without ord specification unsupported"); + PYTORCH_OP_CONVERSION_CHECK(false, "linalg norm for tensor rank > 2 without ord specification unsupported"); } } else { // ord defines the norm that is computed can be string or number @@ -283,7 +282,7 @@ OutputVector translate_linalg_norm(const NodeContext& context) { if (p_str == "fro") { result = frobenius_norm(context, x, dim, keep_dim); } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported ord ", p_str); } } else { auto p = context.const_input(1); diff --git a/src/frontends/pytorch/src/op/pad.cpp b/src/frontends/pytorch/src/op/pad.cpp index 390277edcf5796..4f6e186599544a 100644 --- a/src/frontends/pytorch/src/op/pad.cpp +++ b/src/frontends/pytorch/src/op/pad.cpp @@ -91,10 +91,10 @@ OutputVector translate_pad_common(const NodeContext& context, {"replicate", PadMode::EDGE}, }; auto ov_mode = pt_to_ov_pad.find(mode); - FRONT_END_OP_CONVERSION_CHECK(ov_mode != pt_to_ov_pad.end(), - "aten::pad conversion doesn't support [ ", - mode, - " ] padding mode"); + PYTORCH_OP_CONVERSION_CHECK(ov_mode != pt_to_ov_pad.end(), + "aten::pad conversion doesn't support [ ", + mode, + " ] padding mode"); return {context.mark_node(std::make_shared(data, pads_begins, pads_ends, pad_value_, ov_mode->second))}; } } // namespace diff --git a/src/frontends/pytorch/src/op/pythonop.cpp b/src/frontends/pytorch/src/op/pythonop.cpp index ccaac4a4909004..6040e6bbc97bf9 100644 --- a/src/frontends/pytorch/src/op/pythonop.cpp +++ b/src/frontends/pytorch/src/op/pythonop.cpp @@ -13,16 +13,15 @@ namespace op { OutputVector translate_pythonop(const NodeContext& context) { auto decoder = context.get_decoder(); - FRONT_END_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 1, - "PythonOp must have 1 subgraph to be able to translate it to OV."); + PYTORCH_OP_CONVERSION_CHECK(decoder->get_subgraph_size() == 1, + "PythonOp must have 1 subgraph to be able to translate it to OV."); auto body = context.convert_subgraph(0); auto session = context.get_session(); std::map inputs_map; for (const auto& param : body->get_parameters()) { auto tensor_idx = session->decode_tensor_name(param->output(0)); - FRONT_END_OP_CONVERSION_CHECK(!inputs_map.count(tensor_idx), - "Multiple nodes with the same id are not allowed."); + PYTORCH_OP_CONVERSION_CHECK(!inputs_map.count(tensor_idx), "Multiple nodes with the same id are not allowed."); inputs_map[tensor_idx] = {param}; } for (const auto& input : inputs_map) { diff --git a/src/frontends/pytorch/src/op/quantized_convnd.cpp b/src/frontends/pytorch/src/op/quantized_convnd.cpp index 37ab867d72a4ad..485ce9f9d71eb8 100644 --- a/src/frontends/pytorch/src/op/quantized_convnd.cpp +++ b/src/frontends/pytorch/src/op/quantized_convnd.cpp @@ -23,16 +23,16 @@ Output translate_quantized_convnd_base(const NodeContext& context) { auto input = context.get_input(0); auto packed_params_node = std::dynamic_pointer_cast(context.get_input(1).get_node_shared_ptr()); - FRONT_END_OP_CONVERSION_CHECK(packed_params_node, "Packed params input node type is required to be FrameworkNode."); + PYTORCH_OP_CONVERSION_CHECK(packed_params_node, "Packed params input node type is required to be FrameworkNode."); const auto& attrs = packed_params_node->get_attrs(); - FRONT_END_OP_CONVERSION_CHECK((attrs.find(PtFrameworkNode::op_type_key) != attrs.end()), - "Packed params input node does not contain information about op type."); - FRONT_END_OP_CONVERSION_CHECK((attrs.at(PtFrameworkNode::op_type_key) == "prim::GetAttr"), - "Incorrect packed params input node operator type, expected prim::GetAttr."); + PYTORCH_OP_CONVERSION_CHECK((attrs.find(PtFrameworkNode::op_type_key) != attrs.end()), + "Packed params input node does not contain information about op type."); + PYTORCH_OP_CONVERSION_CHECK((attrs.at(PtFrameworkNode::op_type_key) == "prim::GetAttr"), + "Incorrect packed params input node operator type, expected prim::GetAttr."); auto packed_params = packed_params_node->inputs(); - FRONT_END_OP_CONVERSION_CHECK(packed_params.size() == 6, - "Packed parameters for quantized conv should contain 6 items."); + PYTORCH_OP_CONVERSION_CHECK(packed_params.size() == 6, + "Packed parameters for quantized conv should contain 6 items."); // Packed params: weight, bias, stride, padding, dilation, groups auto weight = packed_params[0].get_source_output(); auto bias = packed_params[1].get_source_output(); diff --git a/src/frontends/pytorch/src/op/quantized_linear.cpp b/src/frontends/pytorch/src/op/quantized_linear.cpp index a69013f3fabb6b..e414d0c6f5a62f 100644 --- a/src/frontends/pytorch/src/op/quantized_linear.cpp +++ b/src/frontends/pytorch/src/op/quantized_linear.cpp @@ -20,16 +20,16 @@ OutputVector translate_quantized_linear(const NodeContext& context) { auto x = context.get_input(0); auto packed_params_node = std::dynamic_pointer_cast(context.get_input(1).get_node_shared_ptr()); - FRONT_END_OP_CONVERSION_CHECK(packed_params_node, "Packed params input node type is required to be FrameworkNode."); + PYTORCH_OP_CONVERSION_CHECK(packed_params_node, "Packed params input node type is required to be FrameworkNode."); const auto& attrs = packed_params_node->get_attrs(); - FRONT_END_OP_CONVERSION_CHECK((attrs.find(PtFrameworkNode::op_type_key) != attrs.end()), - "Packed params input node does not contain information about op type."); - FRONT_END_OP_CONVERSION_CHECK((attrs.at(PtFrameworkNode::op_type_key) == "prim::GetAttr"), - "Incorrect packed params input node operator type, expected prim::GetAttr."); + PYTORCH_OP_CONVERSION_CHECK((attrs.find(PtFrameworkNode::op_type_key) != attrs.end()), + "Packed params input node does not contain information about op type."); + PYTORCH_OP_CONVERSION_CHECK((attrs.at(PtFrameworkNode::op_type_key) == "prim::GetAttr"), + "Incorrect packed params input node operator type, expected prim::GetAttr."); auto packed_params = packed_params_node->inputs(); - FRONT_END_OP_CONVERSION_CHECK(packed_params.size() == 2, - "Packed parameters for quantized linear should contain 2 items."); + PYTORCH_OP_CONVERSION_CHECK(packed_params.size() == 2, + "Packed parameters for quantized linear should contain 2 items."); auto weights = packed_params[0].get_source_output(); auto bias = packed_params[1].get_source_output(); diff --git a/src/frontends/pytorch/src/op/rand.cpp b/src/frontends/pytorch/src/op/rand.cpp index d04b3bbd2780b7..a5a6771d36d581 100644 --- a/src/frontends/pytorch/src/op/rand.cpp +++ b/src/frontends/pytorch/src/op/rand.cpp @@ -56,8 +56,8 @@ OutputVector translate_rand(const NodeContext& context) { auto dtype = element::f32; size_t out_id = 1; if (context.get_input_size() == 3) { - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(1), - "aten::randn conversion with generator does not supported"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(1), + "aten::randn conversion with generator does not supported"); out_id = 2; } // aten::rand.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) @@ -75,8 +75,8 @@ OutputVector translate_rand(const NodeContext& context) { Output convert_like_out; size_t dtype_id = 1; if (context.get_input_size() == 6) { - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(1), - "aten::rand conversion with generator does not supported"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(1), + "aten::rand conversion with generator does not supported"); dtype_id = 2; } if (!context.input_is_none(dtype_id)) { @@ -92,7 +92,7 @@ OutputVector translate_rand(const NodeContext& context) { dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto res = context.mark_node(std::make_shared(sizes, low, high, dtype)); @@ -130,7 +130,7 @@ OutputVector translate_rand_like(const NodeContext& context) { dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto res = context.mark_node(std::make_shared(sizes, low, high, dtype)); @@ -150,8 +150,8 @@ OutputVector translate_randn(const NodeContext& context) { auto dtype = element::f32; size_t out_id = 1; if (context.get_input_size() == 3) { - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(1), - "aten::randn conversion with generator does not supported"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(1), + "aten::randn conversion with generator does not supported"); out_id = 2; } // aten::randn.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!) @@ -165,8 +165,8 @@ OutputVector translate_randn(const NodeContext& context) { } size_t dtype_id = 1; if (context.get_input_size() == 6) { - FRONT_END_OP_CONVERSION_CHECK(context.input_is_none(1), - "aten::randn conversion with generator does not supported"); + PYTORCH_OP_CONVERSION_CHECK(context.input_is_none(1), + "aten::randn conversion with generator does not supported"); dtype_id = 2; } // aten::randn(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? @@ -186,7 +186,7 @@ OutputVector translate_randn(const NodeContext& context) { dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto scale = context.mark_node(v0::Constant::create(dtype, Shape{1}, {1})); @@ -226,7 +226,7 @@ OutputVector translate_randn_like(const NodeContext& context) { dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto scale = context.mark_node(v0::Constant::create(dtype, Shape{1}, {1})); @@ -256,7 +256,7 @@ OutputVector translate_randint(const NodeContext& context) { convert_like_out = fw_node->input_value(0); dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } low = context.mark_node(std::make_shared(low, dtype)); @@ -331,7 +331,7 @@ OutputVector translate_normal(const NodeContext& context) { convert_like_out = fw_node->input_value(0); dtype_applied = false; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); + PYTORCH_OP_CONVERSION_CHECK(false, "Couldn't get dtype input"); } } auto res = make_random_normal(context, sizes, dtype, std, mean); @@ -340,9 +340,9 @@ OutputVector translate_normal(const NodeContext& context) { } return res; } else { - FRONT_END_OP_CONVERSION_CHECK(false, - "Unsupported number of inputs to aten::normal operation: ", - context.get_input_size()); + PYTORCH_OP_CONVERSION_CHECK(false, + "Unsupported number of inputs to aten::normal operation: ", + context.get_input_size()); } } diff --git a/src/frontends/pytorch/src/op/scatter.cpp b/src/frontends/pytorch/src/op/scatter.cpp index d60cfd91bf6c90..afbf8c2208d3a2 100644 --- a/src/frontends/pytorch/src/op/scatter.cpp +++ b/src/frontends/pytorch/src/op/scatter.cpp @@ -58,9 +58,9 @@ const v12::ScatterElementsUpdate::Reduction get_reduction_mode(const std::string {"amax", v12::ScatterElementsUpdate::Reduction::MAX}, {"amin", v12::ScatterElementsUpdate::Reduction::MIN}}; - FRONT_END_OP_CONVERSION_CHECK(TORCH_REDUCTION_TO_OV.count(pt_reduce_mode), - "Unknown reduction mode: ", - pt_reduce_mode); + PYTORCH_OP_CONVERSION_CHECK(TORCH_REDUCTION_TO_OV.count(pt_reduce_mode), + "Unknown reduction mode: ", + pt_reduce_mode); auto reduction = TORCH_REDUCTION_TO_OV.at(pt_reduce_mode); return reduction; } diff --git a/src/frontends/pytorch/src/op/slice.cpp b/src/frontends/pytorch/src/op/slice.cpp index 20f51a8e786745..62b65922e455ec 100644 --- a/src/frontends/pytorch/src/op/slice.cpp +++ b/src/frontends/pytorch/src/op/slice.cpp @@ -40,7 +40,7 @@ OutputVector translate_slice_common(const NodeContext& context, const size_t num step_idx = 3; dim = context.mark_node(v0::Constant::create(element::i32, Shape{1}, {0})); } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Slice must have either 4 or 5 inputs."); + PYTORCH_OP_CONVERSION_CHECK(false, "Slice must have either 4 or 5 inputs."); } // TODO: support default start/end with negative step ov::Output start; diff --git a/src/frontends/pytorch/src/op/to.cpp b/src/frontends/pytorch/src/op/to.cpp index d902caeb8487bc..cc563217f5eb03 100644 --- a/src/frontends/pytorch/src/op/to.cpp +++ b/src/frontends/pytorch/src/op/to.cpp @@ -54,7 +54,7 @@ OutputVector translate_to(const NodeContext& context) { return {context.get_input(0)}; } } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unknown aten::to format"); + PYTORCH_OP_CONVERSION_CHECK(false, "Unknown aten::to format"); } // We ignore both non_blocking and copy inputs since non_blocking argument is used diff --git a/src/frontends/pytorch/src/op/tuple_index.cpp b/src/frontends/pytorch/src/op/tuple_index.cpp index 320733d701284d..b1f0917168d08b 100644 --- a/src/frontends/pytorch/src/op/tuple_index.cpp +++ b/src/frontends/pytorch/src/op/tuple_index.cpp @@ -22,8 +22,8 @@ OutputVector translate_tuple_index(const NodeContext& context) { if (cast_fw_node(tuple, "prim::TupleConstruct")) { // this case require index to be constant auto index = context.const_input(1); - FRONT_END_OP_CONVERSION_CHECK(static_cast(index) < tuple->get_input_size(), - "Index of TupleIndex operation is higher then number of tuple elements."); + PYTORCH_OP_CONVERSION_CHECK(static_cast(index) < tuple->get_input_size(), + "Index of TupleIndex operation is higher then number of tuple elements."); return {tuple->get_input_source_output(index)}; } else { // Assume this case is when tuple is represented as tensor diff --git a/src/frontends/pytorch/src/op/upsample.cpp b/src/frontends/pytorch/src/op/upsample.cpp index 1d405cf60acd07..83a1e59d93d4bc 100644 --- a/src/frontends/pytorch/src/op/upsample.cpp +++ b/src/frontends/pytorch/src/op/upsample.cpp @@ -41,7 +41,7 @@ OutputVector base_translate_upsample(const NodeContext& context, } else if (dims == 3) { spatial_axes = {2, 3, 4}; } else { - FRONT_END_OP_CONVERSION_CHECK(false, "Unsupported number of dimensions in upsample"); + PYTORCH_OP_CONVERSION_CHECK(false, "Unsupported number of dimensions in upsample"); } auto target_axes = std::make_shared(element::i32, Shape{spatial_axes.size()}, spatial_axes); auto scales = @@ -50,7 +50,7 @@ OutputVector base_translate_upsample(const NodeContext& context, context.mark_node(std::make_shared(element::i32, Shape{dims}, std::vector(dims, 1))); Output scales_sizes; if (context.input_is_none(1)) { - FRONT_END_OP_CONVERSION_CHECK(!context.input_is_none(scale_id), "Scale or Output size should be provided"); + PYTORCH_OP_CONVERSION_CHECK(!context.input_is_none(scale_id), "Scale or Output size should be provided"); auto spatial_scales = context.get_input(scale_id); if (context.get_input_type(1).is()) { spatial_scales = concat_list_construct(spatial_scales); diff --git a/src/frontends/pytorch/src/op/where.cpp b/src/frontends/pytorch/src/op/where.cpp index 3d03706970bc67..3c8bf86d84adda 100644 --- a/src/frontends/pytorch/src/op/where.cpp +++ b/src/frontends/pytorch/src/op/where.cpp @@ -17,7 +17,7 @@ using namespace ov::op; OutputVector translate_where(const NodeContext& context) { num_inputs_check(context, 1, 3); auto cond = context.get_input(0); - FRONT_END_OP_CONVERSION_CHECK(!context.input_is_none(1), "aten::where(cond) unsupported"); + PYTORCH_OP_CONVERSION_CHECK(!context.input_is_none(1), "aten::where(cond) unsupported"); auto bool_cond = context.mark_node(std::make_shared(cond, element::boolean)); auto x = context.get_input(1); auto y = context.get_input(2); diff --git a/src/frontends/pytorch/src/translate_session.cpp b/src/frontends/pytorch/src/translate_session.cpp index 1791326f41a57b..5aff8bd1f05755 100644 --- a/src/frontends/pytorch/src/translate_session.cpp +++ b/src/frontends/pytorch/src/translate_session.cpp @@ -9,6 +9,7 @@ #include "input_model.hpp" #include "openvino/op/gather.hpp" #include "openvino/op/slice.hpp" +#include "openvino/util/common_util.hpp" #include "openvino/util/log.hpp" #include "place.hpp" #include "pt_framework_node.hpp" @@ -273,6 +274,12 @@ OutputVector TranslateSession::convert_node(const NodeContext& context) { OPENVINO_DEBUG << "No translator found for: " << context.get_op_type() << "\n"; } catch (std::exception& e) { exception = e.what(); + if (m_telemetry) { + auto cropped_message = ov::util::filter_lines_by_prefix(exception, get_pytorch_prefix()); + if (cropped_message.size()) { + m_telemetry->send_event("error_info", cropped_message); + } + } } catch (...) { exception = "Unknown exception type."; } diff --git a/src/frontends/pytorch/src/utils.cpp b/src/frontends/pytorch/src/utils.cpp index 86c6d11e1d65e7..32f62eed603d47 100644 --- a/src/frontends/pytorch/src/utils.cpp +++ b/src/frontends/pytorch/src/utils.cpp @@ -25,6 +25,10 @@ void num_inputs_check(const NodeContext& context, size_t min_inputs, size_t max_ } } +const std::string& get_pytorch_prefix() { + return pytorch_prefix; +} + Output make_optional_bias(const Output& base_op, const NodeContext& context, int bias_input_idx, diff --git a/src/frontends/pytorch/src/utils.hpp b/src/frontends/pytorch/src/utils.hpp index 3cb5798af9f65c..f7387bd6adaa61 100644 --- a/src/frontends/pytorch/src/utils.hpp +++ b/src/frontends/pytorch/src/utils.hpp @@ -20,6 +20,21 @@ class FrameworkNode; namespace frontend { namespace pytorch { +const std::string pytorch_prefix = "[PyTorch Frontend] "; + +const std::string& get_pytorch_prefix(); + +/// \brief Macro to check whether a boolean condition holds. +/// \param COND Condition to check +/// \param ... Additional error message info to be added to the error message via the `<<` +/// stream-insertion operator. Note that the expressions here will be evaluated lazily, +/// i.e., only if the `cond` evalutes to `false`. +/// \throws ::ov::frontend::OpConversionFailure if `cond` is false. +#ifndef PYTORCH_OP_CONVERSION_CHECK +# define PYTORCH_OP_CONVERSION_CHECK(COND, ...) \ + OPENVINO_ASSERT_HELPER(::ov::frontend::OpConversionFailure, "", (COND), get_pytorch_prefix(), __VA_ARGS__) +#endif + void num_inputs_check(const NodeContext& context, size_t min_inputs, size_t max_inputs); Output make_optional_bias(const Output& base_op, diff --git a/tests/layer_tests/ovc_python_api_tests/telemetry/test_pytorch_telemetry.py b/tests/layer_tests/ovc_python_api_tests/telemetry/test_pytorch_telemetry.py new file mode 100644 index 00000000000000..c1b6d4ae6d4b68 --- /dev/null +++ b/tests/layer_tests/ovc_python_api_tests/telemetry/test_pytorch_telemetry.py @@ -0,0 +1,47 @@ +# Copyright (C) 2018-2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +import unittest +from unittest.mock import MagicMock, patch + +import openvino_telemetry as tm +import torch +from openvino.tools.ovc import convert_model + + +def arange_pt_model(): + + class aten_arange_end_dtype(torch.nn.Module): + def __init__(self, dtype) -> None: + super(aten_arange_end_dtype, self).__init__() + self.dtype = dtype + + def forward(self, x): + return torch.arange(x, dtype=self.dtype) + + return aten_arange_end_dtype(torch.float32) + + +def mocked_inputs(self): + # This line returns incorrect inputs and causes exception raise in translator + if hasattr(self, "graph_element") and hasattr(self.graph_element, "kind") and self.graph_element.kind() == "aten::arange": + return [0] + + return [x.unique() for x in self.raw_inputs] + + +@patch('openvino.frontend.pytorch.ts_decoder.TorchScriptPythonDecoder.inputs', mocked_inputs) +class TestGeneralTelemetrySending(unittest.TestCase): + def test_general_telemetry_sending(self): + tm.Telemetry.send_event = MagicMock() + + # Create PyTorch model with Arange + model = torch.jit.script(arange_pt_model()) + + try: + _ = convert_model(model, input=[torch.float32]) + except: + pass + + tm.Telemetry.send_event.assert_any_call('ovc', 'error_info', '[PyTorch Frontend] Not expected number of inputs for aten::arange\n', 1) + tm.Telemetry.send_event.reset_mock() From 3ffb6abd5f2ca7986d327ffbcff48947bf9dfa77 Mon Sep 17 00:00:00 2001 From: Edward Shogulin Date: Wed, 7 Feb 2024 13:12:24 +0000 Subject: [PATCH 39/55] [LPT] debug info support (#22690) ### Details: - *Dbug info was added for MatMul. Will be extended later.* --- .../src/layer_transformation.cpp | 2 ++ .../src/mat_mul.cpp | 4 ++++ src/core/src/node.cpp | 16 ++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/common/low_precision_transformations/src/layer_transformation.cpp b/src/common/low_precision_transformations/src/layer_transformation.cpp index d3e3103c107aa1..b5c8c9e7f1da14 100644 --- a/src/common/low_precision_transformations/src/layer_transformation.cpp +++ b/src/common/low_precision_transformations/src/layer_transformation.cpp @@ -127,11 +127,13 @@ bool LayerTransformation::canBeTransformedStatic(const std::shared_ptr& la bool LayerTransformation::canBeTransformedSpatialDimension(const TransformationContext& context, std::shared_ptr layer) const { if (!isQuantized(layer, defaultPrecisions)) { + OPENVINO_DEBUG << "LPT: early exit: not quantized"; return false; } const auto outputs = layer->outputs(); if (std::any_of(outputs.begin(), outputs.end(), [](const Output& out) { return out.get_partial_shape().rank().is_dynamic(); })) { + OPENVINO_DEBUG << "LPT: early exit: rank is dynamic"; return false; } return true; diff --git a/src/common/low_precision_transformations/src/mat_mul.cpp b/src/common/low_precision_transformations/src/mat_mul.cpp index a7244ed75578c6..557375d8e4906b 100644 --- a/src/common/low_precision_transformations/src/mat_mul.cpp +++ b/src/common/low_precision_transformations/src/mat_mul.cpp @@ -13,6 +13,7 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "low_precision/network_helper.hpp" +#include "openvino/util/log.hpp" #include "itt.hpp" using namespace ov; @@ -175,6 +176,7 @@ bool MatMulTransformation::transform(TransformationContext &context, ov::pass::p updateOutput(context, newMultiply, newMatMul); + OPENVINO_DEBUG << "LPT: done: " << newMatMul; return true; } @@ -189,12 +191,14 @@ bool MatMulTransformation::canBeTransformed(const TransformationContext& context std::shared_ptr matMul = ov::as_type_ptr(layer); if (matMul == nullptr) { + OPENVINO_DEBUG << "LPT: early exit: not MatMul"; return false; } const auto dequantization1 = NetworkHelper::getDequantization(layer, defaultPrecisions, 0); if (!dequantization1.empty()) { if (updatePrecisions && !dequantization1.isLowPrecision()) { + OPENVINO_DEBUG << "LPT: early exit: dequantization before is not in low precision"; return false; } diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp index 84ad0004848c74..13f31fa093b252 100644 --- a/src/core/src/node.cpp +++ b/src/core/src/node.cpp @@ -406,14 +406,14 @@ ostream& operator<<(ostream& out, const Node* node) { } // namespace ov std::ostream& ov::Node::write_description(std::ostream& out, uint32_t depth) const { - if (depth == 0) { - out << get_friendly_name(); - } else { - auto version = get_type_info().version_id; - if (version) - out << version << "::" << get_type_info().name << " " << get_friendly_name() << " ("; - else - out << get_type_info().name << " " << get_friendly_name() << " ("; + auto version = get_type_info().version_id; + if (version) + out << version << "::" << get_type_info().name << " " << get_friendly_name(); + else + out << get_type_info().name << " " << get_friendly_name(); + + if (depth > 0) { + out << " ("; string sep = ""; for (const auto& arg : input_values()) { out << sep << arg; From 67c270fa58eb27abb24488d6ce69c9ca228c2cd4 Mon Sep 17 00:00:00 2001 From: Evgenya Nugmanova Date: Wed, 7 Feb 2024 19:31:12 +0400 Subject: [PATCH 40/55] Fix names aka locations of operations in TFLite FrontEnd (#22697) ### Details: Fix names aka locations of operations in TFLite FrontEnd Give different names to binary operations with fused activations ### Tickets: - *CVS-131328, CVS-111341* --- .../tensorflow_lite/src/graph_iterator_flatbuffer.cpp | 3 ++- src/frontends/tensorflow_lite/src/op/op_translation_utils.hpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontends/tensorflow_lite/src/graph_iterator_flatbuffer.cpp b/src/frontends/tensorflow_lite/src/graph_iterator_flatbuffer.cpp index 36c2be5f204620..aacbadd9615803 100644 --- a/src/frontends/tensorflow_lite/src/graph_iterator_flatbuffer.cpp +++ b/src/frontends/tensorflow_lite/src/graph_iterator_flatbuffer.cpp @@ -96,7 +96,8 @@ std::shared_ptr GraphIteratorFlatBuffer::get_decoder() const if (type == "CUSTOM") { type = operator_code->custom_code()->str(); } - return std::make_shared(node, type, std::to_string(node_index), input_info, output_info); + auto name = std::to_string(node_index - m_graph->inputs()->size() - m_graph->outputs()->size()); + return std::make_shared(node, type, name, input_info, output_info); } else { auto tensor_id = m_nodes[node_index].as(); auto tensor = (*tensors)[tensor_id]; diff --git a/src/frontends/tensorflow_lite/src/op/op_translation_utils.hpp b/src/frontends/tensorflow_lite/src/op/op_translation_utils.hpp index 16ee477f292de5..94fbc5a5cdca07 100644 --- a/src/frontends/tensorflow_lite/src/op/op_translation_utils.hpp +++ b/src/frontends/tensorflow_lite/src/op/op_translation_utils.hpp @@ -73,10 +73,13 @@ OutputVector translate_binary_op_with_activation(const ov::frontend::tensorflow_ ov::frontend::tensorflow_lite::dequantize_inputs(inputs); auto context = ov::frontend::tensorflow_lite::NodeContext(node.get_decoder(), inputs); auto output = ov::frontend::tensorflow::op::translate_binary_op(context); + output[0].get_node()->set_friendly_name(""); + output[0].set_names({}); const auto& decoder = get_decoder(context); get_activation(output, context, EnumNameActivationFunctionType(decoder->get_attribute(&TF_TYPE::fused_activation_function))); + output[0].get_node()->set_friendly_name(node.get_name()); return output; } From 61b81fb5c6f233bc386728a51995688a2a9852ed Mon Sep 17 00:00:00 2001 From: Irina Efode Date: Wed, 7 Feb 2024 20:39:30 +0400 Subject: [PATCH 41/55] [TRANSFORMATIONS] Exclude Gather from Mixed prc propagation (#22544) ### Details: - *Exclude Gather from sensitive prc types * - *Add handling of `Const fp16 ->Gather -> Pow` pattern* ### Tickets: - *https://jira.devtools.intel.com/browse/CVS-127678* --- .../mark_subgraphs_to_keep_in_mixed_precision.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/common/transformations/src/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.cpp b/src/common/transformations/src/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.cpp index c7c1a000e2cc4c..ad850281c1b051 100644 --- a/src/common/transformations/src/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.cpp +++ b/src/common/transformations/src/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.cpp @@ -36,7 +36,6 @@ #include "openvino/op/transpose.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/op/util/broadcast_base.hpp" -#include "openvino/op/util/gather_base.hpp" #include "openvino/op/util/pad_base.hpp" #include "openvino/op/variadic_split.hpp" #include "openvino/pass/manager.hpp" @@ -97,7 +96,6 @@ const std::shared_ptr propagate_through_ops = ov::op::v8::Slice, ov::op::v1::VariadicSplit, ov::op::v1::Split, - op::util::GatherBase, ov::op::v0::Concat, ov::op::v0::Convert, // through Convert can go only to Constants ov::op::v0::Constant, @@ -389,7 +387,6 @@ class PropagateDownDisableSensitivityForQuantized : public pass::MatcherPass { ov::op::v8::Slice, ov::op::v1::VariadicSplit, ov::op::v1::Split, - op::util::GatherBase, ov::op::v0::Concat, ov::op::v0::Tile>(); From d7d9970695c465169002b10ebb538ad1367ef630 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 7 Feb 2024 20:52:53 +0400 Subject: [PATCH 42/55] Allow OPENVINO_FRAMEWORK_MAP for PyTorch (#22656) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- src/frontends/common/include/openvino/frontend/extension/op.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/frontends/common/include/openvino/frontend/extension/op.hpp b/src/frontends/common/include/openvino/frontend/extension/op.hpp index 668fd56ccc5aa6..79ec43527fe5c3 100644 --- a/src/frontends/common/include/openvino/frontend/extension/op.hpp +++ b/src/frontends/common/include/openvino/frontend/extension/op.hpp @@ -484,6 +484,7 @@ using OpExtension = ov::frontend::OpExtensionBase Date: Wed, 7 Feb 2024 18:22:47 +0100 Subject: [PATCH 43/55] Remove ie api (#22666) ### Details: - Remove ie api ### Tickets: - [CVS-131687](https://jira.devtools.intel.com/browse/CVS-131687) --- cmake/templates/openvino.pc.in | 3 +- docs/snippets/CMakeLists.txt | 3 +- src/bindings/c/src/CMakeLists.txt | 3 +- src/cmake/openvino.cmake | 6 +- .../offline_transformations/pruning_test.cpp | 3 +- src/core/CMakeLists.txt | 3 +- src/core/include/openvino/core/any.hpp | 5 - src/core/src/runtime/allocator.cpp | 3 - src/core/src/runtime/blob_allocator.hpp | 84 -- .../ir/tests/rt_info_deserialization.cpp | 364 ------- src/frontends/onnx/tests/onnx_import.in.cpp | 2 - src/inference/CMakeLists.txt | 4 +- src/inference/dev_api/blob_factory.hpp | 136 --- .../ie_iexecutable_network_internal.hpp | 220 ----- .../interface/ie_iinfer_request_internal.hpp | 288 ------ .../interface/ie_iplugin_internal.hpp | 353 ------- .../interface/ie_ivariable_state_internal.hpp | 83 -- .../dev_api/cpp_interfaces/plugin_itt.hpp | 21 - src/inference/dev_api/description_buffer.hpp | 124 --- src/inference/dev_api/ie_icore.hpp | 178 ---- src/inference/dev_api/ie_ngraph_utils.hpp | 128 --- .../openvino/runtime/icompiled_model.hpp | 8 +- .../dev_api/openvino/runtime/icore.hpp | 3 + .../dev_api/openvino/runtime/iplugin.hpp | 11 +- .../dev_api/openvino/runtime/make_tensor.hpp | 6 - src/inference/docs/api_details.md | 1 - src/inference/include/ie/cpp/ie_cnn_network.h | 243 ----- .../include/ie/cpp/ie_executable_network.hpp | 210 ---- .../include/ie/cpp/ie_infer_request.hpp | 273 ------ .../include/ie/cpp/ie_memory_state.hpp | 111 --- .../include/ie/details/ie_pre_allocator.hpp | 87 -- src/inference/include/ie/ie_allocator.hpp | 87 -- src/inference/include/ie/ie_api.h | 138 --- src/inference/include/ie/ie_blob.h | 894 ------------------ src/inference/include/ie/ie_common.h | 545 ----------- src/inference/include/ie/ie_core.hpp | 320 ------- src/inference/include/ie/ie_data.h | 192 ---- src/inference/include/ie/ie_icnn_network.hpp | 278 ------ .../include/ie/ie_iexecutable_network.hpp | 165 ---- .../include/ie/ie_iinfer_request.hpp | 184 ---- src/inference/include/ie/ie_input_info.hpp | 183 ---- src/inference/include/ie/ie_layouts.h | 408 -------- src/inference/include/ie/ie_locked_memory.hpp | 428 --------- src/inference/include/ie/ie_precision.hpp | 546 ----------- src/inference/include/ie/inference_engine.hpp | 24 - .../include/openvino/runtime/common.hpp | 6 + .../include/openvino/runtime/core.hpp | 4 - .../openvino/runtime/variable_state.hpp | 7 - src/inference/src/blob_factory.cpp | 22 - src/inference/src/cache_guard.cpp | 2 - src/inference/src/check_network_batchable.hpp | 2 +- src/inference/src/cnn_network_ngraph_impl.cpp | 631 ------------ src/inference/src/cnn_network_ngraph_impl.hpp | 119 --- src/inference/src/compilation_context.cpp | 34 +- src/inference/src/core.cpp | 51 +- src/inference/src/cpp/exception2status.hpp | 84 -- src/inference/src/cpp/ie_cnn_network.cpp | 148 --- .../src/cpp/ie_executable_network.cpp | 101 -- .../src/cpp/ie_executable_network_base.hpp | 89 -- .../src/cpp/ie_infer_async_request_base.hpp | 179 ---- src/inference/src/cpp/ie_infer_request.cpp | 195 ---- src/inference/src/cpp/ie_variable_state.cpp | 46 +- .../ie_iexecutable_network_internal.cpp | 130 --- .../interface/ie_iinfer_request_internal.cpp | 361 ------- .../interface/ie_iplugin_internal.cpp | 388 -------- .../interface/ie_ivariable_state_internal.cpp | 27 - src/inference/src/dev/converter_utils.cpp | 707 -------------- src/inference/src/dev/converter_utils.hpp | 40 - src/inference/src/dev/core_impl.cpp | 32 +- src/inference/src/dev/core_impl.hpp | 70 +- src/inference/src/dev/core_impl_ie.cpp | 240 ----- src/inference/src/dev/icompiled_model.cpp | 3 +- .../src/dev/icompiled_model_wrapper.cpp | 62 -- .../src/dev/icompiled_model_wrapper.hpp | 37 - src/inference/src/dev/iplugin_wrapper.cpp | 117 --- src/inference/src/dev/iplugin_wrapper.hpp | 166 ---- src/inference/src/dev/make_tensor.cpp | 228 ----- src/inference/src/dev/plugin.cpp | 14 +- src/inference/src/ie_blob_common.cpp | 108 --- src/inference/src/ie_cache_manager.hpp | 1 - src/inference/src/ie_common.cpp | 100 -- src/inference/src/ie_core.cpp | 352 ------- src/inference/src/ie_data.cpp | 185 ---- src/inference/src/ie_layouts.cpp | 539 ----------- src/inference/src/ie_network_reader.cpp | 195 ---- src/inference/src/ie_network_reader.hpp | 45 - src/inference/src/ie_ngraph_utils.cpp | 26 - src/inference/src/infer_request.cpp | 9 +- src/inference/src/model_reader.cpp | 19 +- src/inference/src/openvino_shutdown.cpp | 5 - src/inference/src/os/lin/lin_system_conf.cpp | 1 - src/inference/src/system_allocator.cpp | 18 - src/inference/src/system_allocator.hpp | 38 - .../tests/functional/matmul_sr_tests.cpp | 1 - .../functional/ov_infer_request_test.cpp | 1 - .../tests/functional/ov_remote_tensor.cpp | 1 - .../functional/ov_shared_object_test.cpp | 10 +- .../tests/unit/compilation_context_test.cpp | 1 - src/inference/tests/unit/query_model_test.cpp | 1 - .../src/memory_desc/blocked_memory_desc.cpp | 3 + .../src/memory_desc/cpu_memory_desc_utils.cpp | 2 - src/plugins/intel_cpu/src/node.cpp | 1 - src/plugins/intel_cpu/src/node.h | 1 - .../fullyconnected_implementations.cpp | 2 - .../nodes/executors/precision_translation.cpp | 2 - src/plugins/intel_cpu/src/nodes/eye.cpp | 1 - src/plugins/intel_cpu/src/serialize.h | 2 +- src/plugins/intel_cpu/src/utils/blob_dump.cpp | 1 - .../intel_cpu/src/utils/general_utils.h | 3 +- .../intel_cpu/tests/unit/dnnl_memory_test.cpp | 6 +- .../include/intel_gpu/plugin/custom_layer.hpp | 1 - .../tests/unit/test_utils/test_utils.h | 2 +- .../include/base/ov_behavior_test_utils.hpp | 2 +- .../ov_infer_request/infer_consistency.hpp | 1 - .../mocks/mock_engine/mock_plugin.cpp | 1 - 115 files changed, 111 insertions(+), 13277 deletions(-) delete mode 100644 src/core/src/runtime/blob_allocator.hpp delete mode 100644 src/inference/dev_api/blob_factory.hpp delete mode 100644 src/inference/dev_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp delete mode 100644 src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp delete mode 100644 src/inference/dev_api/cpp_interfaces/interface/ie_iplugin_internal.hpp delete mode 100644 src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp delete mode 100644 src/inference/dev_api/cpp_interfaces/plugin_itt.hpp delete mode 100644 src/inference/dev_api/description_buffer.hpp delete mode 100644 src/inference/dev_api/ie_icore.hpp delete mode 100644 src/inference/dev_api/ie_ngraph_utils.hpp delete mode 100644 src/inference/include/ie/cpp/ie_cnn_network.h delete mode 100644 src/inference/include/ie/cpp/ie_executable_network.hpp delete mode 100644 src/inference/include/ie/cpp/ie_infer_request.hpp delete mode 100644 src/inference/include/ie/cpp/ie_memory_state.hpp delete mode 100644 src/inference/include/ie/details/ie_pre_allocator.hpp delete mode 100644 src/inference/include/ie/ie_allocator.hpp delete mode 100644 src/inference/include/ie/ie_api.h delete mode 100644 src/inference/include/ie/ie_blob.h delete mode 100644 src/inference/include/ie/ie_common.h delete mode 100644 src/inference/include/ie/ie_core.hpp delete mode 100644 src/inference/include/ie/ie_data.h delete mode 100644 src/inference/include/ie/ie_icnn_network.hpp delete mode 100644 src/inference/include/ie/ie_iexecutable_network.hpp delete mode 100644 src/inference/include/ie/ie_iinfer_request.hpp delete mode 100644 src/inference/include/ie/ie_input_info.hpp delete mode 100644 src/inference/include/ie/ie_layouts.h delete mode 100644 src/inference/include/ie/ie_locked_memory.hpp delete mode 100644 src/inference/include/ie/ie_precision.hpp delete mode 100644 src/inference/include/ie/inference_engine.hpp delete mode 100644 src/inference/src/blob_factory.cpp delete mode 100644 src/inference/src/cnn_network_ngraph_impl.cpp delete mode 100644 src/inference/src/cnn_network_ngraph_impl.hpp delete mode 100644 src/inference/src/cpp/exception2status.hpp delete mode 100644 src/inference/src/cpp/ie_cnn_network.cpp delete mode 100644 src/inference/src/cpp/ie_executable_network.cpp delete mode 100644 src/inference/src/cpp/ie_executable_network_base.hpp delete mode 100644 src/inference/src/cpp/ie_infer_async_request_base.hpp delete mode 100644 src/inference/src/cpp/ie_infer_request.cpp delete mode 100644 src/inference/src/cpp_interfaces/interface/ie_iexecutable_network_internal.cpp delete mode 100644 src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp delete mode 100644 src/inference/src/cpp_interfaces/interface/ie_iplugin_internal.cpp delete mode 100644 src/inference/src/cpp_interfaces/interface/ie_ivariable_state_internal.cpp delete mode 100644 src/inference/src/dev/converter_utils.cpp delete mode 100644 src/inference/src/dev/converter_utils.hpp delete mode 100644 src/inference/src/dev/core_impl_ie.cpp delete mode 100644 src/inference/src/dev/icompiled_model_wrapper.cpp delete mode 100644 src/inference/src/dev/icompiled_model_wrapper.hpp delete mode 100644 src/inference/src/dev/iplugin_wrapper.cpp delete mode 100644 src/inference/src/dev/iplugin_wrapper.hpp delete mode 100644 src/inference/src/ie_blob_common.cpp delete mode 100644 src/inference/src/ie_common.cpp delete mode 100644 src/inference/src/ie_core.cpp delete mode 100644 src/inference/src/ie_data.cpp delete mode 100644 src/inference/src/ie_layouts.cpp delete mode 100644 src/inference/src/ie_network_reader.cpp delete mode 100644 src/inference/src/ie_network_reader.hpp delete mode 100644 src/inference/src/ie_ngraph_utils.cpp delete mode 100644 src/inference/src/system_allocator.cpp delete mode 100644 src/inference/src/system_allocator.hpp diff --git a/cmake/templates/openvino.pc.in b/cmake/templates/openvino.pc.in index 958a8bbd61d9ac..85e349e50b59f1 100644 --- a/cmake/templates/openvino.pc.in +++ b/cmake/templates/openvino.pc.in @@ -9,7 +9,6 @@ exec_prefix=${prefix}/@OV_CPACK_RUNTIMEDIR@ libdir=${exec_prefix} include_prefix=${prefix}/@OV_CPACK_INCLUDEDIR@ -includedir_old=${include_prefix}/ie includedir_new=${include_prefix} Name: OpenVINO @@ -17,6 +16,6 @@ Description: OpenVINOâ„¢ Toolkit URL: https://docs.openvino.ai/latest/index.html Version: @OpenVINO_VERSION@ Conflicts: openvino < @OpenVINO_VERSION@ -Cflags: -I${includedir_old} -I${includedir_new} @PKGCONFIG_OpenVINO_DEFINITIONS@ +Cflags: -I${includedir_new} @PKGCONFIG_OpenVINO_DEFINITIONS@ Libs: -L${libdir} @PKGCONFIG_OpenVINO_FRONTENDS@ -lopenvino_c -lopenvino @PKGCONFIG_OpenVINO_PRIVATE_DEPS@ Libs.private: -ldl -lm -lpthread -lrt diff --git a/docs/snippets/CMakeLists.txt b/docs/snippets/CMakeLists.txt index bb71809a9e2e87..757d95b8771ded 100644 --- a/docs/snippets/CMakeLists.txt +++ b/docs/snippets/CMakeLists.txt @@ -48,8 +48,7 @@ list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dldt_optimization_guide2.c # create a static library add_library(${TARGET_NAME} STATIC ${SOURCES}) -target_include_directories(${TARGET_NAME} PRIVATE "${OpenVINO_SOURCE_DIR}/src/inference/include/ie" - "${OpenVINO_SOURCE_DIR}/src/inference/include" +target_include_directories(${TARGET_NAME} PRIVATE "${OpenVINO_SOURCE_DIR}/src/inference/include" "${OpenVINO_SOURCE_DIR}/src/inference/dev_api" "${OpenVINO_SOURCE_DIR}/src/core/include" "${OpenVINO_SOURCE_DIR}/src/bindings/c/include" diff --git a/src/bindings/c/src/CMakeLists.txt b/src/bindings/c/src/CMakeLists.txt index bae88412fd0600..bade88e437e48b 100644 --- a/src/bindings/c/src/CMakeLists.txt +++ b/src/bindings/c/src/CMakeLists.txt @@ -55,8 +55,7 @@ install(TARGETS ${TARGET_NAME} EXPORT OpenVINOTargets ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE_C} ${OV_CPACK_COMP_CORE_C_EXCLUDE_ALL} LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${OV_CPACK_COMP_CORE_C} ${OV_CPACK_COMP_CORE_C_EXCLUDE_ALL} NAMELINK_COMPONENT ${OV_CPACK_COMP_CORE_C_DEV} - INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR} - ${OV_CPACK_INCLUDEDIR}/ie) + INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR}) install(DIRECTORY ${OpenVINO_C_API_SOURCE_DIR}/include/openvino/ DESTINATION ${OV_CPACK_INCLUDEDIR}/openvino diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index 770615d9365010..ed772ad0810734 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -37,8 +37,7 @@ ov_add_vs_version_file(NAME ${TARGET_NAME} FILEDESCRIPTION "OpenVINO runtime lib target_include_directories(${TARGET_NAME} PUBLIC $ $ - $ - $) + $) target_link_libraries(${TARGET_NAME} PRIVATE openvino::reference openvino::shape_inference @@ -92,8 +91,7 @@ install(TARGETS ${TARGET_NAME} EXPORT OpenVINOTargets ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${OV_CPACK_COMP_CORE} ${OV_CPACK_COMP_CORE_EXCLUDE_ALL} LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT ${OV_CPACK_COMP_CORE} ${OV_CPACK_COMP_CORE_EXCLUDE_ALL} NAMELINK_COMPONENT ${OV_CPACK_COMP_CORE_DEV} - INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR} - ${OV_CPACK_INCLUDEDIR}/ie) + INCLUDES DESTINATION ${OV_CPACK_INCLUDEDIR}) # OpenVINO runtime library dev diff --git a/src/common/transformations/tests/offline_transformations/pruning_test.cpp b/src/common/transformations/tests/offline_transformations/pruning_test.cpp index 9dab20582be727..52978905a41494 100644 --- a/src/common/transformations/tests/offline_transformations/pruning_test.cpp +++ b/src/common/transformations/tests/offline_transformations/pruning_test.cpp @@ -11,7 +11,6 @@ #include #include "common_test_utils/ov_test_utils.hpp" -#include "inference_engine.hpp" #include "mask_attribute.hpp" #include "openvino/core/model.hpp" #include "openvino/op/util/attr_types.hpp" @@ -5181,7 +5180,7 @@ TEST(TransformationTests, CheckReshapeWithNoConstInShape) { m.run_passes(model); } -INSTANTIATE_TEST_CASE_P(TransformationTestsBoolParam, TransformationTestsBoolParamF, ::testing::Values(false, true)); +INSTANTIATE_TEST_SUITE_P(TransformationTestsBoolParam, TransformationTestsBoolParamF, ::testing::Values(false, true)); TEST_F(TransformationTestsF, PruningWithVariadicSplitOnSecondAxis) { { diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 680bf15a5b037d..544f0d7d279373 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -29,8 +29,7 @@ if(ON) APPEND PROPERTY INCLUDE_DIRECTORIES $/src $/dev_api - $/include - $/include/ie) + $/include) endif() # Create named folders for the sources within the .vcproj diff --git a/src/core/include/openvino/core/any.hpp b/src/core/include/openvino/core/any.hpp index 622013b2b1f8b0..d5f45a9f4791e2 100644 --- a/src/core/include/openvino/core/any.hpp +++ b/src/core/include/openvino/core/any.hpp @@ -20,10 +20,6 @@ #include "openvino/core/except.hpp" #include "openvino/core/runtime_attribute.hpp" -namespace InferenceEngine { -class ExecutableNetwork; -} // namespace InferenceEngine - namespace ov { class Plugin; /** @cond INTERNAL */ @@ -662,7 +658,6 @@ class OPENVINO_API Any { }; friend class ::ov::RuntimeAttribute; - friend class ::InferenceEngine::ExecutableNetwork; friend class ::ov::CompiledModel; friend class ::ov::proxy::CompiledModel; friend class ::ov::RemoteContext; diff --git a/src/core/src/runtime/allocator.cpp b/src/core/src/runtime/allocator.cpp index 0abb440396cec5..01c43e4acefc06 100644 --- a/src/core/src/runtime/allocator.cpp +++ b/src/core/src/runtime/allocator.cpp @@ -4,9 +4,6 @@ #include "openvino/runtime/allocator.hpp" -#include "blob_allocator.hpp" -#include "ie_allocator.hpp" -#include "ie_common.h" #include "openvino/core/except.hpp" namespace ov { diff --git a/src/core/src/runtime/blob_allocator.hpp b/src/core/src/runtime/blob_allocator.hpp deleted file mode 100644 index 0513fdfa02d085..00000000000000 --- a/src/core/src/runtime/blob_allocator.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "ie_allocator.hpp" // IE public header -#include "openvino/core/except.hpp" -#include "openvino/runtime/allocator.hpp" -#include "openvino/runtime/common.hpp" -#include "system_allocator.hpp" // IE private header - -IE_SUPPRESS_DEPRECATED_START -namespace InferenceEngine { -struct BlobAllocator : public IAllocator { - BlobAllocator(const ov::Allocator& impl) : _impl{impl} {} - - void* lock(void* handle, LockOp) noexcept override { - return handle; - } - - void unlock(void*) noexcept override {} - - void* alloc(const size_t size) noexcept override { - try { - return size_map.emplace(_impl.allocate(size), size).first->first; - } catch (...) { - return nullptr; - } - } - - bool free(void* handle) noexcept override { - try { - auto size = size_map.at(handle); - size_map.erase(handle); - _impl.deallocate(handle, size); - return true; - } catch (...) { - return false; - } - } - - ov::Allocator _impl; - std::unordered_map size_map; -}; -} // namespace InferenceEngine - -namespace ov { -struct BlobAllocator { - BlobAllocator() : _impl{std::make_shared()} {} - - void* allocate(const size_t bytes, const size_t alignment) { - OPENVINO_ASSERT(alignment == alignof(max_align_t), - "Aligned deallocation is not implemented. alignment: ", - alignment); - auto handle = _impl->alloc(bytes); - OPENVINO_ASSERT(handle != nullptr, "Can not allocate storage for at least ", bytes, " bytes"); - return handle; - } - - void deallocate(void* handle, const size_t bytes, const size_t alignment) { - OPENVINO_ASSERT(bytes == 0, "Sized deallocation is not implemented. bytes: ", bytes); - OPENVINO_ASSERT(alignment == alignof(max_align_t), - "Aligned deallocation is not implemented. alignment: ", - alignment); - auto res = _impl->free(handle); - OPENVINO_ASSERT(res != false, "Can not deallocate storage"); - } - - bool is_equal(const BlobAllocator& other) const { - if (other._impl == _impl) - return true; - auto other_system_memory_allocator = - dynamic_cast(other._impl.get()); - auto system_allocator = dynamic_cast(_impl.get()); - if (system_allocator != nullptr && other_system_memory_allocator != nullptr) - return true; - return false; - } - - std::shared_ptr _impl; -}; -} // namespace ov -IE_SUPPRESS_DEPRECATED_END diff --git a/src/frontends/ir/tests/rt_info_deserialization.cpp b/src/frontends/ir/tests/rt_info_deserialization.cpp index ae43bb01e54921..4aa769f932faa0 100644 --- a/src/frontends/ir/tests/rt_info_deserialization.cpp +++ b/src/frontends/ir/tests/rt_info_deserialization.cpp @@ -9,7 +9,6 @@ #include #include "common_test_utils/graph_comparator.hpp" -#include "ie/ie_core.hpp" #include "openvino/core/preprocess/input_tensor_info.hpp" #include "openvino/frontend/manager.hpp" #include "openvino/op/add.hpp" @@ -137,19 +136,6 @@ TEST_F(RTInfoDeserialization, node_v10) { auto round = result->get_input_node_ptr(0); check_rt_info(round->get_rt_info()); - // read IR v10 with old API - { - InferenceEngine::Core core; - auto f_10 = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - ASSERT_NE(nullptr, f_10.getFunction()); - - auto res = compare_functions(f, f_10.getFunction()); - EXPECT_TRUE(res.first) << res.second; - - EXPECT_EQ(InferenceEngine::Precision::FP32, f_10.getInputsInfo()["in1"]->getPrecision()); - EXPECT_EQ(InferenceEngine::Precision::FP32, f_10.getOutputsInfo()["Round"]->getPrecision()); - } - // read IR v10 with new API and check that CNNNetwork precision conversions are applied { ov::Shape shape{1, 3, 22, 22}; @@ -263,16 +249,6 @@ TEST_F(RTInfoDeserialization, names_collision_v10) { }; check_version(f, 10); - // read IR v10 with old API - { - InferenceEngine::Core core; - auto f_10 = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - ASSERT_NE(nullptr, f_10.getFunction()); - - auto res = compare_functions(f, f_10.getFunction()); - EXPECT_TRUE(res.first) << res.second; - } - // read IR v10 with new API { ov::Core core; @@ -382,19 +358,6 @@ TEST_F(RTInfoDeserialization, input_and_output_v10) { check_rt_info(add->input(1).get_rt_info()); check_rt_info(add->output(0).get_rt_info()); - // read IR v10 with old API - { - InferenceEngine::Core core; - auto f_10 = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - ASSERT_NE(nullptr, f_10.getFunction()); - - auto res = compare_functions(f, f_10.getFunction()); - EXPECT_TRUE(res.first) << res.second; - - EXPECT_EQ(InferenceEngine::Precision::I64, f_10.getInputsInfo()["in1"]->getPrecision()); - EXPECT_EQ(InferenceEngine::Precision::I32, f_10.getOutputsInfo()["sum"]->getPrecision()); - } - // read IR v10 with new API and check that CNNNetwork precision conversions are applied { const ov::Shape shape{1, 3, 22, 22}; @@ -555,217 +518,6 @@ TEST_F(RTInfoDeserialization, node_v11) { check_version(f_11, 11); } - - // read IR v11 with old API and check that old_api_map is applied - { - const ov::PartialShape shape{1, 3, 22, 22}; - auto type = ov::element::f16; - auto param = std::make_shared(type, shape); - param->set_friendly_name("in1"); - param->get_output_tensor(0).set_names({"input_tensor"}); - - // TODO: No guarantee that Transpose will use exactly 'uint64_t' constant - auto constant_param = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); - auto transpose_param = std::make_shared(param, constant_param); - - // TODO: No guarantee that only 'convert' will be added by implicit pre-processing - auto convert_param = std::make_shared(transpose_param, ov::element::f32); - - auto round = std::make_shared(convert_param, ov::op::v5::Round::RoundMode::HALF_TO_EVEN); - // TODO: runtime information should migrate as well? - round->get_rt_info()[ov::FusedNames::get_type_info_static()] = ov::FusedNames("Round1,Round2"); - - // TODO: No guarantee that exactly 'convert, then transpose' will be added by implicit post-processing - auto constant_result = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); - auto transpose_result = std::make_shared(round, constant_result); - - transpose_result->set_friendly_name("Round"); - transpose_result->get_output_tensor(0).set_names({"output_tensor"}); - - auto result = std::make_shared(transpose_result); - result->set_friendly_name("output"); - - auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); - f_10_ref->set_friendly_name("Network"); - - InferenceEngine::Core core; - auto cnn_core = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - auto f_10_core = cnn_core.getFunction(); - ASSERT_NE(nullptr, f_10_core); - - check_version(f_10_core, 10); - - ASSERT_GT(cnn_core.getInputsInfo().count("in1"), 0); - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn_core.getInputsInfo()["in1"]->getPrecision()); - ASSERT_GT(cnn_core.getOutputsInfo().count("Round"), 0); - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn_core.getOutputsInfo()["Round"]->getPrecision()); - - const auto fc = FunctionsComparator::with_default() - .enable(FunctionsComparator::ATTRIBUTES) - .enable(FunctionsComparator::PRECISIONS) - .enable(FunctionsComparator::RUNTIME_KEYS) - .enable(FunctionsComparator::NAMES) - .enable(FunctionsComparator::CONST_VALUES); - auto res = fc.compare(f_10_core, f_10_ref); - EXPECT_TRUE(res.valid) << res.message; - - EXPECT_EQ(shape, f_10_ref->input().get_partial_shape()); - EXPECT_EQ(shape, f_10_core->input().get_partial_shape()); - EXPECT_EQ(shape, f_10_ref->get_output_partial_shape(0)); - EXPECT_EQ(shape, f_10_core->get_output_partial_shape(0)); - - // check that old api map is removed once applied - auto check_old_api_rt_info = [](const ov::RTMap& info) { - const std::string& key_order = ov::OldApiMapOrder::get_type_info_static(); - EXPECT_EQ(0, info.count(key_order)); - const std::string& key_type = ov::OldApiMapElementType::get_type_info_static(); - EXPECT_EQ(0, info.count(key_type)); - }; - - check_old_api_rt_info(f_10_core->get_parameters()[0]->get_rt_info()); - check_old_api_rt_info(f_10_core->get_result()->get_rt_info()); - - // check information about layout - EXPECT_EQ(f_10_core->get_parameters()[0]->get_layout(), ov::Layout("NCHW")) - << f_10_core->get_parameters()[0]->get_layout().to_string(); - EXPECT_EQ(f_10_core->get_results()[0]->get_layout(), ov::Layout("NCHW")) - << f_10_core->get_results()[0]->get_layout().to_string(); - } -} - -TEST_F(RTInfoDeserialization, node_v11_uint8) { - std::string model = R"V0G0N( - - - - - - - - - - - - 1 - 22 - 22 - 3 - - - - - - - - - - - 1 - 22 - 22 - 3 - - - - - 1 - 22 - 22 - 3 - - - - - - - - - - 1 - 22 - 22 - 3 - - - - - - - - - -)V0G0N"; - auto f = getWithIRFrontend(model); - ASSERT_NE(nullptr, f); - - // read IR v11 with old API and check that old_api_map is applied - const ov::PartialShape shape{1, 3, 22, 22}; - auto type = ov::element::f16; - auto param = std::make_shared(type, shape); - param->set_friendly_name("in1"); - param->get_output_tensor(0).set_names({"input_tensor"}); - - auto constant_param = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 2, 3, 1}); - auto transpose_param = std::make_shared(param, constant_param); - - auto round = std::make_shared(transpose_param, ov::op::v5::Round::RoundMode::HALF_TO_EVEN); - round->get_rt_info()[ov::FusedNames::get_type_info_static()] = ov::FusedNames("Round1,Round2"); - auto constant_result = - std::make_shared(ov::element::u64, ov::Shape{4}, std::vector{0, 3, 1, 2}); - auto transpose_result = std::make_shared(round, constant_result); - - transpose_result->set_friendly_name("Round"); - transpose_result->get_output_tensor(0).set_names({"output_tensor"}); - - auto result = std::make_shared(transpose_result); - result->set_friendly_name("output"); - - auto f_10_ref = std::make_shared(ov::ResultVector{result}, ov::ParameterVector{param}); - f_10_ref->set_friendly_name("Network"); - - InferenceEngine::Core core; - auto cnn_core = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - auto f_10_core = cnn_core.getFunction(); - ASSERT_NE(nullptr, f_10_core); - - ASSERT_GT(cnn_core.getInputsInfo().count("in1"), 0); - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn_core.getInputsInfo()["in1"]->getPrecision()); - ASSERT_GT(cnn_core.getOutputsInfo().count("Round"), 0); - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn_core.getOutputsInfo()["Round"]->getPrecision()); - - const auto fc = FunctionsComparator::with_default() - .enable(FunctionsComparator::ATTRIBUTES) - .enable(FunctionsComparator::PRECISIONS) - .enable(FunctionsComparator::RUNTIME_KEYS) - .enable(FunctionsComparator::NAMES) - .enable(FunctionsComparator::CONST_VALUES); - auto res = fc.compare(f_10_core, f_10_ref); - EXPECT_TRUE(res.valid) << res.message; - - EXPECT_EQ(shape, f_10_ref->input().get_partial_shape()); - EXPECT_EQ(shape, f_10_core->input().get_partial_shape()); - EXPECT_EQ(shape, f_10_ref->get_output_partial_shape(0)); - EXPECT_EQ(shape, f_10_core->get_output_partial_shape(0)); - - // check that old api map is removed once applied - auto check_old_api_rt_info = [](const ov::RTMap& info) { - const std::string& key_order = ov::OldApiMapOrder::get_type_info_static(); - EXPECT_EQ(0, info.count(key_order)); - const std::string& key_type = ov::OldApiMapElementType::get_type_info_static(); - EXPECT_EQ(0, info.count(key_type)); - }; - - check_old_api_rt_info(f_10_core->get_parameters()[0]->get_rt_info()); - check_old_api_rt_info(f_10_core->get_result()->get_rt_info()); - - // check information about layout - EXPECT_TRUE(f_10_core->get_parameters()[0]->get_layout().empty()) - << f_10_core->get_parameters()[0]->get_layout().to_string(); - EXPECT_TRUE(f_10_core->get_results()[0]->get_layout().empty()) - << f_10_core->get_results()[0]->get_layout().to_string(); } TEST_F(RTInfoDeserialization, node_v11_multiple_rt_keys) { @@ -948,33 +700,6 @@ TEST_F(RTInfoDeserialization, input_and_output_v11) { check_fused_names(add->input(0).get_rt_info(), "test2,test3"); check_fused_names(add->input(1).get_rt_info(), "test3,test4"); check_fused_names(add->output(0).get_rt_info(), "test4,test5"); - - // read IR v11 with old API - the function is the same since no old_api_map is applied - { - InferenceEngine::Core core; - auto cnn = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - auto f_10 = cnn.getFunction(); - ASSERT_NE(nullptr, f_10); - - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn.getInputsInfo()["in1"]->getPrecision()); - EXPECT_EQ(InferenceEngine::Precision::FP32, cnn.getOutputsInfo()["sum"]->getPrecision()); - - // check that old api map is removed once applied - auto check_old_api_rt_info = [](const ov::RTMap& info) { - const std::string& key_type = ov::OldApiMapElementType::get_type_info_static(); - EXPECT_FALSE(info.count(key_type)); - const std::string& key_order = ov::OldApiMapElementType::get_type_info_static(); - EXPECT_FALSE(info.count(key_order)); - }; - - check_old_api_rt_info(f_10->get_parameters()[0]->get_rt_info()); - check_old_api_rt_info(f_10->get_result()->get_rt_info()); - - auto res = compare_functions(f, f_10); - EXPECT_TRUE(res.first) << res.second; - - check_version(f_10, 10); - } } TEST_F(RTInfoDeserialization, indexes_input_and_output_v11) { @@ -1094,92 +819,3 @@ TEST_F(RTInfoDeserialization, indexes_input_and_output_v11) { ASSERT_EQ(f->get_results()[0]->get_friendly_name(), "output2"); ASSERT_EQ(f->get_results()[1]->get_friendly_name(), "output1"); } - -TEST_F(RTInfoDeserialization, v11_to_v10_without_rt_info) { - std::string model = R"V0G0N( - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - 1 - 3 - 22 - 22 - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - - 1 - 3 - 22 - 22 - - - - - - - - - - -)V0G0N"; - - auto check_version = [](const std::shared_ptr& f, int ref_version) { - auto& rt_info = f->get_rt_info(); - ASSERT_TRUE(rt_info.count("version")); - ASSERT_TRUE(rt_info.at("version").is()); - ASSERT_EQ(rt_info.at("version").as(), ref_version); - }; - InferenceEngine::Core core; - auto cnn = core.ReadNetwork(model, InferenceEngine::Blob::CPtr()); - auto f_10 = cnn.getFunction(); - ASSERT_NE(nullptr, f_10); - - check_version(f_10, 10); -} diff --git a/src/frontends/onnx/tests/onnx_import.in.cpp b/src/frontends/onnx/tests/onnx_import.in.cpp index 227f45aaea9774..3df40f8ecc38d5 100644 --- a/src/frontends/onnx/tests/onnx_import.in.cpp +++ b/src/frontends/onnx/tests/onnx_import.in.cpp @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include - #include #include #include diff --git a/src/inference/CMakeLists.txt b/src/inference/CMakeLists.txt index 25e4c590b68799..51f952f2a38767 100644 --- a/src/inference/CMakeLists.txt +++ b/src/inference/CMakeLists.txt @@ -88,7 +88,6 @@ target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE target_include_directories(${TARGET_NAME}_obj PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" $ - "${CMAKE_CURRENT_SOURCE_DIR}/include/ie" # TODO: remove in 2024.0 $<$:$> # for ov_plugins.hpp $,$>,${CMAKE_CURRENT_BINARY_DIR}/$,${CMAKE_CURRENT_BINARY_DIR}>) @@ -108,8 +107,7 @@ endif() add_library(${TARGET_NAME} INTERFACE) target_link_libraries(${TARGET_NAME} INTERFACE openvino::runtime) -target_include_directories(${TARGET_NAME} INTERFACE $ - $) +target_include_directories(${TARGET_NAME} INTERFACE $) ov_add_clang_format_target(${TARGET_NAME}_clang FOR_SOURCES ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${PUBLIC_HEADERS}) diff --git a/src/inference/dev_api/blob_factory.hpp b/src/inference/dev_api/blob_factory.hpp deleted file mode 100644 index 1c5a6801d654f6..00000000000000 --- a/src/inference/dev_api/blob_factory.hpp +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A file with helper functions to uniformly create Blob objects - * @file blob_factory.hpp - */ - -#pragma once - -#include -#include -#include - -#include "ie_blob.h" -#include "ie_data.h" -#include "openvino/runtime/itensor.hpp" -#include "openvino/runtime/so_ptr.hpp" - -IE_SUPPRESS_DEPRECATED_START -/** - * @private - */ -template -class BlobFactory { -public: - using BlobType = typename InferenceEngine::PrecisionTrait::value_type; - - static InferenceEngine::Blob::Ptr make(const InferenceEngine::TensorDesc& desc) { - return InferenceEngine::make_shared_blob(desc); - } - static InferenceEngine::Blob::Ptr make(const InferenceEngine::TensorDesc& desc, void* ptr) { - return InferenceEngine::make_shared_blob(desc, reinterpret_cast(ptr)); - } - static InferenceEngine::Blob::Ptr make(const InferenceEngine::TensorDesc& desc, void* ptr, const std::size_t size) { - return InferenceEngine::make_shared_blob(desc, reinterpret_cast(ptr), size); - } - static InferenceEngine::Blob::Ptr make(const InferenceEngine::TensorDesc& desc, - const std::shared_ptr& alloc) { - return InferenceEngine::make_shared_blob(desc, alloc); - } -}; - -/** - * @private - */ -template -InferenceEngine::Blob::Ptr make_shared_blob2(Args&&... args) { - return BlobFactory::make(std::forward(args)...); -} - -/** - * @brief Creates Blob::Ptr with precision. - * @ingroup ie_dev_api_memory - * - * @param[in] desc The TensorDesc object - * @return A Blob::Ptr pointer - */ -INFERENCE_ENGINE_API_CPP(InferenceEngine::Blob::Ptr) -make_blob_with_precision(const InferenceEngine::TensorDesc& desc); - -/** - * @brief Makes a blob with precision. - * @ingroup ie_dev_api_memory - * - * @param[in] desc The TensorDesc object - * @param ptr The pointer to a raw memory - * @return A Blob::Ptr pointer - */ -INFERENCE_ENGINE_API_CPP(InferenceEngine::Blob::Ptr) -make_blob_with_precision(const InferenceEngine::TensorDesc& desc, void* ptr); - -/** - * @brief Makes a blob with precision. - * @ingroup ie_dev_api_memory - * - * @param[in] desc The description - * @param[in] alloc The IAllocator object - * @return A Blob::Ptr pointer - */ -INFERENCE_ENGINE_API_CPP(InferenceEngine::Blob::Ptr) -make_blob_with_precision(const InferenceEngine::TensorDesc& desc, - const std::shared_ptr& alloc); - -/** - * @brief Creates Blob::Ptr with precision - * @ingroup ie_dev_api_memory - * - * @param[in] precision The precision - * @param args The arguments - * @tparam Args Variadic template arguments - * @return A Blob::Ptr pointer - */ -template -InferenceEngine::Blob::Ptr make_blob_with_precision(InferenceEngine::Precision precision, Args&&... args) { -#define USE_FACTORY(precision) \ - case InferenceEngine::Precision::precision: \ - return make_shared_blob2(std::forward(args)...); - - switch (precision) { - USE_FACTORY(FP32); - USE_FACTORY(FP64); - USE_FACTORY(FP16); - USE_FACTORY(Q78); - USE_FACTORY(I4); - USE_FACTORY(I8); - USE_FACTORY(I16); - USE_FACTORY(I32); - USE_FACTORY(I64); - USE_FACTORY(U4); - USE_FACTORY(U8); - USE_FACTORY(U16); - USE_FACTORY(U32); - USE_FACTORY(U64); - USE_FACTORY(BIN); - USE_FACTORY(BF16); - USE_FACTORY(BOOL); - USE_FACTORY(STRING); - default: - IE_THROW() << "cannot locate blob for precision: " << precision; - } -#undef USE_FACTORY -} - -namespace ov { - -ov::SoPtr make_tensor(const std::shared_ptr& tensor, bool unwrap = false); - -OPENVINO_RUNTIME_API std::shared_ptr tensor_to_blob(const ov::SoPtr& tensor, - bool unwrap = true, - InferenceEngine::TensorDesc desc = {}); - -} // namespace ov - -IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp deleted file mode 100644 index 4341677a3bd4ea..00000000000000 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_iexecutable_network_internal.hpp +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" -#include "openvino/runtime/so_ptr.hpp" - -namespace ov { -class Model; -namespace op { -namespace v0 { -class Parameter; -class Result; -} // namespace v0 -} // namespace op -} // namespace ov - -namespace InferenceEngine { - -class IInferencePlugin; -class IPluginWrapper; -class IInferRequestInternal; -class IVariableStateInternal; -class ICompiledModelWrapper; - -/** - * @interface IExecutableNetworkInternal - * @brief An internal API of executable network to be implemented by plugin, - * @ingroup ie_dev_api_exec_network_api - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IExecutableNetworkInternal) - : public std::enable_shared_from_this { -public: - /** - * @brief A shared pointer to IExecutableNetworkInternal interface - */ - using Ptr = std::shared_ptr; - - /** - * @brief Sets the network inputs info. - * @param[in] networkInputs The network inputs info - */ - virtual void setNetworkInputs(const InputsDataMap& networkInputs); - - /** - * @brief Sets the network outputs data. - * @param[in] networkOutputs The network outputs - */ - virtual void setNetworkOutputs(const OutputsDataMap& networkOutputs); - - /** - * @brief Sets the network parameters - * @param[in] params The network parameters - */ - virtual void setInputs(const std::vector>& params); - /** - * @brief Returns the network parameters - */ - virtual const std::vector>& getInputs() const; - /** - * @brief Sets the network results - * @param[in] results The network results - */ - virtual void setOutputs(const std::vector>& results); - /** - * @brief Returns the network results - */ - virtual const std::vector>& getOutputs() const; - - /** - * @brief Gets the Executable network output Data node information. The received info is stored in the given Data - * node. - * @return out Reference to the ConstOutputsDataMap object - */ - virtual ConstOutputsDataMap GetOutputsInfo() const; - - /** - * @brief Gets the Executable network input Data node information. The received info is stored in the given - * InputsDataMap object. - * @return inputs Reference to ConstInputsDataMap object. - */ - virtual ConstInputsDataMap GetInputsInfo() const; - - /** - * @brief Create an inference request object used to infer the network - * Note: the returned request will have allocated input and output blobs (that can be changed later) - * @return shared_ptr for the created request - */ - virtual std::shared_ptr CreateInferRequest(); - - /** - * @deprecated Use IExecutableNetworkInternal::Export(std::ostream& networkModel) - * @brief Export the current created executable network so it can be used later in the Import() main API - * @param modelFileName - path to the location of the exported file - */ - virtual void Export(const std::string& modelFileName); - - /** - * @brief Export the current created executable network so it can be used later in the Import() main API - * @param networkModel - Reference to network model output stream - */ - virtual void Export(std::ostream& networkModel); - - /** - * @brief Get executable graph information from a device - * @return A network object to store executable graph information - */ - virtual std::shared_ptr GetExecGraphInfo(); - - /** - * @brief Sets the pointer to plugin internal. - * @param[in] plugin The plugin - * @note Needed to correctly handle ownership between objects. - */ - virtual void SetPointerToPlugin(const std::shared_ptr& plugin); - - /** - * @brief Gets the pointer to plugin so. - * @note Needed to correctly handle ownership between objects. - * @return A shared pointer to the plugin so - */ - virtual std::shared_ptr GetPointerToSo(); - - /** - * @brief Sets configuration for current executable network - * @param config Map of pairs: (config name, config ov::Any value) - */ - virtual void SetConfig(const ov::AnyMap& config); - - /** - * @brief Gets configuration dedicated to plugin behaviour - * @param name A config key, can be found in properties.hpp - * @return A value of config corresponding to config key - */ - virtual ov::Any GetConfig(const std::string& name) const; - - /** - * @brief Gets general runtime metric for dedicated hardware - * @param name A metric name to request - * @return A metric value corresponding to metric key - */ - virtual ov::Any GetMetric(const std::string& name) const; - - /** - * @brief Raises the flag that model was loaded from cache - */ - void loadedFromCache(); - - /** - * @brief Provides an information how model was loaded - * - * @return true if model was loaded from cache - */ - bool isLoadedFromCache() const; - -protected: - virtual ~IExecutableNetworkInternal() = default; - - /** - * @brief Creates an inference request internal implementation. - * @note The method is called by IExecutableNetworkInternal::CreateInferRequest as - * plugin-specific implementation. - * @param[in] networkInputs The network inputs - * @param[in] networkOutputs The network outputs - * @return A shared pointer to inference request object. - */ - virtual std::shared_ptr CreateInferRequestImpl(InputsDataMap networkInputs, - OutputsDataMap networkOutputs); - /** - * @brief Creates an inference request internal implementation. - * @note The method is called by IExecutableNetworkInternal::CreateInferRequest as - * plugin-specific implementation. - * @param[in] inputs The function inputs - * @param[in] outputs The function outputs - * @return A shared pointer to inference request object. - */ - virtual std::shared_ptr CreateInferRequestImpl( - const std::vector>& inputs, - const std::vector>& outputs); - - InferenceEngine::InputsDataMap _networkInputs; //!< Holds information about network inputs info - InferenceEngine::OutputsDataMap _networkOutputs; //!< Holds information about network outputs data - std::vector> _parameters; - std::vector> _results; - - /** - * @brief A pointer to a IInferencePlugin interface. - * @note Needed to correctly handle ownership between objects. - */ - std::shared_ptr _plugin; - - /** - * @brief A pointer to a plugin library. - * @note Needed to correctly handle ownership between objects. - */ - std::shared_ptr _so; - - /** - * @brief If true, it means that model was loaded from cache - */ - bool _loadedFromCache = false; - - friend InferenceEngine::ICompiledModelWrapper; - friend InferenceEngine::IPluginWrapper; -}; - -/** - * @brief SoPtr to IExecutableNetworkInternal. - */ -using SoExecutableNetworkInternal = ov::SoPtr; - -} // namespace InferenceEngine diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp deleted file mode 100644 index 438b94acb65c2d..00000000000000 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_iinfer_request_internal.hpp +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include - -#include "cpp/ie_infer_request.hpp" -#include "ie_common.h" -#include "ie_input_info.hpp" -#include "openvino/core/node_output.hpp" -#include "openvino/runtime/so_ptr.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START -class IExecutableNetworkInternal; -class IVariableStateInternal; - -/** - * @interface IInferRequestInternal - * @brief An internal API of synchronous inference request to be implemented by plugin, - * which is used in InferRequestBase forwarding mechanism - * @ingroup ie_dev_api_infer_request_api - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IInferRequestInternal) - : public std::enable_shared_from_this { -public: - /** - * @brief A shared pointer to a IInferRequestInternal interface - */ - using Ptr = std::shared_ptr; - - IInferRequestInternal() = default; - - /** - * @brief Constructs a new instance. - * @param[in] networkInputs The network inputs info - * @param[in] networkOutputs The network outputs data - */ - IInferRequestInternal(const InputsDataMap& networkInputs, const OutputsDataMap& networkOutputs); - - /** - * @brief Constructs a new instance. - * @param[in] inputs The network inputs - * @param[in] outputs The network outputs - */ - IInferRequestInternal(const std::vector>& networkInputs, - const std::vector>& networkOutputs); - - /** - * @brief Infers specified input(s) in synchronous mode - * @note blocks all method of InferRequest while request is ongoing (running or waiting in queue) - */ - virtual void Infer(); - - /** - * @brief The minimal infer function to be implemented by plugins. It infers specified input(s) in synchronous mode - * @note - * * This method is used in IInferRequestInternal::Infer, which calls the common code first and after uses this - * plugin dependent implementation. - * * Blocks all method of InferRequest while request is ongoing (running or waiting in queue) - */ - virtual void InferImpl(); - - /** - * @brief Cancel current inference request execution - */ - virtual void Cancel(); - - /** - * @brief Queries performance measures per layer to get feedback of what is the most time consuming layer. - * Note: not all plugins may provide meaningful data - * @return - a map of layer names to profiling information for that layer. - */ - virtual std::map GetPerformanceCounts() const; - - /** - * @brief Set input/output data to infer - * @note Memory allocation doesn't happen - * @param name - a name of input or output blob. - * @param data - a reference to input or output blob. The type of Blob must correspond to the network input - * precision and size. - */ - virtual void SetBlob(const std::string& name, const Blob::Ptr& data); - - /** - * @brief Get input/output data to infer - * @note Memory allocation doesn't happen - * @param name - a name of input or output blob. - * @param data - a reference to input or output blob. The type of Blob must correspond to the network input - * precision and size. - */ - virtual Blob::Ptr GetBlob(const std::string& name); - - /** - * @brief Queries memory states. - * @return Returns memory states - */ - virtual std::vector> QueryState(); - - /** - * @brief Start inference of specified input(s) in asynchronous mode - * @note The method returns immediately. Inference starts also immediately. - */ - virtual void StartAsync(); - - /** - * @brief The minimal asynchronous inference function to be implemented by plugins. - * It starts inference of specified input(s) in asynchronous mode - * @note - * * The methos is used in AsyncInferRequestInternal::StartAsync which performs common steps first and - * calls plugin dependent implementation of this method after. - * * It returns immediately. Inference starts also immediately. - */ - virtual void StartAsyncImpl(); - - /** - * @brief Waits for the result to become available. Blocks until specified millis_timeout has elapsed or the result - * becomes available, whichever comes first. - * @param millis_timeout - maximum duration in milliseconds to block for - * @note There are special cases when millis_timeout is equal some value of WaitMode enum: - * * STATUS_ONLY - immediately returns request status (InferRequest::StatusCode). It doesn't block or interrupt - * current thread. - * * RESULT_READY - waits until inference result becomes available - * @return A status code - */ - virtual StatusCode Wait(int64_t millis_timeout); - - /** - * @brief Alias for callback type - */ - using Callback = std::function; - - /** - * @brief Set callback function which will be called on success or failure of asynchronous request - * @param callback - function to be called with the following description: - */ - virtual void SetCallback(Callback callback); - - /** - * @brief Check that @p blob is valid. Throws an exception if it's not. - * - * @param[in] blob The blob to check - * @param[in] name The name of input or output depending of if the @p blob is input or output - * @param[in] isInput Indicates if @p is input - * @param[in] refDims The reference dims, empty if not specified - */ - void checkBlob(const Blob::Ptr& blob, const std::string& name, bool isInput, const SizeVector& refDims = {}) const; - - /** - * @brief Check that all of the blobs is valid. Throws an exception if it's not. - */ - virtual void checkBlobs(); - - /** - * @brief Sets the pointer to executable network internal. - * @note Needed to correctly handle ownership between objects. - * @param[in] exeNetwork The executable network - */ - void setPointerToExecutableNetworkInternal(const std::shared_ptr& exeNetwork); - - /** - * @brief Returns the pointer to executable network internal. - * @returns The executable network - */ - std::shared_ptr getPointerToExecutableNetworkInternal() const; - - /** - * @brief Sets the pointer to so when needed. - * @note Needed to correctly handle ownership between objects. - * @param[in] so The library so - */ - void setPointerToSo(const std::shared_ptr& so); - - /** - * @brief Returns the pointer to so. - * @returns The library - */ - std::shared_ptr getPointerToSo() const; - /** - * @brief Gets the pointer to userData. - * @return Pointer to user data - */ - INFERENCE_ENGINE_DEPRECATED("The method will be removed") - void* GetUserData() noexcept; - - /** - * @brief Sets the pointer to userData. - * @param[in] Pointer to user data - */ - INFERENCE_ENGINE_DEPRECATED("The method will be removed") - void SetUserData(void* userData) noexcept; - - const std::vector>& GetInputs() const; - const std::vector>& GetOutputs() const; - - /** - * @brief Sets inputs/outputs from ov::Model - */ - virtual void setModelInputsOutputs(const std::vector>& inputs, - const std::vector>& outputs); - -protected: - /** - * @brief Destroys the object. - */ - virtual ~IInferRequestInternal(); - - /** - * @brief Checks and executes input data pre-processing if needed. - * @param inputs Inputs blobs to perform preprocessing on - * @param serial Whether to use multiple threads to execute the step - */ - void execDataPreprocessing(InferenceEngine::BlobMap& preprocessedBlobs, bool serial = false); - - /** - * @brief Helper function to find input or output blob by name - * @param name A name of input or output blob. - * @param foundInput A pointer to input information if found. - * @param foundOutput A pointer to output DataPtr if found. - * @return `True` - if loaded network has input with provided name, - * `false` - if loaded network has output with provided name - * @throws [not_found] exception if there is no input and output layers with given name - */ - bool findInputAndOutputBlobByName(const std::string& name, InputInfo::Ptr& foundInput, DataPtr& foundOutput) const; - - /** - * @brief Helper function to find input node by legacy blob name - * @param name A legacy name of input blob - * @return shared pointer to OpenVINO input node - */ - std::shared_ptr findInputByNodeName(const std::string& name) const; - /** - * @brief Helper function to find output node by legacy blob name - * @param name A legacy name of output blob - * @return shared pointer to OpenVINO output node - */ - std::shared_ptr findOutputByNodeName(const std::string& name) const; - - /** - * @brief Checks whether pre-processing step is required for a given input - * @param info InputInfo corresponding to input blob - * @param userBlob Input Blob object corresponding to input info - * @param deviceBlob Blob object in plugin's desired format - * @return `True` if pre-processing is required, `false` otherwise - */ - bool preProcessingRequired(const InputInfo::Ptr& info, - const Blob::Ptr& userBlob, - const Blob::Ptr& deviceBlob = nullptr); - - void addInputPreProcessingFor(const std::string& name, const Blob::Ptr& from, const Blob::Ptr& to); - - InferenceEngine::InputsDataMap _networkInputs; //!< Holds information about network inputs info - InferenceEngine::OutputsDataMap _networkOutputs; //!< Holds information about network outputs data - InferenceEngine::BlobMap _inputs; //!< A map of user passed blobs for network inputs - InferenceEngine::BlobMap _deviceInputs; //!< A map of actual network inputs, in plugin specific format - InferenceEngine::BlobMap _outputs; //!< A map of user passed blobs for network outputs - std::vector> _parameters; //!< A vector of function inputs - std::vector> _results; //!< A vector of function outputs - - /** - * @brief A shared pointer to IInferRequestInternal - * @note Needed to correctly handle ownership between objects. - */ - std::shared_ptr _exeNetwork; - /** - * @brief A shared pointer to loaded library - * @note Needed to correctly handle ownership between objects. - */ - std::shared_ptr _so; - Callback _callback; //!< A callback - -private: - void* _userData = nullptr; -}; - -/** - * @brief SoPtr to IInferRequestInternal. - */ -using SoIInferRequestInternal = ov::SoPtr; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_iplugin_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_iplugin_internal.hpp deleted file mode 100644 index 8480eef310b5be..00000000000000 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_iplugin_internal.hpp +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief Inference Engine plugin API wrapper, to be used by particular implementors - * @file ie_iplugin_internal.hpp - */ - -#pragma once - -#include -#include -#include -#include - -#include "blob_factory.hpp" -#include "cpp/ie_cnn_network.h" -#include "ie_input_info.hpp" -#include "openvino/core/extension.hpp" -#include "openvino/runtime/iplugin.hpp" -#include "openvino/runtime/so_ptr.hpp" -#include "openvino/util/pp.hpp" - -using namespace ov::threading; - -namespace InferenceEngine { - -class ExecutorManager; -class IExecutableNetworkInternal; -class IExtension; -class ICore; - -/** - * @brief Copies the values of `std::string` indexed map and apply const cast - * - * @param[in] map map to copy - * @return map that contains pointers to constant values - */ -template -std::map> constMapCast(const std::map>& map) { - std::map> res; - for (auto&& v : map) - res.emplace(v.first, std::const_pointer_cast(v.second)); - return res; -} - -/** - * @brief Copies the values of `std::string` indexed map and apply const cast - * - * @param[in] map map to copy - * @return map that contains pointers to values - */ -template -std::map> constMapCast(const std::map>& map) { - std::map> res; - for (auto&& v : map) - res.emplace(v.first, std::const_pointer_cast(v.second)); - return res; -} - -/** - * @brief Copies InputInfo - * - * @param[in] networkInputs The network inputs to copy from - * @return copy of network inputs - */ -INFERENCE_ENGINE_API_CPP(InputsDataMap) copyInfo(const InputsDataMap& networkInputs); - -/** - * @brief Copies OutputsData - * - * @param[in] networkInputs network outputs to copy from - * @return copy of network outputs - */ -INFERENCE_ENGINE_API_CPP(OutputsDataMap) copyInfo(const OutputsDataMap& networkOutputs); - -/** - * @brief Set input and output information to executable network. This method is used to - * set additional information to InferenceEngine::IExecutableNetworkInternal created by device plugin. - * @param exeNetwork Executable network object - * @param function Model with initial execution info - */ -INFERENCE_ENGINE_API_CPP(void) -SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const std::shared_ptr& function, - bool new_api); - -/** - * @brief Returns set of nodes which were removed after transformation. - * If originalFunction contains node1 and transformedFunction does not - * contains node1 in ops list, node1 will be returned. - * @param originalFunction Original network - * @param transformedFunction Transformed network - * @return Set of strings which contains removed node names - */ -INFERENCE_ENGINE_API_CPP(std::unordered_set) -GetRemovedNodes(const std::shared_ptr& originalFunction, - const std::shared_ptr& transformedFunction); - -/** - * @brief Returns set of nodes from original model which are - * determined as supported after applied transformation pipeline. - * @param model Original model - * @param transform Transformation pipeline function - * @param is_node_supported Function returning whether node is supported or not - * @return Set of strings which contains supported node names - */ -INFERENCE_ENGINE_API_CPP(std::unordered_set) -GetSupportedNodes(const std::shared_ptr& model, - std::function&)> transform, - std::function)> is_node_supported); - -/** - * @interface IInferencePlugin - * @brief An API of plugin to be implemented by a plugin - * @ingroup ie_dev_api_plugin_api - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IInferencePlugin) - : public std::enable_shared_from_this { - class VersionStore : public ov::Version { - void copyFrom(const Version& v); - - public: - VersionStore() = default; - - explicit VersionStore(const Version& v); - - VersionStore& operator=(const VersionStore& v); - } _version; - -public: - /** - * @brief A shared pointer to IInferencePlugin interface - */ - using Ptr = std::shared_ptr; - - /** - * @brief Sets a plugin version - * @param version A version to set - */ - void SetVersion(const ov::Version& version); - - /** - * @brief Gets a plugin version - * @return A const ov::Version object - */ - const ov::Version& GetVersion() const; - - /** - * @brief Provides a name of a plugin - * @return The name. - */ - virtual std::string GetName() const noexcept; - - /** - * @brief Sets a name for a plugin - * @param[in] name The name - */ - virtual void SetName(const std::string& name) noexcept; - - /** - * @brief Creates an executable network from an pares network object, users can create as many networks as they need - * and use them simultaneously (up to the limitation of the HW resources) - * @param network A network object acquired from InferenceEngine::Core::ReadNetwork - * @param config A string-string map of config parameters relevant only for this load operation - * @return Created Executable Network object - */ - virtual std::shared_ptr LoadNetwork(const CNNNetwork& network, - const std::map& config); - - /** - * @brief Creates an executable network from model file path - * @param modelPath A path to model - * @param config A string-string map of config parameters relevant only for this load operation - * @return Created Executable Network object - */ - virtual ov::SoPtr LoadNetwork(const std::string& modelPath, - const std::map& config); - - /** - * @brief Registers extension within plugin - * @param extension - pointer to already loaded extension - */ - virtual void AddExtension(const std::shared_ptr& extension); - - /** - * @brief Sets configuration for plugin, acceptable keys can be found in properties.hpp - * @param config string-string map of config parameters - */ - virtual void SetConfig(const std::map& config); - - /** - * @brief Sets configuration for plugin, acceptable keys can be found in openvino/runtime/properties.hpp - * @param config ov::AnyMap of config parameters - */ - virtual void SetProperties(const ov::AnyMap& config); - - /** - * @brief Gets configuration dedicated to plugin behaviour - * @param name - value of config corresponding to config key - * @param options - configuration details for config - * @return Value of config corresponding to config key - */ - virtual ov::Any GetConfig(const std::string& name, const ov::AnyMap& options) const; - - /** - * @brief Gets general runtime metric for dedicated hardware - * @param name - metric name to request - * @param options - configuration details for metric - * @return Metric value corresponding to metric key - */ - virtual ov::Any GetMetric(const std::string& name, const ov::AnyMap& options) const; - - /** - * @deprecated Use ImportNetwork(std::istream& networkModel, const std::map& config) - * @brief Creates an executable network from an previously exported network - * @param modelFileName - path to the location of the exported file - * @param config A string -> string map of parameters - * @return An Executable network - */ - virtual std::shared_ptr ImportNetwork(const std::string& modelFileName, - const std::map& config); - - /** - * @brief Creates an executable network from an previously exported network using plugin implementation - * and removes Inference Engine magic and plugin name - * @param networkModel Reference to network model output stream - * @param config A string -> string map of parameters - * @return An Executable network - */ - virtual std::shared_ptr ImportNetwork(std::istream& networkModel, - const std::map& config); - - /** - * @brief Sets pointer to ICore interface - * @param core Pointer to Core interface - */ - virtual void SetCore(std::weak_ptr core); - - /** - * @brief Gets reference to ICore interface - * @return Reference to ICore interface - */ - virtual std::shared_ptr GetCore() const noexcept; - - /** - * @brief Provides an information about used API - * @return true if new API is used - */ - bool IsNewAPI() const noexcept; - - /** - * @brief Gets reference to tasks execution manager - * @return Reference to ExecutorManager interface - */ - const std::shared_ptr& executorManager() const; - - /** - * @brief Queries a plugin about supported layers in network - * @param[in] network The network object to query - * @param[in] config The map of configuration parameters - * @return The result of query operator containing supported layers map - */ - virtual QueryNetworkResult QueryNetwork(const CNNNetwork& network, - const std::map& config) const; - -protected: - IInferencePlugin(); - virtual ~IInferencePlugin() = default; - - /** - * @brief Creates an executable network from a parsed network object, users can create as many networks as they need - * and use them simultaneously (up to the limitation of the HW resources) - * @note The function is used in - * InferencePluginInternal::LoadNetwork(const CNNNetwork&, const std::map&) - * which performs common steps first and calls this plugin-dependent method implementation after. - * @param network A network object - * @param config string-string map of config parameters relevant only for this load operation - * @return Shared pointer to the ExecutableNetwork object - */ - virtual std::shared_ptr LoadExeNetworkImpl( - const CNNNetwork& network, - const std::map& config); - - /** - * @brief Set input and output information to executable network. This method is used to - * set addtional information to InferenceEngine::IExecutableNetworkInternal create by device plugin. - * @param exeNetwork An executable network object to set information to - * @param inputs An input information to set - * @param outputs An output information to set - * @param function Function with initial execution info - */ - void SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const ConstInputsDataMap& inputs, - const ConstOutputsDataMap& outputs); - - /** - * @brief Set input and output information to executable network. This method is used to - * set additional information to InferenceEngine::IExecutableNetworkInternal create by device plugin. - * @param function Function with initial execution info - */ - void SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const std::shared_ptr& function); - - std::string _pluginName; //!< A device name that plugins enables - std::map _config; //!< A map config keys -> values - std::weak_ptr _core; //!< A pointer to ICore interface - std::shared_ptr _executorManager; //!< A tasks execution manager - bool _isNewAPI; //!< A flag which shows used API -}; - -/** - * @def IE_CREATE_PLUGIN - * @brief Defines a name of a function creating plugin instance - * @ingroup ie_dev_api_plugin_api - */ -#ifndef IE_CREATE_PLUGIN -# define IE_CREATE_PLUGIN CreatePluginEngine -#endif - -/** - * @private - */ -constexpr static const auto create_plugin_function = OV_PP_TOSTRING(IE_CREATE_PLUGIN); - -INFERENCE_ENGINE_API_CPP(std::shared_ptr<::ov::IPlugin>) -convert_plugin(const std::shared_ptr& from); - -} // namespace InferenceEngine - -/** - * @def IE_DEFINE_PLUGIN_CREATE_FUNCTION(PluginType, version) - * @brief Defines the exported `IE_CREATE_PLUGIN` function which is used to create a plugin instance - * @ingroup ie_dev_api_plugin_api - */ -#define IE_DEFINE_PLUGIN_CREATE_FUNCTION(PluginType, version, ...) \ - INFERENCE_PLUGIN_API(void) \ - IE_CREATE_PLUGIN(::std::shared_ptr<::ov::IPlugin>& plugin) noexcept(false); \ - void IE_CREATE_PLUGIN(::std::shared_ptr<::ov::IPlugin>& plugin) noexcept(false) { \ - std::shared_ptr<::InferenceEngine::IInferencePlugin> ie_plugin; \ - try { \ - ie_plugin = ::std::make_shared(__VA_ARGS__); \ - } catch (const InferenceEngine::Exception&) { \ - throw; \ - } catch (const std::exception& ex) { \ - IE_THROW() << ex.what(); \ - } catch (...) { \ - IE_THROW(Unexpected); \ - } \ - ie_plugin->SetVersion(version); \ - plugin = convert_plugin(ie_plugin); \ - } diff --git a/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp b/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp deleted file mode 100644 index f04a34bf841e63..00000000000000 --- a/src/inference/dev_api/cpp_interfaces/interface/ie_ivariable_state_internal.hpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include - -#include "ie_blob.h" -#include "openvino/runtime/so_ptr.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @interface IVariableStateInternal - * @brief Minimal interface for variable state implementation - * @ingroup ie_dev_api_variable_state_api - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(IVariableStateInternal) - : public std::enable_shared_from_this { -public: - /** - * @brief A shared pointer to a IVariableStateInternal interface - */ - using Ptr = std::shared_ptr; - - explicit IVariableStateInternal(const std::string& name); - - /** - * @brief Gets a variable state name - * @return A string representing variable state name - */ - virtual std::string GetName() const; - - /** - * @brief Reset internal variable state for relevant infer request, to a value specified as - * default for according `ReadValue` node - */ - virtual void Reset(); - - /** - * @brief Sets the new state for the next inference - * @param newState A new state - */ - virtual void SetState(const Blob::Ptr& newState); - - /** - * @brief Returns the value of the variable state. - * @return The value of the variable state - */ - virtual Blob::CPtr GetState() const; - -protected: - /** - * @brief A default dtor - */ - virtual ~IVariableStateInternal() = default; - - std::string name; - Blob::Ptr state; -}; - -/** - * @brief For compatibility reasons. - */ -using IMemoryStateInternal = IVariableStateInternal; - -/** - * @brief SoPtr to IVariableStateInternal. - */ -using SoIVariableStateInternal = ov::SoPtr; - -/** - * @brief For compatibility reasons. - */ -using MemoryStateInternal = IVariableStateInternal; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/dev_api/cpp_interfaces/plugin_itt.hpp b/src/inference/dev_api/cpp_interfaces/plugin_itt.hpp deleted file mode 100644 index b498cd5eed3f44..00000000000000 --- a/src/inference/dev_api/cpp_interfaces/plugin_itt.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief Defines openvino domains for tracing - * @file plugin_itt.hpp - */ - -#pragma once - -#include - -namespace InferenceEngine { -namespace itt { -namespace domains { -OV_ITT_DOMAIN(Plugin) -OV_ITT_DOMAIN(Plugin_LT) -} // namespace domains -} // namespace itt -} // namespace InferenceEngine diff --git a/src/inference/dev_api/description_buffer.hpp b/src/inference/dev_api/description_buffer.hpp deleted file mode 100644 index 517bd2f13808a4..00000000000000 --- a/src/inference/dev_api/description_buffer.hpp +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief Defines Description buffer to conviniently works with StatusCode and ResponseDesc - * @file description_buffer.hpp - */ - -#pragma once - -#include -#include -#include - -#include "ie_common.h" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief A description buffer wrapping StatusCode and ResponseDesc - * @ingroup ie_dev_api_error_debug - */ -struct INFERENCE_ENGINE_1_0_DEPRECATED DescriptionBuffer : public std::basic_streambuf> { - /** - * @brief Creeates a description buffer with parameters - * - * @param[in] err The error code - * @param desc The response desc to write an error message to - */ - DescriptionBuffer(StatusCode err, ResponseDesc* desc) : err(err) { - init(desc); - } - - /** - * @brief Constructs with StatusCode - * - * @param[in] err The StatusCode value - */ - explicit DescriptionBuffer(StatusCode err) : err(err) {} - - /** - * @brief Constructs with ResponseDesc - * - * @param desc The ResponseDesc pointer - */ - explicit DescriptionBuffer(ResponseDesc* desc) { - init(desc); - } - - /** - * @brief Constructs with parameters - * - * @param pBuffer The buffer to wrtie to. - * @param[in] len The length of `pBuffer` - */ - DescriptionBuffer(char* pBuffer, size_t len) { - init(pBuffer, len); - } - - /** - * @brief Constructs with parameters - * - * @param[in] err The StatusCode value - * @param pBuffer The buffer to wrtie to. - * @param[in] len The length of `pBuffer` - */ - DescriptionBuffer(StatusCode err, char* pBuffer, size_t len) : err(err) { - init(pBuffer, len); - } - - /** - * @brief Writes to ResponseDesc stream - * - * @param[in] obj The object to write to stream - * @tparam T An object type - * - * @return A reference to itself - */ - template - DescriptionBuffer& operator<<(const T& obj) { - if (!stream) - return *this; - (*stream.get()) << obj; - - return *this; - } - - /** - * @brief Converts to StatusCode - * @return A StatusCode value - */ - operator StatusCode() const { - if (stream) - stream->flush(); - return err; - } - -private: - std::unique_ptr stream; - StatusCode err = GENERAL_ERROR; - - void init(ResponseDesc* desc) { - if (desc == nullptr) - return; - init(desc->msg, sizeof(desc->msg) / sizeof(desc->msg[0])); - } - - void init(char* ptr, size_t len) { - if (nullptr != ptr && len > 0) { - // set the "put" pointer the start of the buffer and record it's length. - setp(ptr, ptr + len - 1); - } - stream.reset(new std::ostream(this)); - - if (nullptr != ptr && len > 0) { - ptr[len - 1] = 0; - (*stream.get()) << ptr; - } - } -}; -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/dev_api/ie_icore.hpp b/src/inference/dev_api/ie_icore.hpp deleted file mode 100644 index 4461c580a4515d..00000000000000 --- a/src/inference/dev_api/ie_icore.hpp +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file for ICore interface - * @file ie_icore.hpp - */ - -#pragma once - -#include -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "openvino/runtime/icore.hpp" -#include "openvino/runtime/properties.hpp" - -namespace InferenceEngine { - -class ICore : public ov::ICore { -public: - /** - * @brief Reads IR xml and bin (with the same name) files - * @param model string with IR - * @param weights shared pointer to constant blob with weights - * @param frontendMode read network without post-processing or other transformations - * @return CNNNetwork - */ - virtual CNNNetwork ReadNetwork(const std::string& model, - const Blob::CPtr& weights, - bool frontendMode = false) const = 0; - - /** - * @brief Reads IR xml and bin files - * @param modelPath path to IR file - * @param binPath path to bin file, if path is empty, will try to read bin file with the same name as xml and - * if bin file with the same name was not found, will load IR without weights. - * @return CNNNetwork - */ - virtual CNNNetwork ReadNetwork(const std::string& modelPath, const std::string& binPath) const = 0; - - /** - * @brief Creates an executable network from a network object. - * - * Users can create as many networks as they need and use - * them simultaneously (up to the limitation of the hardware resources) - * - * @param network CNNNetwork object acquired from Core::ReadNetwork - * @param deviceName Name of device to load network to - * @param config Optional map of pairs: (config name, config value) relevant only for this load - * operation - * @return An executable network reference - */ - virtual SoExecutableNetworkInternal LoadNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config = {}) = 0; - - /** - * @brief Creates an executable network from a model memory. - * - * Users can create as many networks as they need and use - * them simultaneously (up to the limitation of the hardware resources) - * - * @param modelStr String data of model - * @param weights Model's weights - * @param deviceName Name of device to load network to - * @param config Optional map of pairs: (config name, config value) relevant only for this load - * operation - * @param val Optional callback to perform validation of loaded CNNNetwork, if ReadNetwork is triggered - * @return An executable network reference - */ - virtual SoExecutableNetworkInternal LoadNetwork( - const std::string& modelStr, - const InferenceEngine::Blob::CPtr& weights, - const std::string& deviceName, - const std::map& config, - const std::function& val = nullptr) = 0; - - /** - * @brief Creates an executable network from a model file. - * - * Users can create as many networks as they need and use - * them simultaneously (up to the limitation of the hardware resources) - * - * @param modelPath Path to model - * @param deviceName Name of device to load network to - * @param config Optional map of pairs: (config name, config value) relevant only for this load - * operation - * @param val Optional callback to perform validation of loaded CNNNetwork, if ReadNetwork is triggered - * @return An executable network reference - */ - virtual SoExecutableNetworkInternal LoadNetwork(const std::string& modelPath, - const std::string& deviceName, - const std::map& config, - const std::function& val = nullptr) = 0; - - /** - * @brief Creates an executable network from a previously exported network - * @param networkModel network model stream - * @param deviceName Name of device load executable network on - * @param config Optional map of pairs: (config name, config value) relevant only for this load - * operation* - * @return An executable network reference - */ - virtual SoExecutableNetworkInternal ImportNetwork(std::istream& networkModel, - const std::string& deviceName = {}, - const std::map& config = {}) = 0; - - /** - * @brief Query device if it supports specified network with specified configuration - * - * @param deviceName A name of a device to query - * @param network Network object to query - * @param config Optional map of pairs: (config name, config value) - * @return An object containing a map of pairs a layer name -> a device name supporting this layer. - */ - virtual QueryNetworkResult QueryNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config) const = 0; - - /** - * @brief Gets general runtime metric for dedicated hardware. - * - * The method is needed to request common device properties - * which are executable network agnostic. It can be device name, temperature, other devices-specific values. - * - * @param deviceName - A name of a device to get a metric value. - * @param name - metric name to request. - * @return Metric value corresponding to metric key. - */ - virtual ov::Any GetMetric(const std::string& deviceName, - const std::string& name, - const ov::AnyMap& options = {}) const = 0; - - /** - * @brief Gets configuration dedicated to device behaviour. - * - * The method is targeted to extract information which can be set via SetConfig method. - * - * @param deviceName - A name of a device to get a configuration value. - * @param name - config key. - * @return Value of config corresponding to config key. - */ - virtual ov::Any GetConfig(const std::string& deviceName, const std::string& name) const = 0; - - /** - * @brief Returns devices available for neural networks inference - * - * @return A vector of devices. The devices are returned as { CPU, GPU.0, GPU.1 } - * If there more than one device of specific type, they are enumerated with .# suffix. - */ - virtual std::vector GetAvailableDevices() const = 0; - - /** - * @brief Checks whether device supports model caching feature - * - * @param deviceName - A name of a device to get a metric value. - * @return True if device has IMPORT_EXPORT_SUPPORT and CACHING_PROPERTIES metric in SUPPORTED_PROPERTIES and - * this metric returns 'true', False otherwise. - */ - virtual bool DeviceSupportsModelCaching(const std::string& deviceName) const = 0; - - /** - * @brief Get only configs that are supported by device - * @param deviceName Name of a device - * @param config Map of configs that can contains configs that are not supported by device - * @return map of configs that are supported by device - */ - virtual std::map GetSupportedConfig(const std::string& deviceName, - const std::map& config) = 0; - - virtual bool isNewAPI() const = 0; -}; - -} // namespace InferenceEngine diff --git a/src/inference/dev_api/ie_ngraph_utils.hpp b/src/inference/dev_api/ie_ngraph_utils.hpp deleted file mode 100644 index 6a2647037aa63d..00000000000000 --- a/src/inference/dev_api/ie_ngraph_utils.hpp +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "ie_precision.hpp" -#include "openvino/core/type/element_type.hpp" -#include "openvino/runtime/common.hpp" - -namespace InferenceEngine { -namespace details { - -INFERENCE_ENGINE_1_0_DEPRECATED inline ::ov::element::Type convertPrecision(const Precision& precision) { - Precision::ePrecision pType = precision; - switch (pType) { - case Precision::UNSPECIFIED: - return ::ov::element::Type(::ov::element::Type_t::undefined); - case Precision::FP32: - return ::ov::element::Type(::ov::element::Type_t::f32); - case Precision::FP64: - return ::ov::element::Type(::ov::element::Type_t::f64); - case Precision::FP16: - return ::ov::element::Type(::ov::element::Type_t::f16); - case Precision::BF16: - return ::ov::element::Type(::ov::element::Type_t::bf16); - case Precision::U4: - return ::ov::element::Type(::ov::element::Type_t::u4); - case Precision::U8: - return ::ov::element::Type(::ov::element::Type_t::u8); - case Precision::I4: - return ::ov::element::Type(::ov::element::Type_t::i4); - case Precision::I8: - return ::ov::element::Type(::ov::element::Type_t::i8); - case Precision::U16: - return ::ov::element::Type(::ov::element::Type_t::u16); - case Precision::I16: - return ::ov::element::Type(::ov::element::Type_t::i16); - case Precision::I32: - return ::ov::element::Type(::ov::element::Type_t::i32); - case Precision::U32: - return ::ov::element::Type(::ov::element::Type_t::u32); - case Precision::I64: - return ::ov::element::Type(::ov::element::Type_t::i64); - case Precision::U64: - return ::ov::element::Type(::ov::element::Type_t::u64); - case Precision::BOOL: - return ::ov::element::Type(::ov::element::Type_t::boolean); - case Precision::BIN: - return ::ov::element::Type(::ov::element::Type_t::u1); - case Precision::NF4: - return ::ov::element::Type(::ov::element::Type_t::nf4); - case Precision::STRING: - return ::ov::element::Type(::ov::element::Type_t::string); - case Precision::Q78: - case Precision::MIXED: - case Precision::CUSTOM: - default: - IE_THROW() << "Incorrect precision!"; - } -} - -INFERENCE_ENGINE_1_0_DEPRECATED inline ::ov::element::Type convertPrecision(const std::string& precision) { - return ::ov::element::Type(precision); -} - -INFERENCE_ENGINE_1_0_DEPRECATED inline Precision convertPrecision(const ::ov::element::Type& precision) { - switch (precision) { - case ::ov::element::Type_t::undefined: - return Precision(Precision::UNSPECIFIED); - case ::ov::element::Type_t::f16: - return Precision(Precision::FP16); - case ::ov::element::Type_t::f32: - return Precision(Precision::FP32); - case ::ov::element::Type_t::f64: - return Precision(Precision::FP64); - case ::ov::element::Type_t::bf16: - return Precision(Precision::BF16); - case ::ov::element::Type_t::i4: - return Precision(Precision::I4); - case ::ov::element::Type_t::i8: - return Precision(Precision::I8); - case ::ov::element::Type_t::i16: - return Precision(Precision::I16); - case ::ov::element::Type_t::i32: - return Precision(Precision::I32); - case ::ov::element::Type_t::i64: - return Precision(Precision::I64); - case ::ov::element::Type_t::u4: - return Precision(Precision::U4); - case ::ov::element::Type_t::u8: - return Precision(Precision::U8); - case ::ov::element::Type_t::u16: - return Precision(Precision::U16); - case ::ov::element::Type_t::u32: - return Precision(Precision::U32); - case ::ov::element::Type_t::u64: - return Precision(Precision::U64); - case ::ov::element::Type_t::u1: - return Precision(Precision::BIN); - case ::ov::element::Type_t::boolean: - return Precision(Precision::BOOL); - case ::ov::element::Type_t::nf4: - return Precision(Precision::NF4); - case ::ov::element::Type_t::string: - return Precision(Precision::STRING); - case ::ov::element::Type_t::dynamic: - return Precision(Precision::UNSPECIFIED); - default: - IE_THROW() << "Incorrect precision " << precision.to_string() << "!"; - return {}; - } -} - -/** - * @brief Clones input network including all layers and internal data objects - * @note Blobs inside layers are reused - * @param network A network to clone - * @return A cloned object - */ -INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(CNNNetwork) cloneNetwork(const CNNNetwork& network); - -} // namespace details -} // namespace InferenceEngine diff --git a/src/inference/dev_api/openvino/runtime/icompiled_model.hpp b/src/inference/dev_api/openvino/runtime/icompiled_model.hpp index 9cbe08b7d546c0..b22d4847f25549 100644 --- a/src/inference/dev_api/openvino/runtime/icompiled_model.hpp +++ b/src/inference/dev_api/openvino/runtime/icompiled_model.hpp @@ -15,6 +15,7 @@ #include "openvino/core/node_output.hpp" #include "openvino/runtime/common.hpp" +#include "openvino/runtime/iplugin.hpp" #include "openvino/runtime/iremote_context.hpp" #include "openvino/runtime/isync_infer_request.hpp" #include "openvino/runtime/remote_context.hpp" @@ -22,15 +23,10 @@ #include "openvino/runtime/threading/cpu_streams_executor.hpp" #include "openvino/runtime/threading/itask_executor.hpp" -namespace InferenceEngine { -class ICompiledModelWrapper; -} // namespace InferenceEngine - namespace ov { class CoreImpl; class IPlugin; -class IExecutableNetworkWrapper; class IAsyncInferRequest; /** @@ -150,8 +146,6 @@ class OPENVINO_RUNTIME_API ICompiledModel : public std::enable_shared_from_this< std::shared_ptr m_callback_executor = nullptr; //!< Holds a callback executor friend ov::CoreImpl; - friend ov::IExecutableNetworkWrapper; - friend InferenceEngine::ICompiledModelWrapper; // FIXME: Remove after removing IE API std::vector> _parameters; diff --git a/src/inference/dev_api/openvino/runtime/icore.hpp b/src/inference/dev_api/openvino/runtime/icore.hpp index bf4da34721d152..d494d326fb6dfd 100644 --- a/src/inference/dev_api/openvino/runtime/icore.hpp +++ b/src/inference/dev_api/openvino/runtime/icore.hpp @@ -24,6 +24,9 @@ class Plugin; } +class ICompiledModel; +class IRemoteContext; + /** * @interface ICore * @brief Minimal ICore interface to allow plugin to get information from Core OpenVINO class. diff --git a/src/inference/dev_api/openvino/runtime/iplugin.hpp b/src/inference/dev_api/openvino/runtime/iplugin.hpp index 92b9ad4e75d7a3..c5c36e2801fb09 100644 --- a/src/inference/dev_api/openvino/runtime/iplugin.hpp +++ b/src/inference/dev_api/openvino/runtime/iplugin.hpp @@ -22,15 +22,10 @@ #include "openvino/runtime/threading/executor_manager.hpp" #include "openvino/util/pp.hpp" -namespace InferenceEngine { - -class IPluginWrapper; -class IExtension; - -} // namespace InferenceEngine - namespace ov { +class ICompiledModel; + /** * @defgroup ov_dev_api OpenVINO Plugin API * @brief Defines Inference Engine Plugin API which can be used in plugin development @@ -229,8 +224,6 @@ class OPENVINO_RUNTIME_API IPlugin : public std::enable_shared_from_this m_core; //!< A pointer to ICore interface std::shared_ptr m_executor_manager; //!< A tasks execution manager diff --git a/src/inference/dev_api/openvino/runtime/make_tensor.hpp b/src/inference/dev_api/openvino/runtime/make_tensor.hpp index 7433b22a7fc38c..f728021c7e12ef 100644 --- a/src/inference/dev_api/openvino/runtime/make_tensor.hpp +++ b/src/inference/dev_api/openvino/runtime/make_tensor.hpp @@ -8,12 +8,6 @@ #include "openvino/runtime/itensor.hpp" #include "openvino/runtime/so_ptr.hpp" -namespace InferenceEngine { - -class Blob; - -} // namespace InferenceEngine - namespace ov { /** diff --git a/src/inference/docs/api_details.md b/src/inference/docs/api_details.md index 89a4ec9965196b..aca93eb4474fc5 100644 --- a/src/inference/docs/api_details.md +++ b/src/inference/docs/api_details.md @@ -1,7 +1,6 @@ # OpenVINO Inference API OpenVINO Inference API contains two folders: - * [ie](../include/ie/) - legacy API, this API is no longer being developed, * [openvino](../include/openvino/) - current public API, this part is described below. ## Components of Public OpenVINO Inference API diff --git a/src/inference/include/ie/cpp/ie_cnn_network.h b/src/inference/include/ie/cpp/ie_cnn_network.h deleted file mode 100644 index 616fd763c523de..00000000000000 --- a/src/inference/include/ie/cpp/ie_cnn_network.h +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides wrapper for ICNNNetwork object - * - * @file ie_cnn_network.h - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include - -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_data.h" -#include "ie_icnn_network.hpp" -#include "openvino/core/model.hpp" - -namespace InferenceEngine { - -class IExtension; - -/** - * @brief This class contains all the information about the Neural Network and the related binary information - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(CNNNetwork) { -public: - /** - * @brief A default constructor - */ - CNNNetwork(); - - IE_SUPPRESS_DEPRECATED_START - /** - * @deprecated Don't use this constructor. It will be removed soon - * @brief Allows helper class to manage lifetime of network object - * - * @param network Pointer to the network object - */ - INFERENCE_ENGINE_DEPRECATED("Don't use this constructor. It will be removed soon") - explicit CNNNetwork(std::shared_ptr network); - - /** - * @brief A constructor from ngraph::Function object - * This constructor wraps existing ngraph::Function - * If you want to avoid modification of original Function, please create a copy - * @param network Pointer to the ngraph::Function object - * @param exts Vector of pointers to IE extension objects - */ - explicit CNNNetwork(const std::shared_ptr& network); - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Gets the network output Data node information. The received info is stored in the given Data node. - * - * For single and multiple outputs networks. - * - * This method need to be called to find out OpenVINO output names for using them later - * when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob - * - * If you want to use framework names, you can use InferenceEngine::CNNNetwork::getOVNameForTensor - * method to map framework names to OpenVINO names - * - * @return the InferenceEngine::OutputsDataMap object - */ - OutputsDataMap getOutputsInfo() const; - - /** - * @brief Gets the network input Data node information. The received info is stored in the given InputsDataMap - * object. - * - * For single and multiple inputs networks. - * This method need to be called to find out OpenVINO input names for using them later - * when calling InferenceEngine::InferRequest::SetBlob - * - * If you want to use framework names, you can use InferenceEngine::ICNNNetwork::getOVNameForTensor - * method to map framework names to OpenVINO names - * - * @return The InferenceEngine::InputsDataMap object. - */ - InputsDataMap getInputsInfo() const; - - /** - * @brief Returns the number of layers in the network as an integer value - * @return The number of layers as an integer value - */ - size_t layerCount() const; - - /** - * @brief Returns the network name. - * @return Network name - */ - const std::string& getName() const; - - /** - * @brief Changes the inference batch size. - * - * @note There are several limitations and it's not recommended to use it. Set batch to the input shape and call - * InferenceEngine::CNNNetwork::reshape. - * - * @param size Size of batch to set - * - * @note Current implementation of the function sets batch size to the first dimension of all layers in the - * networks. Before calling it make sure that all your layers have batch in the first dimension, otherwise the - * method works incorrectly. This limitation is resolved via shape inference feature by using - * InferenceEngine::ICNNNetwork::reshape method. To read more refer to the Shape Inference section in documentation - * - * @note Current implementation of the function sets batch size to the first dimension of all layers in the - * networks. Before calling it make sure that all your layers have batch in the first dimension, otherwise the - * method works incorrectly. This limitation is resolved via shape inference feature by using - * InferenceEngine::ICNNNetwork::reshape method. To read more refer to the Shape Inference section in documentation - */ - void setBatchSize(const size_t size); - - /** - * @brief Gets the inference batch size - * @return The size of batch as a size_t value - */ - size_t getBatchSize() const; - - IE_SUPPRESS_DEPRECATED_START - /** - * @deprecated InferenceEngine::ICNNNetwork interface is deprecated - * @brief An overloaded operator cast to get pointer on current network - * - * @return A shared pointer of the current network - */ - INFERENCE_ENGINE_DEPRECATED("InferenceEngine::ICNNNetwork interface is deprecated") - operator ICNNNetwork::Ptr(); - - /** - * @deprecated InferenceEngine::ICNNNetwork interface is deprecated - * @brief An overloaded operator & to get current network - * - * @return An instance of the current network - */ - INFERENCE_ENGINE_DEPRECATED("InferenceEngine::ICNNNetwork interface is deprecated") - operator ICNNNetwork&(); - - /** - * @deprecated InferenceEngine::ICNNNetwork interface is deprecated - * @brief An overloaded operator & to get current network - * - * @return A const reference of the current network - */ - INFERENCE_ENGINE_DEPRECATED("InferenceEngine::ICNNNetwork interface is deprecated") - operator const ICNNNetwork&() const; - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Returns constant nGraph function - * @return constant nGraph function - */ - std::shared_ptr getFunction(); - - /** - * @brief Returns constant nGraph function - * @return constant nGraph function - */ - std::shared_ptr getFunction() const; - - /** - * @brief Adds output to the layer - * @param layerName Name of the layer - * @param outputIndex Index of the output - */ - void addOutput(const std::string& layerName, size_t outputIndex = 0); - - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Helper method to get collect all input shapes with names of corresponding Data objects - * @return Map of pairs: input name and its dimension. - */ - ICNNNetwork::InputShapes getInputShapes() const; - - /** - * @brief Run shape inference with new input shapes for the network - * @param inputShapes A map of pairs: name of corresponding data and its dimension. - */ - void reshape(const ICNNNetwork::InputShapes& inputShapes); - - /** - * @brief Serialize network to IR and weights files. - * - * @param xmlPath Path to output IR file. - * @param binPath Path to output weights file. The parameter is skipped in case - * of executable graph info serialization. - */ - void serialize(const std::string& xmlPath, const std::string& binPath = {}) const; - - /** - * @brief Serialize network to IR and weights streams. - * - * @param xmlBuf output IR stream. - * @param binBuf output weights stream. - */ - void serialize(std::ostream& xmlBuf, std::ostream& binBuf) const; - - /** - * @brief Serialize network to IR stream and weights Blob::Ptr. - * - * @param xmlBuf output IR stream. - * @param binBlob output weights Blob::Ptr. - */ - void serialize(std::ostream& xmlBuf, Blob::Ptr& binBlob) const; - - /** - * @brief Method maps framework tensor name to OpenVINO name - * @param orig_name Framework tensor name - * @return OpenVINO name - */ - std::string getOVNameForTensor(const std::string& orig_name) const; - -private: - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Network extra interface, might be nullptr - */ - std::shared_ptr network; - - /** - * @brief A pointer to the current network - */ - ICNNNetwork* actual = nullptr; - IE_SUPPRESS_DEPRECATED_END -}; - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/cpp/ie_executable_network.hpp b/src/inference/include/ie/cpp/ie_executable_network.hpp deleted file mode 100644 index 10ab6a66c3d12e..00000000000000 --- a/src/inference/include/ie/cpp/ie_executable_network.hpp +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides ExecutableNetwork class - * - * @file ie_executable_network.hpp - */ - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "cpp/ie_infer_request.hpp" -#include "ie_iexecutable_network.hpp" - -namespace ov { -class Core; -} // namespace ov - -namespace InferenceEngine { -class IExecutableNetworkInternal; - -/** - * @brief This is an interface of an executable network - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) { - std::shared_ptr _impl; - std::shared_ptr _so; - - /** - * @brief Constructs ExecutableNetwork from the initialized std::shared_ptr - * @param impl Initialized shared pointer - * @param so Plugin to use. This is required to ensure that ExecutableNetwork can work properly even if plugin - * object is destroyed. - */ - ExecutableNetwork(const std::shared_ptr& impl, const std::shared_ptr& so); - friend class Core; - friend class ov::Core; - -public: - /// @brief Default constructor - ExecutableNetwork() = default; - - /// @brief Default copy constructor - /// @param other other ExecutableNetwork object - ExecutableNetwork(const ExecutableNetwork& other) = default; - - /// @brief Default copy assignment operator - /// @param other other ExecutableNetwork object - /// @return reference to the current object - ExecutableNetwork& operator=(const ExecutableNetwork& other) = default; - - /// @brief Default move constructor - /// @param other other ExecutableNetwork object - ExecutableNetwork(ExecutableNetwork&& other) = default; - - /// @brief Default move assignment operator - /// @param other other ExecutableNetwork object - /// @return reference to the current object - ExecutableNetwork& operator=(ExecutableNetwork&& other) = default; - - /** - * @brief Destructor preserves unloading order of implementation object and reference to library - */ - ~ExecutableNetwork(); - - /** - * @brief Gets the Executable network output Data node information. - * - * The received info is stored in the given InferenceEngine::ConstOutputsDataMap node. - * This method need to be called to find output names for using them later - * when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob - * - * @return A collection that contains string as key, and const Data smart pointer as value - */ - ConstOutputsDataMap GetOutputsInfo() const; - - /** - * @brief Gets the executable network input Data node information. - * - * The received info is stored in the given InferenceEngine::ConstInputsDataMap object. - * This method need to be called to find out input names for using them later - * when calling InferenceEngine::InferRequest::SetBlob - * - * @return A collection that contains string as key, and const InputInfo smart pointer as value - */ - ConstInputsDataMap GetInputsInfo() const; - - /** - * @brief Creates an inference request object used to infer the network. - * - * The created request has allocated input and output blobs (that can be changed later). - * - * @return InferRequest object - */ - InferRequest CreateInferRequest(); - - /** - * @brief Exports the current executable network. - * - * @see Core::ImportNetwork - * - * @param modelFileName Full path to the location of the exported file - */ - void Export(const std::string& modelFileName); - - /** - * @brief Exports the current executable network. - * - * @see Core::ImportNetwork - * - * @param networkModel Network model output stream - */ - void Export(std::ostream& networkModel); - - /** - * @copybrief IExecutableNetwork::GetExecGraphInfo - * - * Wraps IExecutableNetwork::GetExecGraphInfo. - * @return CNNetwork containing Executable Graph Info - */ - CNNNetwork GetExecGraphInfo(); - - /** - * @brief Sets configuration for current executable network - * - * @param config Map of pairs: (config name, config value) - */ - void SetConfig(const ov::AnyMap& config); - - /** @brief Gets configuration for current executable network. - * - * The method is responsible to extract information - * which affects executable network execution. The list of supported configuration values can be extracted via - * ExecutableNetwork::GetMetric with the SUPPORTED_CONFIG_KEYS key, but some of these keys cannot be changed - * dynamically, e.g. DEVICE_ID cannot changed if an executable network has already been compiled for particular - * device. - * - * @param name config key, can be found in properties.hpp - * @return Configuration ov::Any value - */ - ov::Any GetConfig(const std::string& name) const; - - /** - * @brief Gets general runtime metric for an executable network. - * - * It can be network name, actual device ID on - * which executable network is running or all other properties which cannot be changed dynamically. - * - * @param name metric name to request - * @return Metric ov::Any value - */ - ov::Any GetMetric(const std::string& name) const; - - /** - * @brief Checks if current ExecutableNetwork object is not initialized - * @return true if current ExecutableNetwork object is not initialized, false - otherwise - */ - bool operator!() const noexcept; - - /** - * @brief Checks if current ExecutableNetwork object is initialized - * @return true if current ExecutableNetwork object is initialized, false - otherwise - */ - explicit operator bool() const noexcept; - - /** - * @deprecated The method Will be removed - * @brief reset owned object to new pointer. - * - * Essential for cases when simultaneously loaded networks not expected. - * @param newActual actual pointed object - */ - void reset(std::shared_ptr newActual); - - /** - * @deprecated Will be removed. Use operator bool - * @brief cast operator is used when this wrapper initialized by LoadNetwork - * @return A shared pointer to IExecutableNetwork interface. - */ - operator std::shared_ptr(); - - /** - * @deprecated Use ExecutableNetwork::CreateInferRequest - * @copybrief IExecutableNetwork::CreateInferRequest - * - * Wraps IExecutableNetwork::CreateInferRequest. - * @return shared pointer on InferenceEngine::InferRequest object - */ - InferRequest::Ptr CreateInferRequestPtr(); -}; - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/cpp/ie_infer_request.hpp b/src/inference/include/ie/cpp/ie_infer_request.hpp deleted file mode 100644 index 69702bb5cccd1f..00000000000000 --- a/src/inference/include/ie/cpp/ie_infer_request.hpp +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides wrapper classes for infer requests and callbacks. - * - * @file ie_infer_request.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include - -#include "cpp/ie_memory_state.hpp" -#include "ie_blob.h" -#include "ie_iinfer_request.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -class IInferRequestInternal; - -namespace details { -class ICompletionCallbackWrapper; -} // namespace details - -/** - * @copybrief IInferRequest - * - * Wraps IInferRequest - * It can throw exceptions safely for the application, where it is properly handled. - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(InferRequest) { - std::shared_ptr _impl; - std::shared_ptr _so; - - /** - * @brief Constructs InferRequest from the initialized std::shared_ptr - * @param impl Initialized shared pointer - * @param so Plugin to use. This is required to ensure that InferRequest can work properly even if plugin object is - * destroyed. - */ - InferRequest(const std::shared_ptr& impl, const std::shared_ptr& so); - friend class ExecutableNetwork; - -public: - /** - * @enum WaitMode - * @brief Enumeration to hold wait mode for IInferRequest - */ - enum INFERENCE_ENGINE_1_0_DEPRECATED WaitMode : int64_t { - /** Wait until inference result becomes available */ - RESULT_READY = -1, - /** IInferRequest doesn't block or interrupt current thread and immediately returns inference status */ - STATUS_ONLY = 0, - }; - - /** - * @brief A smart pointer to the InferRequest object - */ - using Ptr = std::shared_ptr; - - /// @brief Default constructor - InferRequest() = default; - - /// @brief Default copy constructor - /// @param other other InferRequest object - InferRequest(const InferRequest& other) = default; - - /// @brief Default copy assignment operator - /// @param other other InferRequest object - /// @return reference to the current object - InferRequest& operator=(const InferRequest& other) = default; - - /// @brief Default move constructor - /// @param other other InferRequest object - InferRequest(InferRequest&& other) = default; - - /// @brief Default move assignment operator - /// @param other other InferRequest object - /// @return reference to the current object - InferRequest& operator=(InferRequest&& other) = default; - - /** - * @brief Destructor preserves unloading order of implementation object and reference to library - */ - ~InferRequest(); - - /** - * @brief Sets input/output data to infer - * - * @note Memory allocation does not happen - * @param name Name of input or output blob. - * @param data Reference to input or output blob. The type of a blob must match the network input precision and - * size. - */ - void SetBlob(const std::string& name, const Blob::Ptr& data); - - /** - * @brief Gets input/output data for inference - * - * @note Memory allocation does not happen - * @param name A name of Blob to get - * @return A shared pointer to a Blob with a name @p name. If a blob is not found, an exception is thrown. - */ - Blob::Ptr GetBlob(const std::string& name); - - /** - * @brief Infers specified input(s) in synchronous mode - * - * @note blocks all methods of InferRequest while request is ongoing (running or waiting in queue) - * - */ - void Infer(); - - /** - * @brief Cancels inference request - */ - void Cancel(); - - /** - * @brief Queries performance measures per layer to get feedback of what is the most time consuming layer - * - * @note not all plugins provide meaningful data - * @return Map of layer names to profiling information for that layer - */ - std::map GetPerformanceCounts() const; - - /** - * @brief Sets input data to infer - * - * @note Memory allocation doesn't happen - * @param inputs A reference to a map of input blobs accessed by input names. - * The type of Blob must correspond to the network input precision and size. - */ - void SetInput(const BlobMap& inputs); - - /** - * @brief Sets data that will contain result of the inference - * - * @note Memory allocation doesn't happen - * @param results - a reference to a map of result blobs accessed by output names. - * The type of Blob must correspond to the network output precision and size. - */ - void SetOutput(const BlobMap& results); - - /** - * @brief Start inference of specified input(s) in asynchronous mode - * - * @note It returns immediately. Inference starts also immediately. - */ - void StartAsync(); - - /** - * @brief Waits for the result to become available. Blocks until specified millis_timeout has elapsed or the result - * becomes available, whichever comes first. - * - * - * @param millis_timeout Maximum duration in milliseconds to block for - * @note There are special cases when millis_timeout is equal some value of the WaitMode enum: - * * STATUS_ONLY - immediately returns inference status (IInferRequest::RequestStatus). It does not block or - * interrupt current thread - * * RESULT_READY - waits until inference result becomes available - * @return A status code of operation - */ - StatusCode Wait(int64_t millis_timeout = RESULT_READY); - -private: - void SetCompletionCallbackImpl(std::function); - void SetCompletionCallbackImpl(std::function); - IE_SUPPRESS_DEPRECATED_START - void SetCompletionCallbackImpl(IInferRequest::CompletionCallback); - IE_SUPPRESS_DEPRECATED_END - - template - struct SetCallback { - void operator()(std::function f) { - _this.SetCompletionCallbackImpl(std::move(f)); - } - InferRequest& _this; - }; - -public: - /** - * @brief Sets a callback function that will be called on success or failure of asynchronous request - * - * @param callbackToSet callback object which will be called on when inference finish. - */ - template - void SetCompletionCallback(F callbackToSet) { - SetCallback{*this}(std::move(callbackToSet)); - } - - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Gets state control interface for given infer request. - * - * State control essential for recurrent networks - * @return A vector of Memory State objects - */ - std::vector QueryState(); - - /** - * @brief IInferRequest pointer to be used directly in CreateInferRequest functions - * @return A shared pointer to IInferRequest interface - */ - INFERENCE_ENGINE_DEPRECATED("Will be removed") - operator std::shared_ptr(); - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Checks if current InferRequest object is not initialized - * @return true if current InferRequest object is not initialized, false - otherwise - */ - bool operator!() const noexcept; - - /** - * @brief Checks if current InferRequest object is initialized - * @return true if current InferRequest object is initialized, false - otherwise - */ - explicit operator bool() const noexcept; - - /** - * @brief Compares whether this request wraps the same impl underneath - * @return true if current InferRequest object doesn't wrap the same impl as the operator's arg - */ - bool operator!=(const InferRequest&) const noexcept; - - /** - * @brief Compares whether this request wraps the same impl underneath - * @return true if current InferRequest object wraps the same impl as the operator's arg - */ - bool operator==(const InferRequest&) const noexcept; -}; - -/** - * @private - */ -template <> -struct InferRequest::SetCallback> { - void operator()(std::function f) { - _this.SetCompletionCallbackImpl(std::move(f)); - } - InferRequest& _this; -}; - -/** - * @private - */ -template <> -struct InferRequest::SetCallback { - void operator()(IInferRequest::CompletionCallback f) { - _this.SetCompletionCallbackImpl(std::move(f)); - } - InferRequest& _this; -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/cpp/ie_memory_state.hpp b/src/inference/include/ie/cpp/ie_memory_state.hpp deleted file mode 100644 index bef706632d4353..00000000000000 --- a/src/inference/include/ie/cpp/ie_memory_state.hpp +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides VariableState - * - * @file ie_memory_state.hpp - */ - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include - -#include "ie_api.h" -#include "ie_blob.h" - -namespace InferenceEngine { - -class IVariableStateInternal; -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief VariableState class - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(VariableState) { - std::shared_ptr _impl; - std::shared_ptr _so; - - /** - * @brief Constructs VariableState from the initialized std::shared_ptr - * @param impl Initialized shared pointer - * @param so Optional: Plugin to use. This is required to ensure that VariableState can work properly even if plugin - * object is destroyed. - */ - VariableState(const std::shared_ptr& impl, const std::shared_ptr& so); - friend class InferRequest; - friend class ExecutableNetwork; - -public: - /// @brief Default constructor - VariableState() = default; - - /// @brief Default copy constructor - /// @param other other VariableState object - VariableState(const VariableState& other) = default; - - /// @brief Default copy assignment operator - /// @param other other VariableState object - /// @return reference to the current object - VariableState& operator=(const VariableState& other) = default; - - /// @brief Default move constructor - /// @param other other VariableState object - VariableState(VariableState&& other) = default; - - /// @brief Default move assignment operator - /// @param other other VariableState object - /// @return reference to the current object - VariableState& operator=(VariableState&& other) = default; - - /** - * @brief Destructor preserves unloading order of implementation object and reference to library - */ - ~VariableState(); - - /** - * @brief Reset internal variable state for relevant infer request, - * to a value specified as default for according ReadValue node - */ - void Reset(); - - /** - * @brief Gets name of current variable state, if length of array is not enough name is truncated by len, null - * terminator is inserted as well. As variable state name `variable_id` from according `ReadValue` used. - * @return A string representing a state name - */ - std::string GetName() const; - - /** - * @brief Returns the value of the variable state. - * @return A blob representing a state - */ - Blob::CPtr GetState() const; - - /** - * @brief Sets the new state for the next inference. - * @param state The current state to set - */ - void SetState(Blob::Ptr state); -}; - -/** - * @brief For compatibility reasons. - */ -using MemoryState = VariableState; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/details/ie_pre_allocator.hpp b/src/inference/include/ie/details/ie_pre_allocator.hpp deleted file mode 100644 index b9e55d4bb98216..00000000000000 --- a/src/inference/include/ie/details/ie_pre_allocator.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief The header file defines utility PreAllocator class - * - * @file ie_pre_allocator.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include - -#include "ie_allocator.hpp" - -IE_SUPPRESS_DEPRECATED_START -namespace InferenceEngine { -namespace details { -/* - * @brief This is a helper class to wrap external memory - */ -class INFERENCE_ENGINE_1_0_DEPRECATED PreAllocator final : public IAllocator { - void* _actualData; - size_t _sizeInBytes; - -public: - PreAllocator(void* ptr, size_t bytes_size) : _actualData(ptr), _sizeInBytes(bytes_size) {} - /** - * @brief Locks a handle to heap memory accessible by any memory manipulation routines - * @return The generic pointer to a memory buffer - */ - void* lock(void* handle, LockOp = LOCK_FOR_WRITE) noexcept override { - if (handle != _actualData) { - return nullptr; - } - return handle; - } - /** - * @brief The PreAllocator class does not utilize this function - */ - void unlock(void*) noexcept override {} - - /** - * @brief Returns a pointer to preallocated memory - * @param size Size in bytes - * @return A handle to the preallocated memory or nullptr - */ - void* alloc(size_t size) noexcept override { - if (size <= _sizeInBytes) { - return _actualData; - } - - return nullptr; - } - /** - * @brief The PreAllocator class cannot release the handle - * @return false - */ - bool free(void*) noexcept override { - return false; - } -}; - -/** - * @brief Creates a special allocator that only works on external memory - * @param ptr Pointer to preallocated memory - * @param size Number of elements allocated - * @return A new allocator - */ -template -std::shared_ptr INFERENCE_ENGINE_1_0_DEPRECATED make_pre_allocator(T* ptr, size_t size) { - return std::make_shared(ptr, size * sizeof(T)); -} - -} // namespace details -} // namespace InferenceEngine -IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_allocator.hpp b/src/inference/include/ie/ie_allocator.hpp deleted file mode 100644 index bd01531526a7c7..00000000000000 --- a/src/inference/include/ie/ie_allocator.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides Allocator interface - * - * @file ie_allocator.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include - -#include "ie_api.h" - -IE_SUPPRESS_DEPRECATED_START -namespace InferenceEngine { - -/** - * @brief Allocator handle mapping type - */ -enum INFERENCE_ENGINE_1_0_DEPRECATED LockOp { - LOCK_FOR_READ = 0, //!< A flag to lock data for read - LOCK_FOR_WRITE //!< A flag to lock data for write -}; - -/** - * @interface IAllocator - * @brief Allocator concept to be used for memory management and is used as part of the Blob. - */ -class INFERENCE_ENGINE_1_0_DEPRECATED IAllocator : public std::enable_shared_from_this { -public: - /** - * @brief Maps handle to heap memory accessible by any memory manipulation routines. - * - * @param handle Handle to the allocated memory to be locked - * @param op Operation to lock memory for - * @return Generic pointer to memory - */ - virtual void* lock(void* handle, LockOp op = LOCK_FOR_WRITE) noexcept = 0; - /** - * @brief Unmaps memory by handle with multiple sequential mappings of the same handle. - * - * The multiple sequential mappings of the same handle are suppose to get the same - * result while there isn't a ref counter supported. - * - * @param handle Handle to the locked memory to unlock - */ - virtual void unlock(void* handle) noexcept = 0; - /** - * @brief Allocates memory - * - * @param size The size in bytes to allocate - * @return Handle to the allocated resource - */ - virtual void* alloc(size_t size) noexcept = 0; - /** - * @brief Releases the handle and all associated memory resources which invalidates the handle. - * @param handle The handle to free - * @return `false` if handle cannot be released, otherwise - `true`. - */ - virtual bool free(void* handle) noexcept = 0; - -protected: - virtual ~IAllocator() = default; -}; - -/** - * @brief Creates the default implementation of the Inference Engine allocator per plugin. - * - * @return The Inference Engine IAllocator* instance - */ -INFERENCE_ENGINE_API_CPP(std::shared_ptr) -INFERENCE_ENGINE_1_0_DEPRECATED CreateDefaultAllocator() noexcept; - -} // namespace InferenceEngine -IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_api.h b/src/inference/include/ie/ie_api.h deleted file mode 100644 index e43d7a377a9863..00000000000000 --- a/src/inference/include/ie/ie_api.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS. - * @file ie_api.h - */ - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#if defined(OPENVINO_STATIC_LIBRARY) || defined(USE_STATIC_IE) || (defined(__GNUC__) && (__GNUC__ < 4)) -# define INFERENCE_ENGINE_API(...) extern "C" __VA_ARGS__ -# define INFERENCE_ENGINE_API_CPP(...) __VA_ARGS__ -# define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__ -#else -# if defined(_WIN32) || defined(__CYGWIN__) -# ifdef IMPLEMENT_INFERENCE_ENGINE_API -# define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllexport) __VA_ARGS__ __cdecl -# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllexport) __VA_ARGS__ -# define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllexport) __VA_ARGS__ -# else -# define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllimport) __VA_ARGS__ __cdecl -# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllimport) __VA_ARGS__ -# define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllimport) __VA_ARGS__ -# endif -# else -# define INFERENCE_ENGINE_API(...) extern "C" __attribute__((visibility("default"))) __VA_ARGS__ -# define INFERENCE_ENGINE_API_CPP(...) __attribute__((visibility("default"))) __VA_ARGS__ -# define INFERENCE_ENGINE_API_CLASS(...) __attribute__((visibility("default"))) __VA_ARGS__ -# endif -#endif - -#if defined(__GNUC__) -# define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated(msg))) -# if __GNUC__ >= 6 || defined(__clang__) -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) INFERENCE_ENGINE_DEPRECATED(msg) -# else -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) -# endif -#elif defined(_MSC_VER) -# define INFERENCE_ENGINE_DEPRECATED(msg) __declspec(deprecated(msg)) -# if _MSC_VER >= 1900 /* VS2015 */ -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) [[deprecated(msg)]] -# else -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) -# endif -#elif defined(__INTEL_COMPILER) -# define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated(msg))) -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) INFERENCE_ENGINE_DEPRECATED(msg) -#else -# define INFERENCE_ENGINE_DEPRECATED(msg) -# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) -#endif - -#define INFERENCE_ENGINE_1_0_DEPRECATED \ - INFERENCE_ENGINE_DEPRECATED("The Inference Engine API is deprecated and will be removed in the 2024.0 release. " \ - "For instructions on transitioning to the new API, please refer to " \ - "https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") - -// Suppress warning "-Wdeprecated-declarations" / C4996 -#if defined(__GNUC__) -# define IE_DO_PRAGMA(x) _Pragma(# x) -#elif defined(_MSC_VER) -# define IE_DO_PRAGMA(x) __pragma(x) -#else -# define IE_DO_PRAGMA(x) -#endif - -#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 405)) || defined(__clang__) -# define IE_SUPPRESS_DEPRECATED_START \ - IE_DO_PRAGMA(GCC diagnostic push) \ - IE_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations") -# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(GCC diagnostic pop) -#elif defined(_MSC_VER) -# define IE_SUPPRESS_DEPRECATED_START \ - IE_DO_PRAGMA(warning(push)) \ - IE_DO_PRAGMA(warning(disable : 4996)) -# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop)) -#elif defined(__INTEL_COMPILER) -# define IE_SUPPRESS_DEPRECATED_START \ - IE_DO_PRAGMA(warning(push)) \ - IE_DO_PRAGMA(warning(disable : 1478)) \ - IE_DO_PRAGMA(warning(disable : 1786)) -# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop)) -#else -# define IE_SUPPRESS_DEPRECATED_START -# define IE_SUPPRESS_DEPRECATED_END -#endif - -#if defined __GNUC__ && (__GNUC__ <= 4 || (__GNUC__ == 5 && __GNUC_MINOR__ <= 5) || \ - (defined __i386__ || defined __arm__ || defined __aarch64__)) -# define _IE_SUPPRESS_DEPRECATED_START_GCC IE_SUPPRESS_DEPRECATED_START -# define _IE_SUPPRESS_DEPRECATED_END_GCC IE_SUPPRESS_DEPRECATED_END -#else -# define _IE_SUPPRESS_DEPRECATED_START_GCC -# define _IE_SUPPRESS_DEPRECATED_END_GCC -#endif - -#ifndef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# ifdef _WIN32 -# if defined(__INTEL_COMPILER) || defined(_MSC_VER) || defined(__GNUC__) -# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# endif -# elif defined(__clang__) -# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) -# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# endif -#endif - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -# ifndef ENABLE_UNICODE_PATH_SUPPORT -# define ENABLE_UNICODE_PATH_SUPPORT -# endif -#endif - -/** - * @def INFERENCE_PLUGIN_API(type) - * @brief Defines Inference Engine Plugin API method - * @param type A plugin type - */ - -#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(IMPLEMENT_INFERENCE_ENGINE_PLUGIN) -# define INFERENCE_PLUGIN_API(type) extern "C" __declspec(dllexport) type -#else -# define INFERENCE_PLUGIN_API(type) INFERENCE_ENGINE_API(type) -#endif diff --git a/src/inference/include/ie/ie_blob.h b/src/inference/include/ie/ie_blob.h deleted file mode 100644 index 4436136c5832e8..00000000000000 --- a/src/inference/include/ie/ie_blob.h +++ /dev/null @@ -1,894 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file for Blob and generic TBlob<> - * - * @file ie_blob.h - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "details/ie_pre_allocator.hpp" -#include "ie_allocator.hpp" -#include "ie_common.h" -#include "ie_layouts.h" -#include "ie_locked_memory.hpp" -#include "ie_precision.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief This class represents a universal container in the Inference Engine - * - * @note Each Blob implementation must be derived from this Blob class directly or indirectly - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Blob) { -public: - /** - * @brief A smart pointer containing Blob object - */ - using Ptr = std::shared_ptr; - - /** - * @brief A smart pointer to the const Blob object - */ - using CPtr = std::shared_ptr; - - /** - * @brief Creates a TBlob<> object from a Data node - * - * @param data A reference to a smart pointer of the Data node - * @return Smart pointer to TBlob<> with the relevant C type to the precision of the data node - */ - static Ptr CreateFromData(const DataPtr& data); - - /** - * @brief Blob virtual destructor - */ - virtual ~Blob(); - - /** - * @brief Checks if the Blob object can be cast to the type T* - * - * @tparam T Type to be checked. Must represent a class derived from the Blob - * @return true if this object can be dynamically cast to the type T*. Otherwise, false - */ - template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> - bool is() noexcept { - return dynamic_cast(this) != nullptr; - } - - /** - * @brief Checks if the Blob object can be cast to the type const T* - * - * @tparam T Type to be checked. Must represent a class derived from the Blob - * @return true if this object can be dynamically cast to the type const T*. Otherwise, false - */ - template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> - bool is() const noexcept { - return dynamic_cast(this) != nullptr; - } - - /** - * @brief Casts this Blob object to the type T*. - * - * Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers - * - * @tparam T Type to cast to. Must represent a class derived from the Blob - * @return Raw pointer to the object of the type T or nullptr on error - */ - template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> - T* as() noexcept { - return dynamic_cast(this); - } - - /** - * @brief Casts this Blob object to the type const T*. - * - * Use InferenceEngine::as() to operate with shared Blob objects instead of raw pointers - * - * @tparam T Type to cast to. Must represent a class derived from the Blob - * @return Raw pointer to the object of the type const T or nullptr on error - */ - template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> - const T* as() const noexcept { - return dynamic_cast(this); - } - - /** - * @brief Constructor. Creates an empty Blob object with the specified precision. - * - * @param tensorDesc Defines the layout and dims of the blob - */ - explicit Blob(const TensorDesc& tensorDesc) : tensorDesc(tensorDesc) {} - - /** - * @brief Returns the tensor description - * @return A const reference to a tensor descriptor - */ - virtual const TensorDesc& getTensorDesc() const noexcept { - return tensorDesc; - } - - /** - * @brief Returns the tensor description - * @return A reference to a tensor descriptor - */ - virtual TensorDesc& getTensorDesc() noexcept { - return tensorDesc; - } - - /** - * @brief By default, returns the total number of elements (a product of all the dims or 1 for scalar) - * - * Return value and its interpretation heavily depend on the blob type - * - * @return The total number of elements - */ - virtual size_t size() const noexcept { - if (tensorDesc.getLayout() == Layout::SCALAR) - return 1; - return product(tensorDesc.getDims()); - } - - /** - * @brief Returns the size of the current Blob in bytes. - * @return Blob's size in bytes - */ - virtual size_t byteSize() const { - return size() * element_size(); - } - - /** - * @deprecated Cast to MemoryBlob and use its API instead. - * Blob class can represent compound blob, which do not refer to the only solid memory. - * - * @brief Provides the number of bytes per element. - * - * The overall Blob capacity is size() * element_size(). Abstract method. - * - * @return Returns the number of bytes per element - */ - virtual size_t element_size() const = 0; - - /** - * @brief Allocates memory to store the data. - * - * Abstract method. - */ - virtual void allocate() noexcept = 0; - - /** - * @brief Releases previously allocated data. - * - * Abstract method. - * - * @return `True` if deallocation happens successfully, `false` otherwise. - */ - virtual bool deallocate() noexcept = 0; - - /** - * @brief Set new shape for blob, deallocate/allocate if new total size is bigger than previous one. - * - * @param dims new shape - */ - virtual void setShape(const SizeVector& dims); - - /** - * @deprecated Cast to MemoryBlob and use new wlock/rwlock API instead. - * Blob class can represent compound blob, which do not refer to the only solid memory. - * @brief Gets access to the allocated memory. - * - * Abstract method. - * - * @return A LockedMemory object - */ - virtual LockedMemory buffer() noexcept = 0; - - /** - * @deprecated Cast to MemoryBlob and use new MemoryBlob::rmap() function instead. - * Blob class can represent compound blob, which do not refer to the only solid memory. - * @brief Gets read-only access to the allocated memory. - * - * Abstract method. - * - * @return A LockedMemory object - */ - virtual LockedMemory cbuffer() const noexcept = 0; - - /** - * @brief Creates a blob describing given ROI object based on the current blob with memory sharing. - * - * Note: default implementation throws "not implemented" exception. - * - * @param roi A ROI object inside of the current blob. - * - * @return A shared pointer to the newly created ROI blob. - */ - virtual Blob::Ptr createROI(const ROI& roi) const; - - /** - * @brief Creates a blob describing given ROI object based on the current blob with memory sharing. - * - * Note: default implementation may throws "not implemented" exception. - * - * @param begin A ROI start coordinate - * @param end A ROI end coordinate - * - * @return A shared pointer to the newly created ROI blob. - */ - virtual Blob::Ptr createROI(const std::vector& begin, const std::vector& end) const; - -protected: - /** - * @brief The tensor descriptor of the given blob. - */ - TensorDesc tensorDesc; - - /** - * @deprecated Cast to MemoryBlob and use its API instead. - * @brief Multiplies the dimension vector values. - * - * @param dims Reference to a vector with dimension values of type size_t - * @return Result of multiplication - */ - static size_t product(const SizeVector& dims) noexcept { - if (dims.empty()) - return 0; - return std::accumulate(std::begin(dims), std::end(dims), (size_t)1, std::multiplies()); - } - - /** - * @deprecated Cast to MemoryBlob and use its API instead. - * @brief Multiplies the dimension vector values. Size of a scalar is 1 instead of 0 as for product. - * - * @param dims Reference to a vector with dimension values of type size_t - * @return Result of multiplication - */ - static size_t properProduct(const SizeVector& dims) noexcept { - return std::accumulate(std::begin(dims), std::end(dims), (size_t)1, std::multiplies()); - } - - /** - * @brief Gets an allocator for allocator-based blobs - * - * @return The allocator for allocator-based blobs or nullptr if there is none - */ - virtual const std::shared_ptr& getAllocator() const noexcept = 0; -}; - -/** - * @brief Helper cast function to work with shared Blob objects - * @param blob A blob to cast - * @return shared_ptr to the type T. Returned shared_ptr shares ownership of the object with the - * input Blob::Ptr - */ -template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> -INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr as(const Blob::Ptr& blob) noexcept { - return std::dynamic_pointer_cast(blob); -} - -/** - * @brief Helper cast function to work with shared Blob objects - * @param blob A blob to cast - * @return shared_ptr to the type const T. Returned shared_ptr shares ownership of the object with - * the input Blob::Ptr - */ -template ::value && !std::is_reference::value, int>::type = 0, - typename std::enable_if::value, int>::type = 0> -INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr as(const Blob::CPtr& blob) noexcept { - return std::dynamic_pointer_cast(blob); -} - -/** - * @brief This class implements a container object that represents a tensor in memory (host and - * remote/accelerated) - * - * @note Any Blob implementation that represents a concept of a tensor in memory (for example, - * TBlob) must be a subclass of MemoryBlob instead of Blob - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(MemoryBlob) : public Blob { -public: - /** - * @brief A smart pointer to the MemoryBlob object - */ - using Ptr = std::shared_ptr; - - /** - * @brief A smart pointer to the const MemoryBlob object - */ - using CPtr = std::shared_ptr; - - /** - * @brief MemoryBlob virtual destructor - */ - virtual ~MemoryBlob(); - - /** - * @brief Constructor. Creates an empty MemoryBlob object with the specified precision. - * - * @param tensorDesc Defines the layout and dims of the blob - */ - explicit MemoryBlob(const TensorDesc& tensorDesc) : Blob(tensorDesc) {} - - /** - * @brief Returns the tensor description - * @return A tensor description - */ - const TensorDesc& getTensorDesc() const noexcept override { - return tensorDesc; - } - - /** - * @brief Returns the tensor description - * @return A tensor description - */ - TensorDesc& getTensorDesc() noexcept override { - return tensorDesc; - } - - /** - * @brief Returns the total number of elements, which is a product of all the dimensions - * @return The total number of elements - */ - size_t size() const noexcept override { - if (tensorDesc.getLayout() == Layout::SCALAR) - return 1; - return product(tensorDesc.getDims()); - } - - /** - * @brief Returns the size of the current Blob in bytes calculated as `size() * element_size()`. - * @return Blob's size in bytes - */ - size_t byteSize() const override { - return (size() * tensorDesc.getPrecision().bitsSize() + 7) >> 3; - } - - size_t element_size() const override { - return tensorDesc.getPrecision().size(); - } - - /** - * @brief Allocates memory to store the data. - * - * Abstract method. - */ - void allocate() noexcept override = 0; - - /** - * @brief Releases previously allocated data. - * - * Abstract method. - * @return `True` if deallocation happens successfully, `false` otherwise. - */ - bool deallocate() noexcept override = 0; - - /** - * @deprecated Use wmap() or rwmap() API instead. - * @brief Gets access to the allocated memory. - * - * Abstract method. - * - * @return A LockedMemory object - */ - LockedMemory buffer() noexcept override = 0; - - /** - * @deprecated Use rmap() function instead. - * @brief Gets read-only access to the allocated memory. - * - * Abstract method. - * - * @return A LockedMemory object - */ - LockedMemory cbuffer() const noexcept override = 0; - - /** - * @brief Gets read/write access to the memory in virtual space of the process. - * The function returns object which retains mapped memory. - * The memory been addressed in the MemoryBlob in general case can be allocated on remote device. - * This function maps remote memory to the memory in the virtual process space and after destruction - * of the LockedMemory will upload changed content to the accelerator. - * - * To avoid extra copy of data, you can use rmap() and wmap() functions. - * - * In case of memory originally allocated on the host, this function returns LockedMemory which will - * transparently refer to original memory address. No extra copy will happen - * - * In general case, pointer received from that LockedMemory becomes invalid just after - * destruction of LockedMemory instance. Keep Locked memory alive while you need to address memory - * in the process on the host. - * - * Abstract method. - * - * @return A LockedMemory object - */ - virtual LockedMemory rwmap() noexcept = 0; - - /** - * @brief Gets read only access to the memory in virtual space of the process. - * The function returns object which retains mapped memory. - * - * The memory been addressed in the MemoryBlob in general case can be allocated on remote device. - * This function copies remote memory to the memory in the virtual process space and after - * destruction of the LockedMemory it will not upload host memory back, because it is expected that - * content is not changed. - * - * To have an ability change content, you can use rwmap() and wmap() functions. - * - * In case of memory originally allocated on the host, this function returns LockedMemory which will - * transparently refer to original memory address. No extra copy will happen - * - * In general case, pointer received from that LockedMemory becomes invalid just after destruction - * of LockedMemory instance. Keep Locked memory alive while you need to address memory in the - * process on the host. - * - * Abstract method. - * - * @return A LockedMemory object - */ - virtual LockedMemory rmap() const noexcept = 0; - - /** - * @brief Gets "write only direction" access to the memory in virtual space of the process. - * The function returns object which retains memory to be uploaded on device. - * - * The memory been addressed in the MemoryBlob in general case can be allocated on remote device. - * This function does not copy of the content from the device to the memory in the virtual process - * space, the content of the memory just after calling of this function is not specified. After - * destruction of the LockedMemory, content will be upload host memory. - * In the same time there is no abilities to restrict reading from the memory, you need to care of - * reading from memory got by wmap(), it might have sense in some cases like filling of content and - * before uploading to device - * - * To access data stored in the blob, you can use rwmap() and rmap() functions. - * - * In case of memory originally allocated on the host, this function returns LockedMemory which will - * transparently refer to original memory address. No extra copy will happen - * - * In general case, pointer received from that LockedMemory becomes invalid just after destruction - * of LockedMemory instance. Keep Locked memory alive while you need to address memory in the - * process on the host. - * - * Abstract method. - * - * @return A LockedMemory object - */ - virtual LockedMemory wmap() noexcept = 0; - -protected: - /** - * @brief Gets the allocator for allocator-based blobs. - * - * @return The allocator for allocator-based blobs or if there is none then a nullptr. - */ - const std::shared_ptr& getAllocator() const noexcept override = 0; - - /** - * @brief Gets the handle to allocated memory. - * - * @return The handle to allocated memory for allocator-based blobs or if there is none then a nullptr. - */ - virtual void* getHandle() const noexcept = 0; - - /// private - template - friend class TBlobProxy; -}; - -/** - * @brief This is a convenient type for working with a map containing pairs(string, pointer to a Blob instance). - */ -using BlobMap = std::map; - -/** - * @brief Represents real host memory allocated for a Tensor/Blob per C type. - */ -template ::value && std::is_trivial::value>> -class INFERENCE_ENGINE_1_0_DEPRECATED TBlob : public MemoryBlob { - template - friend class TBlob; - -public: - /** - * @brief Smart Pointer to this TBlob object. - */ - using Ptr = std::shared_ptr>; - - /** - * @brief Creates a TBlob object with the specified dimensions and layout but does not allocate the memory. - * - * Use the allocate() method to allocate memory. - * - * @param tensorDesc Tensor description - */ - explicit TBlob(const TensorDesc& tensorDesc) : MemoryBlob(tensorDesc) {} - - /** - * @brief The constructor creates a TBlob object with the specified dimensions and layout - * on the pre-allocated memory. - * - * The allocate() call is not required. - * - * @param tensorDesc Tensor description - * @param ptr Pointer to the pre-allocated memory - * @param data_size Length of the pre-allocated array. If not set, size is assumed equal - * to the dot product of dims. - */ - TBlob(const TensorDesc& tensorDesc, T* ptr, size_t data_size = 0) : MemoryBlob(tensorDesc) { - if (data_size == 0) { - data_size = size(); - } - - if (data_size != 0 && ptr == nullptr) { - IE_THROW() << "Using Blob on external nullptr memory"; - } - - _allocator = details::make_pre_allocator(ptr, data_size); - // blob on attached memory is always allocated, so we are not forcing the user to call allocate() - allocate(); - } - - /** - * @brief Creates a TBlob object with the specified dimensions, layout and custom memory allocator but does not - * allocate the memory. - * - * @param tensorDesc Tensor description - * @param alloc An allocator - */ - TBlob(const TensorDesc& tensorDesc, const std::shared_ptr& alloc) - : MemoryBlob(tensorDesc), - _allocator(alloc) { - if (_allocator == nullptr) - IE_THROW() << "TBlob allocator was not initialized."; - } - - /** - * @brief The copy constructor data is reallocated and copied from the source to the target blob. - * - * @param blob Source blob - */ - TBlob(const TBlob& blob) : MemoryBlob(blob.getTensorDesc()) { - copyFrom(blob); - } - - /** - * @brief A move constructor. - * - * @param blob rvalue to make a move from - */ - TBlob(TBlob&& blob) : MemoryBlob(blob.getTensorDesc()) { - moveFrom(blob); - } - - /** - * @brief Copy operator for the TBlob object. - * - * @param blob object reference to copy from - * @return Newly copied object - */ - TBlob& operator=(const TBlob& blob) { - copyFrom(blob); - return *this; - } - - /** - *@brief Virtual destructor. - */ - virtual ~TBlob() { - deallocate(); - } - - /** - * @brief Creates an new empty rvalue LockedMemory object. - * - * @return rvalue for the empty locked object of type T - */ - virtual LockedMemory data() noexcept { - return lockme(); - } - - /** - * @brief Creates a new empty rvalue read-only LockedMemory object. - * - * @return rvalue for the empty locked const object of type T. - */ - virtual LockedMemory readOnly() const noexcept { - return lockme(); - } - - void allocate() noexcept override { - const auto allocator = getAllocator(); - const auto rawHandle = allocator->alloc(byteSize()); - - if (rawHandle == nullptr) { - return; - } - - _handle.reset(rawHandle, [allocator](void* rawHandle) { - allocator->free(rawHandle); - }); - } - - bool deallocate() noexcept override { - return free(); - } - - LockedMemory buffer() noexcept override { - return lockme(); - } - - LockedMemory cbuffer() const noexcept override { - return lockme(); - } - - LockedMemory rwmap() noexcept override { - return lockme(); - } - - LockedMemory rmap() const noexcept override { - return lockme(); - } - LockedMemory wmap() noexcept override { - return lockme(); - } - - Blob::Ptr createROI(const ROI& roi) const override { - return Blob::Ptr(new TBlob(*this, roi)); - } - - Blob::Ptr createROI(const std::vector& begin, const std::vector& end) const override { - return Blob::Ptr(new TBlob(*this, begin, end)); - } - -protected: - /** - * @brief Local instance of IAllocator to manipulate memory. - */ - mutable std::shared_ptr _allocator; - - /** - * @brief A handle for the stored memory returned from _allocator.alloc(). - */ - std::shared_ptr _handle; - - /** - * @brief Copies dimensions and data from the TBlob object. - * - * @param blob object reference to copy from - */ - void copyFrom(const TBlob& blob) { - tensorDesc = blob.tensorDesc; - this->allocate(); - auto memptr = data(); - memcpy(memptr, blob.readOnly(), byteSize()); - } - - /** - * @brief Swaps memory handlers between the current blob and the given one. - * - * @tparam U Type of the blob to move from - * @param blob TBlob instance to move from - */ - template - void moveFrom(TBlob& blob) { - tensorDesc = blob.tensorDesc; - this->_allocator = std::move(blob._allocator); - std::swap(this->_handle, blob._handle); - } - - /** - * @brief Frees handler and cleans up the stored data. - * @return `true` if memory was freed - */ - virtual bool free() { - bool bCanRelease = _handle != nullptr; - _handle.reset(); - return bCanRelease; - } - - /** - * @brief Creates a LockedMemory instance. - * - * @tparam S Type of the LockedMemory to be created - * @return A created instance of LockedMemory - */ - template - LockedMemory lockme() const { - return LockedMemory(_allocator.get(), getHandle(), 0); - // getTensorDesc().getBlockingDesc().getOffsetPadding()); - } - - const std::shared_ptr& getAllocator() const noexcept override { - // in case when constructor without allocator was used - if (!_allocator) { - _allocator = CreateDefaultAllocator(); - } - - return _allocator; - } - - void* getHandle() const noexcept override { - return _handle.get(); - } - - /** - * @brief Creates a blob from the existing blob with a given ROI - * @param origBlob An original blob - * @param roi A ROI object - */ - TBlob(const TBlob& origBlob, const ROI& roi) - : MemoryBlob(make_roi_desc(origBlob.getTensorDesc(), roi, true)), - _allocator(origBlob._allocator) { - IE_ASSERT(origBlob._handle != nullptr) << "Original Blob must be allocated before ROI creation"; - - _handle = origBlob._handle; - } - - /** - * @brief Creates a blob from the existing blob with a given ROI - * @param origBlob An original blob - * @param begin ROI start coordinate - * @param end ROI end coordinate - */ - TBlob(const TBlob& origBlob, const std::vector& begin, const std::vector& end) - : MemoryBlob(make_roi_desc(origBlob.getTensorDesc(), begin, end, true)), - _allocator(origBlob._allocator) { - IE_ASSERT(origBlob._handle != nullptr) << "Original Blob must be allocated before ROI creation"; - - _handle = origBlob._handle; - } -}; - -// These should not be exported for WIN32 to avoid usage of '_handle' and '_allocator' across CRT bounaries -#ifndef _WIN32 -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -extern template class INFERENCE_ENGINE_API_CLASS(InferenceEngine::TBlob); -#endif - -/** - * @brief Creates a blob with the given tensor descriptor. - * - * @tparam Type Type of the shared pointer to be created - * @param tensorDesc Tensor descriptor for Blob creation - * @return A shared pointer to the newly created blob of the given type - */ -template -inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( - const TensorDesc& tensorDesc) { - if (!tensorDesc.getPrecision().hasStorageType()) - IE_THROW() << "Cannot make shared blob! " - << "The blob type cannot be used to store objects of current precision"; - return std::make_shared>(tensorDesc); -} - -/** - * @brief Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory. - * - * @tparam Type Type of the shared pointer to be created - * @param tensorDesc TensorDesc for Blob creation - * @param ptr Pointer to the pre-allocated memory - * @param size Length of the pre-allocated array - * @return A shared pointer to the newly created blob of the given type - */ -template -inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr -make_shared_blob(const TensorDesc& tensorDesc, Type* ptr, size_t size = 0) { - if (!tensorDesc.getPrecision().hasStorageType()) - IE_THROW() << "Cannot make shared blob! " - << "The blob type cannot be used to store objects of current precision"; - return std::make_shared>(tensorDesc, ptr, size); -} - -/** - * @brief Creates a blob with the given tensor descriptor and allocator. - * - * @tparam Type Type of the shared pointer to be created - * @param tensorDesc Tensor descriptor for Blob creation - * @param alloc Shared pointer to IAllocator to use in the blob - * @return A shared pointer to the newly created blob of the given type - */ -template -inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( - const TensorDesc& tensorDesc, - const std::shared_ptr& alloc) { - if (!tensorDesc.getPrecision().hasStorageType()) - IE_THROW() << "Cannot make shared blob! " - << "The blob type cannot be used to store objects of current precision"; - return std::make_shared>(tensorDesc, alloc); -} - -/** - * @brief Creates a copy of given TBlob instance. - * - * @tparam TypeTo Type of the shared pointer to be created - * @param arg given pointer to blob - * @return A shared pointer to the newly created blob of the given type - */ -template -inline INFERENCE_ENGINE_1_0_DEPRECATED typename InferenceEngine::TBlob::Ptr make_shared_blob( - const TBlob& arg) { - return std::make_shared>(arg); -} - -/** - * @brief Creates a Blob object of the specified type - * - * @param args Constructor arguments for the Blob object - * @return A shared pointer to the newly created Blob object - */ -template ::value, int>::type = 0> -INFERENCE_ENGINE_1_0_DEPRECATED std::shared_ptr make_shared_blob(Args&&... args) { - return std::make_shared(std::forward(args)...); -} - -/** - * @brief Creates a blob describing given ROI object based on the given blob with pre-allocated memory. - * - * @param inputBlob original blob with pre-allocated memory. - * @param roi A ROI object inside of the original blob. - * @return A shared pointer to the newly created blob. - */ -INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(Blob::Ptr) - make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi); - -/** - * @brief Creates a blob describing given ROI object based on the given blob with pre-allocated memory. - * - * @param inputBlob original blob with pre-allocated memory. - * @param begin A ROI object start coordinate inside of the original blob. - * @param end A ROI object end coordinate inside of the original blob. - * @return A shared pointer to the newly created blob. - */ -INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(Blob::Ptr) - make_shared_blob(const Blob::Ptr& inputBlob, const std::vector& begin, const std::vector& end); - -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_common.h b/src/inference/include/ie/ie_common.h deleted file mode 100644 index c933f3fab14c60..00000000000000 --- a/src/inference/include/ie/ie_common.h +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief This is a header file with common inference engine definitions. - * - * @file ie_common.h - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ie_api.h" - -IE_SUPPRESS_DEPRECATED_START -#ifndef NDEBUG -# include -#endif -namespace InferenceEngine { -/** - * @brief Represents tensor size. - * - * The order is opposite to the order in Caffe*: (w,h,n,b) where the most frequently changing element in memory is - * first. - */ -using SizeVector = std::vector; - -/** - * @brief The main data representation node - */ -class Data; - -/** - * @brief Smart pointer to Data - */ -using DataPtr = std::shared_ptr; - -/** - * @brief Smart pointer to constant Data - */ -using CDataPtr = std::shared_ptr; - -/** - * @brief Smart weak pointer to Data - */ -using DataWeakPtr = std::weak_ptr; - -/** - * @union UserValue - * @brief The method holds the user values to enable binding of data per graph node. - */ -union INFERENCE_ENGINE_1_0_DEPRECATED UserValue { - int v_int; //!< An integer value - float v_float; //!< A floating point value - void* v_ptr; //!< A pointer to a void -}; - -/** - * @enum Layout - * @brief Layouts that the inference engine supports - */ -enum INFERENCE_ENGINE_1_0_DEPRECATED Layout : uint8_t { - ANY = 0, //!< "any" layout - - // I/O data layouts - NCHW = 1, //!< NCHW layout for input / output blobs - NHWC = 2, //!< NHWC layout for input / output blobs - NCDHW = 3, //!< NCDHW layout for input / output blobs - NDHWC = 4, //!< NDHWC layout for input / output blobs - - // weight layouts - OIHW = 64, //!< OIHW layout for operation weights - GOIHW = 65, //!< GOIHW layout for operation weights - OIDHW = 66, //!< OIDHW layout for operation weights - GOIDHW = 67, //!< GOIDHW layout for operation weights - - // Scalar - SCALAR = 95, //!< A scalar layout - - // bias layouts - C = 96, //!< A bias layout for operation - - // Single image layouts - CHW = 128, //!< A single image layout (e.g. for mean image) - HWC = 129, //!< A single image layout (e.g. for mean image) - - // 2D - HW = 192, //!< HW 2D layout - NC = 193, //!< NC 2D layout - CN = 194, //!< CN 2D layout - - BLOCKED = 200, //!< A blocked layout -}; - -/** - * @brief Prints a string representation of InferenceEngine::Layout to a stream - * @param out An output stream to send to - * @param p A layout value to print to a stream - * @return A reference to the `out` stream - */ -INFERENCE_ENGINE_1_0_DEPRECATED inline std::ostream& operator<<(std::ostream& out, const Layout& p) { - switch (p) { -#define PRINT_LAYOUT(name) \ - case name: \ - out << #name; \ - break; - - PRINT_LAYOUT(ANY); - PRINT_LAYOUT(NCHW); - PRINT_LAYOUT(NHWC); - PRINT_LAYOUT(NCDHW); - PRINT_LAYOUT(NDHWC); - PRINT_LAYOUT(OIHW); - PRINT_LAYOUT(GOIHW); - PRINT_LAYOUT(OIDHW); - PRINT_LAYOUT(GOIDHW); - PRINT_LAYOUT(SCALAR); - PRINT_LAYOUT(C); - PRINT_LAYOUT(CHW); - PRINT_LAYOUT(HWC); - PRINT_LAYOUT(HW); - PRINT_LAYOUT(NC); - PRINT_LAYOUT(CN); - PRINT_LAYOUT(BLOCKED); -#undef PRINT_LAYOUT - default: - out << static_cast(p); - break; - } - return out; -} - -/** - * @enum ColorFormat - * @brief Extra information about input color format for preprocessing - */ -enum INFERENCE_ENGINE_1_0_DEPRECATED ColorFormat : uint32_t { - RAW = 0u, ///< Plain blob (default), no extra color processing required - RGB, ///< RGB color format - BGR, ///< BGR color format, default in OpenVINO - RGBX, ///< RGBX color format with X ignored during inference - BGRX, ///< BGRX color format with X ignored during inference -}; - -/** - * @brief Prints a string representation of InferenceEngine::ColorFormat to a stream - * @param out An output stream to send to - * @param fmt A color format value to print to a stream - * @return A reference to the `out` stream - */ -INFERENCE_ENGINE_1_0_DEPRECATED inline std::ostream& operator<<(std::ostream& out, const ColorFormat& fmt) { - switch (fmt) { -#define PRINT_COLOR_FORMAT(name) \ - case name: \ - out << #name; \ - break; - - PRINT_COLOR_FORMAT(RAW); - PRINT_COLOR_FORMAT(RGB); - PRINT_COLOR_FORMAT(BGR); - PRINT_COLOR_FORMAT(RGBX); - PRINT_COLOR_FORMAT(BGRX); -#undef PRINT_COLOR_FORMAT - - default: - out << static_cast(fmt); - break; - } - return out; -} - -/** - * @struct InferenceEngineProfileInfo - * @brief Represents basic inference profiling information per layer. - * - * If the layer is executed using tiling, the sum time per each tile is indicated as the total execution time. - * Due to parallel execution, the total execution time for all layers might be greater than the total inference time. - */ -struct INFERENCE_ENGINE_1_0_DEPRECATED InferenceEngineProfileInfo { - /** - * @brief Defines the general status of the layer - */ - enum INFERENCE_ENGINE_1_0_DEPRECATED LayerStatus { - NOT_RUN, //!< A layer is not executed - OPTIMIZED_OUT, //!< A layer is optimized out during graph optimization phase - EXECUTED //!< A layer is executed - }; - - /** - * @brief Defines a layer status - */ - LayerStatus status; - - /** - * @brief The absolute time in microseconds that the layer ran (in total) - */ - long long realTime_uSec; - /** - * @brief The net host cpu time that the layer ran - */ - long long cpu_uSec; - - /** - * @brief An execution type of unit - */ - char exec_type[256] = {}; - - /** - * @brief A layer type - */ - char layer_type[256] = {}; - - /** - * @brief An execution index of the unit - */ - unsigned execution_index; -}; - -/** - * @enum StatusCode - * @brief This enum contains codes for all possible return values of the interface functions - */ -enum INFERENCE_ENGINE_1_0_DEPRECATED StatusCode : int { - OK = 0, - GENERAL_ERROR = -1, - NOT_IMPLEMENTED = -2, - NETWORK_NOT_LOADED = -3, - PARAMETER_MISMATCH = -4, - NOT_FOUND = -5, - OUT_OF_BOUNDS = -6, - /* - * @brief exception not of std::exception derived type was thrown - */ - UNEXPECTED = -7, - REQUEST_BUSY = -8, - RESULT_NOT_READY = -9, - NOT_ALLOCATED = -10, - INFER_NOT_STARTED = -11, - NETWORK_NOT_READ = -12, - INFER_CANCELLED = -13 -}; - -/** - * @struct ResponseDesc - * @brief Represents detailed information for an error - */ -struct INFERENCE_ENGINE_1_0_DEPRECATED ResponseDesc { - /** - * @brief A character buffer that holds the detailed information for an error. - */ - char msg[4096] = {}; -}; - -/** - * @brief Response structure encapsulating information about supported layer - */ -struct INFERENCE_ENGINE_1_0_DEPRECATED QueryNetworkResult { - /** - * @brief A map of supported layers: - * - key - a layer name - * - value - a device name on which layer is assigned - */ - std::map supportedLayersMap; - - /** - * @brief A status code - */ - StatusCode rc = OK; - - /** - * @brief Response message - */ - ResponseDesc resp; -}; - -/** - * @brief A collection that contains string as key, and const Data smart pointer as value - */ -using ConstOutputsDataMap = std::map; - -/** - * @brief A collection that contains string as key, and Data smart pointer as value - */ -using OutputsDataMap = std::map; - -namespace details { -struct INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(InferenceEngineException) - : public std::runtime_error { - using std::runtime_error::runtime_error; - bool hasStatus() const { - return true; - } - StatusCode getStatus() const; -}; -} // namespace details - -/** - * @brief Base Inference Engine exception class - */ -IE_SUPPRESS_DEPRECATED_START -struct INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Exception) - : public details::InferenceEngineException { - using InferenceEngineException::InferenceEngineException; -}; -IE_SUPPRESS_DEPRECATED_END - -/// @cond -namespace details { -template -struct ExceptionTraits; - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED ExceptionTraits { - static const char* string() { - return ""; - } -}; -} // namespace details - -#define INFERENCE_ENGINE_DECLARE_EXCEPTION(ExceptionType, statusCode) \ - struct INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ExceptionType) final \ - : public InferenceEngine::Exception { \ - using Exception::Exception; \ - }; \ - namespace details { \ - template <> \ - struct INFERENCE_ENGINE_1_0_DEPRECATED ExceptionTraits { \ - static const char* string() { \ - return "[ " #statusCode " ]"; \ - } \ - }; \ - } -/// @endcond - -/** @brief This class represents StatusCode::GENERAL_ERROR exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(GeneralError, GENERAL_ERROR) - -/** @brief This class represents StatusCode::NOT_IMPLEMENTED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(NotImplemented, NOT_IMPLEMENTED) - -/** @brief This class represents StatusCode::NETWORK_NOT_LOADED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(NetworkNotLoaded, NETWORK_NOT_LOADED) - -/** @brief This class represents StatusCode::PARAMETER_MISMATCH exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(ParameterMismatch, PARAMETER_MISMATCH) - -/** @brief This class represents StatusCode::NOT_FOUND exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(NotFound, NOT_FOUND) - -/** @brief This class represents StatusCode::OUT_OF_BOUNDS exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(OutOfBounds, OUT_OF_BOUNDS) - -/** @brief This class represents StatusCode::UNEXPECTED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(Unexpected, UNEXPECTED) - -/** @brief This class represents StatusCode::REQUEST_BUSY exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(RequestBusy, REQUEST_BUSY) - -/** @brief This class represents StatusCode::RESULT_NOT_READY exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(ResultNotReady, RESULT_NOT_READY) - -/** @brief This class represents StatusCode::NOT_ALLOCATED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(NotAllocated, NOT_ALLOCATED) - -/** @brief This class represents StatusCode::INFER_NOT_STARTED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(InferNotStarted, INFER_NOT_STARTED) - -/** @brief This class represents StatusCode::NETWORK_NOT_READ exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(NetworkNotRead, NETWORK_NOT_READ) - -/** @brief This class represents StatusCode::INFER_CANCELLED exception */ -INFERENCE_ENGINE_DECLARE_EXCEPTION(InferCancelled, INFER_CANCELLED) - -/** - * @private - */ -#undef INFERENCE_ENGINE_DECLARE_EXCEPTION - -// TODO: Move this section out of public API -namespace details { - -/** - * @brief Rethrow a copy of exception. UShould be used in catch blocks - */ -[[noreturn]] INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CPP(void) Rethrow(); - -/** - * @brief Tag struct used to throw exception - */ -#ifndef NDEBUG -template -struct INFERENCE_ENGINE_1_0_DEPRECATED ThrowNow final { - const char* const file; - const int line; - - [[noreturn]] static void create(const std::ostream& ostream, const char* file, int line) { - std::stringstream stream; - stream << '\n' << file << ':' << line << ' '; - stream << ExceptionTraits::string() << ' ' << ostream.rdbuf(); - throw ExceptionType{stream.str()}; - } - - [[noreturn]] void operator<<=(const std::ostream& ostream) { - create(ostream, file, line); - } -}; -#else -template -struct INFERENCE_ENGINE_1_0_DEPRECATED ThrowNow final { - [[noreturn]] static void create(const std::ostream& ostream) { - std::stringstream stream; - stream << ExceptionTraits::string() << ' ' << ostream.rdbuf(); - throw ExceptionType{stream.str()}; - } - - [[noreturn]] void operator<<=(const std::ostream& ostream) { - create(ostream); - } -}; -#endif - -/// @cond -#ifndef NDEBUG -# define IE_LOCATION '\n' << __FILE__ << ':' << __LINE__ << ' ' -# define IE_LOCATION_PARAM __FILE__, __LINE__ -#else -# define IE_LOCATION "" -# define IE_LOCATION_PARAM -#endif // NDEBUG - -// WARNING: DO NOT USE THIS MACRO! Use openvino/util/pp.hpp macro library -#define IE_PP_EXPAND(X) X -#define IE_PP_NARG(...) IE_PP_EXPAND(IE_PP_NARG_(__VA_ARGS__, IE_PP_RSEQ_N())) -#define IE_PP_NARG_(...) IE_PP_EXPAND(IE_PP_ARG_N(__VA_ARGS__)) -#define IE_PP_ARG_N(_0, _1, N, ...) N -#define IE_PP_RSEQ_N() 0, 1, 0 -#define IE_PP_NO_ARGS(NAME) , -#define IE_PP_CAT3_(x, y, z) x##y##z -#define IE_PP_CAT3(x, y, z) IE_PP_CAT3_(x, y, z) -#define IE_PP_OVERLOAD(NAME, ...) \ - IE_PP_EXPAND(IE_PP_CAT3(NAME, _, IE_PP_EXPAND(IE_PP_NARG(IE_PP_NO_ARGS __VA_ARGS__(NAME))))(__VA_ARGS__)) -// ENDWARNING - -#define IE_THROW_0() \ - (InferenceEngine::details::ThrowNow{IE_LOCATION_PARAM}) <<= std::stringstream {} - -#define IE_THROW_1(ExceptionType) \ - (InferenceEngine::details::ThrowNow{IE_LOCATION_PARAM}) <<= std::stringstream {} -/// @endcond - -/** - * @def IE_THROW - * @brief A macro used to throw specified exception with a description - */ -#define IE_THROW(...) IE_PP_OVERLOAD(IE_THROW, __VA_ARGS__) - -/** - * @def IE_ASSERT - * @brief Uses assert() function if NDEBUG is not defined, InferenceEngine exception otherwise - */ -#ifdef NDEBUG -# define IE_ASSERT(EXPRESSION) \ - if (!(EXPRESSION)) \ - IE_THROW(GeneralError) << " AssertionError " #EXPRESSION -#else -/** - * @private - */ -struct NullStream { - template - NullStream& operator<<(const T&) noexcept { - return *this; - } -}; - -# define IE_ASSERT(EXPRESSION) \ - assert((EXPRESSION)); \ - InferenceEngine::details::NullStream() -#endif // NDEBUG - -/// @cond -#define THROW_IE_EXCEPTION \ - (InferenceEngine::details::ThrowNow{IE_LOCATION_PARAM}) <<= \ - std::stringstream {} - -#define IE_EXCEPTION_CASE(TYPE_ALIAS, STATUS_CODE, EXCEPTION_TYPE, ...) \ - case InferenceEngine::STATUS_CODE: { \ - using InferenceEngine::EXCEPTION_TYPE; \ - using TYPE_ALIAS = EXCEPTION_TYPE; \ - __VA_ARGS__; \ - } break; -/// @endcond - -/** - * @def IE_EXCEPTION_SWITCH - * @brief Generate Switch statement over error codes adn maps them to coresponding exceptions type - */ -#define IE_EXCEPTION_SWITCH(STATUS, TYPE_ALIAS, ...) \ - switch (STATUS) { \ - IE_EXCEPTION_CASE(TYPE_ALIAS, GENERAL_ERROR, GeneralError, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, NOT_IMPLEMENTED, NotImplemented, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, NETWORK_NOT_LOADED, NetworkNotLoaded, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, PARAMETER_MISMATCH, ParameterMismatch, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, NOT_FOUND, NotFound, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, OUT_OF_BOUNDS, OutOfBounds, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, UNEXPECTED, Unexpected, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, REQUEST_BUSY, RequestBusy, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, RESULT_NOT_READY, ResultNotReady, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, NOT_ALLOCATED, NotAllocated, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, INFER_NOT_STARTED, InferNotStarted, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, NETWORK_NOT_READ, NetworkNotRead, __VA_ARGS__) \ - IE_EXCEPTION_CASE(TYPE_ALIAS, INFER_CANCELLED, InferCancelled, __VA_ARGS__) \ - default: \ - IE_ASSERT(!"Unreachable"); \ - } - -} // namespace details -} // namespace InferenceEngine - -#if defined(_WIN32) && !defined(__GNUC__) -# define __PRETTY_FUNCTION__ __FUNCSIG__ -#else -# define __PRETTY_FUNCTION__ __PRETTY_FUNCTION__ -#endif -IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/include/ie/ie_core.hpp b/src/inference/include/ie/ie_core.hpp deleted file mode 100644 index a18cba26cbca7f..00000000000000 --- a/src/inference/include/ie/ie_core.hpp +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief This is a header file for the Inference Engine Core class C++ API - * - * @file ie_core.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include - -#include "cpp/ie_executable_network.hpp" -#include "openvino/core/version.hpp" - -namespace InferenceEngine { - -/** - * @ingroup ie_cpp - * @brief This class represents Inference Engine Core entity. - * - * It can throw exceptions safely for the application, where it is properly handled. - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Core) { - class Impl; - std::shared_ptr _impl; - -public: - /** @brief Constructs an OpenVINO Core instance with devices - * and their plugins description. - * - * There are two ways how to configure device plugins: - * 1. (default) Use XML configuration file in case of dynamic libraries build; - * 2. Use strictly defined configuration in case of static libraries build. - * - * @param xmlConfigFile Path to the .xml file with plugins to load from. If the XML configuration file is not - * specified, default OpenVINO Runtime plugins are loaded from: - * 1. (dynamic build) default `plugins.xml` file located in the same folder as OpenVINO runtime shared library; - * 2. (static build) statically defined configuration. In this case path to the .xml file is ignored. - */ - explicit Core(const std::string& xmlConfigFile = {}); - - /** - * @brief Returns plugins version information - * - * @param deviceName Device name to identify plugin - * @return A vector of versions - */ - std::map GetVersions(const std::string& deviceName) const; - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT - /** - * @brief Reads models from IR and ONNX formats - * @param modelPath path to model - * @param binPath path to data file - * For IR format (*.bin): - * * if path is empty, will try to read bin file with the same name as xml and - * * if bin file with the same name was not found, will load IR without weights. - * For ONNX format (*.onnx): - * * binPath parameter is not used. - * @return CNNNetwork - */ - CNNNetwork ReadNetwork(const std::wstring& modelPath, const std::wstring& binPath = {}) const; -#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT - - /** - * @brief Reads models from IR and ONNX formats - * @param modelPath path to model - * @param binPath path to data file - * For IR format (*.bin): - * * if path is empty, will try to read bin file with the same name as xml and - * * if bin file with the same name was not found, will load IR without weights. - * For ONNX format (*.onnx): - * * binPath parameter is not used. - * @return CNNNetwork - */ - CNNNetwork ReadNetwork(const std::string& modelPath, const std::string& binPath = {}) const; - - /** - * @brief Reads models from IR and ONNX formats - * @param model string with model in IR or ONNX format - * @param weights shared pointer to constant blob with weights - * Reading ONNX models doesn't support loading weights from data blobs. - * If you are using an ONNX model with external data files, please use the - * `InferenceEngine::Core::ReadNetwork(const std::string& model, const Blob::CPtr& weights) const` - * function overload which takes a filesystem path to the model. - * For ONNX case the second parameter should contain empty blob. - * @note Created InferenceEngine::CNNNetwork object shares the weights with `weights` object. - * So, do not create `weights` on temporary data which can be later freed, since the network - * constant data becomes to point to invalid memory. - * @return CNNNetwork - */ - CNNNetwork ReadNetwork(const std::string& model, const Blob::CPtr& weights) const; - - /** - * @brief Creates an executable network from a network object and uses AUTO plugin as the default device to load - * executable network. - * - * Users can create as many networks as they need and use - * them simultaneously (up to the limitation of the hardware resources) - * - * @param network CNNNetwork object acquired from Core::ReadNetwork - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation - * @return An executable network reference - */ - ExecutableNetwork LoadNetwork(const CNNNetwork& network, const std::map& config = {}); - - /** - * @brief Creates an executable network from a network object. - * - * Users can create as many networks as they need and use - * them simultaneously (up to the limitation of the hardware resources) - * - * @param network CNNNetwork object acquired from Core::ReadNetwork - * @param deviceName Name of device to load network to - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation - * @return An executable network reference - */ - ExecutableNetwork LoadNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config = {}); - - /** - * @brief Reads model and creates an executable network from IR or ONNX file and uses AUTO plugin as the default - * device to load executable network. - * - * This can be more efficient than using ReadNetwork + LoadNetwork(CNNNetwork) flow - * especially for cases when caching is enabled and cached model is available - * - * @param modelPath path to model - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation/ - * - * @return An executable network reference - */ - ExecutableNetwork LoadNetwork(const std::string& modelPath, const std::map& config = {}); - - /** - * @brief Reads model and creates an executable network from IR or ONNX file - * - * This can be more efficient than using ReadNetwork + LoadNetwork(CNNNetwork) flow - * especially for cases when caching is enabled and cached model is available - * - * @param modelPath path to model - * @param deviceName Name of device to load network to - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation/ - * - * @return An executable network reference - */ - ExecutableNetwork LoadNetwork(const std::string& modelPath, - const std::string& deviceName, - const std::map& config = {}); - - /** - * @brief Creates an executable network from a previously exported network - * - * @param modelFileName Path to the location of the exported file - * @param deviceName Name of device load executable network on - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation* - * @return An executable network reference - */ - ExecutableNetwork ImportNetwork(const std::string& modelFileName, - const std::string& deviceName, - const std::map& config = {}); - - /** - * @brief Creates an executable network from a previously exported network - * @param networkModel network model stream - * @param deviceName Name of device load executable network on - * @param config Optional map of pairs: (config parameter name, config parameter value) relevant only for this load - * operation* - * @return An executable network reference - */ - ExecutableNetwork ImportNetwork(std::istream& networkModel, - const std::string& deviceName, - const std::map& config = {}); - - /** - * @deprecated Use Core::ImportNetwork with explicit device name - * @brief Creates an executable network from a previously exported network - * @param networkModel network model stream - * @return An executable network reference - */ - INFERENCE_ENGINE_DEPRECATED("Use Core::ImportNetwork with explicit device name") - ExecutableNetwork ImportNetwork(std::istream& networkModel); - - /** - * @brief Query device if it supports specified network with specified configuration - * - * @param deviceName A name of a device to query - * @param network Network object to query - * @param config Optional map of pairs: (config parameter name, config parameter value) - * @return An object containing a map of pairs a layer name -> a device name supporting this layer. - */ - QueryNetworkResult QueryNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config = {}) const; - - /** - * @brief Sets configuration for device, acceptable keys can be found in properties.hpp - * - * @param deviceName An optional name of a device. If device name is not specified, the config is set for all the - * registered devices. - * - * @param config Map of pairs: (config parameter name, config parameter value) - */ - void SetConfig(const std::map& config, const std::string& deviceName = {}); - - /** - * @brief Gets configuration dedicated to device behaviour. - * - * The method is targeted to extract information which can be set via SetConfig method. - * - * @param deviceName - A name of a device to get a configuration value. - * @param name - config key. - * @return Value of config corresponding to config key. - */ - ov::Any GetConfig(const std::string& deviceName, const std::string& name) const; - - /** - * @brief Gets general runtime metric for dedicated hardware. - * - * The method is needed to request common device properties - * which are executable network agnostic. It can be device name, temperature, other devices-specific values. - * - * @param deviceName - A name of a device to get a metric value. - * @param name - metric name to request. - * @param options - optional parameters to get a metric value - * @return Metric value corresponding to metric key. - */ - ov::Any GetMetric(const std::string& deviceName, const std::string& name, const ov::AnyMap& options = {}) const; - - /** - * @brief Returns devices available for neural networks inference - * - * @return A vector of devices. The devices are returned as { CPU, GPU.0, GPU.1, NPU } - * If there more than one device of specific type, they are enumerated with .# suffix. - */ - std::vector GetAvailableDevices() const; - - /** - * @brief Register new device and plugin which implement this device inside Inference Engine. - * - * @param plugin Path (absolute or relative) or name of a plugin. Depending on platform, `plugin` is wrapped with - * shared library suffix and prefix to identify library full name - * - * @param deviceName A device name to register plugin for - */ - void RegisterPlugin(const std::string& plugin, const std::string& deviceName); - - /** - * @brief Unloads previously loaded plugin with a specified name from Inference Engine - * The method is needed to remove plugin instance and free its resources. If plugin for a - * specified device has not been created before, the method throws an exception. - * - * @param deviceName Device name identifying plugin to remove from Inference Engine - */ - void UnregisterPlugin(const std::string& deviceName); - - /** @brief Registers plugin to Inference Engine Core instance using XML configuration file with - * plugins description. - * - * XML file has the following structure: - * - * ```xml - * - * - * - * - * - * - * - * - * - * - * - * - * ``` - * - * - `name` identifies name of device enabled by plugin - * - `location` specifies absolute path to dynamic library with plugin. A path can also be relative to inference - * engine shared library. It allows to have common config for different systems with different configurations. - * - Properties are set to plugin via the `SetConfig` method. - * - Extensions are set to plugin via the `AddExtension` method. - * - * @param xmlConfigFile A path to .xml file with plugins to register. - */ - void RegisterPlugins(const std::string& xmlConfigFile); -}; - -/** - * @brief Shut down the OpenVINO by deleting all static-duration objects allocated by the library and releasing - * dependent resources - * - * @note This function should be used by advanced user to control unload the resources. - * - * You might want to use this function if you are developing a dynamically-loaded library which should clean up all - * resources after itself when the library is unloaded. - */ -INFERENCE_ENGINE_API_CPP(void) INFERENCE_ENGINE_1_0_DEPRECATED shutdown(); -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_data.h b/src/inference/include/ie/ie_data.h deleted file mode 100644 index 66bd61d4639c95..00000000000000 --- a/src/inference/include/ie/ie_data.h +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief This header file defines the main Data representation node. - * - * @file ie_data.h - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include - -#include "ie_api.h" -#include "ie_common.h" -#include "ie_layouts.h" -#include "ie_precision.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -/** - * @deprecated The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on - * transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html - * @brief This class represents the main Data representation node. - * - * The NN graphs are di-graphs consisting of data nodes and layer nodes. - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(Data) { - class Impl; - -public: - /** - * @brief An empty constructor (dimensionless) - * - * @param name Name of the data node - * @param _precision Precision of the data - * @param layout Data layout - */ - Data(const std::string& name, Precision _precision, Layout layout = NCHW); - - /** - * @brief A constructor with tensor descriptor - * - * @param name Name of the data node - * @param desc Tensor descriptor - */ - Data(const std::string& name, const TensorDesc& desc); - - /** - * @brief A copy constructor - * - * @param data A data object to copy from - */ - Data(const Data& data); - - /** - * @brief An assignment operator - * - * @param data A data object to copy from - * @return An assigned object - */ - Data& operator=(const Data& data); - - /** - * @brief Checks if the current node is resolved - * - * @return true if resolved, false otherwise. - */ - bool isInitialized() const; - - /** - * @brief Sets the data dimensions. - * - * After the current node is marked as resolved. - * - * @param a_dims Tensor dimensions to set - */ - void setDims(const SizeVector& a_dims); - - /** - * @brief Sets the layout value for this Data instance - * - * @param layout Layout value to set - */ - void setLayout(Layout layout); - - /** - * @brief changes dims and layout at same time - * - * @param dims new dimensions - * @param layout new layout - */ - void reshape(const SizeVector& dims, Layout layout); - - /** - * @deprecated Use InferenceEngine::Data::reshape(const SizeVector&, Layout) - * @brief changes dims and layout at same time - * - * @param dims new dimensions - * @param layout new layout - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::Data::reshape(const SizeVector&, Layout)") - void reshape(const std::initializer_list& dims, Layout layout); - - /** - * @brief Gets the layout value for this Data instance - * @return Layout - */ - Layout getLayout() const; - - /** - * @brief Gets Tensor descriptor reference - * - * @return reference to TensorDesc - */ - const TensorDesc& getTensorDesc() const; - - /** - * @brief Gets a precision type of this Data instance - * - * @return Precision type - */ - const Precision& getPrecision() const; - - /** - * @brief Sets a precision type of this Data instance - * - * @param precision Precision of the data - */ - void setPrecision(const Precision& precision); - - /** - * @return data dimensions - */ - const SizeVector& getDims() const; - - /** - * @return name of the data object - */ - const std::string& getName() const; - - /** - * @brief Sets a name the Data object - * - * @param newName Name of the data node - */ - - void setName(const std::string& newName); - - /** - * @return convenient arbitrary user data holder - */ - const UserValue& getUserObject() const; - - /** - * @private - * @brief Don't touch this field. An implementation details for Data object. - */ - std::shared_ptr _impl; - -private: - /** - * @brief A unique name that identifies this data node - */ - std::string name; - - /** - * @brief A user utility place holder - */ - UserValue userObject; - - /** - * @brief A tensor descriptor - */ - mutable TensorDesc tensorDesc; -}; -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_icnn_network.hpp b/src/inference/include/ie/ie_icnn_network.hpp deleted file mode 100644 index 038f1ec8b63d2d..00000000000000 --- a/src/inference/include/ie/ie_icnn_network.hpp +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief This is a header file for the ICNNNetwork class - * - * @file ie_icnn_network.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include - -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_data.h" -#include "ie_input_info.hpp" -#include "openvino/core/model.hpp" -#include "openvino/core/partial_shape.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @interface ICNNNetwork - * @brief This is the main interface to describe the NN topology - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(ICNNNetwork) - : public std::enable_shared_from_this { -public: - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief A shared pointer to a ICNNNetwork interface - */ - using Ptr = std::shared_ptr; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Returns nGraph function - * @return nGraph function - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual std::shared_ptr getFunction() noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Returns constant nGraph function - * @return constant nGraph function - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual std::shared_ptr getFunction() const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Gets the network output Data node information. The received info is stored in the given Data node. - * - * For single and multiple outputs networks. - * - * This method need to be called to find out OpenVINO output names for using them later - * when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob - * - * If you want to use framework names, you can use InferenceEngine::ICNNNetwork::getOVNameForTensor - * method to map framework names to OpenVINO names - * - * @param out Reference to the OutputsDataMap object - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual void getOutputsInfo(OutputsDataMap& out) const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Gets the network input Data node information. The received info is stored in the given InputsDataMap - * object. - * - * For single and multiple inputs networks. - * This method need to be called to find out OpenVINO input names for using them later - * when calling InferenceEngine::InferRequest::SetBlob - * - * If you want to use framework names, you can use InferenceEngine::ICNNNetwork::getOVNameForTensor - * method to map framework names to OpenVINO names - * - * @param inputs Reference to InputsDataMap object. - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual void getInputsInfo(InputsDataMap& inputs) const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Returns information on certain input pointed by inputName - * - * @param inputName Name of input layer to get info on - * @return A smart pointer to the input information - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual InputInfo::Ptr getInput(const std::string& inputName) const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Returns the network name. - * - * @return Network name - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual const std::string& getName() const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Returns the number of layers in the network as an integer value - * - * @return The number of layers as an integer value - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual size_t layerCount() const = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Adds output to the layer - * - * @param layerName Name of the layer - * @param outputIndex Index of the output - * @param resp Response message - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode addOutput(const std::string& layerName, - size_t outputIndex = 0, - ResponseDesc* resp = nullptr) noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Changes the inference batch size. - * - * @note There are several limitations and it's not recommended to use it. Set batch to the input shape and call - * ICNNNetwork::reshape. - * - * @param size Size of batch to set - * @param responseDesc Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - * @note Current implementation of the function sets batch size to the first dimension of all layers in the - * networks. Before calling it make sure that all your layers have batch in the first dimension, otherwise the - * method works incorrectly. This limitation is resolved via shape inference feature by using - * InferenceEngine::ICNNNetwork::reshape method. To read more refer to the Shape Inference section in documentation - * - * @note Current implementation of the function sets batch size to the first dimension of all layers in the - * networks. Before calling it make sure that all your layers have batch in the first dimension, otherwise the - * method works incorrectly. This limitation is resolved via shape inference feature by using - * InferenceEngine::ICNNNetwork::reshape method. To read more refer to the Shape Inference section in documentation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode setBatchSize(size_t size, ResponseDesc* responseDesc) noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Gets the inference batch size - * - * @return The size of batch as a size_t value - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual size_t getBatchSize() const = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Map of pairs: name of corresponding data and its dimension. - */ - using InputShapes = std::map; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Run shape inference with new input shapes for the network - * - * @param inputShapes - map of pairs: name of corresponding data and its dimension. - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode reshape(const InputShapes& inputShapes, ResponseDesc* resp) noexcept { - (void)inputShapes; - (void)resp; - return NOT_IMPLEMENTED; - }; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Run shape inference with new input shapes for the network - * - * @param partialShapes - map of pairs: name of corresponding data and its dimension. - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode reshape(const std::map& partialShapes, - ResponseDesc* resp) noexcept { - (void)partialShapes; - (void)resp; - return NOT_IMPLEMENTED; - }; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Serialize network to IR and weights files. - * - * @param xmlPath Path to output IR file. - * @param binPath Path to output weights file. - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode serialize(const std::string& xmlPath, const std::string& binPath, ResponseDesc* resp) const - noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Serialize network to IR and weights files. - * - * @param xmlStream A stream for xml content (.xml file) - * @param binStream A stream for weights content (.bin file) - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode serialize(std::ostream& xmlStream, std::ostream& binStream, ResponseDesc* resp) const - noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Serialize network to IR and weights files. - * - * @param xmlStream A stream for xml content (.xml file) - * @param binData A blob for weights content (.bin file) - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode serialize(std::ostream& xmlStream, Blob::Ptr& binData, ResponseDesc* resp) const noexcept = 0; - - /** - * @deprecated Use InferenceEngine::CNNNetwork wrapper instead - * @brief Methods maps framework tensor name to OpenVINO name - * - * @param ov_name OpenVINO name - * @param orig_name Framework tensor name - * @param resp Pointer to the response message that holds a description of an error if any occurred - * - * @return Status code of the operation - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::CNNNetwork wrapper instead") - virtual StatusCode getOVNameForTensor(std::string& ov_name, const std::string& orig_name, ResponseDesc* resp) const - noexcept { - (void)ov_name; - (void)orig_name; - (void)resp; - return NOT_IMPLEMENTED; - } - -protected: - /** - * @brief Default destructor. - */ - ~ICNNNetwork() = default; -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_iexecutable_network.hpp b/src/inference/include/ie/ie_iexecutable_network.hpp deleted file mode 100644 index c3ffc38cb5e26c..00000000000000 --- a/src/inference/include/ie/ie_iexecutable_network.hpp +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief a header file for IExecutableNetwork interface - * - * @file ie_iexecutable_network.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include -#include -#include - -#include "ie_common.h" -#include "ie_icnn_network.hpp" -#include "ie_iinfer_request.hpp" -#include "ie_input_info.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief This is an interface of an executable network - */ -class INFERENCE_ENGINE_1_0_DEPRECATED IExecutableNetwork : public std::enable_shared_from_this { -public: - IE_SUPPRESS_DEPRECATED_START - /** - * @brief A smart pointer to the current IExecutableNetwork object - */ - using Ptr = std::shared_ptr; - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Gets the Executable network output Data node information. - * - * The received info is stored in the given InferenceEngine::ConstOutputsDataMap node. - * This method need to be called to find output names for using them later - * when calling InferenceEngine::InferRequest::GetBlob or InferenceEngine::InferRequest::SetBlob - * - * @param out Reference to the InferenceEngine::ConstOutputsDataMap object - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetOutputsInfo(ConstOutputsDataMap& out, ResponseDesc* resp) const noexcept = 0; - - /** - * @brief Gets the executable network input Data node information. - * - * The received info is stored in the given InferenceEngine::ConstInputsDataMap object. - * This method need to be called to find out input names for using them later - * when calling InferenceEngine::InferRequest::SetBlob - * - * @param inputs Reference to InferenceEngine::ConstInputsDataMap object. - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetInputsInfo(ConstInputsDataMap& inputs, ResponseDesc* resp) const noexcept = 0; - - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Creates an inference request object used to infer the network. - * - * The created request has allocated input and output blobs (that can be changed later). - * - * @param req Shared pointer to the created request object - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode CreateInferRequest(IInferRequest::Ptr& req, ResponseDesc* resp) noexcept = 0; - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Exports the current executable network. - * - * @see Core::ImportNetwork - * - * @param modelFileName Full path to the location of the exported file - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode Export(const std::string& modelFileName, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Exports the current executable network. - * - * @see Core::ImportNetwork - * - * @param networkModel Network model output stream - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode Export(std::ostream& networkModel, ResponseDesc* resp) noexcept = 0; - - IE_SUPPRESS_DEPRECATED_START - /** - * @deprecated Use InferenceEngine::ExecutableNetwork::GetExecGraphInfo instead - * @brief Get executable graph information from a device - * - * @param graphPtr network ptr to store executable graph information - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - INFERENCE_ENGINE_DEPRECATED("Use InferenceEngine::ExecutableNetwork::GetExecGraphInfo instead") - virtual StatusCode GetExecGraphInfo(ICNNNetwork::Ptr& graphPtr, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Sets configuration for current executable network - * - * @param config Map of pairs: (config name, config value) - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return code of the operation. InferenceEngine::OK if succeeded - */ - virtual StatusCode SetConfig(const ov::AnyMap& config, ResponseDesc* resp) noexcept = 0; - - /** @brief Gets configuration for current executable network. - * - * The method is responsible to extract information - * which affects executable network execution. The list of supported configuration values can be extracted via - * ExecutableNetwork::GetMetric with the SUPPORTED_CONFIG_KEYS key, but some of these keys cannot be changed - * dynamically, e.g. DEVICE_ID cannot changed if an executable network has already been compiled for particular - * device. - * - * @param name config key, can be found in properties.hpp - * @param result value of config corresponding to config key - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return code of the operation. InferenceEngine::OK if succeeded - */ - virtual StatusCode GetConfig(const std::string& name, ov::Any& result, ResponseDesc* resp) const noexcept = 0; - - /** - * @brief Gets general runtime metric for an executable network. - * - * It can be network name, actual device ID on - * which executable network is running or all other properties which cannot be changed dynamically. - * - * @param name metric name to request - * @param result metric value corresponding to metric key - * @param resp Pointer to the response message that holds a description of an error if any occurred - * @return code of the operation. InferenceEngine::OK if succeeded - */ - virtual StatusCode GetMetric(const std::string& name, ov::Any& result, ResponseDesc* resp) const noexcept = 0; - -protected: - virtual ~IExecutableNetwork() = default; -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_iinfer_request.hpp b/src/inference/include/ie/ie_iinfer_request.hpp deleted file mode 100644 index 73c7570abf6d76..00000000000000 --- a/src/inference/include/ie/ie_iinfer_request.hpp +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief a header file for IInferRequest interface - * - * @file ie_iinfer_request.hpp - */ - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include - -#include "ie_blob.h" -#include "ie_common.h" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @deprecated Use InferenceEngine::InferRequest C++ wrapper - * @brief This is an interface of asynchronous infer request - */ -class INFERENCE_ENGINE_1_0_DEPRECATED IInferRequest : public std::enable_shared_from_this { -public: - /** - * @enum WaitMode - * @brief Enumeration to hold wait mode for IInferRequest - */ - enum WaitMode : int64_t { - /** Wait until inference result becomes available */ - RESULT_READY = -1, - /** IInferRequest doesn't block or interrupt current thread and immediately returns inference status */ - STATUS_ONLY = 0, - }; - - IE_SUPPRESS_DEPRECATED_START - - /** - * @brief A shared pointer to the IInferRequest object - */ - using Ptr = std::shared_ptr; - /** - * @brief A smart pointer to the IInferRequest object - */ - using WeakPtr = std::weak_ptr; - - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Sets input/output data to infer - * - * @note Memory allocation does not happen - * @param name Name of input or output blob. - * @param data Reference to input or output blob. The type of a blob must match the network input precision and - * size. - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode SetBlob(const char* name, const Blob::Ptr& data, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Gets input/output data for inference - * - * @note Memory allocation does not happen - * @param name Name of input or output blob. - * @param data Reference to input or output blob. The type of Blob must match the network input precision and size. - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetBlob(const char* name, Blob::Ptr& data, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Infers specified input(s) in synchronous mode - * - * @note blocks all methods of IInferRequest while request is ongoing (running or waiting in queue) - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode Infer(ResponseDesc* resp) noexcept = 0; - /** - * @brief Cancels current async inference request - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode Cancel(ResponseDesc* resp) noexcept = 0; - - /** - * @brief Queries performance measures per layer to get feedback of what is the most time consuming layer - * - * @note not all plugins provide meaningful data - * @param perfMap Map of layer names to profiling information for that layer - * @param resp Optional: pointer to an already allocated object to contain information in case of failure - * @return Status code of the operation: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetPerformanceCounts(std::map& perfMap, - ResponseDesc* resp) const noexcept = 0; - - /** - * @brief Waits for the result to become available. Blocks until specified millis_timeout has elapsed or the result - * becomes available, whichever comes first. - * - * @param millis_timeout Maximum duration in milliseconds to block for - * @note There are special cases when millis_timeout is equal some value of the WaitMode enum: - * * STATUS_ONLY - immediately returns inference status (IInferRequest::RequestStatus). It does not block or - * interrupt current thread - * * RESULT_READY - waits until inference result becomes available - * @param resp Optional: a pointer to an already allocated object to contain extra information of a failure (if - * occurred) - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - virtual InferenceEngine::StatusCode Wait(int64_t millis_timeout, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Starts inference of specified input(s) in asynchronous mode - * - * @note It returns immediately. Inference starts also immediately - * @param resp Optional: a pointer to an already allocated object to contain extra information of a failure (if - * occurred) - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - virtual StatusCode StartAsync(ResponseDesc* resp) noexcept = 0; - - IE_SUPPRESS_DEPRECATED_START - - /** - * @brief Completion callback definition as pointer to a function - * - * @param context Pointer to request for providing context inside callback - * @param code Completion result status: InferenceEngine::OK (0) for success - */ - typedef void (*CompletionCallback)(InferenceEngine::IInferRequest::Ptr context, InferenceEngine::StatusCode code); - - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Sets a callback function that will be called on success or failure of asynchronous request - * - * @param callback A function to be called - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - virtual StatusCode SetCompletionCallback(CompletionCallback callback) noexcept = 0; - - /** - * @brief Gets arbitrary data for the request and stores a pointer to a pointer to the obtained data - * - * @param data Pointer to a pointer to the gotten arbitrary data - * @param resp Optional: a pointer to an already allocated object to contain extra information of a failure (if - * occurred) - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - virtual StatusCode GetUserData(void** data, ResponseDesc* resp) noexcept = 0; - - /** - * @brief Sets arbitrary data for the request - * - * @param data Pointer to a pointer to arbitrary data to set - * @param resp Optional: a pointer to an already allocated object to contain extra information of a failure (if - * occurred) - * @return Enumeration of the resulted action: InferenceEngine::OK (0) for success - */ - virtual StatusCode SetUserData(void* data, ResponseDesc* resp) noexcept = 0; - -protected: - virtual ~IInferRequest() = default; -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_input_info.hpp b/src/inference/include/ie/ie_input_info.hpp deleted file mode 100644 index ec7092d42e5c62..00000000000000 --- a/src/inference/include/ie/ie_input_info.hpp +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief a header file for InputInfo class - * - * @file ie_input_info.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include - -#include "ie_api.h" -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_data.h" -#include "ie_precision.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START -/** - * @brief This class contains information about each input of the network - */ -class INFERENCE_ENGINE_1_0_DEPRECATED InputInfo { -public: - /** @brief A smart pointer to the InputInfo instance */ - using Ptr = std::shared_ptr; - /** @brief A smart pointer to the constant InputInfo instance */ - using CPtr = std::shared_ptr; - - /** - * @brief Gets a precision of the input data provided by user - * - * By default it matches the layers precision, but there are exceptions of this rule - * For Q78 precision networks the input is expected in I16 by default - * For FP16 precision networks the input is expected in FP32 by default - * The default input precision might be changed preferred one using InputInfo::setPrecision() - * function. - * For example, for a Q78 precision network you can pass FP32 input data - * @return The precision used for input blob creation - */ - Precision getPrecision() const { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - return _inputData->getPrecision(); - } - - /** - * @brief Changes the precision of the input data provided by the user. - * - * This function should be called before loading the network to the plugin - * @param p A new precision of the input data to set - */ - void setPrecision(Precision p) { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - _inputData->setPrecision(p); - } - - /** - * @brief Gets a layout of the input data provided by user - * - * @details By default it matches the layers precision and depends on number of its dimensions: - * C - for 1-dimensional, - * NC - for 2-dimensional, - * CHW - for 3-dimensional, - * NCHW - for 4-dimensional - * NCDHW - for 5-dimensional - * The default input layout might be changed preferred one using setLayout() function. - * @return The precision used for input blob creation - */ - Layout getLayout() { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - return _inputData->getLayout(); - } - - /** - * @brief Changes the layout of the input data provided by the user. - * - * This function should be called before loading the network to the plugin - * @param l A new layout of the input data to set - */ - void setLayout(Layout l) { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - _inputData->setLayout(l); - } - - /** - * @brief Gets the name of the input - * - * @return A string - the name of the input - */ - const std::string& name() const { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - return _inputData->getName(); - } - - /** - * @brief Changes the name of the input data provided by the user. - * - * @param newName A new name of the input data to set - */ - void setName(const std::string& newName) { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - _inputData->setName(newName); - } - - /** - * @brief Gets the input data - * - * @return A smart pointer to the input data - */ - DataPtr getInputData() const { - return _inputData; - } - - /** - * @brief Initializes the pointer to the input data that stores the main input parameters like dims, - * etc - * - * This method initializes the precision with the information from the inputPtr if it was not set - * explicitly through InputInfo::setPrecision. If InputInfo::setPrecision is called, this method does - * not overwrite the precision. - * @param inputPtr Pointer to the input data to set - */ - void setInputData(DataPtr inputPtr) { - _inputData = inputPtr; - } - - /** - * @brief Returns the tensor descriptor - * @return A const reference to a tensor descriptor - */ - const TensorDesc& getTensorDesc() const { - if (!_inputData) { - IE_THROW() << "Data is empty!"; - } - return _inputData->getTensorDesc(); - } - -protected: - /** - * @brief A smart pointer to the input data - */ - DataPtr _inputData; -}; - -/** - * @brief A collection that contains string as key, and InputInfo smart pointer as value - */ -using InputsDataMap = std::map; - -/** - * @brief A collection that contains string as key, and const InputInfo smart pointer as value - */ -using ConstInputsDataMap = std::map; -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_layouts.h b/src/inference/include/ie/ie_layouts.h deleted file mode 100644 index a14b8dbd803bac..00000000000000 --- a/src/inference/include/ie/ie_layouts.h +++ /dev/null @@ -1,408 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file for data layouts and conversion between them - * - * @file ie_layouts.h - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include - -#include "ie_api.h" -#include "ie_common.h" -#include "ie_precision.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief This class describes blocking layouts - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(BlockingDesc) { -public: - /** - * @brief The default constructor which creates empty blocking descriptor - */ - BlockingDesc(); - /** - * @brief The constructor which allows to create blocking descriptors for standard layouts - * - * @param dims real dimensions - * @param layout memory layout - */ - BlockingDesc(const SizeVector& dims, Layout layout); - /** - * @brief The constructor allows to create blocking descriptors for blocked memory - * - * @param blocked_dims blocked dimensions - * @param order the order of dimensions - */ - BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order); - /** - * @brief The constructor allows to create blocking descriptors for blocked memory - * - * @param blocked_dims blocked dimensions - * @param order the order of dimensions - * @param offset offset to the current memory block - */ - BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset); - /** - * @brief The constructor allows to create blocking descriptors for blocked memory - * - * @param blocked_dims blocked dimensions - * @param order the order of dimensions - * @param offset offset to the current memory block - * @param dimOffsets per-dimension offset from the padding to actual data, - */ - BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset, const SizeVector& dimOffsets); - /** - * @brief The constructor allows to create blocking descriptors for blocked memory - * - * @param blocked_dims blocked dimensions - * @param order the order of dimensions - * @param offset offset to the current memory block - * @param dimOffsets per-dimension offset from the padding to actual data, - * @param strides strides for each dimension - */ - BlockingDesc(const SizeVector& blocked_dims, - const SizeVector& order, - size_t offset, - const SizeVector& dimOffsets, - const SizeVector& strides); - - /** - * @brief Returns the blocked dimensions vector - * - * @return blocked dimensions - */ - const SizeVector& getBlockDims() const { - return blockedDims; - } - - /** - * @brief Returns the vector of order - * - * @return order of dimensions - */ - const SizeVector& getOrder() const { - return order; - } - - /** - * @brief Returns the per-dimension offset vector - * - * @return offsets in elements - */ - const SizeVector& getOffsetPaddingToData() const { - return offsetPaddingToData; - } - - /** - * @brief Returns the offset to the current memory block - * - * @return offset in elements - */ - size_t getOffsetPadding() const { - return offsetPadding; - } - - /** - * @brief Returns strides for each dimension - * - * @return strides in elements - */ - const SizeVector& getStrides() const { - return strides; - } - - /** - * @brief The comparison operator for the BlockingDesc - * - * @param rhs object to compare - * @return true if objects are equal - */ - bool operator==(const BlockingDesc& rhs) const; - /** - * @brief The comparison operator for the BlockingDesc - * - * @param rhs object to compare - * @return true if objects aren't equal - */ - bool operator!=(const BlockingDesc& rhs) const; - -protected: - /** - * @brief Fills tensor descriptor based on blocking dimensions and specific order - * @param blocked_dims A vector representing blocking dimensions - * @param order A vector with specific dims order - */ - void fillDesc(const SizeVector& blocked_dims, const SizeVector& order); - -private: - /** Blocked dimensions. */ - SizeVector blockedDims; - /** Strides for blocked dimensions */ - SizeVector strides; - /** The order of blocked dimensions **/ - SizeVector order; - /** Per-dimension offset from the padding to actual data, the top-level - * tensor with offsets applied must lie within the padding area. */ - SizeVector offsetPaddingToData; - /** Offset from memory origin to the current block, non-zero only in - * a description of a memory sub-block. */ - size_t offsetPadding; -}; - -/** - * @brief This class defines Tensor description - */ -class INFERENCE_ENGINE_1_0_DEPRECATED INFERENCE_ENGINE_API_CLASS(TensorDesc) { -public: - /** - * @brief The constructor creates the tensor descriptor using blocking descriptor - * - * @param precision memory precision - * @param dims memory dimensions - * @param blockDesc blocking descriptor - */ - TensorDesc(const Precision& precision, const SizeVector& dims, const BlockingDesc& blockDesc); - /** - * @brief The constructor creates the tensor descriptor using standard layout - * - * @param precision memory precision - * @param dims memory dimensions - * @param layout memory layout - */ - TensorDesc(const Precision& precision, const SizeVector& dims, Layout layout); - /** - * @brief The constructor creates the empty tensor descriptor with precision and layout - * - * @param precision memory precision - * @param layout memory layout - */ - TensorDesc(const Precision& precision, Layout layout); - /** - * @brief The default constructor which creates empty tensor descriptor - */ - TensorDesc(); - - /** - * @brief Reshapes the tensor descriptor - * - * @param dims new dimensions - * @param layout new layout if it is necessary - */ - void reshape(const SizeVector& dims, Layout layout = Layout::ANY); - /** - * @brief Reshapes the tensor descriptor - * - * @param dims new dimensions - * @param blockDesc new blocking descriptor - */ - void reshape(const SizeVector& dims, const BlockingDesc& blockDesc); - - /** - * @brief Returns the vector of dimensions - * - * @return dimensions - */ - SizeVector& getDims() { - return dims; - } - /** - * @brief Returns the constant vector of dimensions - * - * @return dimensions - */ - const SizeVector& getDims() const noexcept { - return dims; - } - /** - * @brief Sets dimensions - * - * @param dims new dimensions - */ - void setDims(const SizeVector& dims); - - /** - * @brief Returns the memory layout - * - * @return layout - */ - Layout getLayout() const { - return layout; - } - - /** - * @brief Sets the layout - * - * @param l memory layout - */ - void setLayout(Layout l); - - /** - * @brief Returns the memory precision - * - * @return precision - */ - const Precision& getPrecision() const { - return precision; - } - - /** - * @brief Sets the memory precision - * - * @param p precision - */ - void setPrecision(const Precision& p) { - precision = p; - } - - /** - * @brief Returns the blocking descriptor - * - * @return blocking descriptor - */ - const BlockingDesc& getBlockingDesc() const { - return blockingDesc; - } - - /** - * @brief The comparison operator for the TensorDesc - * - * @param rhs object to compare - * @return true if objects are equal - */ - bool operator==(const TensorDesc& rhs) const; - /** - * @brief The comparison operator for the TensorDesc - * - * @param rhs object to compare - * @return true if objects aren't equal - */ - bool operator!=(const TensorDesc& rhs) const; - - /** - * @brief Calculates offset for the vector of dimensions - * - * @param v vector of dimensions - * @return offset - */ - size_t offset(const SizeVector& v) const; - /** - * @brief Calculates offset for the local offset - * - * @param l local offset - * @return offset - */ - size_t offset(size_t l) const; - - /** - * @brief Returns the standard layout for dimensions - * - * @param dims the vector of dimensions - * @return the standard memory layout - */ - static Layout getLayoutByDims(const SizeVector& dims); - - /** - * @brief Returns the standard layout for the specified tensor rank - * - * @param rank of the requested layout - * @return the standard memory layout - */ - static Layout getLayoutByRank(size_t rank); - -private: - /** - * Memory layout - */ - Layout layout; - /** - * @brief blob's dimensions - */ - SizeVector dims; - /** - * @brief memory precision - */ - Precision precision; - /** - * Detailed information about layout construction - */ - BlockingDesc blockingDesc; -}; - -/** - * @brief This structure describes ROI data for image-like tensors. - */ -struct INFERENCE_ENGINE_1_0_DEPRECATED ROI { - size_t id = 0; //!< ID of a ROI (offset over batch dimension) - size_t posX = 0; //!< W upper left coordinate of ROI - size_t posY = 0; //!< H upper left coordinate of ROI - size_t sizeX = 0; //!< W size of ROI - size_t sizeY = 0; //!< H size of ROI - - ROI() = default; - - /** - * @brief Creates a ROI objects with given parameters - * @param id ID of a ROI (offset over batch dimension) - * @param posX W upper left coordinate of ROI - * @param posY H upper left coordinate of ROI - * @param sizeX W size of ROI - * @param sizeY H size of ROI - */ - ROI(size_t id, size_t posX, size_t posY, size_t sizeX, size_t sizeY) - : id(id), - posX(posX), - posY(posY), - sizeX(sizeX), - sizeY(sizeY) {} -}; - -/** - * @brief Creates a TensorDesc object for ROI. - * - * @param origDesc original TensorDesc object. - * @param roi An image ROI object inside of the original object. - * @param useOrigMemDesc Flag to use original memory description (strides/offset). - * Should be set if the new TensorDesc describes shared memory. - * - * @return A newly created TensorDesc object representing ROI. - */ -INFERENCE_ENGINE_API_CPP(TensorDesc) -INFERENCE_ENGINE_1_0_DEPRECATED make_roi_desc(const TensorDesc& origDesc, const ROI& roi, bool useOrigMemDesc); - -/** - * @brief Creates a TensorDesc object for ROI. - * - * @param origDesc original TensorDesc object. - * @param begin start coordinate of ROI object inside of the original object. - * @param end end coordinate of ROI object inside of the original object. - * @param useOrigMemDesc Flag to use original memory description (strides/offset). - * Should be set if the new TensorDesc describes shared memory. - * - * @return A newly created TensorDesc object representing ROI. - */ -INFERENCE_ENGINE_API_CPP(TensorDesc) -INFERENCE_ENGINE_1_0_DEPRECATED make_roi_desc(const TensorDesc& origDesc, - const std::vector& begin, - const std::vector& end, - bool useOrigMemDesc); - -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_locked_memory.hpp b/src/inference/include/ie/ie_locked_memory.hpp deleted file mode 100644 index d334745be4224e..00000000000000 --- a/src/inference/include/ie/ie_locked_memory.hpp +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file for generic LockedMemory<> and different variations of locks - * - * @file ie_locked_memory.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include - -#include "ie_allocator.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START -namespace details { -/** - * @brief This class is a LockedMemory concept for hardware memory - */ -template -class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemoryBase { - IAllocator* _allocator = nullptr; - void* _handle = nullptr; - mutable T* _locked = nullptr; - LockOp _lockFlag = LOCK_FOR_WRITE; - -protected: - /** - * @brief An offset size - * - * The default value is 0. - */ - size_t _offset = 0; - -public: - /** - * @brief A constructor - * - * @param ptr Pointer to an IAllocator object - * @param handle Handle provided by allocator->Alloc() - * @param lockFlag Read/Write type of mapping - * @param offsetInBytes Offset in originally locked region - */ - LockedMemoryBase(IAllocator* ptr, void* handle, LockOp lockFlag, size_t offsetInBytes) - : _allocator(ptr), - _handle(handle), - _lockFlag(lockFlag), - _offset(offsetInBytes) {} - - /** - * @brief A copy constructor - * - * @param that An rvalue reference for the other LockedMemoryBase instance - */ - LockedMemoryBase(LockedMemoryBase&& that) noexcept - : _allocator(that._allocator), - _handle(that._handle), - _lockFlag(that._lockFlag), - _offset(that._offset) { - that._locked = nullptr; - } - - /** - * @brief A virtual destructor - */ - virtual ~LockedMemoryBase() { - if (_locked != nullptr) { - _allocator->unlock(_handle); - } - } - -protected: - /** - * @brief Compares referenced values - * - * @param pointer Pointer to the object to compare with - * @return True if all handlers are nullptr or referenced values are equal, false otherwise - */ - bool isEqualTo(const T* pointer) const { - if (pointer == nullptr && (_allocator == nullptr || _handle == nullptr)) { - return true; - } - return dereference() == pointer; - } - - /** - * @brief Gets the locked object. - * - * Locks the handler and casts memory to the object of the given template type. - * - * @return The pointer to the locked object, nullptr otherwise - */ - virtual T* dereference() const { - if (_locked != nullptr) - return _locked; - - if (_allocator == nullptr) { - return nullptr; - } - - if (_handle == nullptr) { - return nullptr; - } - - uint8_t* pBytes = reinterpret_cast(_allocator->lock(_handle, _lockFlag)); - - return _locked = reinterpret_cast(pBytes + _offset); - } -}; -} // namespace details - -/** - * @brief This class represents locked memory for read/write memory - */ -template -class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { - using base = details::LockedMemoryBase; - -public: - /** - * @brief A constructor - * - * @param ptr Pointer to IAllocator object - * @param handle Handle provided by allocator - * @param offsetInBytes Offset in originally locked region - */ - LockedMemory(IAllocator* ptr, void* handle, size_t offsetInBytes = 0) - : base(ptr, handle, LOCK_FOR_WRITE, offsetInBytes) {} - - /** - * @brief A default copy constructor, accepting rvalue - */ - LockedMemory(LockedMemory&&) = default; - - /** - * @brief A default copy constructor that accepts rvalue - * - * Also sets the offset value for the new memory object - * - * @param that Rvalue reference for the other LockedMemoryBase instance - * @param offset Offset value - */ - LockedMemory(LockedMemory&& that, size_t offset) : base(std::move(that)) { - base::_offset = offset; - } - - /** - * @brief A disabled copy constructor for lvalue - */ - LockedMemory(const LockedMemory&) = delete; - - /** - * @brief Gets a pointer to the stored object - * - * Dereferences from the base class. - * - * @return The pointer to the object of the given template type - */ - operator T*() { - return base::dereference(); - } - - /** - * @brief Gets the const pointer to the stored object - * - * Dereferences from the base class. - * @return The const pointer object of the given template type. - */ - operator const T*() const { - return base::dereference(); - } - - /** - * @brief Compares stored object with the given one - * @param pointer An pointer to compare with. - * @return `true` if objects are equal, `false` otherwise - */ - bool operator==(const T* pointer) const { - // special case with nullptr - return base::isEqualTo(pointer); - } - - /** - * @brief Compares the object with the one stored in the memory. - * @param pointer A pointer to compare with - * @param lm A compared LockedMemory object - * @return `true` if objects are equal, `false` otherwise - */ - friend bool operator==(const T* pointer, const LockedMemory& lm) { - return lm.operator==(pointer); - } - - /** - * @brief Casts stored object to any provided type. - * - * Uses reinterpret_cast. - * - * @tparam S Type to be casted to - * @return Casted to the given type object - */ - template ::value>> - S as() { - return reinterpret_cast(base::dereference()); - } - - /** - * @brief Casts stored object to any provided type. - * - * Uses reinterpret_cast. - * - * @tparam S Type to be casted to - * @return Casted to the given type const object - */ - template ::value>> - const S as() const { - return reinterpret_cast(base::dereference()); - } -}; - -/** - * @brief This class is for data and allows casting to any pointers - */ -template <> -class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { - using base = details::LockedMemoryBase; - -public: - /** - * @brief A constructor - * - * @param ptr Pointer to IAllocator object - * @param handle Handle provided by allocator - * @param offsetInBytes Offset in originally locked region - */ - LockedMemory(IAllocator* ptr, void* handle, size_t offsetInBytes) - : base(ptr, handle, LOCK_FOR_WRITE, offsetInBytes) {} - - /** - * @brief A default copy constructor that accepts rvalue - */ - LockedMemory(LockedMemory&&) = default; - - /** - * @brief A default copy constructor that accepts rvalue - * - * Also sets the offset value for the new memory object - * - * @param that Rvalue reference for the other LockedMemoryBase instance - * @param offset Offset value - */ - LockedMemory(LockedMemory&& that, size_t offset) : base(std::move(that)) { - base::_offset = offset; - } - - /** - * @brief A disabled copy constructor for lvalue - */ - LockedMemory(const LockedMemory&) = delete; - - /** - * @brief Gets the pointer to the stored object of the given template type - * - * Dereferences from the base class. - * - * @tparam S Type to be casted to - * @return The pointer to the object of the given template type - */ - template - operator S*() { - return reinterpret_cast(base::dereference()); - } - - /** - * @brief Compares stored object with the given one - * @param pointer A pointer to compare with - * @return `true` if objects are equal, `false` otherwise - */ - bool operator==(const void* pointer) const { - // special case with nullptr - return base::isEqualTo(pointer); - } - - /** - * @brief Compares stored object with the given one - * @param pointer A LockedMemory to compare with - * @return `true` if objects are equal, `false` otherwise - */ - bool operator==(const LockedMemory& lm) const { - // special case with nullptr - return base::isEqualTo(lm.as()); - } - - IE_SUPPRESS_DEPRECATED_START - /** - * @brief Compares the object with the one stored in the memory - * @param pointer A pointer to compare with - * @param lm A compared LockedMemory object - * @return `true` if objects are equal, `false` otherwise - */ - friend bool operator==(const void* pointer, const LockedMemory& lm) { - return lm.operator==(pointer); - } - IE_SUPPRESS_DEPRECATED_END - - /** - * @brief Casts stored object to any given type - * - * Uses reinterpret_cast. - * - * @tparam S Type to be casted to - * @return Casted to the given type object - */ - template ::value>> - S as() { - return reinterpret_cast(dereference()); - } - - /** - * @brief Casts stored object to any given type - * - * Uses reinterpret_cast. - * - * @tparam S Type to be casted to - * @return Casted to the given type const object - */ - template ::value>> - const S as() const { - return reinterpret_cast(dereference()); - } -}; - -/** - * @brief This class is for read-only segments - */ -template -class INFERENCE_ENGINE_1_0_DEPRECATED LockedMemory : public details::LockedMemoryBase { - using base = details::LockedMemoryBase; - -public: - /** - * @brief A constructor - * - * @param ptr Pointer to IAllocator object - * @param handle Handle provided by allocator - * @param offset Offset in bytes in originally locked region - */ - LockedMemory(IAllocator* ptr, void* handle, size_t offset) : base(ptr, handle, LOCK_FOR_READ, offset) {} - - /** - * @brief A default copy constructor that accepts rvalue - */ - LockedMemory(LockedMemory&&) = default; - - /** - * @brief A default copy constructor that accepts rvalue. - * - * Also sets the offset value for the new memory object - * - * @param that Rvalue reference for the other LockedMemoryBase instance - * @param offset Offset value - */ - LockedMemory(LockedMemory&& that, size_t offset) : base(std::move(that)) { - base::_offset = offset; - } - - /** - * @brief A disabled copy constructor for lvalue - */ - LockedMemory(const LockedMemory&) = delete; - - /** - * @brief Gets the const pointer to the stored object - * - * Dereferences from the base class. - * - * @return The pointer to the object. - */ - operator const T*() const { - return base::dereference(); - } - - /** - * @brief Compares stored object with the given one - * @param pointer A pointer to compare with - * @return `true` if objects are equal, `false` otherwise - */ - bool operator==(const T* pointer) const { - // special case with nullptr - return base::isEqualTo(pointer); - } - - /** - * @brief Compares the object with the one stored in the memory - * @param pointer A pointer to compare with - * @param lm A compared LockedMemory object - * @return `true` if objects are equal, `false` otherwise - */ - friend bool operator==(const T* pointer, const LockedMemory& lm) { - return lm.operator==(pointer); - } - - /** - * @brief Casts stored object to any given type. - * - * Uses reinterpret_cast. - * - * @tparam S Type to be casted to - * @return Casted to the given type object - */ - template ::value && std::is_const::value>> - S as() const { - return reinterpret_cast(base::dereference()); - } -}; -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/include/ie/ie_precision.hpp b/src/inference/include/ie/ie_precision.hpp deleted file mode 100644 index f967e2dd645c58..00000000000000 --- a/src/inference/include/ie/ie_precision.hpp +++ /dev/null @@ -1,546 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides class for describing precision of data - * - * @file ie_precision.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include -#include -#include - -#include "ie_common.h" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief This class holds precision value and provides precision related operations - */ -class INFERENCE_ENGINE_1_0_DEPRECATED Precision { -public: - /** Enum to specify of different */ - enum ePrecision : uint8_t { - UNSPECIFIED = 255, /**< Unspecified value. Used by default */ - MIXED = 0, /**< Mixed value. Can be received from network. No applicable for tensors */ - FP32 = 10, /**< 32bit floating point value */ - FP16 = 11, /**< 16bit floating point value, 5 bit for exponent, 10 bit for mantisa */ - BF16 = 12, /**< 16bit floating point value, 8 bit for exponent, 7 bit for mantisa*/ - FP64 = 13, /**< 64bit floating point value */ - NF4 = 14, /**< 4bit normalized float value */ - Q78 = 20, /**< 16bit specific signed fixed point precision */ - I16 = 30, /**< 16bit signed integer value */ - U4 = 39, /**< 4bit unsigned integer value */ - U8 = 40, /**< 8bit unsigned integer value */ - I4 = 49, /**< 4bit signed integer value */ - I8 = 50, /**< 8bit signed integer value */ - U16 = 60, /**< 16bit unsigned integer value */ - I32 = 70, /**< 32bit signed integer value */ - U32 = 74, /**< 32bit unsigned integer value */ - I64 = 72, /**< 64bit signed integer value */ - U64 = 73, /**< 64bit unsigned integer value */ - BIN = 71, /**< 1bit integer value */ - BOOL = 41, /**< 8bit bool type */ - STRING = 79, /**< string type, std::string in C++ */ - CUSTOM = 80 /**< custom precision has it's own name and size of elements */ - }; - -private: - struct PrecisionInfo { - /** @brief Size of underlined element */ - size_t bitsSize = 0; - - /** @brief Null terminated string with precision name */ - const char* name = "UNSPECIFIED"; - - bool isFloat = false; - ePrecision value = Precision::UNSPECIFIED; - }; - PrecisionInfo precisionInfo; - -public: - /** @brief Default constructor */ - Precision() = default; - - /** - * @brief Constructor with specified precision - * @param value A value of ePrecision to create an object from - */ - Precision(const Precision::ePrecision value) { - precisionInfo = getPrecisionInfo(value); - } - - /** - * @brief Custom precision constructor - * - * @param bitsSize size of elements - * @param name optional: name string, used in serialisation - */ - explicit Precision(size_t bitsSize, const char* name = nullptr) { - if (bitsSize == 0) { - IE_THROW() << "Precision with 0 elements size not supported"; - } - precisionInfo.bitsSize = bitsSize; - if (name == nullptr) { - precisionInfo.name = "CUSTOM"; - } else { - precisionInfo.name = name; - } - precisionInfo.value = CUSTOM; - } - - /** - * @brief Creates custom precision with specific underlined type - * @param typeName A string name of precision - * @return Precision converted from string name - */ - template - static Precision fromType(const char* typeName = nullptr) { - return Precision(8 * sizeof(T), typeName == nullptr ? typeid(T).name() : typeName); - } - - /** - * @brief checks whether given storage class T can be used to store objects of current precision - * @param typeName A string name of precision - * @return `true` if `typeName` has underlaying storage type - */ - template - bool hasStorageType(const char* typeName = nullptr) const noexcept { - try { -#define CASE(x, y) \ - case x: \ - return std::is_same() -#define CASE2(x, y1, y2) \ - case x: \ - return std::is_same() || std::is_same() - - switch (precisionInfo.value) { - CASE(FP32, float); - CASE(FP64, double); - CASE2(FP16, int16_t, uint16_t); - CASE2(BF16, int16_t, uint16_t); - CASE(NF4, int8_t); - CASE2(I4, int8_t, uint8_t); - CASE(I8, int8_t); - CASE(I16, int16_t); - CASE(I32, int32_t); - CASE(I64, int64_t); - CASE(U4, uint8_t); - CASE(U8, uint8_t); - CASE(U16, uint16_t); - CASE(U32, uint32_t); - CASE(U64, uint64_t); - CASE(BOOL, uint8_t); - CASE2(Q78, int16_t, uint16_t); - CASE2(BIN, int8_t, uint8_t); - CASE(STRING, std::string); - default: - return areSameStrings(name(), typeName == nullptr ? typeid(T).name() : typeName); -#undef CASE -#undef CASE2 - } - } catch (...) { - return false; - } - } - - /** - * @brief Equality operator with Precision object - * @param p A value of Precision to compare with - * @return `true` if values represent the same precisions, `false` otherwise - */ - bool operator==(const Precision& p) const noexcept { - return precisionInfo.value == p && precisionInfo.bitsSize == p.precisionInfo.bitsSize && - areSameStrings(precisionInfo.name, p.precisionInfo.name); - } - - /** - * @brief Inequality operator with Precision object - * @param p A value of Precision to compare with - * @return `true` if values represent different precisions, `false` otherwise - */ - bool operator!=(const Precision& p) const noexcept { - return !(*this == p); - } - - /** - * @brief Equality operator with ePrecision enum value - * @param p A value of ePrecision to compare with - * @return `true` if values represent the same precisions, `false` otherwise - */ - bool operator==(const ePrecision p) const noexcept { - return precisionInfo.value == p; - } - - /** - * @brief Inequality operator with ePrecision enum value - * @param p A value of ePrecision to compare with - * @return `true` if values represent different precisions, `false` otherwise - */ - bool operator!=(const ePrecision p) const noexcept { - return precisionInfo.value != p; - } - - /** - * @brief Assignment operator with ePrecision enum value - * @param p A value of ePrecision enumeration - * @return A Precision instance - */ - Precision& operator=(const ePrecision p) noexcept { - precisionInfo = getPrecisionInfo(p); - return *this; - } - - /** - * @brief Cast operator to a bool - * @return `true` if precision is specified, `false` otherwise - */ - explicit operator bool() const noexcept { - return precisionInfo.value != UNSPECIFIED; - } - - /** - * @brief Logical negation operator - * @return `true` if precision is NOT specified, `false` otherwise - */ - bool operator!() const noexcept { - return precisionInfo.value == UNSPECIFIED; - } - - /** - * @brief Cast operator to a ePrecision - * @return A casted value of Precision::ePrecision enumeration - */ - operator Precision::ePrecision() const noexcept { - return precisionInfo.value; - } - - /** - * @brief Gets the precision value of type ePrecision. - * @return The preccision value. - */ - constexpr uint8_t getPrecVal() const noexcept { - return precisionInfo.value; - } - - /** - * @brief Getter of precision name - * @return A string representing precision name - */ - const char* name() const noexcept { - return precisionInfo.name; - } - - /** - * @brief Creates Precision from string with precision name - * @param str A string representing precision - * @return Precision created from string representation - */ - static Precision FromStr(const std::string& str) { - static const std::unordered_map names = { -#define PRECISION_NAME(s) {#s, s} - PRECISION_NAME(Q78), PRECISION_NAME(BOOL), PRECISION_NAME(BF16), PRECISION_NAME(I4), - PRECISION_NAME(I8), PRECISION_NAME(I16), PRECISION_NAME(I32), PRECISION_NAME(I64), - PRECISION_NAME(U4), PRECISION_NAME(U8), PRECISION_NAME(U16), PRECISION_NAME(U32), - PRECISION_NAME(U64), PRECISION_NAME(FP32), PRECISION_NAME(FP64), PRECISION_NAME(FP16), - PRECISION_NAME(MIXED), PRECISION_NAME(NF4), PRECISION_NAME(STRING), PRECISION_NAME(BIN), -#undef PRECISION_NAME - }; - auto i = names.find(str); - return i == names.end() ? Precision() : Precision(i->second); - } - - /** - * @brief Returns size of single element of that precision in bytes - * @returns Number of bytes per element - */ - size_t size() const { - return (bitsSize() + 7) >> 3; - } - - /** - * @brief Returns size of single element of that precision in bits - * @returns Number of bits per element - */ - size_t bitsSize() const { - if (precisionInfo.bitsSize == 0) { - IE_THROW() << " cannot estimate element if precision is " << precisionInfo.name; - } - return precisionInfo.bitsSize; - } - - /** - * @brief Checks if it is a floating point value - * @return True if precision is float point, `false` otherwise - */ - bool is_float() const noexcept { - return precisionInfo.isFloat; - } - - /** - * @brief Checks if it is a signed value - * @return True if precision is signed, `false` otherwise - */ - bool isSigned() const noexcept { - return (precisionInfo.value == Precision::UNSPECIFIED) || (precisionInfo.value == Precision::MIXED) || - (precisionInfo.value == Precision::FP32) || (precisionInfo.value == Precision::FP64) || - (precisionInfo.value == Precision::FP16) || (precisionInfo.value == Precision::Q78) || - (precisionInfo.value == Precision::I16) || (precisionInfo.value == Precision::I8) || - (precisionInfo.value == Precision::I32) || (precisionInfo.value == Precision::I64) || - (precisionInfo.value == Precision::BIN) || (precisionInfo.value == Precision::BF16) || - (precisionInfo.value == Precision::CUSTOM) || (precisionInfo.value == Precision::I4) || - (precisionInfo.value == Precision::NF4); - } - -protected: - /** - * @brief Creates PrecisionInfo by @p precision with a specified name - * @tparam precision A precision to create PrecisionInfo for - * @param name Name of precision - * @return A PrecisionInfo object - */ - template - static PrecisionInfo makePrecisionInfo(const char* name); - - /** - * @brief Compare two c-strings - * - * @param l Const pointer to first string - * @param r Const pointer to another string - * @returns True if strings are the same - */ - static bool areSameStrings(const char* l, const char* r) noexcept { - if (l == r) - return true; - - if (l == nullptr || r == nullptr) - return false; - - for (; *l && *r; l++, r++) { - if (*l != *r) - return false; - } - return *l == *r; - } - - /** - * @brief Creates PrecisionInfo based on ePrecision - * @param v A value of ePrecision emuneration - * @return Precision info object - */ - static PrecisionInfo getPrecisionInfo(ePrecision v) { -#define CASE(x) \ - case x: \ - return makePrecisionInfo(#x); - switch (v) { - CASE(FP32); - CASE(FP64); - CASE(FP16); - CASE(BF16); - CASE(NF4); - CASE(I4); - CASE(I8); - CASE(I16); - CASE(I32); - CASE(I64); - CASE(U4); - CASE(U8); - CASE(U16); - CASE(U32); - CASE(U64); - CASE(Q78); - CASE(MIXED); - CASE(BIN); - CASE(BOOL); - CASE(STRING); - default: - return makePrecisionInfo("UNSPECIFIED"); -#undef CASE - } - } -}; - -/** - * @brief Particular precision traits - */ -template -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait {}; - -/** @cond INTERNAL */ -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = float; - enum { is_float = true }; -}; - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = double; - enum { is_float = true }; -}; - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int16_t; - enum { is_float = true }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int16_t; - enum { is_float = true }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint16_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int16_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint16_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint8_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint8_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int8_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int8_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint8_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int32_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint32_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int64_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = uint64_t; - enum { is_float = false }; -}; -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int8_t; - enum { is_float = false }; -}; - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = int8_t; - enum { is_float = false }; -}; - -template <> -struct PrecisionTrait { - using value_type = std::string; - enum { is_float = false }; -}; - -template -INFERENCE_ENGINE_1_0_DEPRECATED inline uint8_t type_size_or_zero() { - return sizeof(T); -} - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait { - using value_type = void; - enum { is_float = false }; -}; - -template <> -struct INFERENCE_ENGINE_1_0_DEPRECATED PrecisionTrait : PrecisionTrait {}; - -template <> -INFERENCE_ENGINE_1_0_DEPRECATED inline uint8_t type_size_or_zero() { - return 0; -} - -template -INFERENCE_ENGINE_1_0_DEPRECATED inline Precision::PrecisionInfo Precision::makePrecisionInfo(const char* name) { - Precision::PrecisionInfo info; - info.name = name; - - size_t nBits = precision == BIN ? 1 : (precision == U4 || precision == I4 || precision == NF4) ? 4 : 8; - info.bitsSize = nBits * type_size_or_zero::value_type>(); - info.isFloat = PrecisionTrait::is_float; - info.value = precision; - return info; -} - -inline std::ostream& operator<<(std::ostream& out, const InferenceEngine::Precision& p) { - return out << p.name(); -} - -inline std::ostream& operator<<(std::ostream& out, const InferenceEngine::Precision::ePrecision& p) { - return out << Precision(p).name(); -} - -inline std::ostream& operator<<(std::ostream& os, const std::vector& values) { - os << "{ "; - for (size_t i = 0; i < values.size(); ++i) { - os << values[i]; - if (i != (values.size() - 1ul)) { - os << ", "; - } - } - os << " }"; - return os; -} - -INFERENCE_ENGINE_1_0_DEPRECATED inline constexpr uint32_t getPrecisionMask( - InferenceEngine::Precision::ePrecision precision1, - InferenceEngine::Precision::ePrecision precision2, - InferenceEngine::Precision::ePrecision precision3 = InferenceEngine::Precision::MIXED, - InferenceEngine::Precision::ePrecision precision4 = InferenceEngine::Precision::MIXED) { - return (precision1) | (precision2 << 8) | (precision3 << 16) | (precision4 << 24); -} - -/** @endcond */ - -IE_SUPPRESS_DEPRECATED_END -} // namespace InferenceEngine diff --git a/src/inference/include/ie/inference_engine.hpp b/src/inference/include/ie/inference_engine.hpp deleted file mode 100644 index 5638013e294af2..00000000000000 --- a/src/inference/include/ie/inference_engine.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A header file that provides a set minimal required Inference Engine API. - * @file inference_engine.hpp - */ -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED) -# define IE_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# else -# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html") -# endif -#endif - -#include "ie_core.hpp" - -// remove in 2022.1 major release -#include diff --git a/src/inference/include/openvino/runtime/common.hpp b/src/inference/include/openvino/runtime/common.hpp index e78df4ccedb10b..9e6bac8fa9e37c 100644 --- a/src/inference/include/openvino/runtime/common.hpp +++ b/src/inference/include/openvino/runtime/common.hpp @@ -50,3 +50,9 @@ namespace ov { using SupportedOpsMap = std::map; } // namespace ov + +#if defined(_WIN32) && !defined(__GNUC__) +# define __PRETTY_FUNCTION__ __FUNCSIG__ +#else +# define __PRETTY_FUNCTION__ __PRETTY_FUNCTION__ +#endif diff --git a/src/inference/include/openvino/runtime/core.hpp b/src/inference/include/openvino/runtime/core.hpp index d0653cdaffcbad..128a90372b7d82 100644 --- a/src/inference/include/openvino/runtime/core.hpp +++ b/src/inference/include/openvino/runtime/core.hpp @@ -25,10 +25,6 @@ #include "openvino/runtime/remote_context.hpp" #include "openvino/runtime/tensor.hpp" -namespace InferenceEngine { -class IExtension; -} // namespace InferenceEngine - namespace ov { /** diff --git a/src/inference/include/openvino/runtime/variable_state.hpp b/src/inference/include/openvino/runtime/variable_state.hpp index 711544b6efa0da..2cd3a7d494af5e 100644 --- a/src/inference/include/openvino/runtime/variable_state.hpp +++ b/src/inference/include/openvino/runtime/variable_state.hpp @@ -15,15 +15,10 @@ #include "openvino/runtime/common.hpp" #include "openvino/runtime/tensor.hpp" -namespace InferenceEngine { -class IAsyncInferRequestWrapper; -} // namespace InferenceEngine - namespace ov { class InferRequest; class IVariableState; -class IInferRequestInternalWrapper; /** * @brief VariableState class @@ -42,8 +37,6 @@ class OPENVINO_RUNTIME_API VariableState { VariableState(const std::shared_ptr& impl, const std::shared_ptr& so); friend class ov::InferRequest; - friend class ov::IInferRequestInternalWrapper; - friend class InferenceEngine::IAsyncInferRequestWrapper; public: /** diff --git a/src/inference/src/blob_factory.cpp b/src/inference/src/blob_factory.cpp deleted file mode 100644 index dcf7181944502e..00000000000000 --- a/src/inference/src/blob_factory.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "blob_factory.hpp" - -#include - -IE_SUPPRESS_DEPRECATED_START - -InferenceEngine::Blob::Ptr make_blob_with_precision(const InferenceEngine::TensorDesc& desc) { - return make_blob_with_precision(desc.getPrecision(), desc); -} - -InferenceEngine::Blob::Ptr make_blob_with_precision(const InferenceEngine::TensorDesc& desc, void* ptr) { - return make_blob_with_precision(desc.getPrecision(), desc, ptr); -} - -InferenceEngine::Blob::Ptr make_blob_with_precision(const InferenceEngine::TensorDesc& desc, - const std::shared_ptr& alloc) { - return make_blob_with_precision(desc.getPrecision(), desc, alloc); -} diff --git a/src/inference/src/cache_guard.cpp b/src/inference/src/cache_guard.cpp index 184455fa463d4b..6460cdbb861b07 100644 --- a/src/inference/src/cache_guard.cpp +++ b/src/inference/src/cache_guard.cpp @@ -4,8 +4,6 @@ #include "cache_guard.hpp" -#include "ie_common.h" - namespace ov { CacheGuardEntry::CacheGuardEntry(CacheGuard& cacheGuard, diff --git a/src/inference/src/check_network_batchable.hpp b/src/inference/src/check_network_batchable.hpp index cf21cfa1636d38..3b8efe37992808 100644 --- a/src/inference/src/check_network_batchable.hpp +++ b/src/inference/src/check_network_batchable.hpp @@ -5,7 +5,7 @@ #include -#include "cnn_network_ngraph_impl.hpp" +#include "openvino/core/model.hpp" namespace ov { namespace details { diff --git a/src/inference/src/cnn_network_ngraph_impl.cpp b/src/inference/src/cnn_network_ngraph_impl.cpp deleted file mode 100644 index 433461f22d3dcc..00000000000000 --- a/src/inference/src/cnn_network_ngraph_impl.cpp +++ /dev/null @@ -1,631 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cnn_network_ngraph_impl.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "blob_factory.hpp" -#include "cpp/ie_cnn_network.h" -#include "ie_common.h" -#include "ie_ngraph_utils.hpp" -#include "itt.hpp" -#include "openvino/cc/pass/itt.hpp" -#include "openvino/core/except.hpp" -#include "openvino/op/util/op_types.hpp" -#include "openvino/pass/manager.hpp" -#include "openvino/pass/serialize.hpp" -#include "transformations/common_optimizations/fold_subgraph_empty_inputs.hpp" -#include "transformations/common_optimizations/nop_elimination.hpp" -#include "transformations/common_optimizations/remove_concat_zero_dim_input.hpp" -#include "transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp" -#include "transformations/smart_reshape/set_batch_size.hpp" -#include "transformations/smart_reshape/smart_reshape.hpp" -#include "transformations/utils/utils.hpp" - -using namespace std; -using namespace InferenceEngine; -using details::CNNNetworkNGraphImpl; -using InferenceEngine::details::CNNNetworkNGraphImpl; - -void CNNNetworkNGraphImpl::createDataForResult(const ::ov::Output<::ov::Node>& output, - const std::string& outName, - DataPtr& ptr) { - const auto isCompatible = [](int64_t size, const Layout& l) -> bool { - switch (size) { - case -1: - return l == Layout::BLOCKED; - case 0: - return l == Layout::SCALAR; - case 1: - return l == Layout::C; - case 2: - return l == Layout::CN || l == Layout::HW || l == Layout::NC; - case 3: - return l == Layout::CHW || l == Layout::HWC; - case 4: - return l == Layout::NCHW || l == Layout::NHWC; - case 5: - return l == Layout::NCDHW || l == Layout::NDHWC; - default: - return false; - } - }; - auto shape = output.get_partial_shape(); - SizeVector dims(1, 0); - if (shape.rank().is_static()) { - dims.resize(shape.size(), 0); - for (size_t i = 0; i < shape.size(); ++i) { - if (shape[i].get_max_length() != -1) // dimension has an estimation - dims[i] = shape[i].get_max_length(); - } - } - // query shape from ngraph::Parameter output shape and check there are no zeros in it - for (const auto& dim : shape) { - if (dim.is_static() && dim.get_length() == 0) - IE_THROW() << outName << " has zero dimension which is not allowed"; - } - - auto rank = shape.rank().is_static() ? shape.rank().get_length() : -1; - const Layout rankLayout = rank < 0 ? Layout::BLOCKED : TensorDesc::getLayoutByRank(rank); - if (ptr) { - const auto origLayout = ptr->getTensorDesc().getLayout(); - const auto layout = isCompatible(rank, origLayout) ? origLayout : rankLayout; - ptr->reshape(dims, layout); - } else { - const auto precision = details::convertPrecision(output.get_element_type()); - ptr.reset(new Data(outName, {precision, dims, rankLayout})); - } -} - -void CNNNetworkNGraphImpl::validateFunctionNames() const { - // nGraph function parameters and pre-Results operations should have unique names - std::unordered_map> unique_names; - for (const auto& param : _ngraph_function->get_parameters()) { - if (unique_names.count(param->get_friendly_name())) { - IE_THROW() << "Function contains several inputs with one friendly name!"; - } - unique_names.insert({param->get_friendly_name(), param}); - } - for (const auto& result : _ngraph_function->get_results()) { - const auto& parent = result->get_input_node_shared_ptr(0); - auto name = parent->get_friendly_name(); - if (parent->get_output_size() > 1) { - name += "." + std::to_string(result->get_input_source_output(0).get_index()); - } - if (unique_names.count(name) && !ov::op::util::is_parameter(parent) && parent != unique_names.at(name)) { - IE_THROW() << "Function contains several inputs and outputs with one friendly name: " << name; - } - unique_names.insert({name, parent}); - } -} - -ov::element::Type details::toLegacyType(const ov::element::Type& ngraph_type, bool input) { - if (input) { - return ngraph_type == ov::element::f16 ? ov::element::f32 : ngraph_type; - } else { - if (ngraph_type == ov::element::i64 || ngraph_type == ov::element::u64 || ngraph_type == ov::element::i32 || - ngraph_type == ov::element::u32) { - return ov::element::i32; - } else if (ngraph_type != ov::element::f32) { - return ov::element::f32; - } - } - - return ngraph_type; -} - -CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const std::shared_ptr& nGraph, bool newAPI) - : _ngraph_function(nGraph), - _new_api(newAPI) { - { - ov::pass::Manager m; - using namespace ov::pass; - REGISTER_PASS(m, EliminateScatterUpdate) - REGISTER_PASS(m, RemoveConcatZeroDimInput) - REGISTER_PASS(m, RemoveMultiSubGraphOpDanglingParamsResults) - REGISTER_PASS(m, FoldSubgraphEmptyInputs) - m.run_passes(_ngraph_function); - } - // Restore usual attributes for CNNNetwork - auto keep_input_info = [=](CNNNetworkNGraphImpl& network, const DataPtr& inData) { - InputInfo::Ptr info(new InputInfo()); - info->setInputData(inData); - - if (!_new_api) { - Precision prc = info->getPrecision(); - - // Convert precision into native format (keep element size) - prc = prc == Precision::Q78 - ? Precision::I16 - : prc == Precision::FP16 ? Precision::FP32 : static_cast(prc); - - info->setPrecision(details::convertPrecision(toLegacyType(details::convertPrecision(prc), true))); - } - - network.setInputInfo(info); - }; - - validateFunctionNames(); - - reshape(); - for (const auto& layer : _ngraph_function->get_parameters()) { - std::string outName = layer->get_friendly_name(); - IE_ASSERT(layer->get_output_size() == 1); // Parameter as only singly output port - - // map original names to OpenVINO name - for (const auto& name : layer->get_output_tensor(0).get_names()) { - _tensorNames[name] = outName; - } - - DataPtr& ptr = _data[outName]; - IE_ASSERT(ptr); // Data must be allocated after the reshape method - - keep_input_info(*this, ptr); - } - - if (!_new_api) { - for (auto& output : _outputData) { - // Convert precision into native format. Be consistent with possible conversion to CNNNetwork later. - output.second->setPrecision(details::convertPrecision( - toLegacyType(details::convertPrecision(output.second->getPrecision()), false))); - } - } -} - -CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const CNNNetwork& network) { - IE_SUPPRESS_DEPRECATED_START - const ICNNNetwork& iNetwork = network; - IE_SUPPRESS_DEPRECATED_END - const auto net = dynamic_cast(&iNetwork); - if (network.getFunction() == nullptr || !net) { - IE_THROW() << "Cannot create CNNNetwork with nGraph from legacy network format!"; - } - - _ngraph_function = network.getFunction()->clone(); - validateFunctionNames(); - InputsDataMap inputs = network.getInputsInfo(); - OutputsDataMap outputs = network.getOutputsInfo(); - - _tensorNames = net->_tensorNames; - - for (const auto& outputInfo : outputs) { - const auto& name = outputInfo.second->getName(); - DataPtr output = std::make_shared(name, outputInfo.second->getTensorDesc()); - _outputData[name] = output; - _data[name] = output; - } - for (const auto& inputInfo : inputs) { - InputInfo::Ptr info = std::make_shared(); - const auto& name = inputInfo.second->getInputData()->getName(); - const auto& inData = inputInfo.second->getInputData(); - DataPtr input = std::make_shared(name, inData->getTensorDesc()); - _data[name] = input; - info->setInputData(input); - info->setPrecision(inputInfo.second->getPrecision()); - info->setLayout(inputInfo.second->getLayout()); - _inputData[name] = info; - } -} - -void CNNNetworkNGraphImpl::setInputInfo(InputInfo::Ptr data) { - _inputData[data->name()] = data; -} - -const std::string& CNNNetworkNGraphImpl::getName() const noexcept { - return _ngraph_function->get_friendly_name(); -} - -InputInfo::Ptr CNNNetworkNGraphImpl::getInput(const std::string& inputName) const noexcept { - auto it = _inputData.find(inputName); - if (it == _inputData.end()) { - return nullptr; - } - return it->second; -} - -void CNNNetworkNGraphImpl::getOutputsInfo(OutputsDataMap& out) const noexcept { - out = _outputData; -} - -void CNNNetworkNGraphImpl::getInputsInfo(InputsDataMap& inputs) const noexcept { - inputs = _inputData; -} - -size_t CNNNetworkNGraphImpl::layerCount() const { - return _ngraph_function->get_ops().size(); -} - -void CNNNetworkNGraphImpl::validate(int version) { - _ngraph_function->validate_nodes_and_infer_types(); -} - -StatusCode CNNNetworkNGraphImpl::addOutput(const std::string& layerName, - size_t outputIndex, - ResponseDesc* resp) noexcept { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "CNNNetworkNGraphImpl::addOutput"); - - try { - for (const auto& layer : _ngraph_function->get_ops()) { - // Result can have the same name as previous operation - if (layer->get_friendly_name() == layerName && !std::dynamic_pointer_cast(layer)) { - // Check that output port exists - if (layer->outputs().size() <= outputIndex) { - return DescriptionBuffer(OUT_OF_BOUNDS, resp) - << "port index " << outputIndex << " exceeds the number of layer outputs " - << layer->outputs().size(); - } - std::string outputName = layerName; - if (layer->outputs().size() != 1) { - outputName += "." + std::to_string(outputIndex); - } - - // Check that we don't have a result for the output port - for (const auto& port : layer->output(outputIndex).get_target_inputs()) { - if (dynamic_cast(port.get_node())) - return OK; - } - auto result = make_shared<::ov::op::v0::Result>(layer->output(outputIndex)); - result->set_friendly_name(outputName); - _ngraph_function->add_results({result}); - // Check that we cannot add Result to layer with non unique friendly name - try { - validateFunctionNames(); - } catch (...) { - _ngraph_function->remove_result(result); - throw; - } - - if (_outputData.count(outputName) == 0) { - reshape(); - } - return OK; - } - } - } catch (...) { - return GENERAL_ERROR; - } - return DescriptionBuffer(NOT_FOUND, resp) << "Cannot add output! Layer " << layerName << " wasn't found!"; -} - -void CNNNetworkNGraphImpl::addOutput(const ::ov::Output<::ov::Node>& output) { - auto dataName = ov::op::util::create_ie_output_name(output); - DataPtr data; - if (_data.count(dataName)) - data = _data[dataName]; - createDataForResult(output, dataName, data); - _data[dataName] = data; - _outputData[dataName] = data; - - // Save original framework names - for (const auto& name : output.get_tensor().get_names()) { - _tensorNames[name] = dataName; - } -} - -size_t CNNNetworkNGraphImpl::getBatchSize() const { - // TODO Provide adequate implementation. - // The original code from CNNNetworkImpl just gets the first input and returns the first dimension. - // This is not correct in general. We can follow the same semantics, but order of inputs should be - // guaranteed to be the same. - auto params = _ngraph_function->get_parameters(); - sort(params.begin(), params.end(), [](std::shared_ptr lhs, std::shared_ptr rhs) { - return lhs->get_friendly_name() < rhs->get_friendly_name(); - }); - - for (const auto& param : params) { - if (param->get_output_partial_shape(0).rank().is_dynamic()) - continue; - auto pshape = param->get_output_partial_shape(0); - auto rank = pshape.rank().get_length(); - // WA: for speech recognition and scalar layouts (copy-past from CNNNetwork) - if ((rank == 2 || rank > 3) && pshape[0].is_static()) { - return pshape[0].get_length(); - } - } - return 1; -} - -void CNNNetworkNGraphImpl::reshape() { - reshape({}); -} - -StatusCode CNNNetworkNGraphImpl::reshape(const std::map& inputShapes, - ResponseDesc* responseDesc) noexcept { - try { - if (inputShapes.empty()) - return OK; - - const auto& params = _ngraph_function->get_parameters(); - - // Check that we need to do reshape only if input shapes will be changed - bool needReshape = false; - for (const auto& param : params) { - const auto it = inputShapes.find(param->get_friendly_name()); - if (it == inputShapes.end()) { - continue; - } - if (param->get_output_partial_shape(0).is_dynamic() || param->get_output_partial_shape(0) != it->second) { - needReshape = true; - break; - } - } - - if (!needReshape) - return OK; - - // save original parameters shape - std::map originalInputShapes; - for (const auto& param : params) { - originalInputShapes[param->get_friendly_name()] = param->get_output_partial_shape(0); - } - - try { - ov::pass::Manager ssr_manager; - using namespace ov::pass; - REGISTER_PASS(ssr_manager, SmartReshape) - ssr_manager.run_passes(_ngraph_function); - - reshape(inputShapes); - } catch (std::exception& ex) { - reshape(originalInputShapes); - return DescriptionBuffer(GENERAL_ERROR, responseDesc) << ex.what(); - } - - return OK; - } catch (const InferenceEngine::GeneralError& ex) { - return DescriptionBuffer(GENERAL_ERROR, responseDesc) << ex.what(); - } catch (const ov::Exception& ex) { - return DescriptionBuffer(GENERAL_ERROR, responseDesc) << ex.what(); - } catch (const std::runtime_error& ex) { - return DescriptionBuffer(GENERAL_ERROR, responseDesc) << ex.what(); - } catch (const std::out_of_range& ex) { - return DescriptionBuffer(OUT_OF_BOUNDS, responseDesc) << ex.what(); - } catch (...) { - return GENERAL_ERROR; - } -} - -StatusCode CNNNetworkNGraphImpl::reshape(const std::map& inputShapes, - ResponseDesc* responseDesc) noexcept { - std::map shapes; - for (const auto& shape : inputShapes) - shapes[shape.first] = ov::PartialShape(shape.second); - return reshape(shapes, responseDesc); -} - -#if 0 -namespace { -void collect_dynamism_signature(const std::shared_ptr& ov_model, - std::map>& signatures, - bool obfuscate) { - for (const auto& op : ov_model->get_ordered_ops()) { - const auto& type_name = string(op->get_type_info().name) + "_" + op->get_type_info().version_id; - - std::stringstream shape_representation; - for (const auto& input : op->input_values()) { - bool first = true; - shape_representation << "{"; - for (const auto& dimension : input.get_partial_shape()) { - if (!first) - shape_representation << ","; - first = false; - - if (obfuscate) - shape_representation << (dimension.is_dynamic() ? "D" : "S"); - else - shape_representation << dimension; - } - shape_representation << "} "; - } - shape_representation << "-> "; - for (const auto& output : op->outputs()) { - bool first = true; - shape_representation << "{"; - for (const auto& dimension : output.get_partial_shape()) { - if (!first) - shape_representation << ","; - first = false; - - if (obfuscate) - shape_representation << (dimension.is_dynamic() ? "D" : "S"); - else - shape_representation << dimension; - } - shape_representation << "} "; - } - signatures[type_name][shape_representation.str()]++; - - // collect dynamism signature for sub-graphs of multi-subgraph operation - if (const auto multi_sub_graph_op = ov::as_type_ptr(op)) { - int num_subgraphs = static_cast(multi_sub_graph_op->get_internal_subgraphs_size()); - for (int i = 0; i < num_subgraphs; i++) - collect_dynamism_signature(multi_sub_graph_op->get_function(i), signatures, obfuscate); - } - } -} -} // namespace -#endif - -void CNNNetworkNGraphImpl::reshape(const std::map& inputShapes) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "CNNNetworkNGraphImpl::reshape"); - - auto params = _ngraph_function->get_parameters(); - - bool parameter_replaced = false; - for (auto& param : params) { - if (inputShapes.find(param->get_friendly_name()) == inputShapes.end()) - continue; - param->set_partial_shape(inputShapes.at(param->get_friendly_name())); - parameter_replaced = true; - } - if (parameter_replaced) - _ngraph_function->validate_nodes_and_infer_types(); - -#if 0 - bool obfuscate = true; // set to false to get exact dimensions - std::map> signatures; - - collect_dynamism_signature(_ngraph_function, signatures, obfuscate); - - for (const auto& item : signatures) - for (const auto& shape_to_count : item.second) - std::cout << item.first << " " << shape_to_count.second << "x " << shape_to_count.first << std::endl; -#endif - - std::unordered_set opName; - for (const auto& result : _ngraph_function->get_results()) { - addOutput(result->input_value(0)); - } - - for (const auto& parameter : _ngraph_function->get_parameters()) { - const auto& outName = parameter->get_friendly_name(); - if (opName.find(outName) != opName.end()) { - IE_THROW() << "All operations in nGraph function should have unique friendly names!"; - } - opName.insert(outName); - createDataForResult(parameter, outName, _data[outName]); - } -} - -StatusCode CNNNetworkNGraphImpl::serialize(const std::string& xmlPath, - const std::string& binPath, - ResponseDesc* resp) const noexcept { - try { - ov::pass::Manager manager; - using namespace ov::pass; - REGISTER_PASS(manager, Serialize, xmlPath, binPath, ov::pass::Serialize::Version::IR_V10) - manager.run_passes(_ngraph_function); - } catch (const Exception& e) { - return DescriptionBuffer(GENERAL_ERROR, resp) << e.what(); - } catch (const std::exception& e) { - return DescriptionBuffer(UNEXPECTED, resp) << e.what(); - } catch (...) { - return DescriptionBuffer(UNEXPECTED, resp); - } - return OK; -} - -StatusCode CNNNetworkNGraphImpl::serialize(std::ostream& xmlBuf, std::ostream& binBuf, ResponseDesc* resp) const - noexcept { - try { - ov::pass::Manager manager; - using namespace ov::pass; - REGISTER_PASS(manager, Serialize, xmlBuf, binBuf, ov::pass::Serialize::Version::IR_V10) - manager.run_passes(_ngraph_function); - } catch (const Exception& e) { - return DescriptionBuffer(GENERAL_ERROR, resp) << e.what(); - } catch (const std::exception& e) { - return DescriptionBuffer(UNEXPECTED, resp) << e.what(); - } catch (...) { - return DescriptionBuffer(UNEXPECTED, resp); - } - return OK; -} - -StatusCode CNNNetworkNGraphImpl::serialize(std::ostream& xmlBuf, Blob::Ptr& binBlob, ResponseDesc* resp) const - noexcept { - try { - std::stringstream binBuf; - ov::pass::Manager manager; - using namespace ov::pass; - REGISTER_PASS(manager, Serialize, xmlBuf, binBuf, ov::pass::Serialize::Version::IR_V10) - manager.run_passes(_ngraph_function); - - std::streambuf* pbuf = binBuf.rdbuf(); - unsigned long bufSize = static_cast(binBuf.tellp()); - - TensorDesc tensorDesc(Precision::U8, {bufSize}, Layout::C); - binBlob = make_shared_blob(tensorDesc); - binBlob->allocate(); - pbuf->sgetn(binBlob->buffer(), bufSize); - } catch (const Exception& e) { - return DescriptionBuffer(GENERAL_ERROR, resp) << e.what(); - } catch (const std::exception& e) { - return DescriptionBuffer(UNEXPECTED, resp) << e.what(); - } catch (...) { - return DescriptionBuffer(UNEXPECTED, resp); - } - return OK; -} - -StatusCode CNNNetworkNGraphImpl::getOVNameForTensor(std::string& ov_name, - const std::string& orig_name, - ResponseDesc* resp) const noexcept { - if (_tensorNames.find(orig_name) == _tensorNames.end()) - return DescriptionBuffer(NOT_FOUND, resp) - << "Framework tensor with name \"" << orig_name << "\" was not mapped to OpenVINO data!"; - ov_name = _tensorNames.at(orig_name); - return OK; -} - -StatusCode CNNNetworkNGraphImpl::setBatchSize(size_t size, ResponseDesc* responseDesc) noexcept { - try { - if (getBatchSize() == size) - return OK; - auto original_parameters = _ngraph_function->get_parameters(); - if (original_parameters.empty()) - return DescriptionBuffer(GENERAL_ERROR, responseDesc) - << "Cannot set batch! Function doesn't contain parameters!"; - - stringstream ss; - ss << " Please use reshape method instead. Original parameter shapes are: "; - for (size_t i = 0; i < original_parameters.size(); ++i) { - if (i) - ss << ", "; - ss << "\"" << original_parameters[i]->get_friendly_name() - << "\": " << original_parameters[i]->get_output_partial_shape(0); - } - - // ill-formed logic from the past setBatchSize (we keep it for backward-compatibility) - const auto first_parameter = - *std::min_element(original_parameters.begin(), - original_parameters.end(), - [](std::shared_ptr lhs, std::shared_ptr rhs) { - return lhs->get_friendly_name() < rhs->get_friendly_name(); - }); - const auto first_parameter_pshape = first_parameter->get_output_partial_shape(0); - if (first_parameter_pshape.is_dynamic()) - return DescriptionBuffer(PARAMETER_MISMATCH, responseDesc) - << "Cannot set batch! Function contains parameter with partially defined shape!" << ss.str(); - const auto first_parameter_rank = first_parameter_pshape.rank().get_length(); - if (first_parameter_rank == 0 || first_parameter_rank == 1 || first_parameter_rank == 3) - return DescriptionBuffer(PARAMETER_MISMATCH, responseDesc) - << "Cannot set batch! Function contains 0D/1D/3D parameter with unknown batch dimension placement." - << ss.str(); - - std::map> inShapes; - for (const auto& parameter : original_parameters) { - const auto& pshape = parameter->get_output_partial_shape(0); - if (pshape.is_dynamic()) - return DescriptionBuffer(PARAMETER_MISMATCH, responseDesc) - << "Cannot set batch! Function contains parameter with partially defined shape!" << ss.str(); - const auto& rank = pshape.rank().get_length(); - if (rank == 0) - return DescriptionBuffer(PARAMETER_MISMATCH, responseDesc) - << "Cannot set batch! Function contains 0D/1D/3D parameter with unknown batch dimension " - "placement." - << ss.str(); - auto shape = parameter->get_shape(); - shape[0] = {static_cast( - std::ceil(size * static_cast(shape[0]) / static_cast(getBatchSize())))}; - inShapes[parameter->get_friendly_name()] = shape; - } - ov::pass::Manager ssr_manager; - using namespace ov::pass; - REGISTER_PASS(ssr_manager, SetBatchSize) - ssr_manager.run_passes(_ngraph_function); - - return reshape(inShapes, responseDesc); - } catch (std::exception& ex) { - return DescriptionBuffer(GENERAL_ERROR, responseDesc) << ex.what(); - } -} diff --git a/src/inference/src/cnn_network_ngraph_impl.hpp b/src/inference/src/cnn_network_ngraph_impl.hpp deleted file mode 100644 index 482e3a3e5baa6f..00000000000000 --- a/src/inference/src/cnn_network_ngraph_impl.hpp +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief A file containing ngraph implementation of public CNNNetwork wrapper - * @file cnn_network_ngraph_impl.hpp - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "description_buffer.hpp" -#include "ie_api.h" -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_data.h" -#include "ie_input_info.hpp" - -namespace InferenceEngine { -namespace details { - -ov::element::Type toLegacyType(const ov::element::Type& ngraph_type, bool input); - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief Ngraph-based implementation of the CNNNetwork. - */ -class INFERENCE_ENGINE_API_CLASS(CNNNetworkNGraphImpl) final : public ICNNNetwork { -public: - CNNNetworkNGraphImpl(const std::shared_ptr<::ov::Model>& nGraph, bool newAPI = false); - - CNNNetworkNGraphImpl(const CNNNetwork& nGraph); - - void getOutputsInfo(std::map& out) const noexcept override; - - void getInputsInfo(InputsDataMap& inputs) const noexcept override; - - InputInfo::Ptr getInput(const std::string& inputName) const noexcept override; - const std::string& getName() const noexcept override; - - size_t layerCount() const override; - - void setInputInfo(InputInfo::Ptr data); - - // public version - StatusCode setBatchSize(size_t size, ResponseDesc* responseDesc) noexcept override; - - size_t getBatchSize() const override; - - StatusCode addOutput(const std::string& layerName, size_t outputIndex, ResponseDesc* resp) noexcept override; - - void addOutput(const ::ov::Output<::ov::Node>& dataName); - - std::shared_ptr getFunction() const noexcept override { - return _ngraph_function; - } - std::shared_ptr<::ov::Model> getFunction() noexcept override { - return _ngraph_function; - } - - virtual void validate(int = 10); - - StatusCode reshape(const std::map& inputShapes, ResponseDesc* resp) noexcept override; - StatusCode reshape(const std::map& inputShapes, - ResponseDesc* resp) noexcept override; - - StatusCode serialize(const std::string& xmlPath, const std::string& binPath, ResponseDesc* resp) const - noexcept override; - - StatusCode serialize(std::ostream& xmlBuf, std::ostream& binBuf, ResponseDesc* resp) const noexcept override; - - StatusCode serialize(std::ostream& xmlBuf, Blob::Ptr& binBlob, ResponseDesc* resp) const noexcept override; - - StatusCode getOVNameForTensor(std::string& ov_name, const std::string& orig_name, ResponseDesc* resp) const - noexcept override; - - // used by convertFunctionToICNNNetwork from legacy library - std::map _data; - -protected: - std::shared_ptr<::ov::Model> _ngraph_function; - -private: - InferenceEngine::InputsDataMap _inputData; - std::map _outputData; - std::unordered_map _tensorNames; - bool _new_api = false; - - /** - * @brief Create DataPtr for nGraph operation - * - * @param output output port from nGraph op - * @param outName name for DataPtr - * @param ptr reference to new DataPtr - */ - void createDataForResult(const ::ov::Output<::ov::Node>& output, const std::string& outName, DataPtr& ptr); - - /** - * @brief Reshape on the same shape - */ - void reshape(); - void reshape(const std::map& inputShapes); - void validateFunctionNames() const; -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace details -} // namespace InferenceEngine diff --git a/src/inference/src/compilation_context.cpp b/src/inference/src/compilation_context.cpp index 8eaca40d5f09c8..999bbb9c2cc47f 100644 --- a/src/inference/src/compilation_context.cpp +++ b/src/inference/src/compilation_context.cpp @@ -11,7 +11,6 @@ # include #endif -#include "cpp/ie_cnn_network.h" #include "itt.hpp" #include "openvino/pass/manager.hpp" #include "openvino/util/file_util.hpp" @@ -39,18 +38,6 @@ static int32_t as_int32_t(T v) { } // namespace ov -namespace { - -uint64_t calculate_td(const InferenceEngine::TensorDesc& td, uint64_t _seed) { - uint64_t seed = _seed; - - seed = ov::hash_combine(seed, ov::as_int32_t(td.getPrecision())); - seed = ov::hash_combine(seed, ov::as_int32_t(td.getLayout())); - return seed; -} - -} // namespace - namespace ov { std::string ModelCache::calculate_file_info(const std::string& filePath) { @@ -102,23 +89,6 @@ std::string ModelCache::compute_hash(const std::shared_ptr& mod } } - // 4. Legacy part if CNNNetwork is used with new Plugin API - for (auto&& input : model->inputs()) { - auto& rt_info = input.get_rt_info(); - - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - seed = calculate_td(it->second.as(), seed); - } - } - for (auto&& output : model->outputs()) { - auto& rt_info = output.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - seed = calculate_td(it->second.as(), seed); - } - } - return std::to_string(seed); } @@ -185,9 +155,7 @@ std::istream& operator>>(std::istream& stream, CompiledBlobHeader& header) { pugi::xml_document document; pugi::xml_parse_result res = document.load_string(xmlStr.c_str()); - if (res.status != pugi::status_ok) { - IE_THROW(NetworkNotRead) << "Error reading compiled blob header"; - } + OPENVINO_ASSERT(res.status == pugi::status_ok, "Error reading compiled blob header"); pugi::xml_node compiledBlobNode = document.document_element(); header.m_ieVersion = ov::util::pugixml::get_str_attr(compiledBlobNode, "ie_version"); diff --git a/src/inference/src/core.cpp b/src/inference/src/core.cpp index 618c795de14382..64057da0d83550 100644 --- a/src/inference/src/core.cpp +++ b/src/inference/src/core.cpp @@ -5,7 +5,6 @@ #include "openvino/runtime/core.hpp" #include "any_copy.hpp" -#include "dev/converter_utils.hpp" #include "dev/core_impl.hpp" #include "itt.hpp" #include "openvino/core/so_extension.hpp" @@ -80,9 +79,51 @@ Core::Core(const std::string& xml_config_file) { std::map Core::get_versions(const std::string& device_name) const { OV_CORE_CALL_STATEMENT({ - std::map versions; - for (auto&& kvp : _impl->GetVersions(device_name)) { - versions[kvp.first] = Version{kvp.second.buildNumber, kvp.second.description}; + std::map versions; + std::vector deviceNames; + + // for compatibility with samples / demo + if (device_name.find("HETERO") == 0) { + auto pos = device_name.find_first_of(":"); + if (pos != std::string::npos) { + deviceNames = ov::DeviceIDParser::get_hetero_devices(device_name.substr(pos + 1)); + } + deviceNames.push_back("HETERO"); + } else if (device_name.find("MULTI") == 0) { + auto pos = device_name.find_first_of(":"); + if (pos != std::string::npos) { + deviceNames = ov::DeviceIDParser::get_multi_devices(device_name.substr(pos + 1)); + } + deviceNames.push_back("MULTI"); + } else if (device_name.find("AUTO") == 0) { + auto pos = device_name.find_first_of(":"); + if (pos != std::string::npos) { + deviceNames = ov::DeviceIDParser::get_multi_devices(device_name.substr(pos + 1)); + } + deviceNames.emplace_back("AUTO"); + } else if (device_name.find("BATCH") == 0) { + auto pos = device_name.find_first_of(":"); + if (pos != std::string::npos) { + deviceNames = {ov::DeviceIDParser::get_batch_device(device_name.substr(pos + 1))}; + } + deviceNames.push_back("BATCH"); + } else { + deviceNames.push_back(device_name); + } + + for (auto&& deviceName_ : deviceNames) { + ov::DeviceIDParser parser(deviceName_); + std::string deviceNameLocal = parser.get_device_name(); + + try { + ov::Plugin cppPlugin = _impl->get_plugin(deviceNameLocal); + versions[deviceNameLocal] = cppPlugin.get_version(); + } catch (const ov::Exception& ex) { + std::string exception(ex.what()); + if (exception.find("not registered in the OpenVINO Runtime") == std::string::npos) { + throw; + } + } } return versions; }) @@ -227,7 +268,7 @@ Any Core::get_property(const std::string& device_name, const std::string& name, } std::vector Core::get_available_devices() const { - OV_CORE_CALL_STATEMENT(return _impl->GetAvailableDevices();); + OV_CORE_CALL_STATEMENT(return _impl->get_available_devices();); } void Core::register_plugin(const std::string& plugin, const std::string& device_name, const ov::AnyMap& properties) { diff --git a/src/inference/src/cpp/exception2status.hpp b/src/inference/src/cpp/exception2status.hpp deleted file mode 100644 index 4350a2b6c1f4dc..00000000000000 --- a/src/inference/src/cpp/exception2status.hpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief Wrappers from c++ function to c-style one - * @file exception2status.hpp - */ -#pragma once - -#include - -#include "description_buffer.hpp" -#include "openvino/core/except.hpp" - -namespace InferenceEngine { -#define CATCH_IE_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) \ - catch (const InferenceEngine::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \ - } - -#define CATCH_OV_EXCEPTION_TO_STATUS(StatusCode, ExceptionType) \ - catch (const ov::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \ - } - -#define CATCH_IE_EXCEPTIONS_TO_STATUS \ - CATCH_OV_EXCEPTION_TO_STATUS(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_OV_EXCEPTION_TO_STATUS(GENERAL_ERROR, Exception) \ - CATCH_IE_EXCEPTION_TO_STATUS(GENERAL_ERROR, GeneralError) \ - CATCH_IE_EXCEPTION_TO_STATUS(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_IE_EXCEPTION_TO_STATUS(NETWORK_NOT_LOADED, NetworkNotLoaded) \ - CATCH_IE_EXCEPTION_TO_STATUS(PARAMETER_MISMATCH, ParameterMismatch) \ - CATCH_IE_EXCEPTION_TO_STATUS(NOT_FOUND, NotFound) \ - CATCH_IE_EXCEPTION_TO_STATUS(OUT_OF_BOUNDS, OutOfBounds) \ - CATCH_IE_EXCEPTION_TO_STATUS(UNEXPECTED, Unexpected) \ - CATCH_IE_EXCEPTION_TO_STATUS(REQUEST_BUSY, RequestBusy) \ - CATCH_IE_EXCEPTION_TO_STATUS(RESULT_NOT_READY, ResultNotReady) \ - CATCH_IE_EXCEPTION_TO_STATUS(NOT_ALLOCATED, NotAllocated) \ - CATCH_IE_EXCEPTION_TO_STATUS(INFER_NOT_STARTED, InferNotStarted) \ - CATCH_IE_EXCEPTION_TO_STATUS(NETWORK_NOT_READ, NetworkNotRead) \ - CATCH_IE_EXCEPTION_TO_STATUS(INFER_CANCELLED, InferCancelled) - -/** - * @def TO_STATUS(x) - * @brief Converts C++ exceptioned function call into a c-style one - * @ingroup ie_dev_api_error_debug - */ -#define TO_STATUS(x) \ - try { \ - x; \ - return OK; \ - } \ - CATCH_IE_EXCEPTIONS_TO_STATUS catch (const std::exception& ex) { \ - return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); \ - } \ - catch (...) { \ - return InferenceEngine::DescriptionBuffer(UNEXPECTED); \ - } - -#define CALL_STATUS_FNC(function, ...) \ - if (!actual) { \ - IE_THROW() << "Wrapper used was not initialized."; \ - } \ - ResponseDesc resp; \ - auto res = actual->function(__VA_ARGS__, &resp); \ - if (res != OK) \ - IE_EXCEPTION_SWITCH( \ - res, \ - ExceptionType, \ - (InferenceEngine::details::ThrowNow{IE_LOCATION_PARAM}) <<= std::stringstream{} << resp.msg) - -#define CALL_STATUS_FNC_NO_ARGS(function) \ - if (!actual) \ - IE_THROW() << "Wrapper used in the CALL_STATUS_FNC_NO_ARGS was not initialized."; \ - ResponseDesc resp; \ - auto res = actual->function(&resp); \ - if (res != OK) \ - IE_EXCEPTION_SWITCH( \ - res, \ - ExceptionType, \ - (InferenceEngine::details::ThrowNow{IE_LOCATION_PARAM}) <<= std::stringstream{}) - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_cnn_network.cpp b/src/inference/src/cpp/ie_cnn_network.cpp deleted file mode 100644 index dc5977499ddf04..00000000000000 --- a/src/inference/src/cpp/ie_cnn_network.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cpp/ie_cnn_network.h" - -#include "cnn_network_ngraph_impl.hpp" -#include "exception2status.hpp" -#include "itt.hpp" - -namespace InferenceEngine { - -CNNNetwork::CNNNetwork() : network(), actual() {} - -IE_SUPPRESS_DEPRECATED_START - -CNNNetwork::CNNNetwork(std::shared_ptr network) : network(network) { - actual = network.get(); - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; -} - -CNNNetwork::CNNNetwork(const std::shared_ptr& graph) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "CNNNetwork::CNNNetwork"); - - if (graph == nullptr) { - IE_THROW() << "CNNNetwork was not initialized: 'graph' object is empty"; - } - - // Create CNNNetworkNGraphImpl - network = std::make_shared(graph); - actual = network.get(); - if (actual == nullptr) { - IE_THROW() << "CNNNetwork was not initialized."; - } -} - -OutputsDataMap CNNNetwork::getOutputsInfo() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - OutputsDataMap outputs; - actual->getOutputsInfo(outputs); - return outputs; -} - -InputsDataMap CNNNetwork::getInputsInfo() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - InputsDataMap inputs; - actual->getInputsInfo(inputs); - return inputs; -} - -size_t CNNNetwork::layerCount() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return actual->layerCount(); -} - -const std::string& CNNNetwork::getName() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return actual->getName(); -} - -void CNNNetwork::setBatchSize(const size_t size) { - CALL_STATUS_FNC(setBatchSize, size); -} - -size_t CNNNetwork::getBatchSize() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return actual->getBatchSize(); -} - -CNNNetwork::operator ICNNNetwork::Ptr() { - return network; -} - -CNNNetwork::operator ICNNNetwork&() { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return *actual; -} - -CNNNetwork::operator const ICNNNetwork&() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return *actual; -} - -std::shared_ptr CNNNetwork::getFunction() { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return actual->getFunction(); -} - -std::shared_ptr CNNNetwork::getFunction() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - return actual->getFunction(); -} - -void CNNNetwork::addOutput(const std::string& layerName, size_t outputIndex) { - CALL_STATUS_FNC(addOutput, layerName, outputIndex); -} - -ICNNNetwork::InputShapes CNNNetwork::getInputShapes() const { - if (actual == nullptr) - IE_THROW() << "CNNNetwork was not initialized."; - ICNNNetwork::InputShapes shapes; - InputsDataMap inputs; - actual->getInputsInfo(inputs); - for (const auto& pair : inputs) { - auto info = pair.second; - if (info) { - auto data = info->getInputData(); - if (data) { - shapes[data->getName()] = data->getTensorDesc().getDims(); - } - } - } - return shapes; -} - -void CNNNetwork::reshape(const ICNNNetwork::InputShapes& inputShapes) { - CALL_STATUS_FNC(reshape, inputShapes); -} - -void CNNNetwork::serialize(const std::string& xmlPath, const std::string& binPath) const { - CALL_STATUS_FNC(serialize, xmlPath, binPath); -} - -void CNNNetwork::serialize(std::ostream& xmlBuf, std::ostream& binBuf) const { - CALL_STATUS_FNC(serialize, xmlBuf, binBuf); -} - -void CNNNetwork::serialize(std::ostream& xmlBuf, Blob::Ptr& binBlob) const { - CALL_STATUS_FNC(serialize, xmlBuf, binBlob); -} - -std::string CNNNetwork::getOVNameForTensor(const std::string& orig_name) const { - std::string ov_name; - CALL_STATUS_FNC(getOVNameForTensor, ov_name, orig_name); - return ov_name; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_executable_network.cpp b/src/inference/src/cpp/ie_executable_network.cpp deleted file mode 100644 index 1b5ecdf5d7a2a1..00000000000000 --- a/src/inference/src/cpp/ie_executable_network.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cpp/ie_executable_network.hpp" - -#include "any_copy.hpp" -#include "cpp/exception2status.hpp" -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "ie_common.h" -#include "ie_executable_network_base.hpp" -#include "openvino/core/except.hpp" -#include "openvino/runtime/compiled_model.hpp" - -namespace InferenceEngine { - -#define EXEC_NET_CALL_STATEMENT(...) \ - if (_impl == nullptr) \ - IE_THROW(NotAllocated) << "ExecutableNetwork was not initialized."; \ - try { \ - __VA_ARGS__; \ - } catch (...) { \ - InferenceEngine::details::Rethrow(); \ - } - -ExecutableNetwork::~ExecutableNetwork() { - _impl = {}; -} - -ExecutableNetwork::ExecutableNetwork(const IExecutableNetworkInternal::Ptr& impl, const std::shared_ptr& so) - : _impl(impl), - _so(so) { - IE_ASSERT(_impl != nullptr); -} - -IE_SUPPRESS_DEPRECATED_START - -ConstOutputsDataMap ExecutableNetwork::GetOutputsInfo() const { - EXEC_NET_CALL_STATEMENT(return _impl->GetOutputsInfo()); -} - -ConstInputsDataMap ExecutableNetwork::GetInputsInfo() const { - EXEC_NET_CALL_STATEMENT(return _impl->GetInputsInfo()); -} - -void ExecutableNetwork::reset(IExecutableNetwork::Ptr newActual) { - if (_impl == nullptr) - IE_THROW() << "ExecutableNetwork was not initialized."; - if (newActual == nullptr) - IE_THROW() << "ExecutableNetwork wrapper used for reset was not initialized."; - auto newBase = std::dynamic_pointer_cast(newActual); - IE_ASSERT(newBase != nullptr); - auto newImpl = newBase->GetImpl(); - IE_ASSERT(newImpl != nullptr); - _impl = newImpl; -} - -ExecutableNetwork::operator IExecutableNetwork::Ptr() { - return std::make_shared(_impl); -} - -InferRequest ExecutableNetwork::CreateInferRequest() { - EXEC_NET_CALL_STATEMENT(return {_impl->CreateInferRequest(), _so}); -} - -InferRequest::Ptr ExecutableNetwork::CreateInferRequestPtr() { - return std::make_shared(CreateInferRequest()); -} - -void ExecutableNetwork::Export(const std::string& modelFileName) { - EXEC_NET_CALL_STATEMENT(_impl->Export(modelFileName)); -} - -void ExecutableNetwork::Export(std::ostream& networkModel) { - EXEC_NET_CALL_STATEMENT(_impl->Export(networkModel)); -} - -CNNNetwork ExecutableNetwork::GetExecGraphInfo() { - EXEC_NET_CALL_STATEMENT(return CNNNetwork{_impl->GetExecGraphInfo()}); -} - -void ExecutableNetwork::SetConfig(const ov::AnyMap& config) { - EXEC_NET_CALL_STATEMENT(_impl->SetConfig(config)); -} - -ov::Any ExecutableNetwork::GetConfig(const std::string& name) const { - EXEC_NET_CALL_STATEMENT(return {_impl->GetConfig(name), {_so}}); -} - -ov::Any ExecutableNetwork::GetMetric(const std::string& name) const { - EXEC_NET_CALL_STATEMENT(return {_impl->GetMetric(name), {_so}}); -} - -bool ExecutableNetwork::operator!() const noexcept { - return !_impl; -} - -ExecutableNetwork::operator bool() const noexcept { - return !!_impl; -} -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_executable_network_base.hpp b/src/inference/src/cpp/ie_executable_network_base.hpp deleted file mode 100644 index d62e8fc3ee2eb9..00000000000000 --- a/src/inference/src/cpp/ie_executable_network_base.hpp +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * \brief inference engine executanle network API wrapper, to be used by particular implementors - * \file ie_executable_network_base.hpp - */ - -#pragma once - -#include -#include -#include -#include - -#include "cpp/exception2status.hpp" -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" -#include "ie_iexecutable_network.hpp" -#include "ie_infer_async_request_base.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START -/** - * @brief Executable network `noexcept` wrapper which accepts IExecutableNetworkInternal derived instance which can - * throw exceptions - * @ingroup ie_dev_api_exec_network_api - */ -class ExecutableNetworkBase : public IExecutableNetwork { -protected: - std::shared_ptr _impl; - -public: - /** - * @brief Constructor with actual underlying implementation. - * @param impl Underlying implementation of type IExecutableNetworkInternal - */ - explicit ExecutableNetworkBase(std::shared_ptr impl) { - if (impl.get() == nullptr) { - IE_THROW() << "implementation not defined"; - } - _impl = impl; - } - - StatusCode GetOutputsInfo(ConstOutputsDataMap& outs, ResponseDesc* resp) const noexcept override { - TO_STATUS(outs = _impl->GetOutputsInfo()); - } - - StatusCode GetInputsInfo(ConstInputsDataMap& inputs, ResponseDesc* resp) const noexcept override { - TO_STATUS(inputs = _impl->GetInputsInfo()); - } - - StatusCode CreateInferRequest(IInferRequest::Ptr& req, ResponseDesc* resp) noexcept override { - TO_STATUS(req = std::make_shared(_impl->CreateInferRequest())); - } - - StatusCode Export(const std::string& modelFileName, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->Export(modelFileName)); - } - - StatusCode Export(std::ostream& networkModel, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->Export(networkModel)); - } - - StatusCode GetExecGraphInfo(ICNNNetwork::Ptr& graphPtr, ResponseDesc* resp) noexcept override { - TO_STATUS(graphPtr = CNNNetwork{_impl->GetExecGraphInfo()}); - } - - StatusCode SetConfig(const ov::AnyMap& config, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->SetConfig(config)); - } - - StatusCode GetConfig(const std::string& name, ov::Any& result, ResponseDesc* resp) const noexcept override { - TO_STATUS(result = _impl->GetConfig(name)); - } - - StatusCode GetMetric(const std::string& name, ov::Any& result, ResponseDesc* resp) const noexcept override { - TO_STATUS(result = _impl->GetMetric(name)); - } - - std::shared_ptr GetImpl() const { - return _impl; - } -}; -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_infer_async_request_base.hpp b/src/inference/src/cpp/ie_infer_async_request_base.hpp deleted file mode 100644 index 79415ba6cb34b5..00000000000000 --- a/src/inference/src/cpp/ie_infer_async_request_base.hpp +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include - -#include "cpp/exception2status.hpp" -#include "cpp_interfaces/plugin_itt.hpp" -#include -#include "ie_iinfer_request.hpp" - -namespace InferenceEngine { - -#define CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) \ - catch (const InferenceEngine::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \ - } - -#define CATCH_OV_EXCEPTION_TO_STATUS_NO_RESP(StatusCode, ExceptionType) \ - catch (const ov::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode) << ex.what(); \ - } - -#define CATCH_IE_EXCEPTIONS_TO_STATUS_NO_RESP \ - CATCH_OV_EXCEPTION_TO_STATUS_NO_RESP(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_OV_EXCEPTION_TO_STATUS_NO_RESP(GENERAL_ERROR, Exception) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(GENERAL_ERROR, GeneralError) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(NETWORK_NOT_LOADED, NetworkNotLoaded) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(PARAMETER_MISMATCH, ParameterMismatch) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(NOT_FOUND, NotFound) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(OUT_OF_BOUNDS, OutOfBounds) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(UNEXPECTED, Unexpected) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(REQUEST_BUSY, RequestBusy) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(RESULT_NOT_READY, ResultNotReady) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(NOT_ALLOCATED, NotAllocated) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(INFER_NOT_STARTED, InferNotStarted) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(NETWORK_NOT_READ, NetworkNotRead) \ - CATCH_IE_EXCEPTION_TO_STATUS_NO_RESP(INFER_CANCELLED, InferCancelled) - -/** - * @def TO_STATUS_NO_RESP(x) - * @brief Converts C++ exceptioned function call into a status code. Does not work with a ResponseDesc object - * @ingroup ie_dev_api_error_debug - */ -#define TO_STATUS_NO_RESP(x) \ - try { \ - x; \ - return OK; \ - } CATCH_IE_EXCEPTIONS_TO_STATUS_NO_RESP catch (const std::exception& ex) { \ - return InferenceEngine::DescriptionBuffer(GENERAL_ERROR) << ex.what(); \ - } catch (...) { \ - return InferenceEngine::DescriptionBuffer(UNEXPECTED); \ - } - -#define CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) \ -catch (const InferenceEngine::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \ -} - -#define CATCH_OV_EXCEPTION_CALL_RETURN_STATUS(StatusCode, ExceptionType) \ -catch (const ov::ExceptionType& ex) { \ - return InferenceEngine::DescriptionBuffer(StatusCode, resp) << ex.what(); \ -} - -#define CATCH_IE_EXCEPTIONS_CALL_RETURN_STATUS \ - CATCH_OV_EXCEPTION_CALL_RETURN_STATUS(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_OV_EXCEPTION_CALL_RETURN_STATUS(GENERAL_ERROR, Exception) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(GENERAL_ERROR, GeneralError) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(NETWORK_NOT_LOADED, NetworkNotLoaded) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(PARAMETER_MISMATCH, ParameterMismatch) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(NOT_FOUND, NotFound) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(OUT_OF_BOUNDS, OutOfBounds) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(UNEXPECTED, Unexpected) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(REQUEST_BUSY, RequestBusy) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(RESULT_NOT_READY, ResultNotReady) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(NOT_ALLOCATED, NotAllocated) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(INFER_NOT_STARTED, InferNotStarted) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(NETWORK_NOT_READ, NetworkNotRead) \ - CATCH_IE_EXCEPTION_CALL_RETURN_STATUS(INFER_CANCELLED, InferCancelled) - -/** - * @def NO_EXCEPT_CALL_RETURN_STATUS(x) - * @brief Returns a status code of a called function, handles exeptions and converts to a status code. - * @ingroup ie_dev_api_error_debug - */ -#define NO_EXCEPT_CALL_RETURN_STATUS(x) \ - try { \ - return x; \ - } CATCH_IE_EXCEPTIONS_CALL_RETURN_STATUS catch (const std::exception& ex) { \ - return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what(); \ - } catch (...) { \ - return InferenceEngine::DescriptionBuffer(UNEXPECTED); \ - } - -IE_SUPPRESS_DEPRECATED_START - -/** - * @brief Inference request `noexcept` wrapper which accepts IInferRequestInternal derived instance which can throw exceptions - * @ingroup ie_dev_api_infer_request_api - */ -class InferRequestBase : public IInferRequest { - std::shared_ptr _impl; - -public: - /** - * @brief Constructor with actual underlying implementation. - * @param impl Underlying implementation of type IInferRequestInternal - */ - explicit InferRequestBase(std::shared_ptr impl): _impl(impl) {} - - StatusCode Infer(ResponseDesc* resp) noexcept override { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "Infer"); - TO_STATUS(_impl->Infer()); - } - - StatusCode Cancel(ResponseDesc* resp) noexcept override { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "Cancel"); - TO_STATUS(_impl->Cancel()); - } - - StatusCode GetPerformanceCounts(std::map& perfMap, - ResponseDesc* resp) const noexcept override { - TO_STATUS(perfMap = _impl->GetPerformanceCounts()); - } - - StatusCode SetBlob(const char* name, const Blob::Ptr& data, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->SetBlob(name, data)); - } - - StatusCode GetBlob(const char* name, Blob::Ptr& data, ResponseDesc* resp) noexcept override { - TO_STATUS(data = _impl->GetBlob(name)); - } - - StatusCode StartAsync(ResponseDesc* resp) noexcept override { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "StartAsync"); - TO_STATUS(_impl->StartAsync()); - } - - StatusCode Wait(int64_t millis_timeout, ResponseDesc* resp) noexcept override { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "Wait"); - NO_EXCEPT_CALL_RETURN_STATUS(_impl->Wait(millis_timeout)); - } - - StatusCode SetCompletionCallback(CompletionCallback callback) noexcept override { - auto weakImpl = std::shared_ptr(_impl.get(), [](IInferRequestInternal*){}); - TO_STATUS_NO_RESP(_impl->SetCallback([callback, weakImpl] (std::exception_ptr exceptionPtr) { - StatusCode statusCode = [&] ()-> StatusCode { - if (exceptionPtr) { - TO_STATUS_NO_RESP(std::rethrow_exception(exceptionPtr)); - } else { - return OK; - } - } (); - callback(std::make_shared(weakImpl), statusCode); - })); - } - - StatusCode GetUserData(void** data, ResponseDesc* resp) noexcept override { - if (data != nullptr) { - TO_STATUS(*data = _impl->GetUserData()); - } else { - return GENERAL_ERROR; - } - } - - StatusCode SetUserData(void* data, ResponseDesc* resp) noexcept override { - TO_STATUS(_impl->SetUserData(data)); - } -}; - -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_infer_request.cpp b/src/inference/src/cpp/ie_infer_request.cpp deleted file mode 100644 index 4b384b3df69e20..00000000000000 --- a/src/inference/src/cpp/ie_infer_request.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cpp/ie_infer_request.hpp" - -#include -#include -#include - -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp" -#include "dev/converter_utils.hpp" -#include "ie_infer_async_request_base.hpp" -#include "ie_ngraph_utils.hpp" -#include "openvino/runtime/compiled_model.hpp" -#include "openvino/runtime/exception.hpp" -#include "openvino/runtime/infer_request.hpp" -#include "transformations/utils/utils.hpp" - -namespace InferenceEngine { - -#define INFER_REQ_CALL_STATEMENT(...) \ - if (_impl == nullptr) \ - IE_THROW(NotAllocated) << "Inference Request is not initialized"; \ - try { \ - __VA_ARGS__ \ - } catch (...) { \ - ::InferenceEngine::details::Rethrow(); \ - } - -InferRequest::~InferRequest() { - _impl = {}; -} - -InferRequest::InferRequest(const IInferRequestInternal::Ptr& impl, const std::shared_ptr& so) - : _impl(impl), - _so(so) { - IE_ASSERT(_impl != nullptr); -} - -IE_SUPPRESS_DEPRECATED_START - -void InferRequest::SetBlob(const std::string& name, const Blob::Ptr& data) { - INFER_REQ_CALL_STATEMENT(_impl->SetBlob(name, data);) -} - -Blob::Ptr InferRequest::GetBlob(const std::string& name) { - Blob::Ptr blobPtr; - INFER_REQ_CALL_STATEMENT(blobPtr = _impl->GetBlob(name);) - std::string error = "Internal error: blob with name `" + name + "` is not allocated!"; - if (blobPtr == nullptr) - IE_THROW() << error; - if (blobPtr->buffer() == nullptr) - IE_THROW() << error; - return blobPtr; -} - -void InferRequest::Infer() { - INFER_REQ_CALL_STATEMENT(_impl->Infer();) -} - -void InferRequest::Cancel() { - INFER_REQ_CALL_STATEMENT(_impl->Cancel();) -} - -std::map InferRequest::GetPerformanceCounts() const { - INFER_REQ_CALL_STATEMENT(return _impl->GetPerformanceCounts();) -} - -void InferRequest::SetInput(const BlobMap& inputs) { - INFER_REQ_CALL_STATEMENT(for (auto&& input : inputs) { _impl->SetBlob(input.first, input.second); }) -} - -void InferRequest::SetOutput(const BlobMap& results) { - INFER_REQ_CALL_STATEMENT(for (auto&& result : results) { _impl->SetBlob(result.first, result.second); }) -} - -void InferRequest::StartAsync() { - INFER_REQ_CALL_STATEMENT(_impl->StartAsync();) -} - -StatusCode InferRequest::Wait(int64_t millis_timeout) { - INFER_REQ_CALL_STATEMENT(return _impl->Wait(millis_timeout);) -} - -void InferRequest::SetCompletionCallbackImpl(std::function callbackToSet) { - INFER_REQ_CALL_STATEMENT(_impl->SetCallback([callbackToSet](std::exception_ptr) { - callbackToSet(); - });) -} - -#define CATCH_IE_EXCEPTION_RETURN(StatusCode, ExceptionType) \ - catch (const ::InferenceEngine::ExceptionType&) { \ - return StatusCode; \ - } - -#define CATCH_OV_EXCEPTION_RETURN(StatusCode, ExceptionType) \ - catch (const ::ov::ExceptionType&) { \ - return StatusCode; \ - } - -#define CATCH_IE_EXCEPTIONS_RETURN \ - CATCH_OV_EXCEPTION_RETURN(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_OV_EXCEPTION_RETURN(GENERAL_ERROR, Exception) \ - CATCH_IE_EXCEPTION_RETURN(GENERAL_ERROR, GeneralError) \ - CATCH_IE_EXCEPTION_RETURN(NOT_IMPLEMENTED, NotImplemented) \ - CATCH_IE_EXCEPTION_RETURN(NETWORK_NOT_LOADED, NetworkNotLoaded) \ - CATCH_IE_EXCEPTION_RETURN(PARAMETER_MISMATCH, ParameterMismatch) \ - CATCH_IE_EXCEPTION_RETURN(NOT_FOUND, NotFound) \ - CATCH_IE_EXCEPTION_RETURN(OUT_OF_BOUNDS, OutOfBounds) \ - CATCH_IE_EXCEPTION_RETURN(UNEXPECTED, Unexpected) \ - CATCH_IE_EXCEPTION_RETURN(REQUEST_BUSY, RequestBusy) \ - CATCH_IE_EXCEPTION_RETURN(RESULT_NOT_READY, ResultNotReady) \ - CATCH_IE_EXCEPTION_RETURN(NOT_ALLOCATED, NotAllocated) \ - CATCH_IE_EXCEPTION_RETURN(INFER_NOT_STARTED, InferNotStarted) \ - CATCH_IE_EXCEPTION_RETURN(NETWORK_NOT_READ, NetworkNotRead) \ - CATCH_IE_EXCEPTION_RETURN(INFER_CANCELLED, InferCancelled) - -void InferRequest::SetCompletionCallbackImpl(std::function callbackToSet) { - INFER_REQ_CALL_STATEMENT( - auto weakThis = - InferRequest{std::shared_ptr{_impl.get(), [](IInferRequestInternal*) {}}, _so}; - _impl->SetCallback([callbackToSet, weakThis](std::exception_ptr exceptionPtr) { - StatusCode statusCode = StatusCode::OK; - if (exceptionPtr != nullptr) { - statusCode = [&] { - try { - std::rethrow_exception(exceptionPtr); - } - CATCH_IE_EXCEPTIONS_RETURN catch (const std::exception&) { - return GENERAL_ERROR; - } - catch (...) { - return UNEXPECTED; - } - }(); - } - callbackToSet(weakThis, statusCode); - });) -} - -void InferRequest::SetCompletionCallbackImpl(IInferRequest::CompletionCallback callbackToSet) { - INFER_REQ_CALL_STATEMENT( - IInferRequest::Ptr weakThis = - InferRequest{std::shared_ptr{_impl.get(), [](IInferRequestInternal*) {}}, _so}; - _impl->SetCallback([callbackToSet, weakThis](std::exception_ptr exceptionPtr) { - StatusCode statusCode = StatusCode::OK; - if (exceptionPtr != nullptr) { - statusCode = [&] { - try { - std::rethrow_exception(exceptionPtr); - } - CATCH_IE_EXCEPTIONS_RETURN catch (const std::exception&) { - return GENERAL_ERROR; - } - catch (...) { - return UNEXPECTED; - } - }(); - } - callbackToSet(weakThis, statusCode); - });) -} - -InferRequest::operator IInferRequest::Ptr() { - INFER_REQ_CALL_STATEMENT(return std::make_shared(_impl);) -} - -std::vector InferRequest::QueryState() { - std::vector controller; - INFER_REQ_CALL_STATEMENT(for (auto&& state - : _impl->QueryState()) { - controller.emplace_back(VariableState{state, _so}); - }) - return controller; -} - -bool InferRequest::operator!() const noexcept { - return !_impl; -} - -InferRequest::operator bool() const noexcept { - return (!!_impl); -} - -bool InferRequest::operator!=(const InferRequest& r) const noexcept { - return !(r == *this); -} - -bool InferRequest::operator==(const InferRequest& r) const noexcept { - return r._impl == _impl; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp/ie_variable_state.cpp b/src/inference/src/cpp/ie_variable_state.cpp index e89b7e3413a8df..f305c799e15121 100644 --- a/src/inference/src/cpp/ie_variable_state.cpp +++ b/src/inference/src/cpp/ie_variable_state.cpp @@ -2,22 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "cpp/ie_memory_state.hpp" -#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" #include "openvino/core/except.hpp" #include "openvino/runtime/ivariable_state.hpp" #include "openvino/runtime/make_tensor.hpp" #include "openvino/runtime/variable_state.hpp" -IE_SUPPRESS_DEPRECATED_START -#define VARIABLE_CALL_STATEMENT(...) \ - if (_impl == nullptr) \ - IE_THROW(NotAllocated) << "VariableState was not initialized."; \ - try { \ - __VA_ARGS__; \ - } catch (...) { \ - ::InferenceEngine::details::Rethrow(); \ - } +namespace ov { #define OV_VARIABLE_CALL_STATEMENT(...) \ OPENVINO_ASSERT(_impl != nullptr, "VariableState was not initialized."); \ @@ -29,40 +19,6 @@ IE_SUPPRESS_DEPRECATED_START OPENVINO_THROW("Unexpected exception"); \ } -namespace InferenceEngine { - -VariableState::~VariableState() { - _impl = {}; -} - -VariableState::VariableState(const IVariableStateInternal::Ptr& impl, const std::shared_ptr& so) - : _impl(impl), - _so(so) { - if (_impl == nullptr) - IE_THROW() << "VariableState was not initialized."; -} - -void VariableState::Reset() { - VARIABLE_CALL_STATEMENT(_impl->Reset()); -} - -std::string VariableState::GetName() const { - VARIABLE_CALL_STATEMENT(return _impl->GetName()); -} - -Blob::CPtr VariableState::GetState() const { - VARIABLE_CALL_STATEMENT(return _impl->GetState()); -} - -void VariableState::SetState(Blob::Ptr state) { - VARIABLE_CALL_STATEMENT(_impl->SetState(state)); -} - -} // namespace InferenceEngine - -IE_SUPPRESS_DEPRECATED_END -namespace ov { - VariableState::~VariableState() { _impl = {}; } diff --git a/src/inference/src/cpp_interfaces/interface/ie_iexecutable_network_internal.cpp b/src/inference/src/cpp_interfaces/interface/ie_iexecutable_network_internal.cpp deleted file mode 100644 index 33b85be225558a..00000000000000 --- a/src/inference/src/cpp_interfaces/interface/ie_iexecutable_network_internal.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" - -#include -#include -#include -#include -#include - -#include "cpp/ie_cnn_network.h" -#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "ie_icore.hpp" -#include "ie_ngraph_utils.hpp" -#include "openvino/core/node.hpp" - -namespace InferenceEngine { - -void IExecutableNetworkInternal::setNetworkInputs(const InputsDataMap& networkInputs) { - _networkInputs = networkInputs; -} - -void IExecutableNetworkInternal::setNetworkOutputs(const OutputsDataMap& networkOutputs) { - _networkOutputs = networkOutputs; -} - -void IExecutableNetworkInternal::setInputs(const std::vector>& params) { - _parameters = params; -} -const std::vector>& IExecutableNetworkInternal::getInputs() const { - return _parameters; -} -void IExecutableNetworkInternal::setOutputs(const std::vector>& results) { - _results = results; -} -const std::vector>& IExecutableNetworkInternal::getOutputs() const { - return _results; -} - -ConstOutputsDataMap IExecutableNetworkInternal::GetOutputsInfo() const { - ConstOutputsDataMap outputMap; - for (const auto& output : _networkOutputs) { - outputMap.emplace(output.first, output.second); - } - return outputMap; -} - -ConstInputsDataMap IExecutableNetworkInternal::GetInputsInfo() const { - ConstInputsDataMap inputMap; - for (const auto& input : _networkInputs) { - inputMap.emplace(input.first, input.second); - } - return inputMap; -} - -std::shared_ptr IExecutableNetworkInternal::CreateInferRequest() { - std::shared_ptr asyncRequestImpl; - try { - asyncRequestImpl = CreateInferRequestImpl(_parameters, _results); - } catch (const InferenceEngine::NotImplemented&) { - } catch (const ov::NotImplemented&) { - } - if (!asyncRequestImpl) - asyncRequestImpl = CreateInferRequestImpl(_networkInputs, _networkOutputs); - asyncRequestImpl->setPointerToExecutableNetworkInternal(shared_from_this()); - return asyncRequestImpl; -} - -void IExecutableNetworkInternal::Export(const std::string& modelFileName) { - std::ofstream modelFile(modelFileName, std::ios::out | std::ios::binary); - - if (modelFile.is_open()) { - Export(modelFile); - } else { - IE_THROW() << "The " << modelFileName << " file can not be opened for Export"; - } -} - -void IExecutableNetworkInternal::Export(std::ostream& networkModel) { - IE_THROW(NotImplemented); -} - -std::shared_ptr IExecutableNetworkInternal::GetExecGraphInfo() { - IE_THROW(NotImplemented); -} - -void IExecutableNetworkInternal::SetPointerToPlugin(const std::shared_ptr& plugin) { - _plugin = plugin; -} - -std::shared_ptr IExecutableNetworkInternal::GetPointerToSo() { - return _so; -} - -void IExecutableNetworkInternal::SetConfig(const ov::AnyMap&) { - IE_THROW(NotImplemented); -} - -ov::Any IExecutableNetworkInternal::GetConfig(const std::string&) const { - IE_THROW(NotImplemented); -} - -ov::Any IExecutableNetworkInternal::GetMetric(const std::string&) const { - IE_THROW(NotImplemented); -} - -std::shared_ptr IExecutableNetworkInternal::CreateInferRequestImpl( - InputsDataMap networkInputs, - OutputsDataMap networkOutputs) { - IE_THROW(NotImplemented); -} - -void IExecutableNetworkInternal::loadedFromCache() { - _loadedFromCache = true; -} - -bool IExecutableNetworkInternal::isLoadedFromCache() const { - return _loadedFromCache; -} - -std::shared_ptr IExecutableNetworkInternal::CreateInferRequestImpl( - const std::vector>& inputs, - const std::vector>& outputs) { - IE_THROW(NotImplemented); -} - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp b/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp deleted file mode 100644 index e388fc868fbcfe..00000000000000 --- a/src/inference/src/cpp_interfaces/interface/ie_iinfer_request_internal.cpp +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp" - -#include -#include -#include - -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "cpp_interfaces/plugin_itt.hpp" -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_ngraph_utils.hpp" -#include "openvino/core/partial_shape.hpp" -#include "openvino/util/common_util.hpp" -#include "transformations/utils/utils.hpp" - -namespace InferenceEngine { - -IE_SUPPRESS_DEPRECATED_START - -IInferRequestInternal::~IInferRequestInternal() {} - -IInferRequestInternal::IInferRequestInternal(const InputsDataMap& networkInputs, const OutputsDataMap& networkOutputs) - : // We should copy maps since they can be overriden in SetBlob with preprocess - _networkInputs{copyInfo(networkInputs)}, - _networkOutputs{copyInfo(networkOutputs)} {} - -IInferRequestInternal::IInferRequestInternal(const std::vector>& inputs, - const std::vector>& outputs) - : _parameters(inputs), - _results(outputs) { - const auto& create_old_data = [](const ov::Output& output) -> InferenceEngine::DataPtr { - auto name = ov::op::util::get_ie_output_name(output); - auto shape = output.get_partial_shape(); - auto rank = shape.rank().is_static() ? shape.rank().get_length() : -1; - SizeVector dims(1, 0); - if (shape.is_static()) { - dims = output.get_shape(); - } else if (rank >= 0) { - dims = SizeVector(rank, 0); - } - for (const auto& dim : shape) { - if (dim.is_static() && dim.get_length() == 0) - IE_THROW() << name << " has zero dimension which is not allowed"; - } - const Layout rankLayout = rank < 0 ? Layout::BLOCKED : TensorDesc::getLayoutByRank(rank); - const auto precision = InferenceEngine::details::convertPrecision(output.get_element_type()); - return std::make_shared(name, TensorDesc{precision, dims, rankLayout}); - }; - const auto& create_old_input_data = - [create_old_data](const ov::Output& output) -> InferenceEngine::InputInfo::Ptr { - auto info = std::make_shared(); - info->setInputData(create_old_data(output)); - return info; - }; - - for (const auto& param : _parameters) { - const auto& input = create_old_input_data(param->output(0)); - input->setName(param->get_friendly_name()); - _networkInputs[input->name()] = input; - } - - for (const auto& result : _results) { - auto input = result->input_value(0); - const auto& output = create_old_data(ov::Output(input.get_node(), input.get_index())); - _networkOutputs[output->getName()] = output; - } -} - -void IInferRequestInternal::Infer() { - checkBlobs(); - InferImpl(); -} - -void IInferRequestInternal::InferImpl() { - IE_THROW(NotImplemented); -} - -void IInferRequestInternal::Cancel() { - IE_THROW(NotImplemented); -} - -std::map IInferRequestInternal::GetPerformanceCounts() const { - IE_THROW(NotImplemented); -} - -std::shared_ptr IInferRequestInternal::findInputByNodeName(const std::string& name) const { - for (const auto& input : GetInputs()) { - if (input->get_friendly_name() == name) - return input; - } - return nullptr; -} - -std::shared_ptr IInferRequestInternal::findOutputByNodeName(const std::string& name) const { - for (const auto& output : GetOutputs()) { - if (output->input_value(0).get_node()->get_friendly_name() == name) - return output; - } - return nullptr; -} - -void IInferRequestInternal::SetBlob(const std::string& name, const Blob::Ptr& userBlob) { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "SetBlob"); - if (name.empty()) { - IE_THROW(NotFound) << "Failed to set blob with empty name"; - } - if (!userBlob) - IE_THROW(NotAllocated) << "Failed to set empty blob with name: \'" << name << "\'"; - InputInfo::Ptr foundInput; - DataPtr foundOutput; - const bool isInput = findInputAndOutputBlobByName(name, foundInput, foundOutput); - const auto input = findInputByNodeName(name); - const auto output = findOutputByNodeName(name); - - if (userBlob->buffer() == nullptr) - IE_THROW(NotAllocated) << "Input data was not allocated. Input name: \'" << name << "\'"; - if (userBlob->size() == 0 && !((input && input->get_output_partial_shape(0).is_dynamic()) || - (output && output->get_output_partial_shape(0).is_dynamic()))) { - IE_THROW() << "Input data is empty. Input name: \'" << name << "\'"; - } - const bool isInputDynamic = input && input->get_output_partial_shape(0).is_dynamic(); - const bool isOutputDynamic = output && output->get_input_partial_shape(0).is_dynamic(); - - size_t dataSize = userBlob->size(); - if (isInput) { - // ilavreno: the condition below is obsolete, but we need an exact list of precisions - // which are supports by G-API preprocessing - if (foundInput->getPrecision() != userBlob->getTensorDesc().getPrecision()) { - IE_THROW(ParameterMismatch) - << "Failed to set Blob with precision not corresponding to user input precision"; - } - - auto& devBlob = _deviceInputs[name]; - - size_t inputSize = foundInput->getTensorDesc().getLayout() != InferenceEngine::Layout::SCALAR - ? ov::util::product(foundInput->getTensorDesc().getDims()) - : 1; - if (!isInputDynamic && dataSize != inputSize) { - IE_THROW() << "Input tensor size is not equal network input size (" << dataSize << "!=" << inputSize - << ")."; - } - _inputs[name] = userBlob; - devBlob = userBlob; - } else { - size_t outputSize = foundOutput->getTensorDesc().getLayout() != InferenceEngine::Layout::SCALAR - ? ov::util::product(foundOutput->getTensorDesc().getDims()) - : 1; - if (!isOutputDynamic && dataSize != outputSize) { - IE_THROW() << "Output blob size is not equal network output size (" << dataSize << "!=" << outputSize - << ")."; - } - if (foundOutput->getPrecision() != userBlob->getTensorDesc().getPrecision()) { - IE_THROW(ParameterMismatch) - << "Failed to set Blob with precision not corresponding to user output precision"; - } - // ilavreno: this condition is valid for most plugins except MYRIAD - // it is able to perform layout conversion for output blob dynamically - // if (foundOutput->getLayout() != userBlob->getTensorDesc().getLayout()) { - // IE_THROW(ParameterMismatch) << "Failed to set Blob with layout not corresponding to user output layout"; - // } - _outputs[name] = userBlob; - } -} - -Blob::Ptr IInferRequestInternal::GetBlob(const std::string& name) { - OV_ITT_SCOPED_TASK(itt::domains::Plugin, "GetBlob"); - Blob::Ptr data; - InputInfo::Ptr foundInput; - DataPtr foundOutput; - const SizeVector oneVector = {1}; - if (findInputAndOutputBlobByName(name, foundInput, foundOutput)) { - const auto input = findInputByNodeName(name); - const bool isInputDynamic = input && input->get_output_partial_shape(0).is_dynamic(); - data = _inputs[name]; - const auto& dims = foundInput->getTensorDesc().getDims(); - if (isInputDynamic) - checkBlob(data, name, true); - else - checkBlob(data, name, true, foundInput->getTensorDesc().getLayout() != SCALAR ? dims : oneVector); - } else { - const auto output = findOutputByNodeName(name); - const bool isOutputDynamic = output && output->get_output_partial_shape(0).is_dynamic(); - data = _outputs[name]; - const auto& dims = foundOutput->getTensorDesc().getDims(); - if (isOutputDynamic) - checkBlob(data, name, false); - else - checkBlob(data, name, false, foundOutput->getTensorDesc().getLayout() != SCALAR ? dims : oneVector); - } - return data; -} - -std::vector> IInferRequestInternal::QueryState() { - IE_THROW(NotImplemented); -} - -void IInferRequestInternal::StartAsync() { - checkBlobs(); - StartAsyncImpl(); -} - -void IInferRequestInternal::StartAsyncImpl() { - IE_THROW(NotImplemented); -} - -StatusCode IInferRequestInternal::Wait(int64_t millis_timeout) { - IE_THROW(NotImplemented); -} - -void IInferRequestInternal::SetCallback(Callback callback) { - _callback = std::move(callback); -} - -void IInferRequestInternal::execDataPreprocessing(InferenceEngine::BlobMap& preprocessedBlobs, bool serial) {} - -bool IInferRequestInternal::findInputAndOutputBlobByName(const std::string& name, - InputInfo::Ptr& foundInput, - DataPtr& foundOutput) const { - foundInput = nullptr; - foundOutput = nullptr; - if (_networkOutputs.empty()) { - IE_THROW() << "Internal error: network outputs is not set"; - } - auto foundInputPair = std::find_if(std::begin(_networkInputs), - std::end(_networkInputs), - [&](const std::pair& pair) { - return pair.first == name; - }); - auto foundOutputPair = std::find_if(std::begin(_networkOutputs), - std::end(_networkOutputs), - [&](const std::pair& pair) { - return pair.first == name; - }); - bool retVal; - - if (foundInputPair != std::end(_networkInputs)) { - foundInput = foundInputPair->second; - retVal = true; - } else if (foundOutputPair != std::end(_networkOutputs)) { - foundOutput = foundOutputPair->second; - retVal = false; - } else { - IE_THROW(NotFound) << "Failed to find input or output with name: \'" << name << "\'"; - } - return retVal; -} - -void IInferRequestInternal::checkBlob(const Blob::Ptr& blob, - const std::string& name, - bool isInput, - const SizeVector& refDims) const { - std::string bType = isInput ? "Input" : "Output"; - std::string sType = isInput ? "input" : "output"; - std::string strNotAllocated(bType + " data was not allocated."); - std::string strNotMatched("The " + sType + " blob size is not equal to the network " + sType + " size"); - - if (!blob) { - IE_THROW(NotAllocated) << strNotAllocated; - } - size_t refSize; - bool isDynamic = false; - if (refDims.empty()) { - SizeVector dims; - if (isInput) { - auto foundInputPair = std::find_if(std::begin(_networkInputs), - std::end(_networkInputs), - [&](const std::pair& pair) { - return pair.first == name; - }); - if (foundInputPair == std::end(_networkInputs)) { - IE_THROW(NotFound) << "Failed to find input with name: \'" << name << "\'"; - } - const auto input = findInputByNodeName(name); - isDynamic = input && input->get_output_partial_shape(0).is_dynamic(); - dims = foundInputPair->second->getTensorDesc().getDims(); - refSize = foundInputPair->second->getTensorDesc().getLayout() != SCALAR ? ov::util::product(dims) : 1; - } else { - auto foundOutputPair = std::find_if(std::begin(_networkOutputs), - std::end(_networkOutputs), - [&](const std::pair& pair) { - return pair.first == name; - }); - if (foundOutputPair == std::end(_networkOutputs)) { - IE_THROW(NotFound) << "Failed to find output with name: \'" << name << "\'"; - } - const auto output = findOutputByNodeName(name); - isDynamic = output && output->get_output_partial_shape(0).is_dynamic(); - ov::PartialShape blobPartialShape(blob->getTensorDesc().getDims()); - if (output && output->get_output_partial_shape(0).compatible(blobPartialShape)) { - dims = blob->getTensorDesc().getDims(); - } else { - // TODO: it is strange to request tensor desc from data when the shapes are not compatible, probably we - // need to immediately throw here - dims = foundOutputPair->second->getTensorDesc().getDims(); - } - refSize = foundOutputPair->second->getTensorDesc().getLayout() != SCALAR ? ov::util::product(dims) : 1; - } - } else { - refSize = ov::util::product(refDims); - } - - if (!isDynamic && refSize != blob->size()) { - IE_THROW() << strNotMatched + ": got " << blob->size() << " expecting " << refSize; - } - if (blob->buffer() == nullptr) - IE_THROW() << strNotAllocated; -} - -void IInferRequestInternal::checkBlobs() { - for (auto const& input : _inputs) { - checkBlob(input.second, input.first, true); - } - for (auto const& output : _outputs) { - checkBlob(output.second, output.first, false); - } -} - -void IInferRequestInternal::setPointerToExecutableNetworkInternal( - const std::shared_ptr& exeNetwork) { - _exeNetwork = exeNetwork; -} - -std::shared_ptr IInferRequestInternal::getPointerToExecutableNetworkInternal() const { - return _exeNetwork; -} - -void IInferRequestInternal::setPointerToSo(const std::shared_ptr& so) { - _so = so; -} - -std::shared_ptr IInferRequestInternal::getPointerToSo() const { - return _so; -} - -void* IInferRequestInternal::GetUserData() noexcept { - return _userData; -} - -void IInferRequestInternal::SetUserData(void* userData) noexcept { - _userData = userData; -} - -void IInferRequestInternal::setModelInputsOutputs(const std::vector>& inputs, - const std::vector>& outputs) { - _parameters = inputs; - _results = outputs; -} - -const std::vector>& IInferRequestInternal::GetInputs() const { - return _parameters; -} - -const std::vector>& IInferRequestInternal::GetOutputs() const { - return _results; -} -} // namespace InferenceEngine diff --git a/src/inference/src/cpp_interfaces/interface/ie_iplugin_internal.cpp b/src/inference/src/cpp_interfaces/interface/ie_iplugin_internal.cpp deleted file mode 100644 index 8612b7b64f0a49..00000000000000 --- a/src/inference/src/cpp_interfaces/interface/ie_iplugin_internal.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/** - * @brief Inference Engine plugin API wrapper, to be used by particular implementors - * @file ie_iplugin_internal.hpp - */ - -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "any_copy.hpp" -#include "blob_factory.hpp" -#include "cnn_network_ngraph_impl.hpp" -#include "cpp/ie_cnn_network.h" -#include "dev/converter_utils.hpp" -#include "ie_api.h" -#include "ie_icore.hpp" -#include "ie_input_info.hpp" -#include "ie_ngraph_utils.hpp" -#include "openvino/core/deprecated.hpp" -#include "openvino/core/except.hpp" -#include "openvino/core/model.hpp" -#include "openvino/core/runtime_attribute.hpp" -#include "openvino/op/util/op_types.hpp" -#include "openvino/pass/manager.hpp" -#include "openvino/runtime/exec_model_info.hpp" -#include "openvino/runtime/threading/executor_manager.hpp" -#include "transformations/utils/utils.hpp" - -namespace InferenceEngine { - -InputsDataMap copyInfo(const InputsDataMap& networkInputs) { - InputsDataMap _networkInputs; - for (const auto& it : networkInputs) { - InputInfo::Ptr newPtr; - if (it.second) { - newPtr = std::make_shared(); - newPtr->setInputData(std::make_shared(*it.second->getInputData())); - } - _networkInputs.emplace(it.first, newPtr); - } - return _networkInputs; -} - -OutputsDataMap copyInfo(const OutputsDataMap& networkOutputs) { - OutputsDataMap _networkOutputs; - for (const auto& it : networkOutputs) { - DataPtr newData; - if (it.second) { - newData = std::make_shared(*it.second); - } - _networkOutputs.emplace(it.first, newData); - } - return _networkOutputs; -} - -IInferencePlugin::IInferencePlugin() : _executorManager(ov::threading::executor_manager()), _isNewAPI(true) {} - -void IInferencePlugin::VersionStore::copyFrom(const Version& v) { - description = v.description; - buildNumber = v.buildNumber; -} - -IInferencePlugin::VersionStore::VersionStore(const Version& v) { - copyFrom(v); -} - -IInferencePlugin::VersionStore& IInferencePlugin::VersionStore::operator=(const VersionStore& v) { - if (&v != this) { - copyFrom(v); - } - return *this; -} - -void IInferencePlugin::SetVersion(const ov::Version& version) { - _version = VersionStore(version); -} - -const ov::Version& IInferencePlugin::GetVersion() const { - return _version; -} - -std::string IInferencePlugin::GetName() const noexcept { - return _pluginName; -} - -void IInferencePlugin::SetName(const std::string& pluginName) noexcept { - _pluginName = pluginName; -} - -template -std::map> const_map_cast(const std::map>& map) { - std::map> res; - for (auto&& v : map) - res.emplace(v.first, std::const_pointer_cast(v.second)); - return res; -} - -std::shared_ptr IInferencePlugin::LoadNetwork( - const CNNNetwork& orig_network, - const std::map& config) { - std::shared_ptr impl; - - // if IR `version` is not set, suppose it's IR v10 for old API - // it allows to use operation names in set_ / get_tensor instead of tensor_names - auto orig_function = orig_network.getFunction(); - std::shared_ptr function; - InferenceEngine::CNNNetwork network = orig_network; - if (orig_function) { - function = std::make_shared(orig_function->get_results(), - orig_function->get_sinks(), - orig_function->get_parameters(), - orig_function->get_variables(), - orig_function->get_friendly_name()); - function->get_rt_info() = orig_function->get_rt_info(); - } - if (function && !IsNewAPI()) { - if (!function->has_rt_info("version")) { - function->set_rt_info(int64_t(10), "version"); - - // re-create `network` with new patched `function` - using namespace InferenceEngine; - OPENVINO_SUPPRESS_DEPRECATED_START - const auto& orig_icnn = static_cast(orig_network); - auto orig_impl = - std::dynamic_pointer_cast(orig_icnn.shared_from_this()); - OPENVINO_ASSERT(orig_impl != nullptr, - "Internal: orig_impl must be castable to details::CNNNetworkNGraphImpl"); - auto new_impl = std::make_shared(function, IsNewAPI()); - network = CNNNetwork(new_impl); - for (const auto& inputInfo : orig_network.getInputsInfo()) { - auto toInfo = network.getInputsInfo().at(inputInfo.first); - toInfo->setPrecision(inputInfo.second->getPrecision()); - toInfo->setLayout(inputInfo.second->getLayout()); - } - for (const auto& outputInfo : orig_network.getOutputsInfo()) { - auto toInfo = network.getOutputsInfo().at(outputInfo.first); - toInfo->setPrecision(outputInfo.second->getPrecision()); - toInfo->setLayout(outputInfo.second->getLayout()); - } - OPENVINO_SUPPRESS_DEPRECATED_END - } - } - - impl = LoadExeNetworkImpl(network, config); - - SetExeNetworkInfo(impl, const_map_cast(network.getInputsInfo()), const_map_cast(network.getOutputsInfo())); - if (function) { - SetExeNetworkInfo(impl, function); - } - - return impl; -} - -ov::SoPtr IInferencePlugin::LoadNetwork(const std::string& modelPath, - const std::map& config) { - auto cnnNet = GetCore()->ReadNetwork(modelPath, std::string()); - return GetCore()->LoadNetwork(cnnNet, GetName(), config); -} - -void IInferencePlugin::AddExtension(const std::shared_ptr&) { - IE_THROW(NotImplemented); -} - -void IInferencePlugin::SetConfig(const std::map&) { - IE_THROW(NotImplemented); -} - -void IInferencePlugin::SetProperties(const ov::AnyMap& config) { - SetConfig(any_copy(config)); -} - -ov::Any IInferencePlugin::GetConfig(const std::string&, const ov::AnyMap&) const { - IE_THROW(NotImplemented); -} - -ov::Any IInferencePlugin::GetMetric(const std::string&, const ov::AnyMap&) const { - IE_THROW(NotImplemented); -} - -std::shared_ptr IInferencePlugin::ImportNetwork( - const std::string& modelFileName, - const std::map& config) { - std::ifstream blobFile(modelFileName, std::ios::binary); - - if (!blobFile.is_open()) { - IE_THROW(NetworkNotRead); - } - - return ImportNetwork(blobFile, config); -} - -std::shared_ptr IInferencePlugin::ImportNetwork( - std::istream& networkModel, - const std::map& config) { - IE_THROW(NotImplemented); -} - -void IInferencePlugin::SetCore(std::weak_ptr core) { - IE_ASSERT(!core.expired()); - _core = core; - auto locked_core = _core.lock(); - if (locked_core) - _isNewAPI = locked_core->isNewAPI(); -} - -std::shared_ptr IInferencePlugin::GetCore() const noexcept { - return _core.lock(); -} - -bool IInferencePlugin::IsNewAPI() const noexcept { - return _isNewAPI; -} - -const std::shared_ptr& IInferencePlugin::executorManager() const { - return _executorManager; -} - -QueryNetworkResult IInferencePlugin::QueryNetwork(const CNNNetwork& network, - const std::map& config) const { - IE_THROW(NotImplemented); -} - -std::shared_ptr IInferencePlugin::LoadExeNetworkImpl( - const CNNNetwork&, - const std::map&) { - IE_THROW(NotImplemented); -} - -void IInferencePlugin::SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const ConstInputsDataMap& inputs, - const ConstOutputsDataMap& outputs) { - IE_ASSERT(exeNetwork != nullptr); - - // Set inputs/outputs and pointer to plugin manually here - exeNetwork->setNetworkInputs(copyInfo(constMapCast(inputs))); - exeNetwork->setNetworkOutputs(copyInfo(constMapCast(outputs))); - - exeNetwork->SetPointerToPlugin(shared_from_this()); -} - -void IInferencePlugin::SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const std::shared_ptr& function) { - bool newAPI = IsNewAPI(); - InferenceEngine::SetExeNetworkInfo(exeNetwork, function, newAPI); - exeNetwork->SetPointerToPlugin(shared_from_this()); -} - -std::unordered_set GetRemovedNodes(const std::shared_ptr& originalFunction, - const std::shared_ptr& transformedFunction) { - std::unordered_set result = {}; - std::unordered_set transformedNodeNames = {}; - - for (auto&& node : transformedFunction->get_ops()) { - transformedNodeNames.emplace(node->get_friendly_name()); - for (auto&& fusedLayerName : ov::getFusedNamesVector(node)) - transformedNodeNames.emplace(fusedLayerName); - } - - for (auto&& originalNode : originalFunction->get_ops()) { - if (transformedNodeNames.find(originalNode->get_friendly_name()) == transformedNodeNames.end()) - result.emplace(originalNode->get_friendly_name()); - } - - return result; -} - -std::unordered_set GetSupportedNodes( - const std::shared_ptr& model, - std::function&)> transform, - std::function)> is_node_supported) { - return ov::get_supported_nodes(model, transform, is_node_supported); -} - -void SetExeNetworkInfo(const std::shared_ptr& exeNetwork, - const std::shared_ptr& function, - bool new_api) { - OPENVINO_ASSERT(exeNetwork != nullptr); - OPENVINO_ASSERT(function != nullptr); - - std::vector> const_params; - std::vector> const_results; - - std::unordered_set leaf_names; - bool add_operation_names = false; - if (function->has_rt_info("version")) { - const int64_t ir_version = function->get_rt_info("version"); - // here we decide whether we need to add operation_names as tensor names for - // getInputs / getOutputs. Since these functions are designed to be used in new API only - // always need to add operation names for IR v10 - add_operation_names = ir_version == 10; - - for (const auto& vals : {function->inputs(), function->outputs()}) { - for (const auto& val : vals) { - for (const auto& name : val.get_names()) { - leaf_names.insert(name); - } - } - } - } - - const auto& inputsInfo = exeNetwork->GetInputsInfo(); - const auto& outputsInfo = exeNetwork->GetOutputsInfo(); - OPENVINO_ASSERT(inputsInfo.size() == function->get_parameters().size()); - - if (outputsInfo.size() != function->get_output_size()) { - const auto& outputs = function->outputs(); - std::unordered_set> output_tensors; - std::transform(outputs.cbegin(), - outputs.cend(), - std::inserter(output_tensors, output_tensors.begin()), - [](const ov::Output& out) { - return out.get_tensor_ptr(); - }); - - OPENVINO_ASSERT(outputsInfo.size() == output_tensors.size(), - "outputsInfo.size() is: ", - outputsInfo.size(), - ", and function->get_output_size() is: ", - function->get_output_size(), - ". Number of duplicated outputs: ", - outputs.size() - output_tensors.size()); - } - - for (const auto& param : function->get_parameters()) { - const auto& param_name = param->get_friendly_name(); - auto new_param = ov::as_type_ptr(param->copy_with_new_inputs({})); - new_param->set_friendly_name(param_name); - if (add_operation_names) { - OPENVINO_ASSERT(!new_api || leaf_names.find(param_name) == leaf_names.end() || - param->output(0).get_names().find(param_name) != param->output(0).get_names().end(), - "Model operation names have collisions with tensor names.", - " Please use MO to generate new IR version, it should allow to avoid the issue"); - leaf_names.insert(param_name); - new_param->output(0).get_tensor().add_names({param_name}); - } - // WA: use CNNNetwork's precisions since plugins sometimes override their precisions - // after transformation pipeline is run - new_param->set_element_type( - InferenceEngine::details::convertPrecision(inputsInfo.at(param_name)->getPrecision())); - new_param->set_layout(param->get_layout()); - new_param->output(0).get_rt_info() = param->output(0).get_rt_info(); - new_param->validate_and_infer_types(); - const_params.emplace_back(new_param); - } - for (const auto& result : function->get_results()) { - auto fake_param = std::make_shared(result->get_output_element_type(0), - result->get_output_partial_shape(0)); - const std::string res_name = ov::op::util::create_ie_output_name(result->input_value(0)); - fake_param->set_friendly_name(res_name); - fake_param->set_element_type( - InferenceEngine::details::convertPrecision(outputsInfo.at(res_name)->getPrecision())); - fake_param->validate_and_infer_types(); - auto new_result = result->copy_with_new_inputs({fake_param}); - new_result->set_friendly_name(result->get_friendly_name()); - if (add_operation_names) { - OPENVINO_ASSERT(!new_api || leaf_names.find(res_name) == leaf_names.end() || - result->output(0).get_names().find(res_name) != result->output(0).get_names().end(), - "Model operation names have collisions with tensor names.", - " Please use MO to generate new IR version, it should allow to avoid the issue"); - leaf_names.insert(res_name); - new_result->output(0).get_tensor().add_names({res_name}); - } - auto r = std::dynamic_pointer_cast(new_result); - OPENVINO_ASSERT(r, "Internal error. SetNetworkInfo failure casting output copy to Result"); - r->set_layout(result->get_layout()); - const_results.emplace_back(new_result); - } - - exeNetwork->setInputs(const_params); - exeNetwork->setOutputs(const_results); -} - -std::shared_ptr<::ov::IPlugin> convert_plugin(const std::shared_ptr& from) { - return ov::legacy_convert::convert_plugin(from); -} - -} // namespace InferenceEngine diff --git a/src/inference/src/cpp_interfaces/interface/ie_ivariable_state_internal.cpp b/src/inference/src/cpp_interfaces/interface/ie_ivariable_state_internal.cpp deleted file mode 100644 index 79bb02d8fe62d3..00000000000000 --- a/src/inference/src/cpp_interfaces/interface/ie_ivariable_state_internal.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -IE_SUPPRESS_DEPRECATED_START -namespace InferenceEngine { -IVariableStateInternal::IVariableStateInternal(const std::string& name_) : name{name_} {} - -std::string IVariableStateInternal::GetName() const { - return name; -} - -void IVariableStateInternal::Reset() { - IE_THROW(NotImplemented); -} - -void IVariableStateInternal::SetState(const Blob::Ptr& newState) { - state = newState; -} - -Blob::CPtr IVariableStateInternal::GetState() const { - return state; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/dev/converter_utils.cpp b/src/inference/src/dev/converter_utils.cpp deleted file mode 100644 index 6566534df7e83b..00000000000000 --- a/src/inference/src/dev/converter_utils.cpp +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "converter_utils.hpp" - -#include -#include -#include - -#include "any_copy.hpp" -#include "cnn_network_ngraph_impl.hpp" -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "cpp_interfaces/interface/ie_ivariable_state_internal.hpp" -#include "icompiled_model_wrapper.hpp" -#include "ie_blob.h" -#include "ie_common.h" -#include "ie_icore.hpp" -#include "ie_input_info.hpp" -#include "ie_layouts.h" -#include "ie_ngraph_utils.hpp" -#include "iplugin_wrapper.hpp" -#include "openvino/core/except.hpp" -#include "openvino/op/parameter.hpp" -#include "openvino/runtime/exception.hpp" -#include "openvino/runtime/icompiled_model.hpp" -#include "openvino/runtime/iinfer_request.hpp" -#include "openvino/runtime/iplugin.hpp" -#include "openvino/runtime/itensor.hpp" -#include "openvino/runtime/ivariable_state.hpp" -#include "openvino/runtime/make_tensor.hpp" -#include "openvino/runtime/profiling_info.hpp" -#include "openvino/runtime/so_ptr.hpp" -#include "openvino/runtime/tensor.hpp" -#include "openvino/runtime/threading/executor_manager.hpp" -#include "openvino/runtime/variable_state.hpp" -#include "transformations/utils/utils.hpp" - -#ifdef PROXY_PLUGIN_ENABLED -# include "openvino/proxy/infer_request.hpp" -#endif - -namespace { - -std::string get_legacy_name_from_port(const ov::Output& port) { - ov::Output p(std::const_pointer_cast(port.get_node_shared_ptr()), port.get_index()); - if (auto node = std::dynamic_pointer_cast(p.get_node_shared_ptr())) { - p = node->input_value(0); - } - return ov::op::util::create_ie_output_name(p); -} - -void fill_input_info(ov::Output& input, InferenceEngine::InputInfo::Ptr& input_info) { - const ov::Output const_input(input.get_node(), input.get_index()); - ov::legacy_convert::fill_input_info(const_input, input_info); - auto& rt_info = input.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - rt_info.erase(it); - } -} - -void fill_output_info(ov::Output& input, InferenceEngine::DataPtr& output_info) { - const ov::Output const_input(input.get_node(), input.get_index()); - ov::legacy_convert::fill_output_info(const_input, output_info); - auto& rt_info = input.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - rt_info.erase(it); - } -} - -InferenceEngine::SizeVector get_dims(const ov::Output& port) { - InferenceEngine::SizeVector dims = {}; - const auto& p_shape = port.get_partial_shape(); - if (p_shape.is_static()) - dims = p_shape.get_shape(); - return dims; -} - -} // namespace - -void ov::legacy_convert::fill_input_info(const ov::Output& input, - InferenceEngine::InputInfo::Ptr& input_info) { - if (!input_info) { - // Create input info - auto param_name = input.get_node()->get_friendly_name(); - auto dims = get_dims(input); - InferenceEngine::TensorDesc desc(InferenceEngine::details::convertPrecision(input.get_element_type()), - dims, - InferenceEngine::TensorDesc::getLayoutByDims(dims)); - auto data = std::make_shared(param_name, desc); - input_info = std::make_shared(); - input_info->setInputData(data); - } - auto& rt_info = input.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - auto td = it->second.as(); - input_info->getInputData()->reshape(td.getDims(), td.getLayout()); - input_info->setPrecision(td.getPrecision()); - } -} -void ov::legacy_convert::fill_output_info(const ov::Output& output, - InferenceEngine::DataPtr& output_info) { - if (!output_info) { - // Create input info - const auto& res_name = ov::op::util::create_ie_output_name(output); - auto dims = get_dims(output); - InferenceEngine::TensorDesc desc(InferenceEngine::details::convertPrecision(output.get_element_type()), - dims, - InferenceEngine::TensorDesc::getLayoutByDims(dims)); - output_info = std::make_shared(res_name, desc); - } - auto& rt_info = output.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - if (it != rt_info.end()) { - auto td = it->second.as(); - output_info->reshape(td.getDims(), td.getLayout()); - output_info->setPrecision(td.getPrecision()); - } -} - -InferenceEngine::CNNNetwork ov::legacy_convert::convert_model(const std::shared_ptr& model, - bool is_new_api) { - auto network = InferenceEngine::CNNNetwork(std::shared_ptr( - new InferenceEngine::details::CNNNetworkNGraphImpl(model->clone(), is_new_api))); - std::shared_ptr cloned_model = network.getFunction(); - for (auto&& input : cloned_model->inputs()) { - auto param_name = input.get_node()->get_friendly_name(); - - OPENVINO_ASSERT(network.getInputsInfo().count(param_name)); - - auto input_info = network.getInputsInfo()[param_name]; - ::fill_input_info(input, input_info); - } - for (auto&& result : cloned_model->get_results()) { - auto output = result->input_value(0); - const auto& res_name = ov::op::util::create_ie_output_name(output); - - OPENVINO_ASSERT(network.getOutputsInfo().count(res_name)); - auto output_info = network.getOutputsInfo()[res_name]; - - ::fill_output_info(output, output_info); - } - return network; -} -std::shared_ptr ov::legacy_convert::convert_model(const InferenceEngine::CNNNetwork& network, - bool is_new_api) { - OPENVINO_ASSERT(network.getFunction(), - "CNNNetwork can be converted to OpenVINO Model only in case if it contains ov::Model"); - if (is_new_api) - return network.getFunction(); - - auto cloned_model = network.getFunction()->clone(); - for (auto&& input : cloned_model->inputs()) { - auto param_name = input.get_node()->get_friendly_name(); - - OPENVINO_ASSERT(network.getInputsInfo().count(param_name)); - - auto input_info = network.getInputsInfo().at(param_name); - auto& rt_info = input.get_rt_info(); - rt_info["ie_legacy_td"] = input_info->getTensorDesc(); - } - for (auto&& result : cloned_model->get_results()) { - auto output = result->input_value(0); - const auto& res_name = ov::op::util::create_ie_output_name(output); - - OPENVINO_ASSERT(network.getOutputsInfo().count(res_name)); - auto output_info = network.getOutputsInfo().at(res_name); - - auto& rt_info = output.get_rt_info(); - rt_info["ie_legacy_td"] = output_info->getTensorDesc(); - } - if (!cloned_model->has_rt_info("version")) { - cloned_model->set_rt_info(int64_t(10), "version"); - } - return cloned_model; -} - -namespace ov { - -class IVariableStateInternalWrapper : public InferenceEngine::IVariableStateInternal { - ov::SoPtr m_state; - -public: - IVariableStateInternalWrapper(const ov::SoPtr& state) - : InferenceEngine::IVariableStateInternal(state->get_name()), - m_state(state) {} - - std::string GetName() const override { - return m_state->get_name(); - } - - void Reset() override { - m_state->reset(); - } - - void SetState(const InferenceEngine::Blob::Ptr& newState) override { - m_state->set_state(ov::make_tensor(newState, true)); - } - - InferenceEngine::Blob::CPtr GetState() const override { - return tensor_to_blob(m_state->get_state()); - } -}; - -class IInferencePluginWrapper : public InferenceEngine::IInferencePlugin { -public: - IInferencePluginWrapper(const ov::SoPtr& plugin) : m_plugin(plugin) { - auto& ver = plugin->get_version(); - ov::Version version; - version.buildNumber = ver.buildNumber; - version.description = ver.description; - SetVersion(version); - _isNewAPI = plugin->is_new_api(); - _executorManager = plugin->get_executor_manager(); - } - - virtual ~IInferencePluginWrapper() = default; - - std::string GetName() const noexcept override { - return m_plugin->get_device_name(); - } - - void SetName(const std::string& name) noexcept override { - m_plugin->set_device_name(name); - } - - std::shared_ptr LoadNetwork( - const InferenceEngine::CNNNetwork& network, - const std::map& config) override { - return ov::legacy_convert::convert_compiled_model( - {m_plugin->compile_model(ov::legacy_convert::convert_model(network, m_plugin->is_new_api()), - ov::any_copy(config)), - m_plugin._so}); - } - - ov::SoPtr LoadNetwork( - const std::string& modelPath, - const std::map& config) override { - return ov::SoPtr( - ov::legacy_convert::convert_compiled_model( - {m_plugin->compile_model(modelPath, ov::any_copy(config)), m_plugin._so}), - m_plugin._so); - } - - void SetConfig(const std::map& config) override { - m_plugin->set_property(ov::any_copy(config)); - } - - void SetProperties(const ov::AnyMap& config) override { - m_plugin->set_property(config); - } - - ov::Any GetConfig(const std::string& name, const ov::AnyMap& options) const override { - return m_plugin->get_property(name, options); - } - - ov::Any GetMetric(const std::string& name, const ov::AnyMap& options) const override { - return m_plugin->get_property(name, options); - } - - std::shared_ptr ImportNetwork( - const std::string& modelFileName, - const std::map& config) override { - std::ifstream model(modelFileName, std::ios::binary); - return ov::legacy_convert::convert_compiled_model( - {m_plugin->import_model(model, ov::any_copy(config)), m_plugin._so}); - } - - std::shared_ptr ImportNetwork( - std::istream& networkModel, - const std::map& config) override { - return ov::legacy_convert::convert_compiled_model( - {m_plugin->import_model(networkModel, ov::any_copy(config)), m_plugin._so}); - } - - void SetCore(std::weak_ptr core) override { - return m_plugin->set_core(std::dynamic_pointer_cast(core.lock())); - } - - std::shared_ptr GetCore() const noexcept override { - auto core = m_plugin->get_core(); - return std::dynamic_pointer_cast(core); - } - - InferenceEngine::QueryNetworkResult QueryNetwork(const InferenceEngine::CNNNetwork& network, - const std::map& config) const override { - auto res = m_plugin->query_model(ov::legacy_convert::convert_model(network, m_plugin->is_new_api()), - ov::any_copy(config)); - InferenceEngine::QueryNetworkResult ret; - if (!network.getFunction() || res.empty()) { - ret.rc = InferenceEngine::GENERAL_ERROR; - return ret; - } - ret.supportedLayersMap = res; - - return ret; - } - - ov::SoPtr get_plugin() { - return m_plugin; - } - -private: - ov::SoPtr m_plugin; -}; - -} // namespace ov - -std::shared_ptr<::InferenceEngine::IInferencePlugin> ov::legacy_convert::convert_plugin( - const ov::SoPtr<::ov::IPlugin>& plugin) { - if (auto wrapper = std::dynamic_pointer_cast(plugin._ptr)) - return wrapper->get_plugin(); - return std::make_shared(plugin); -} - -std::shared_ptr<::ov::IPlugin> ov::legacy_convert::convert_plugin( - const std::shared_ptr<::InferenceEngine::IInferencePlugin>& plugin) { - std::shared_ptr<::ov::IPlugin> ov_plugin(new ::InferenceEngine::IPluginWrapper(plugin)); - return ov_plugin; -} - -namespace ov { - -class IExecutableNetworkWrapper : public InferenceEngine::IExecutableNetworkInternal { -public: - explicit IExecutableNetworkWrapper(const ov::SoPtr& model) : m_model(model) { - for (const auto& input : m_model->inputs()) { - InferenceEngine::InputInfo::Ptr input_info; - ov::legacy_convert::fill_input_info(input, input_info); - _networkInputs[input_info->name()] = input_info; - _parameters.emplace_back(input.get_node_shared_ptr()); - } - for (const auto& output : m_model->outputs()) { - auto out = output.get_node()->input_value(0); - InferenceEngine::DataPtr output_info; - ov::legacy_convert::fill_output_info(ov::Output(out.get_node(), out.get_index()), - output_info); - _networkOutputs[output_info->getName()] = output_info; - _results.emplace_back(output.get_node_shared_ptr()); - } - _plugin = - ov::legacy_convert::convert_plugin({std::const_pointer_cast(m_model->m_plugin), m_model._so}); - _so = model._so; - } - - std::shared_ptr CreateInferRequest() override { - auto infer_request = legacy_convert::convert_infer_request({m_model->create_infer_request(), m_model._so}); - infer_request->setPointerToExecutableNetworkInternal(shared_from_this()); - return infer_request; - } - - void Export(std::ostream& model) override { - m_model->export_model(model); - } - - void Export(const std::string& modelFileName) override { - std::ofstream ostream(modelFileName, std::ios::out | std::ios::binary); - Export(ostream); - } - - std::shared_ptr GetExecGraphInfo() override { - return m_model->get_runtime_model()->clone(); - } - - void SetConfig(const ov::AnyMap& config) override { - m_model->set_property(config); - } - - ov::Any GetConfig(const std::string& name) const override { - return m_model->get_property(name); - } - - ov::Any GetMetric(const std::string& name) const override { - return m_model->get_property(name); - } - - ov::SoPtr get_compiled_model() { - return m_model; - } - -private: - ov::SoPtr m_model; -}; -} // namespace ov - -std::shared_ptr ov::legacy_convert::convert_compiled_model( - const ov::SoPtr& model) { - if (auto comp_model = std::dynamic_pointer_cast(model._ptr)) { - return comp_model->get_executable_network(); - } - return std::make_shared(model); -} - -ov::SoPtr ov::legacy_convert::convert_compiled_model( - const std::shared_ptr& model) { - if (auto comp_model = std::dynamic_pointer_cast(model)) { - return comp_model->get_compiled_model(); - } - return {std::make_shared(model), model->GetPointerToSo()}; -} - -namespace ov { - -class IInferRequestInternalWrapper : public InferenceEngine::IInferRequestInternal { - ov::Output find_port(const std::string& legacy_name) const { - for (const auto& port : m_request->get_inputs()) { - if (get_legacy_name_from_port(port) == legacy_name) - return port; - } - for (const auto& port : m_request->get_outputs()) { - if (get_legacy_name_from_port(port) == legacy_name) - return port; - } - OPENVINO_THROW("Failed to find input or output with name: \'", legacy_name, "\'"); - } - -public: - explicit IInferRequestInternalWrapper(const ov::SoPtr& request) : m_request(request) { - _so = request._so; - } - - void Infer() override { - m_request->infer(); - } - - void Cancel() override { - m_request->cancel(); - } - - std::map GetPerformanceCounts() const override { - auto res = m_request->get_profiling_info(); - std::map ret; - for (size_t i = 0; i < res.size(); i++) { - const auto& info = res[i]; - InferenceEngine::InferenceEngineProfileInfo old_info; - old_info.cpu_uSec = info.cpu_time.count(); - old_info.execution_index = static_cast(i); - old_info.realTime_uSec = info.real_time.count(); - strncpy(old_info.exec_type, info.exec_type.c_str(), sizeof(old_info.exec_type)); - old_info.exec_type[sizeof(old_info.exec_type) - 1] = 0; - strncpy(old_info.layer_type, info.node_type.c_str(), sizeof(old_info.layer_type)); - old_info.layer_type[sizeof(old_info.layer_type) - 1] = 0; - switch (info.status) { - case ov::ProfilingInfo::Status::EXECUTED: - old_info.status = InferenceEngine::InferenceEngineProfileInfo::EXECUTED; - break; - case ov::ProfilingInfo::Status::NOT_RUN: - old_info.status = InferenceEngine::InferenceEngineProfileInfo::NOT_RUN; - break; - case ov::ProfilingInfo::Status::OPTIMIZED_OUT: - old_info.status = InferenceEngine::InferenceEngineProfileInfo::OPTIMIZED_OUT; - break; - } - ret[info.node_name] = old_info; - } - return ret; - } - - void SetBlob(const std::string& name, const InferenceEngine::Blob::Ptr& data) override { - try { - m_request->set_tensor(find_port(name), ov::make_tensor(data, true)); - } catch (const ov::Exception& ex) { - const std::string what = ex.what(); - if (what.find("Failed to set tensor") != std::string::npos) { - IE_THROW(ParameterMismatch) << what; - } - IE_THROW(GeneralError) << what; - } - } - - InferenceEngine::Blob::Ptr GetBlob(const std::string& name) override { - auto port = find_port(name); - auto& rt_info = port.get_rt_info(); - auto it = rt_info.find("ie_legacy_td"); - InferenceEngine::TensorDesc desc; - if (it != rt_info.end()) { - desc = it->second.as(); - } - return tensor_to_blob(m_request->get_tensor(port), true, desc); - } - - std::vector> QueryState() override { - auto res = m_request->query_state(); - std::vector> ret; - for (const auto& state : res) { - ret.emplace_back(std::make_shared(state)); - } - return ret; - } - - void StartAsync() override { - m_request->start_async(); - } - - InferenceEngine::StatusCode Wait(int64_t millis_timeout) override { - if (millis_timeout == InferenceEngine::IInferRequest::RESULT_READY) { - m_request->wait(); - } else { - std::chrono::milliseconds timeout(millis_timeout); - bool res = m_request->wait_for(timeout); - if (!res) - return InferenceEngine::StatusCode::RESULT_NOT_READY; - } - return InferenceEngine::StatusCode::OK; - } - - void SetCallback(std::function callback) override { - m_request->set_callback(std::move(callback)); - } - - ov::SoPtr get_infer_request() { - return m_request; - } - -private: - ov::SoPtr m_request; -}; - -} // namespace ov - -namespace InferenceEngine { - -class IVariableStateWrapper : public ov::IVariableState { -private: - std::shared_ptr m_state; - -public: - explicit IVariableStateWrapper(const std::shared_ptr& state) - : ov::IVariableState(state->GetName()), - m_state(state) {} - - void reset() override { - m_state->Reset(); - } - - void set_state(const ov::SoPtr& state) override { - m_state->SetState(ov::tensor_to_blob(state)); - } - - ov::SoPtr get_state() const override { - return ov::make_tensor(std::const_pointer_cast(m_state->GetState())); - } -}; - -class IAsyncInferRequestWrapper : public ov::IAsyncInferRequest { -public: - IAsyncInferRequestWrapper(const std::shared_ptr& request, - const std::string& plugin_name) - : ov::IAsyncInferRequest(nullptr, nullptr, nullptr), - m_request(request), - m_unwrap_tensor(plugin_name != "AUTO" && plugin_name != "MULTI" && plugin_name != "BATCH" && - plugin_name != "HETERO") { - if (m_request->getPointerToExecutableNetworkInternal()) - m_compiled_model = - ov::legacy_convert::convert_compiled_model(m_request->getPointerToExecutableNetworkInternal()); - } - std::shared_ptr get_infer_request() { - return m_request; - } - - void infer() override { - m_request->Infer(); - } - void start_async() override { - m_request->StartAsync(); - } - - void wait() override { - try { - m_request->Wait(InferenceEngine::InferRequest::RESULT_READY); - } catch (const ov::Cancelled&) { - throw; - } catch (const InferenceEngine::InferCancelled& e) { - ov::Cancelled::create(e.what()); - } catch (const std::exception& ex) { - OPENVINO_THROW(ex.what()); - } catch (...) { - OPENVINO_THROW("Unexpected exception"); - } - } - bool wait_for(const std::chrono::milliseconds& timeout) override { - try { - return m_request->Wait(timeout.count()) == InferenceEngine::OK; - } catch (const InferenceEngine::InferCancelled& e) { - ov::Cancelled::create(e.what()); - } catch (const std::exception& ex) { - OPENVINO_THROW(ex.what()); - } catch (...) { - OPENVINO_THROW("Unexpected exception"); - } - } - - void cancel() override { - m_request->Cancel(); - } - - std::vector get_profiling_info() const override { - auto ieInfos = m_request->GetPerformanceCounts(); - std::vector infos; - infos.reserve(ieInfos.size()); - while (!ieInfos.empty()) { - auto itIeInfo = std::min_element( - std::begin(ieInfos), - std::end(ieInfos), - [](const decltype(ieInfos)::value_type& lhs, const decltype(ieInfos)::value_type& rhs) { - return lhs.second.execution_index < rhs.second.execution_index; - }); - IE_ASSERT(itIeInfo != ieInfos.end()); - auto& ieInfo = itIeInfo->second; - infos.push_back(ov::ProfilingInfo{}); - auto& info = infos.back(); - switch (ieInfo.status) { - case InferenceEngine::InferenceEngineProfileInfo::NOT_RUN: - info.status = ov::ProfilingInfo::Status::NOT_RUN; - break; - case InferenceEngine::InferenceEngineProfileInfo::OPTIMIZED_OUT: - info.status = ov::ProfilingInfo::Status::OPTIMIZED_OUT; - break; - case InferenceEngine::InferenceEngineProfileInfo::EXECUTED: - info.status = ov::ProfilingInfo::Status::EXECUTED; - break; - } - info.real_time = std::chrono::microseconds{ieInfo.realTime_uSec}; - info.cpu_time = std::chrono::microseconds{ieInfo.cpu_uSec}; - info.node_name = itIeInfo->first; - info.exec_type = std::string{ieInfo.exec_type}; - info.node_type = std::string{ieInfo.layer_type}; - ieInfos.erase(itIeInfo); - } - return infos; - } - - ov::SoPtr get_tensor(const ov::Output& port) const override { - const auto& name = get_legacy_name_from_port(port); - auto blob = m_request->GetBlob(name); - ov::SoPtr tensor = ov::make_tensor(blob); - if (!tensor._so) - tensor._so = m_request->getPointerToSo(); - return tensor; - } - - void set_tensor(const ov::Output& port, const ov::SoPtr& tensor) override { - m_request->SetBlob(get_legacy_name_from_port(port), ov::tensor_to_blob(tensor, m_unwrap_tensor)); - } - - std::vector> query_state() const override { - std::vector> variable_states; - for (auto&& state : m_request->QueryState()) { - variable_states.push_back( - {std::make_shared(state), m_request->getPointerToSo()}); - } - return variable_states; - } - - void set_callback(std::function callback) override { - m_request->SetCallback(std::move(callback)); - } - - const std::shared_ptr& get_compiled_model() const override { - if (!m_compiled_model) { - std::lock_guard lock(m_mutex); - if (!m_compiled_model) { - if (m_request->getPointerToExecutableNetworkInternal()) - m_compiled_model = - ov::legacy_convert::convert_compiled_model(m_request->getPointerToExecutableNetworkInternal()); - } - } - OPENVINO_ASSERT(m_compiled_model); - return m_compiled_model._ptr; - } - - const std::vector>& get_inputs() const override { - return get_compiled_model()->inputs(); - } - const std::vector>& get_outputs() const override { - return get_compiled_model()->outputs(); - } - -private: - std::shared_ptr m_request; - mutable ov::SoPtr m_compiled_model; - mutable std::mutex m_mutex; - const bool m_unwrap_tensor; -}; - -} // namespace InferenceEngine - -std::shared_ptr<::InferenceEngine::IInferRequestInternal> ov::legacy_convert::convert_infer_request( - const ov::SoPtr<::ov::IAsyncInferRequest>& request) { - if (auto comp_model = std::dynamic_pointer_cast(request._ptr)) { - return comp_model->get_infer_request(); - } - return std::make_shared(request); -} -ov::SoPtr<::ov::IAsyncInferRequest> ov::legacy_convert::convert_infer_request( - const std::shared_ptr<::InferenceEngine::IInferRequestInternal>& request, - const std::string& plugin_name) { - if (auto comp_model = std::dynamic_pointer_cast(request)) { - return comp_model->get_infer_request(); - } - return {std::make_shared(request, plugin_name), - request->getPointerToSo()}; -} diff --git a/src/inference/src/dev/converter_utils.hpp b/src/inference/src/dev/converter_utils.hpp deleted file mode 100644 index 6264a59432fd50..00000000000000 --- a/src/inference/src/dev/converter_utils.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "cpp/ie_cnn_network.h" -#include "cpp_interfaces/interface/ie_iinfer_request_internal.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "openvino/core/extension.hpp" -#include "openvino/core/model.hpp" -#include "openvino/runtime/iasync_infer_request.hpp" -#include "openvino/runtime/icompiled_model.hpp" -#include "openvino/runtime/iplugin.hpp" -#include "openvino/runtime/iremote_context.hpp" - -namespace ov { -namespace legacy_convert { - -void fill_input_info(const ov::Output& input, InferenceEngine::InputInfo::Ptr& inputInfo); -void fill_output_info(const ov::Output& output, InferenceEngine::DataPtr& outputInfo); - -InferenceEngine::CNNNetwork convert_model(const std::shared_ptr& model, bool is_new_api); -std::shared_ptr convert_model(const InferenceEngine::CNNNetwork& model, bool is_new_api); - -std::shared_ptr<::InferenceEngine::IInferencePlugin> convert_plugin(const ov::SoPtr<::ov::IPlugin>& plugin); -std::shared_ptr<::ov::IPlugin> convert_plugin(const std::shared_ptr<::InferenceEngine::IInferencePlugin>& plugin); - -std::shared_ptr<::InferenceEngine::IExecutableNetworkInternal> convert_compiled_model( - const ov::SoPtr<::ov::ICompiledModel>& model); -ov::SoPtr<::ov::ICompiledModel> convert_compiled_model( - const std::shared_ptr<::InferenceEngine::IExecutableNetworkInternal>& model); - -std::shared_ptr<::InferenceEngine::IInferRequestInternal> convert_infer_request( - const ov::SoPtr<::ov::IAsyncInferRequest>& request); -ov::SoPtr<::ov::IAsyncInferRequest> convert_infer_request( - const std::shared_ptr<::InferenceEngine::IInferRequestInternal>& request, - const std::string& plugin_name = ""); -} // namespace legacy_convert -} // namespace ov diff --git a/src/inference/src/dev/core_impl.cpp b/src/inference/src/dev/core_impl.cpp index 89b805254ef9dd..44f6c877471a5a 100644 --- a/src/inference/src/dev/core_impl.cpp +++ b/src/inference/src/dev/core_impl.cpp @@ -8,9 +8,6 @@ #include "check_network_batchable.hpp" #include "compilation_context.hpp" -#include "dev/converter_utils.hpp" -#include "dev/icompiled_model_wrapper.hpp" -#include "dev/iplugin_wrapper.hpp" #include "itt.hpp" #include "model_reader.hpp" #include "openvino/core/any.hpp" @@ -56,7 +53,6 @@ template void allowNotImplemented(F&& f) { try { f(); - } catch (const InferenceEngine::NotImplemented&) { } catch (const ov::NotImplemented&) { } } @@ -586,8 +582,6 @@ ov::Plugin ov::CoreImpl::get_plugin(const std::string& pluginName) const { so = ov::util::load_shared_object(desc.libraryLocation.c_str()); std::shared_ptr plugin_impl; reinterpret_cast(ov::util::get_symbol(so, ov::create_plugin_function))(plugin_impl); - if (auto wrapper = std::dynamic_pointer_cast(plugin_impl)) - wrapper->set_shared_object(so); plugin = Plugin{plugin_impl, so}; } @@ -692,7 +686,7 @@ ov::Plugin ov::CoreImpl::get_plugin(const std::string& pluginName) const { std::vector ext; desc.extensionCreateFunc(ext); add_extensions_unsafe(ext); - } catch (const InferenceEngine::GeneralError&) { + } catch (const ov::Exception&) { // the same extension can be registered multiple times - ignore it! } } else { @@ -700,15 +694,6 @@ ov::Plugin ov::CoreImpl::get_plugin(const std::string& pluginName) const { } return plugins.emplace(deviceName, plugin).first->second; - } catch (const InferenceEngine::Exception& ex) { - OPENVINO_THROW("Failed to create plugin ", - ov::util::from_file_path(desc.libraryLocation), - " for device ", - deviceName, - "\n", - "Please, check your environment\n", - ex.what(), - "\n"); } catch (const ov::Exception& ex) { OPENVINO_THROW("Failed to create plugin ", ov::util::from_file_path(desc.libraryLocation), @@ -851,9 +836,6 @@ ov::SoPtr ov::CoreImpl::import_model(std::istream& model, OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::import_model"); auto parsed = parseDeviceNameIntoConfig(device_name, config); auto compiled_model = get_plugin(parsed._deviceName).import_model(model, parsed._config); - if (auto wrapper = std::dynamic_pointer_cast(compiled_model._ptr)) { - wrapper->get_executable_network()->loadedFromCache(); - } return compiled_model; } @@ -864,9 +846,6 @@ ov::SoPtr ov::CoreImpl::import_model(std::istream& modelStre OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::import_model"); auto parsed = parseDeviceNameIntoConfig(context->get_device_name(), config); auto compiled_model = get_plugin(parsed._deviceName).import_model(modelStream, context, parsed._config); - if (auto wrapper = std::dynamic_pointer_cast(compiled_model._ptr)) { - wrapper->get_executable_network()->loadedFromCache(); - } return compiled_model; } @@ -907,10 +886,8 @@ std::vector ov::CoreImpl::get_available_devices() const { if (is_hidden_device(deviceName)) continue; try { - const ov::Any p = GetMetric(deviceName, propertyName); + const ov::Any p = get_property(deviceName, propertyName, {}); devicesIDs = p.as>(); - } catch (const InferenceEngine::Exception&) { - // plugin is not created by e.g. invalid env } catch (const ov::Exception&) { // plugin is not created by e.g. invalid env } catch (const std::runtime_error&) { @@ -1376,8 +1353,6 @@ bool ov::CoreImpl::device_supports_model_caching(const ov::Plugin& plugin) const bool ov::CoreImpl::device_supports_cache_dir(const ov::Plugin& plugin) const { try { return util::contains(plugin.get_property(ov::supported_properties), ov::cache_dir); - } catch (const InferenceEngine::NotImplemented&) { - return false; } catch (const ov::NotImplemented&) { return false; } @@ -1459,9 +1434,6 @@ ov::SoPtr ov::CoreImpl::load_model_from_cache( update_config[ov::loaded_from_cache.name()] = true; compiled_model = context ? plugin.import_model(networkStream, context, update_config) : plugin.import_model(networkStream, update_config); - if (auto wrapper = std::dynamic_pointer_cast(compiled_model._ptr)) { - wrapper->get_executable_network()->loadedFromCache(); - } }); } catch (const HeaderException&) { // For these exceptions just remove old cache and set that import didn't work diff --git a/src/inference/src/dev/core_impl.hpp b/src/inference/src/dev/core_impl.hpp index 4543f5ce342349..c7c06c968aa681 100644 --- a/src/inference/src/dev/core_impl.hpp +++ b/src/inference/src/dev/core_impl.hpp @@ -4,14 +4,11 @@ #pragma once -#include - #include "any_copy.hpp" #include "cache_guard.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "dev/plugin.hpp" #include "ie_cache_manager.hpp" -#include "ie_icore.hpp" +#include "openvino/runtime/icore.hpp" #include "openvino/core/any.hpp" #include "openvino/core/extension.hpp" #include "openvino/core/so_extension.hpp" @@ -53,7 +50,7 @@ bool is_config_applicable(const std::string& device_name, const std::string& dev std::string find_plugins_xml(const std::string& xmlFile); -class CoreImpl : public InferenceEngine::ICore, public std::enable_shared_from_this { +class CoreImpl : public ov::ICore, public std::enable_shared_from_this { private: mutable std::map plugins; // Mutex is needed to prevent changes of dev mutexes map from different threads @@ -189,12 +186,6 @@ class CoreImpl : public InferenceEngine::ICore, public std::enable_shared_from_t } void add_extensions_unsafe(const std::vector& extensions) const; - // Legacy API - ov::SoPtr LoadNetworkImpl( - const InferenceEngine::CNNNetwork& model, - ov::Plugin& plugin, - const std::map& parsedConfig); - public: CoreImpl(bool _newAPI); @@ -217,63 +208,6 @@ class CoreImpl : public InferenceEngine::ICore, public std::enable_shared_from_t */ void register_compile_time_plugins(); - // - // ICore public API - // - - InferenceEngine::CNNNetwork ReadNetwork(const std::string& modelPath, const std::string& binPath) const override; - - InferenceEngine::CNNNetwork ReadNetwork(const std::string& model, - const InferenceEngine::Blob::CPtr& weights, - bool frontendMode = false) const override; - - bool isNewAPI() const override; - - InferenceEngine::SoExecutableNetworkInternal LoadNetwork(const InferenceEngine::CNNNetwork& network, - const std::string& deviceNameOrig, - const std::map& config) override; - - InferenceEngine::SoExecutableNetworkInternal LoadNetwork( - const std::string& modelPath, - const std::string& deviceName, - const std::map& config, - const std::function& val = nullptr) override; - - InferenceEngine::SoExecutableNetworkInternal LoadNetwork( - const std::string& modelStr, - const InferenceEngine::Blob::CPtr& weights, - const std::string& deviceName, - const std::map& config, - const std::function& val = nullptr) override; - - InferenceEngine::SoExecutableNetworkInternal ImportNetwork( - std::istream& networkModel, - const std::string& deviceName, - const std::map& config) override; - - InferenceEngine::QueryNetworkResult QueryNetwork(const InferenceEngine::CNNNetwork& network, - const std::string& deviceName, - const std::map& config) const override; - - Any GetMetric(const std::string& deviceName, const std::string& name, const AnyMap& options = {}) const override; - - Any GetConfig(const std::string& deviceName, const std::string& name) const override; - - /** - * @brief Returns devices available for neural networks inference - * - * @return A vector of devices. The devices are returned as { CPU, GPU.0, GPU.1, NPU } - * If there more than one device of specific type, they are enumerated with .# suffix. - */ - std::vector GetAvailableDevices() const override; - - std::map GetSupportedConfig(const std::string& deviceName, - const std::map& configs) override; - - bool DeviceSupportsModelCaching(const std::string& deviceName) const override; - - std::map GetVersions(const std::string& deviceName) const; - // Common API /** diff --git a/src/inference/src/dev/core_impl_ie.cpp b/src/inference/src/dev/core_impl_ie.cpp deleted file mode 100644 index 5be5624aba8151..00000000000000 --- a/src/inference/src/dev/core_impl_ie.cpp +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include - -#include "any_copy.hpp" -#include "blob_factory.hpp" -#include "compilation_context.hpp" -#include "core_impl.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "dev/converter_utils.hpp" -#include "dev/icompiled_model_wrapper.hpp" -#include "ie_network_reader.hpp" -#include "iplugin_wrapper.hpp" -#include "itt.hpp" -#include "openvino/itt.hpp" -#include "openvino/pass/constant_folding.hpp" -#include "openvino/runtime/device_id_parser.hpp" -#include "openvino/runtime/icompiled_model.hpp" -#include "openvino/runtime/iplugin.hpp" -#include "openvino/runtime/itensor.hpp" -#include "openvino/runtime/make_tensor.hpp" -#include "openvino/util/common_util.hpp" - -bool ov::CoreImpl::isNewAPI() const { - return is_new_api(); -} - -ov::SoPtr ov::CoreImpl::LoadNetworkImpl( - const InferenceEngine::CNNNetwork& network, - ov::Plugin& plugin, - const std::map& parsedConfig) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "CoreImpl::LoadNetworkImpl"); - ov::SoPtr execNetwork; - auto wrapper = std::dynamic_pointer_cast(plugin.m_ptr); - OPENVINO_ASSERT(wrapper); - auto old_plugin = wrapper->get_plugin(); - return {old_plugin->LoadNetwork(network, parsedConfig), plugin.m_so}; -} - -InferenceEngine::CNNNetwork ov::CoreImpl::ReadNetwork(const std::string& modelPath, const std::string& binPath) const { - OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::ReadTime, "CoreImpl::ReadNetwork from file"); - return InferenceEngine::details::ReadNetwork(modelPath, - binPath, - extensions, - isNewAPI(), - coreConfig.get_enable_mmap()); -} - -InferenceEngine::CNNNetwork ov::CoreImpl::ReadNetwork(const std::string& model, - const InferenceEngine::Blob::CPtr& weights, - bool frontendMode) const { - OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::ReadTime, "CoreImpl::ReadNetwork from memory"); - return InferenceEngine::details::ReadNetwork(model, weights, extensions, isNewAPI(), frontendMode); -} - -InferenceEngine::SoExecutableNetworkInternal ov::CoreImpl::LoadNetwork( - const InferenceEngine::CNNNetwork& network, - const std::string& deviceName, - const std::map& config) { - OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::LoadTime, "Core::LoadNetwork::CNN"); - if (network.getFunction()) { - auto compiled_model = - compile_model(ov::legacy_convert::convert_model(network, isNewAPI()), deviceName, any_copy(config)); - return {ov::legacy_convert::convert_compiled_model(compiled_model), compiled_model._so}; - } - auto parsed = parseDeviceNameIntoConfig(deviceName, any_copy(config)); - auto plugin = get_plugin(parsed._deviceName); - auto res = LoadNetworkImpl(network, plugin, any_copy(parsed._config)); - return {res._ptr, res._so}; -} - -InferenceEngine::SoExecutableNetworkInternal ov::CoreImpl::LoadNetwork( - const std::string& modelPath, - const std::string& deviceName, - const std::map& config, - const std::function& val) { - OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::LoadTime, "Core::LoadNetwork::Path"); - - auto compiled_model = compile_model(modelPath, deviceName, any_copy(config)); - return {ov::legacy_convert::convert_compiled_model(compiled_model), compiled_model._so}; -} - -InferenceEngine::SoExecutableNetworkInternal ov::CoreImpl::LoadNetwork( - const std::string& modelStr, - const InferenceEngine::Blob::CPtr& weights, - const std::string& deviceName, - const std::map& config, - const std::function& val) { - OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::LoadTime, "Core::LoadNetwork::Memory"); - - auto compiled_model = - compile_model(modelStr, - ov::make_tensor(ov::make_tensor(std::const_pointer_cast(weights))), - deviceName, - ov::any_copy(config)); - return {ov::legacy_convert::convert_compiled_model(compiled_model), compiled_model._so}; -} - -InferenceEngine::SoExecutableNetworkInternal ov::CoreImpl::ImportNetwork( - std::istream& networkModel, - const std::string& deviceName, - const std::map& config) { - auto compiled_model = import_model(networkModel, deviceName, any_copy(config)); - if (auto wrapper = std::dynamic_pointer_cast(compiled_model._ptr)) { - wrapper->get_executable_network()->loadedFromCache(); - } - return {ov::legacy_convert::convert_compiled_model(compiled_model), compiled_model._so}; -} - -InferenceEngine::QueryNetworkResult ov::CoreImpl::QueryNetwork(const InferenceEngine::CNNNetwork& network, - const std::string& deviceName, - const std::map& config) const { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::QueryNetwork"); - InferenceEngine::QueryNetworkResult ret; - if (!network.getFunction()) { - ret.rc = InferenceEngine::GENERAL_ERROR; - return ret; - } - auto res = query_model(network.getFunction(), deviceName, any_copy(config)); - ret.supportedLayersMap = res; - - return ret; -} - -ov::Any ov::CoreImpl::GetMetric(const std::string& deviceName, - const std::string& name, - const ov::AnyMap& options) const { - // HETERO case - { - if (deviceName.find("HETERO:") == 0) { - IE_THROW() - << "You can get specific metrics with the GetMetric only for the HETERO itself (without devices). " - "To get individual devices's metrics call GetMetric for each device separately"; - } - } - - // MULTI case - { - if (deviceName.find("MULTI:") == 0) { - IE_THROW() - << "You can get specific metrics with the GetMetric only for the MULTI itself (without devices). " - "To get individual devices's metrics call GetMetric for each device separately"; - } - } - - // AUTO case - { - if (deviceName.find("AUTO:") == 0) { - IE_THROW() << "You can get specific metrics with the GetMetric only for the AUTO itself (without devices). " - "To get individual devices's metrics call GetMetric for each device separately"; - } - } - - // BATCH case - { - if (deviceName.find("BATCH:") == 0) { - IE_THROW() - << "You can get specific metrics with the GetMetric only for the BATCH itself (without devices). " - "To get individual devices's metrics call GetMetric for each device separately"; - } - } - - auto parsed = parseDeviceNameIntoConfig(deviceName, options); - return get_plugin(parsed._deviceName).get_property(name, parsed._config); -} - -ov::Any ov::CoreImpl::GetConfig(const std::string& deviceName, const std::string& name) const { - auto parsed = parseDeviceNameIntoConfig(deviceName); - return get_plugin(parsed._deviceName).get_property(name, parsed._config); -} - -std::vector ov::CoreImpl::GetAvailableDevices() const { - return get_available_devices(); -} - -bool ov::CoreImpl::DeviceSupportsModelCaching(const std::string& deviceName) const { - return device_supports_model_caching(deviceName); -} - -std::map ov::CoreImpl::GetSupportedConfig(const std::string& deviceName, - const std::map& configs) { - return ov::any_copy(get_supported_property(deviceName, any_copy(configs))); -} - -std::map ov::CoreImpl::GetVersions(const std::string& deviceName) const { - std::map versions; - std::vector deviceNames; - - { - // for compatibility with samples / demo - if (deviceName.find("HETERO") == 0) { - auto pos = deviceName.find_first_of(":"); - if (pos != std::string::npos) { - deviceNames = ov::DeviceIDParser::get_hetero_devices(deviceName.substr(pos + 1)); - } - deviceNames.push_back("HETERO"); - } else if (deviceName.find("MULTI") == 0) { - auto pos = deviceName.find_first_of(":"); - if (pos != std::string::npos) { - deviceNames = ov::DeviceIDParser::get_multi_devices(deviceName.substr(pos + 1)); - } - deviceNames.push_back("MULTI"); - } else if (deviceName.find("AUTO") == 0) { - auto pos = deviceName.find_first_of(":"); - if (pos != std::string::npos) { - deviceNames = ov::DeviceIDParser::get_multi_devices(deviceName.substr(pos + 1)); - } - deviceNames.emplace_back("AUTO"); - } else if (deviceName.find("BATCH") == 0) { - auto pos = deviceName.find_first_of(":"); - if (pos != std::string::npos) { - deviceNames = {ov::DeviceIDParser::get_batch_device(deviceName.substr(pos + 1))}; - } - deviceNames.push_back("BATCH"); - } else { - deviceNames.push_back(deviceName); - } - } - - for (auto&& deviceName_ : deviceNames) { - ov::DeviceIDParser parser(deviceName_); - std::string deviceNameLocal = parser.get_device_name(); - - try { - ov::Plugin cppPlugin = get_plugin(deviceNameLocal); - auto convertedPlugin = - ov::legacy_convert::convert_plugin(ov::SoPtr{cppPlugin.m_ptr, cppPlugin.m_so}); - versions[deviceNameLocal] = convertedPlugin->GetVersion(); - } catch (const ov::Exception& ex) { - std::string exception(ex.what()); - if (exception.find("not registered in the OpenVINO Runtime") == std::string::npos) { - throw; - } - } - } - - return versions; -} diff --git a/src/inference/src/dev/icompiled_model.cpp b/src/inference/src/dev/icompiled_model.cpp index 49d60e5268cb49..c216fab0a49c32 100644 --- a/src/inference/src/dev/icompiled_model.cpp +++ b/src/inference/src/dev/icompiled_model.cpp @@ -4,9 +4,8 @@ #include "openvino/runtime/icompiled_model.hpp" -#include "dev/converter_utils.hpp" -#include "icompiled_model_wrapper.hpp" #include "openvino/core/model.hpp" +#include "openvino/runtime/iasync_infer_request.hpp" #include "openvino/runtime/properties.hpp" #include "transformations/utils/utils.hpp" diff --git a/src/inference/src/dev/icompiled_model_wrapper.cpp b/src/inference/src/dev/icompiled_model_wrapper.cpp deleted file mode 100644 index 563c428cdf6c9e..00000000000000 --- a/src/inference/src/dev/icompiled_model_wrapper.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "icompiled_model_wrapper.hpp" - -#include "dev/converter_utils.hpp" -#include "openvino/core/except.hpp" - -InferenceEngine::ICompiledModelWrapper::ICompiledModelWrapper( - const std::shared_ptr& model) - : ov::ICompiledModel(nullptr, ov::legacy_convert::convert_plugin(model->_plugin), nullptr, nullptr), - m_model(model) { - std::vector> inputs, outputs; - for (const auto& input : m_model->getInputs()) { - inputs.emplace_back(input->output(0)); - } - for (const auto& output : m_model->getOutputs()) { - outputs.emplace_back(output->output(0)); - } - m_inputs = inputs; - m_outputs = outputs; -} - -std::shared_ptr InferenceEngine::ICompiledModelWrapper::create_infer_request() const { - auto infer_request = m_model->CreateInferRequest(); - infer_request->setPointerToSo(m_model->GetPointerToSo()); - return ov::legacy_convert::convert_infer_request(infer_request, m_model->_plugin->GetName())._ptr; -} - -void InferenceEngine::ICompiledModelWrapper::export_model(std::ostream& model) const { - try { - m_model->Export(model); - } catch (const InferenceEngine::NotImplemented& ex) { - OPENVINO_THROW_NOT_IMPLEMENTED(ex.what()); - } -} - -std::shared_ptr InferenceEngine::ICompiledModelWrapper::get_runtime_model() const { - return m_model->GetExecGraphInfo(); -} - -void InferenceEngine::ICompiledModelWrapper::set_property(const ov::AnyMap& properties) { - m_model->SetConfig(properties); -} - -ov::Any InferenceEngine::ICompiledModelWrapper::get_property(const std::string& name) const { - if (ov::loaded_from_cache == name) { - return m_model->isLoadedFromCache(); - } - return m_model->GetConfig(name); -} - -std::shared_ptr -InferenceEngine::ICompiledModelWrapper::get_executable_network() { - return m_model; -} - -std::shared_ptr -InferenceEngine::ICompiledModelWrapper::get_executable_network() const { - return m_model; -} diff --git a/src/inference/src/dev/icompiled_model_wrapper.hpp b/src/inference/src/dev/icompiled_model_wrapper.hpp deleted file mode 100644 index 09c4fbb8dafd92..00000000000000 --- a/src/inference/src/dev/icompiled_model_wrapper.hpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "dev/converter_utils.hpp" -#include "openvino/runtime/icompiled_model.hpp" - -namespace InferenceEngine { - -class ICompiledModelWrapper : public ov::ICompiledModel { -public: - ICompiledModelWrapper(const std::shared_ptr& model); - virtual ~ICompiledModelWrapper() = default; - std::shared_ptr create_infer_request() const override; - - void export_model(std::ostream& model) const override; - - std::shared_ptr get_runtime_model() const override; - - void set_property(const ov::AnyMap& properties) override; - - ov::Any get_property(const std::string& name) const override; - - std::shared_ptr get_executable_network(); - std::shared_ptr get_executable_network() const; - -private: - std::shared_ptr m_model; - - std::shared_ptr create_sync_infer_request() const override { - OPENVINO_NOT_IMPLEMENTED; - } -}; -} // namespace InferenceEngine diff --git a/src/inference/src/dev/iplugin_wrapper.cpp b/src/inference/src/dev/iplugin_wrapper.cpp deleted file mode 100644 index 1dc493293029a2..00000000000000 --- a/src/inference/src/dev/iplugin_wrapper.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "iplugin_wrapper.hpp" - -#include - -#include "any_copy.hpp" -#include "dev/converter_utils.hpp" -#include "ie_icore.hpp" -#include "openvino/runtime/iremote_context.hpp" -#include "openvino/runtime/threading/executor_manager.hpp" - -namespace InferenceEngine { - -IPluginWrapper::IPluginWrapper(const std::shared_ptr& ptr) : m_old_plugin(ptr) { - OPENVINO_ASSERT(m_old_plugin); - auto& ver = m_old_plugin->GetVersion(); - m_version.buildNumber = ver.buildNumber; - m_version.description = ver.description; - m_plugin_name = m_old_plugin->GetName(); - m_is_new_api = m_old_plugin->IsNewAPI(); - m_core = m_old_plugin->GetCore(); - m_executor_manager = m_old_plugin->executorManager(); -} - -const std::shared_ptr& IPluginWrapper::update_exec_network( - const std::shared_ptr& network) const { - network->SetPointerToPlugin(m_old_plugin); - if (!network->GetPointerToSo()) - network->_so = m_so; - - return network; -} - -std::shared_ptr IPluginWrapper::compile_model(const std::shared_ptr& model, - const ov::AnyMap& properties) const { - auto exec_network = - m_old_plugin->LoadNetwork(ov::legacy_convert::convert_model(model, is_new_api()), ov::any_copy(properties)); - return ov::legacy_convert::convert_compiled_model(update_exec_network(exec_network))._ptr; -} - -std::shared_ptr IPluginWrapper::compile_model(const std::string& model_path, - const ov::AnyMap& properties) const { - auto exec_network = m_old_plugin->LoadNetwork(model_path, any_copy(properties)); - return ov::legacy_convert::convert_compiled_model(update_exec_network(exec_network._ptr))._ptr; -} - -std::shared_ptr IPluginWrapper::compile_model(const std::shared_ptr& model, - const ov::AnyMap& properties, - const ov::SoPtr& context) const { - OPENVINO_NOT_IMPLEMENTED; -} - -void IPluginWrapper::set_property(const ov::AnyMap& properties) { - m_old_plugin->SetProperties(properties); -} - -ov::Any IPluginWrapper::get_property(const std::string& name, const ov::AnyMap& arguments) const { - try { - return m_old_plugin->GetConfig(name, arguments); - } catch (...) { - return m_old_plugin->GetMetric(name, arguments); - } -} - -ov::SoPtr IPluginWrapper::create_context(const ov::AnyMap& remote_properties) const { - OPENVINO_NOT_IMPLEMENTED; -} - -ov::SoPtr IPluginWrapper::get_default_context(const ov::AnyMap& remote_properties) const { - OPENVINO_NOT_IMPLEMENTED; -} - -std::shared_ptr IPluginWrapper::import_model(std::istream& model, - const ov::AnyMap& properties) const { - return ov::legacy_convert::convert_compiled_model( - update_exec_network(m_old_plugin->ImportNetwork(model, any_copy(properties)))) - ._ptr; -} - -std::shared_ptr IPluginWrapper::import_model(std::istream& model, - const ov::SoPtr& context, - const ov::AnyMap& properties) const { - OPENVINO_NOT_IMPLEMENTED; -} - -ov::SupportedOpsMap IPluginWrapper::query_model(const std::shared_ptr& model, - const ov::AnyMap& properties) const { - auto res = m_old_plugin->QueryNetwork(ov::legacy_convert::convert_model(model, is_new_api()), any_copy(properties)); - OPENVINO_ASSERT(res.rc == InferenceEngine::OK, res.resp.msg); - return res.supportedLayersMap; -} - -const std::shared_ptr& IPluginWrapper::get_plugin() const { - return m_old_plugin; -} - -void IPluginWrapper::set_core(const std::weak_ptr& core) { - auto locked_core = core.lock(); - auto old_core = std::dynamic_pointer_cast(locked_core); - if (old_core) - m_old_plugin->SetCore(old_core); - m_core = core; -} - -void IPluginWrapper::set_device_name(const std::string& device_name) { - m_plugin_name = device_name; - m_old_plugin->SetName(device_name); -} - -void IPluginWrapper::set_shared_object(const std::shared_ptr& so) { - m_so = so; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/dev/iplugin_wrapper.hpp b/src/inference/src/dev/iplugin_wrapper.hpp deleted file mode 100644 index 5aeada9621ab47..00000000000000 --- a/src/inference/src/dev/iplugin_wrapper.hpp +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "openvino/runtime/iplugin.hpp" - -namespace InferenceEngine { - -/** - * @brief Class wraps InferenceEngine::IInferencePlugin into ov::IPlugin - */ -class IPluginWrapper : public ov::IPlugin { -public: - /** - * @brief Constructs Plugin wrapper - * - * @param ptr shared pointer to InferenceEngine::IInferencePlugin - */ - IPluginWrapper(const std::shared_ptr& ptr); - - /** - * @brief Destructor - */ - virtual ~IPluginWrapper() = default; - - /** - * @brief Create compiled model based on model and properties - * - * @param model OpenVINO Model representation - * @param properties configurations for compiled model - * - * @return shared pointer to compiled model interface - */ - std::shared_ptr compile_model(const std::shared_ptr& model, - const ov::AnyMap& properties) const override; - - /** - * @brief Create compiled model based on model and properties - * - * @param model_path Path to the model - * @param properties configurations for compiled model - * - * @return shared pointer to compiled model interface - */ - std::shared_ptr compile_model(const std::string& model_path, - const ov::AnyMap& properties) const override; - - /** - * @brief Create compiled model based on model and properties - * - * @param model OpenVINO Model representation - * @param properties configurations for compiled model - * @param context remote context - * - * @return shared pointer to compiled model interface - */ - std::shared_ptr compile_model(const std::shared_ptr& model, - const ov::AnyMap& properties, - const ov::SoPtr& context) const override; - - /** - * @brief Specifies some plugin properties - * - * @param properties map with configuration properties - */ - void set_property(const ov::AnyMap& properties) override; - - /** - * @brief Returns the property - * - * @param name property name - * @param arguments configuration parameters - * - * @return ov::Any object which contains property value - */ - ov::Any get_property(const std::string& name, const ov::AnyMap& arguments) const override; - - /** - * @brief Create remote context - * - * @param remote_properties configuration parameters - * - * @return Remote context - */ - ov::SoPtr create_context(const ov::AnyMap& remote_properties) const override; - - /** - * @brief Create default remote context - * - * @param remote_properties configuration parameters - * - * @return Remote context - */ - ov::SoPtr get_default_context(const ov::AnyMap& remote_properties) const override; - - /** - * @brief Import model to the plugin - * - * @param model strim with the model - * @param properties configuration properties - * - * @return shared pointer to compiled model interface - */ - std::shared_ptr import_model(std::istream& model, const ov::AnyMap& properties) const override; - - /** - * @brief Import model to the plugin - * - * @param model strim with the model - * @param context remote context - * @param properties configuration properties - * - * @return shared pointer to compiled model interface - */ - std::shared_ptr import_model(std::istream& model, - const ov::SoPtr& context, - const ov::AnyMap& properties) const override; - - /** - * @brief query model - * - * @param model OpenVINO Model - * @param properties configuration properties - * - * @return Map of supported operations - */ - ov::SupportedOpsMap query_model(const std::shared_ptr& model, - const ov::AnyMap& properties) const override; - - /** - * @brief Returns the instance of the legacy plugin - * - * @return Legacy InferenceEngine::IInferencePlugin object - */ - const std::shared_ptr& get_plugin() const; - - /** - * @brief Set core interface to the plugin - * This method works under the non-virtual method of IPlugin class - * - * @param core OpenVINO Core interface - */ - void set_core(const std::weak_ptr& core); - - /** - * @brief Set plugin name for the wrapper and legacy plugin - * This method works under the non-virtual method of IPlugin class - * - * @param device_name The name of plugin - */ - void set_device_name(const std::string& device_name); - - void set_shared_object(const std::shared_ptr& so); - -private: - std::shared_ptr m_old_plugin; - std::shared_ptr m_so; - - const std::shared_ptr& update_exec_network( - const std::shared_ptr& network) const; -}; - -} // namespace InferenceEngine diff --git a/src/inference/src/dev/make_tensor.cpp b/src/inference/src/dev/make_tensor.cpp index 9f7ea21f1dc79e..e34497749ad98e 100644 --- a/src/inference/src/dev/make_tensor.cpp +++ b/src/inference/src/dev/make_tensor.cpp @@ -6,8 +6,6 @@ #include -#include "blob_factory.hpp" -#include "ie_ngraph_utils.hpp" #include "openvino/runtime/iremote_tensor.hpp" #include "openvino/runtime/properties.hpp" #ifdef PROXY_PLUGIN_ENABLED @@ -352,232 +350,6 @@ std::shared_ptr make_tensor(const std::shared_ptr& other, return std::make_shared(other, begin, end); } -/** - * @brief Tensor what contains InferenceEngine::Blob inside - * Blob owns the memory - */ -class BlobTensor : public ITensor { - mutable element::Type m_type; - mutable Shape m_shape; - mutable Strides m_strides; - - void update_strides() { - if (get_element_type().bitwidth() >= 8) { - const auto& element_strides = blob->getTensorDesc().getBlockingDesc().getStrides(); - const size_t elem_size = get_element_type().size(); - m_strides.clear(); - m_strides.resize(element_strides.size()); - std::transform(element_strides.begin(), - element_strides.end(), - m_strides.begin(), - [&elem_size](size_t stride) { - return stride * elem_size; - }); - } - } - -public: - std::shared_ptr blob; - - BlobTensor(const InferenceEngine::Blob::Ptr& blob) : blob{blob} { - OPENVINO_ASSERT(blob); - m_shape = blob->getTensorDesc().getBlockingDesc().getBlockDims(); - update_strides(); - } - - const element::Type& get_element_type() const override { - m_type = InferenceEngine::details::convertPrecision(blob->getTensorDesc().getPrecision()); - return m_type; - } - - void set_shape(ov::Shape shape) override { - blob->setShape({shape.begin(), shape.end()}); - update_strides(); - } - - const Shape& get_shape() const override { - m_shape = blob->getTensorDesc().getBlockingDesc().getBlockDims(); - return m_shape; - } - - const Strides& get_strides() const override { - OPENVINO_ASSERT(get_element_type().bitwidth() >= 8, - "Could not get strides for types with bitwidths less then 8 bit. Tensor type: ", - get_element_type()); - return m_strides; - } - - size_t get_size() const override { - return blob->size(); - } - - size_t get_byte_size() const override { - return blob->byteSize(); - } - - void* data(const element::Type& element_type) const override { - OPENVINO_ASSERT(blob != nullptr, "Tensor was not initialized."); -#define TYPE_CHECK(TYPE) (dynamic_cast*>(blob.get()) != nullptr) - auto host_accesable_implementation = TYPE_CHECK(bool) || TYPE_CHECK(int8_t) || TYPE_CHECK(uint8_t) || - TYPE_CHECK(int16_t) || TYPE_CHECK(uint16_t) || TYPE_CHECK(int32_t) || - TYPE_CHECK(uint32_t) || TYPE_CHECK(int64_t) || TYPE_CHECK(uint64_t) || - TYPE_CHECK(float) || TYPE_CHECK(double); -#undef TYPE_CHECK - OPENVINO_ASSERT(host_accesable_implementation, - "Tensor implementation type dose not contains host accessable data"); - if (element_type != element::undefined && element_type.is_static()) { - OPENVINO_ASSERT(element_type == get_element_type(), - "Tensor data with element type ", - get_element_type(), - ", is not representable as pointer to ", - element_type); - } - // since we don't use byte offsets, we need to explicitly multiply by element_size - auto byte_offset = blob->getTensorDesc().getBlockingDesc().getOffsetPadding() * get_element_type().size(); - OPENVINO_ASSERT((get_element_type().bitwidth() >= 8) || (byte_offset == 0), - "ROI access for types with bitwidths less then 8 bit is not implemented. Tensor type: ", - get_element_type()); - return byte_offset + InferenceEngine::as(blob)->rmap().as(); - } -}; - -/** - * @brief Create InferenceEngine::TBlob from the tensor - * - * @tparam T Blob data type - */ -template -class TensorMemoryBlob : public InferenceEngine::TBlob { -public: - ~TensorMemoryBlob() override = default; - explicit TensorMemoryBlob(const ov::SoPtr& tensor_, InferenceEngine::TensorDesc desc) try : InferenceEngine - ::TBlob{desc, static_cast(tensor_->data()), tensor_->get_byte_size()}, tensor{tensor_} { - OPENVINO_ASSERT(!std::dynamic_pointer_cast(tensor._ptr)); - } - catch (const std::exception& ex) { - OPENVINO_THROW(ex.what()); - } - - void setShape(const InferenceEngine::SizeVector& dims) override { - tensor->set_shape(dims); - InferenceEngine::TBlob::getTensorDesc().setDims(dims); - allocate(); - } - - void allocate() noexcept override { - if ((void*)InferenceEngine::TBlob::buffer() != tensor->data()) { - InferenceEngine::TBlob::_allocator = - InferenceEngine::details::make_pre_allocator(static_cast(tensor->data()), tensor->get_byte_size()); - InferenceEngine::TBlob::allocate(); - } - } - - ov::SoPtr tensor; -}; - -ov::SoPtr make_tensor(const std::shared_ptr& blob, bool unwrap) { -#define ELSE_IF(type) \ - else if (auto tblob = dynamic_cast*>(blob.get())) { \ - return tblob->tensor; \ - } - if (blob == nullptr) { - return {}; - } - ELSE_IF(float) - ELSE_IF(double) - ELSE_IF(int8_t) - ELSE_IF(int8_t) - ELSE_IF(int16_t) - ELSE_IF(int32_t) - ELSE_IF(int64_t) - ELSE_IF(uint8_t) - ELSE_IF(uint8_t) - ELSE_IF(uint16_t) - ELSE_IF(uint32_t) - ELSE_IF(uint64_t) - ELSE_IF(int8_t) - ELSE_IF(bool) else { - return {std::make_shared(blob), nullptr}; - } -#undef IF -} - -InferenceEngine::Blob::Ptr tensor_to_blob(const ov::SoPtr& orig_tensor, - bool unwrap, - InferenceEngine::TensorDesc desc) { - auto create_desc = [](const ov::SoPtr& tensor, - const InferenceEngine::TensorDesc& desc) -> InferenceEngine::TensorDesc { - if (desc.getLayout() != InferenceEngine::ANY || - desc.getPrecision() != InferenceEngine::Precision::UNSPECIFIED) { - return desc; - } - auto element_type = tensor->get_element_type(); - auto shape = tensor->get_shape(); - InferenceEngine::SizeVector blk_order(shape.size()); - std::iota(blk_order.begin(), blk_order.end(), 0); - InferenceEngine::SizeVector dim_offset(shape.size(), 0); - InferenceEngine::SizeVector blk_strides; - auto byte_strides = element_type.bitwidth() >= 8 ? tensor->get_strides() : Strides{}; - if (byte_strides.empty()) { - blk_strides = ov::row_major_strides(shape); - } else { - blk_strides.resize(byte_strides.size()); - std::transform(byte_strides.begin(), - byte_strides.end(), - blk_strides.begin(), - [&element_type](size_t byte_stride) { - OPENVINO_ASSERT(byte_stride % element_type.size() == 0, - "Limitation: Stride in bytes ", - byte_stride, - " should be divisible by size of element ", - element_type.size()); - return byte_stride / element_type.size(); - }); - } - return InferenceEngine::TensorDesc{InferenceEngine::details::convertPrecision(element_type), - shape, - InferenceEngine::BlockingDesc{shape, blk_order, 0, dim_offset, blk_strides}}; - }; -#ifdef PROXY_PLUGIN_ENABLED - const auto& tensor = unwrap ? ov::proxy::get_hardware_tensor(orig_tensor) : orig_tensor; -#else - const auto& tensor = orig_tensor; -#endif - if (tensor == nullptr) { - return {}; - } else if (auto blob_tensor = std::dynamic_pointer_cast(tensor._ptr)) { - return blob_tensor->blob; - } else { -#define CASE(precision, T) \ - case element::precision: \ - return std::make_shared>(tensor, create_desc(tensor, desc)); - switch (tensor->get_element_type()) { - CASE(f32, float); - CASE(f64, double); - CASE(i4, int8_t); - CASE(i8, int8_t); - CASE(i16, int16_t); - CASE(i32, int32_t); - CASE(i64, int64_t); - CASE(u4, uint8_t); - CASE(u8, uint8_t); - CASE(u16, uint16_t); - CASE(u32, uint32_t); - CASE(u64, uint64_t); - CASE(u1, int8_t); - CASE(boolean, bool); - case element::f16: - return std::make_shared>(tensor, create_desc(tensor, desc)); - case element::bf16: - return std::make_shared>(tensor, create_desc(tensor, desc)); - default: - OPENVINO_THROW("Unsupported element type"); - } -#undef CASE - } - OPENVINO_THROW("Cannot convert tensor to blob!"); -} // namespace ov - namespace util { ov::Tensor make_tensor(const std::shared_ptr& tensor, const std::shared_ptr& so) { diff --git a/src/inference/src/dev/plugin.cpp b/src/inference/src/dev/plugin.cpp index f8bfb69250f6a2..66c75ddd7e7e02 100644 --- a/src/inference/src/dev/plugin.cpp +++ b/src/inference/src/dev/plugin.cpp @@ -6,8 +6,6 @@ #include -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" -#include "iplugin_wrapper.hpp" #include "openvino/runtime/internal_properties.hpp" #include "openvino/runtime/properties.hpp" #include "openvino/util/common_util.hpp" @@ -32,11 +30,7 @@ ov::Plugin::Plugin(const std::shared_ptr& ptr, const std::shared_pt } void ov::Plugin::set_name(const std::string& deviceName) { - OV_PLUGIN_CALL_STATEMENT({ - m_ptr->set_device_name(deviceName); - if (auto wrapper = std::dynamic_pointer_cast(m_ptr)) - wrapper->set_device_name(deviceName); - }); + OV_PLUGIN_CALL_STATEMENT({ m_ptr->set_device_name(deviceName); }); } const std::string& ov::Plugin::get_name() const { @@ -44,11 +38,7 @@ const std::string& ov::Plugin::get_name() const { } void ov::Plugin::set_core(std::weak_ptr core) { - OV_PLUGIN_CALL_STATEMENT({ - m_ptr->set_core(core); - if (auto wrapper = std::dynamic_pointer_cast(m_ptr)) - wrapper->set_core(core); - }); + OV_PLUGIN_CALL_STATEMENT({ m_ptr->set_core(core); }); } const ov::Version ov::Plugin::get_version() const { diff --git a/src/inference/src/ie_blob_common.cpp b/src/inference/src/ie_blob_common.cpp deleted file mode 100644 index eb26b055a597bd..00000000000000 --- a/src/inference/src/ie_blob_common.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include - -#include "ie_blob.h" -#include "openvino/runtime/make_tensor.hpp" -#include "system_allocator.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -void Blob::setShape(const SizeVector& dims) { - // we don't want to allow setShape for: - // 1. ROI cases - { - size_t denseStride = 1; - const auto& blockedDims = getTensorDesc().getBlockingDesc().getBlockDims(); - const auto& strides = getTensorDesc().getBlockingDesc().getStrides(); - - for (size_t i = 1; i <= strides.size(); i++) { - if (denseStride != strides[strides.size() - i]) { - IE_THROW() << "Blob::setShape requires dense blob"; - } - denseStride *= blockedDims[blockedDims.size() - i]; - } - } - - if (properProduct(dims) > properProduct(getTensorDesc().getDims())) { - // 2. Blobs created on top of preallocated memory - if (std::dynamic_pointer_cast(getAllocator())) { - IE_THROW() - << "Cannot call setShape for Blobs created on top of preallocated memory if shape was increased."; - } - // New blob shape requires more memory than old one -- reallocate - if (!deallocate()) { - IE_THROW() << "Cannot deallocate blob while an attempt to enlarge blob area in setShape."; - } - - // Old and new ranks should match as well as layouts - getTensorDesc().setDims(dims); - - allocate(); - // no way to detect if allocation is successful other than map/unmap - // that we wouldn't like to do here; but for cases when we use SystemMemoryAllocator - // we can do it - if (std::dynamic_pointer_cast(getAllocator())) { - if (buffer() == nullptr) { - IE_THROW() << "Failed to allocate memory in Blob::setShape"; - } - } - } else { - // Don't shrink area when new size fit the existing area - getTensorDesc().setDims(dims); - } -} - -Blob::Ptr Blob::createROI(const ROI& roi) const { - if (getTensorDesc().getLayout() == Layout::NCHW || getTensorDesc().getLayout() == Layout::NHWC) { - return createROI({roi.id, 0, roi.posY, roi.posX}, - {roi.id + 1, getTensorDesc().getDims()[1], roi.posY + roi.sizeY, roi.posX + roi.sizeX}); - } - IE_THROW(NotImplemented) << "createROI is not implemented for current type of Blob"; -} - -Blob::Ptr Blob::createROI(const std::vector& begin, const std::vector& end) const { - IE_THROW(NotImplemented) << "createROI is not implemented for current type of Blob or roi"; -} - -Blob::Ptr make_shared_blob(const Blob::Ptr& inputBlob, const ROI& roi) { - return inputBlob->createROI(roi); -} - -Blob::Ptr make_shared_blob(const Blob::Ptr& inputBlob, - const std::vector& begin, - const std::vector& end) { - return inputBlob->createROI(begin, end); -} - -// -// RTTI -// - -Blob::~Blob() {} -MemoryBlob::~MemoryBlob() {} - -#ifndef _WIN32 -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -template class TBlob; -#endif - -} // namespace InferenceEngine diff --git a/src/inference/src/ie_cache_manager.hpp b/src/inference/src/ie_cache_manager.hpp index 01f6cc943d68ab..86e1817045fd45 100644 --- a/src/inference/src/ie_cache_manager.hpp +++ b/src/inference/src/ie_cache_manager.hpp @@ -14,7 +14,6 @@ #include #include -#include "ie_api.h" #include "openvino/util/file_util.hpp" namespace ov { diff --git a/src/inference/src/ie_common.cpp b/src/inference/src/ie_common.cpp deleted file mode 100644 index b15e49a9d8b371..00000000000000 --- a/src/inference/src/ie_common.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ie_common.h" - -#include -#include -#include -#include -#include -#include - -#include "ie_blob.h" -#include "openvino/core/except.hpp" -#include "openvino/runtime/exception.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START -namespace details { - -void Rethrow() { - try { - throw; - } catch (const ov::NotImplemented& e) { - IE_THROW(NotImplemented) << e.what(); - } catch (const InferenceEngine::GeneralError& e) { - throw e; - } catch (const InferenceEngine::NotImplemented& e) { - throw e; - } catch (const InferenceEngine::NetworkNotLoaded& e) { - throw e; - } catch (const InferenceEngine::ParameterMismatch& e) { - throw e; - } catch (const InferenceEngine::NotFound& e) { - throw e; - } catch (const InferenceEngine::OutOfBounds& e) { - throw e; - } catch (const InferenceEngine::Unexpected& e) { - throw e; - } catch (const InferenceEngine::RequestBusy& e) { - throw e; - } catch (const InferenceEngine::ResultNotReady& e) { - throw e; - } catch (const InferenceEngine::NotAllocated& e) { - throw e; - } catch (const InferenceEngine::InferNotStarted& e) { - throw e; - } catch (const InferenceEngine::NetworkNotRead& e) { - throw e; - } catch (const InferenceEngine::InferCancelled& e) { - throw e; - } catch (const ov::Cancelled& e) { - IE_THROW(InferCancelled) << e.what(); - } catch (const std::exception& e) { - IE_THROW() << e.what(); - } catch (...) { - IE_THROW(Unexpected); - } -} - -IE_SUPPRESS_DEPRECATED_START - -StatusCode InferenceEngineException::getStatus() const { - if (dynamic_cast(this) != nullptr || dynamic_cast(this) != nullptr) { - return GENERAL_ERROR; - } else if (dynamic_cast(this) != nullptr || - dynamic_cast(this) != nullptr) { - return NOT_IMPLEMENTED; - } else if (dynamic_cast(this) != nullptr) { - return NETWORK_NOT_LOADED; - } else if (dynamic_cast(this) != nullptr) { - return PARAMETER_MISMATCH; - } else if (dynamic_cast(this) != nullptr) { - return NOT_FOUND; - } else if (dynamic_cast(this) != nullptr) { - return OUT_OF_BOUNDS; - } else if (dynamic_cast(this) != nullptr) { - return UNEXPECTED; - } else if (dynamic_cast(this) != nullptr) { - return REQUEST_BUSY; - } else if (dynamic_cast(this) != nullptr) { - return RESULT_NOT_READY; - } else if (dynamic_cast(this) != nullptr) { - return NOT_ALLOCATED; - } else if (dynamic_cast(this) != nullptr) { - return INFER_NOT_STARTED; - } else if (dynamic_cast(this) != nullptr) { - return NETWORK_NOT_READ; - } else if (dynamic_cast(this) != nullptr) { - return INFER_CANCELLED; - } else { - assert(!"Unreachable"); - return OK; - } -} -} // namespace details -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/src/ie_core.cpp b/src/inference/src/ie_core.cpp deleted file mode 100644 index 3073ae4f65be06..00000000000000 --- a/src/inference/src/ie_core.cpp +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ie_core.hpp" - -#include - -#include -#include -#include -#include -#include - -#include "any_copy.hpp" -#include "cache_guard.hpp" -#include "check_network_batchable.hpp" -#include "cnn_network_ngraph_impl.hpp" -#include "compilation_context.hpp" -#include "cpp/ie_cnn_network.h" -#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" -#include "dev/converter_utils.hpp" -#include "dev/core_impl.hpp" -#include "ie_cache_manager.hpp" -#include "ie_icore.hpp" -#include "ie_network_reader.hpp" -#include "ie_ngraph_utils.hpp" -#include "itt.hpp" -#include "openvino/core/except.hpp" -#include "openvino/core/so_extension.hpp" -#include "openvino/op/parameter.hpp" -#include "openvino/op/result.hpp" -#include "openvino/runtime/compiled_model.hpp" -#include "openvino/runtime/core.hpp" -#include "openvino/runtime/device_id_parser.hpp" -#include "openvino/runtime/threading/executor_manager.hpp" -#include "openvino/util/common_util.hpp" -#include "openvino/util/file_util.hpp" -#include "openvino/util/shared_object.hpp" -#include "openvino/util/xml_parse_utils.hpp" - -using namespace InferenceEngine; -using namespace std::placeholders; - -namespace { - -std::tuple CheckStatic(const InferenceEngine::CNNNetwork& network) { - bool res = true; - std::stringstream errMsg; - auto model = network.getFunction(); - if (model) { - for (const auto& input : model->inputs()) { - if (input.get_partial_shape().is_dynamic()) { - errMsg << "{ input:'"; - for (const auto& name : input.get_names()) { - errMsg << name << ","; - } - if (auto node = input.get_node_shared_ptr()) { - errMsg << node->get_friendly_name(); - } - errMsg << "', shape=" << input.get_partial_shape() << "} "; - res = false; - } - } - } - return {res, errMsg.str()}; -} -} // namespace - -namespace InferenceEngine { - -class Core::Impl : public ov::CoreImpl { -public: - Impl() : ov::CoreImpl(false) {} -}; - -Core::Core(const std::string& xmlConfigFile) { - _impl = std::make_shared(); - - try { - std::string xmlConfigFile_ = ov::find_plugins_xml(xmlConfigFile); - if (!xmlConfigFile_.empty()) - // If XML is default, load default plugins by absolute paths - _impl->register_plugins_in_registry(xmlConfigFile_, xmlConfigFile.empty()); - // Load plugins from pre-compiled list - _impl->register_compile_time_plugins(); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -std::map Core::GetVersions(const std::string& deviceName) const { - return _impl->GetVersions(deviceName); -} - -#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT - -CNNNetwork Core::ReadNetwork(const std::wstring& modelPath, const std::wstring& binPath) const { - try { - return ReadNetwork(ov::util::wstring_to_string(modelPath), ov::util::wstring_to_string(binPath)); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -#endif - -CNNNetwork Core::ReadNetwork(const std::string& modelPath, const std::string& binPath) const { - try { - return _impl->ReadNetwork(modelPath, binPath); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -CNNNetwork Core::ReadNetwork(const std::string& model, const Blob::CPtr& weights) const { - try { - return _impl->ReadNetwork(model, weights); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::LoadNetwork(const CNNNetwork& network, const std::map& config) { - try { - return LoadNetwork(network, ov::DEFAULT_DEVICE_NAME, config); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::LoadNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config) { - auto valid = ::CheckStatic(network); - try { - OPENVINO_ASSERT(std::get<0>(valid), - "InferenceEngine::Core::LoadNetwork doesn't support inputs having dynamic shapes. ", - "Use ov::Core::compile_model API instead. Dynamic inputs are :", - std::get<1>(valid)); - auto exec = _impl->LoadNetwork(network, deviceName, config); - return {exec._ptr, exec._so}; - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::LoadNetwork(const std::string& modelPath, - const std::string& deviceName, - const std::map& config) { - try { - auto exec = _impl->LoadNetwork(modelPath, deviceName, config, [](const CNNNetwork& network) { - auto valid = ::CheckStatic(network); - OPENVINO_ASSERT(std::get<0>(valid), - "InferenceEngine::Core::LoadNetwork doesn't support inputs having dynamic shapes. ", - "Use ov::Core::compile_model API instead. Dynamic inputs are :", - std::get<1>(valid)); - }); - return {exec._ptr, exec._so}; - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::LoadNetwork(const std::string& modelPath, const std::map& config) { - try { - return LoadNetwork(modelPath, ov::DEFAULT_DEVICE_NAME, config); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::ImportNetwork(const std::string& modelFileName, - const std::string& deviceName, - const std::map& config) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::ImportNetwork"); - auto parsed = ov::parseDeviceNameIntoConfig(deviceName, ov::any_copy(config)); - std::ifstream modelStream(modelFileName, std::ios::binary); - if (!modelStream.is_open()) - IE_THROW(NetworkNotRead) << "Model file " << modelFileName << " cannot be opened!"; - try { - auto exec = _impl->get_plugin(parsed._deviceName).import_model(modelStream, parsed._config); - return {ov::legacy_convert::convert_compiled_model(exec), exec._so}; - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::ImportNetwork(std::istream& networkModel, - const std::string& deviceName, - const std::map& config) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::ImportNetwork"); - try { - auto exec = _impl->ImportNetwork(networkModel, deviceName, config); - return {exec._ptr, exec._so}; - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ExecutableNetwork Core::ImportNetwork(std::istream& networkModel) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "Core::ImportNetwork"); - - using ExportMagic = std::array; - constexpr static const ExportMagic exportMagic = {{0x1, 0xE, 0xE, 0x1}}; - - std::string deviceName; - ExportMagic magic = {}; - auto currentPos = networkModel.tellg(); - networkModel.read(magic.data(), magic.size()); - if (exportMagic == magic) { - std::getline(networkModel, deviceName); - } else { - IE_THROW() << "Passed compiled stream does not contain device name. " - "Please, provide device name manually"; - } - networkModel.seekg(currentPos, networkModel.beg); - - try { - auto exec = _impl->get_plugin(deviceName).import_model(networkModel, {}); - return {ov::legacy_convert::convert_compiled_model(exec), exec._so}; - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -QueryNetworkResult Core::QueryNetwork(const CNNNetwork& network, - const std::string& deviceName, - const std::map& config) const { - try { - auto valid = ::CheckStatic(network); - OPENVINO_ASSERT(std::get<0>(valid), - "InferenceEngine::Core::QueryNetwork doesn't support inputs having dynamic shapes. ", - "Use ov::Core::compile_model API instead. Dynamic inputs are :", - std::get<1>(valid)); - - return _impl->QueryNetwork(network, deviceName, config); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -void Core::SetConfig(const std::map& config, const std::string& deviceName) { - // HETERO case - if (deviceName.find("HETERO:") == 0) { - IE_THROW() << "SetConfig is supported only for HETERO itself (without devices). " - "You can configure the devices with SetConfig before creating the HETERO on top."; - } - - // MULTI case - if (deviceName.find("MULTI:") == 0) { - IE_THROW() << "SetConfig is supported only for MULTI itself (without devices). " - "You can configure the devices with SetConfig before creating the MULTI on top."; - } - - // AUTO case - if (deviceName.find("AUTO:") == 0) { - IE_THROW() << "SetConfig is supported only for AUTO itself (without devices). " - "You can configure the devices with SetConfig before creating the AUTO on top."; - } - - ov::AnyMap conf = ov::any_copy(config); - try { - if (deviceName.empty()) { - _impl->set_property_for_device(conf, std::string()); - } else { - _impl->set_property_for_device(conf, deviceName); - } - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ov::Any Core::GetConfig(const std::string& deviceName, const std::string& name) const { - // HETERO case - { - if (deviceName.find("HETERO:") == 0) { - IE_THROW() << "You can only GetConfig of the HETERO itself (without devices). " - "GetConfig is also possible for the individual devices before creating the HETERO on top."; - } - } - // MULTI case - { - if (deviceName.find("MULTI:") == 0) { - IE_THROW() << "You can only GetConfig of the MULTI itself (without devices). " - "GetConfig is also possible for the individual devices before creating the MULTI on top."; - } - } - // AUTO case - { - if (deviceName.find("AUTO:") == 0) { - IE_THROW() << "You can only GetConfig of the AUTO itself (without devices). " - "GetConfig is also possible for the individual devices before creating the AUTO on top."; - } - } - - if (name == ov::force_tbb_terminate.name()) { - return ov::threading::executor_manager()->get_property(ov::force_tbb_terminate.name()).as(); - } - - try { - auto parsed = ov::parseDeviceNameIntoConfig(deviceName); - return _impl->get_plugin(parsed._deviceName).get_property(name, parsed._config); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -ov::Any Core::GetMetric(const std::string& deviceName, const std::string& name, const ov::AnyMap& options) const { - try { - return _impl->GetMetric(deviceName, name, options); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -std::vector Core::GetAvailableDevices() const { - try { - return _impl->GetAvailableDevices(); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -void Core::RegisterPlugin(const std::string& pluginName, const std::string& deviceName) { - try { - _impl->register_plugin(pluginName, deviceName, {}); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -void Core::RegisterPlugins(const std::string& xmlConfigFile) { - try { - _impl->register_plugins_in_registry(xmlConfigFile); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what(); - } -} - -void Core::UnregisterPlugin(const std::string& deviceName_) { - try { - ov::DeviceIDParser parser(deviceName_); - std::string deviceName = parser.get_device_name(); - - _impl->unload_plugin(deviceName); - } catch (const ov::Exception& ex) { - IE_THROW() << ex.what() << std::endl; - } -} - -} // namespace InferenceEngine diff --git a/src/inference/src/ie_data.cpp b/src/inference/src/ie_data.cpp deleted file mode 100644 index 3ce53ce286dbf4..00000000000000 --- a/src/inference/src/ie_data.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include -#include -#include - -#include "blob_factory.hpp" -#include "cnn_network_ngraph_impl.hpp" -#include "ie_api.h" -#include "ie_common.h" - -using namespace InferenceEngine; - -Blob::Ptr Blob::CreateFromData(const DataPtr& data) { - // TODO Here some decision should be made about the layout. - // For now we just pass the layout and use conversion to NCHW for ANY. - InferenceEngine::Layout targetLayout = data->getLayout(); - if (data->getLayout() == InferenceEngine::Layout::ANY) { - targetLayout = InferenceEngine::Layout::NCHW; - } - - InferenceEngine::TensorDesc desc(data->getPrecision(), data->getTensorDesc().getDims(), targetLayout); - - switch (data->getPrecision()) { - case InferenceEngine::Precision::FP32: - return std::make_shared>(desc); - case InferenceEngine::Precision::Q78: - case InferenceEngine::Precision::I16: - case InferenceEngine::Precision::FP16: - return std::make_shared>(desc); - case InferenceEngine::Precision::U8: - return std::make_shared>(desc); - case InferenceEngine::Precision::I8: - return std::make_shared>(desc); - case InferenceEngine::Precision::I32: - return std::make_shared>(desc); - case InferenceEngine::Precision::BF16: - return std::make_shared>(desc); - default: - IE_THROW() << "precision is no set"; - } -} - -namespace InferenceEngine { - -class CNNLayer; - -/** - * @brief A smart pointer to the CNNLayer - */ -using CNNLayerPtr = std::shared_ptr; -/** - * @brief A smart weak pointer to the CNNLayer - */ -using CNNLayerWeakPtr = std::weak_ptr; - -} // namespace InferenceEngine - -class Data::Impl { -public: - /** - * @brief A pointer to the layer that creates this data element, null for input data elements - */ - CNNLayerWeakPtr creatorLayer; - - /** - * @brief A map of layers that use this node as input. - * It is useful for recursive NN graph traversal. - */ - std::map inputTo; - - ov::PartialShape pShape; -}; - -Data::Data(const std::string& name, Precision _precision, Layout layout) - : name(name), - userObject({0}), - tensorDesc(_precision, layout) { - _impl = std::make_shared(); -} - -Data::Data(const std::string& name, const TensorDesc& desc) : name(name), userObject({0}), tensorDesc(desc) { - _impl = std::make_shared(); - _impl->pShape = ov::PartialShape(desc.getDims()); -} - -const Precision& Data::getPrecision() const { - return tensorDesc.getPrecision(); -} - -const TensorDesc& Data::getTensorDesc() const { - return tensorDesc; -} - -bool Data::isInitialized() const { - return !tensorDesc.getDims().empty() || tensorDesc.getLayout() == SCALAR; -} - -void Data::setDims(const SizeVector& a_dims) { - tensorDesc.setDims(a_dims); - _impl->pShape = ov::PartialShape(a_dims); -} - -void Data::setLayout(Layout layout) { - tensorDesc.setLayout(layout); -} - -void Data::reshape(const SizeVector& a_dims, Layout a_layout) { - tensorDesc.reshape(a_dims, a_layout); - _impl->pShape = ov::PartialShape(a_dims); -} - -Data::Data(const Data& data) : name(data.name), userObject(data.userObject), tensorDesc(data.tensorDesc) { - _impl = std::make_shared(); - _impl->creatorLayer = data._impl->creatorLayer; - _impl->inputTo = data._impl->inputTo; - _impl->pShape = data._impl->pShape; -} - -Data& Data::operator=(const Data& data) { - if (this != &data) { - name = data.name; - userObject = data.userObject; - tensorDesc = data.tensorDesc; - - _impl->creatorLayer = data._impl->creatorLayer; - _impl->inputTo = data._impl->inputTo; - _impl->pShape = data._impl->pShape; - } - - return *this; -} - -const std::string& Data::getName() const { - return name; -} - -void Data::setName(const std::string& newName) { - name = newName; -} - -const UserValue& Data::getUserObject() const { - return userObject; -} - -Layout Data::getLayout() const { - return tensorDesc.getLayout(); -} - -void Data::setPrecision(const Precision& precision) { - tensorDesc.setPrecision(precision); -} - -const SizeVector& Data::getDims() const { - if (_impl->pShape.is_dynamic()) - IE_THROW() << "Cannot return dims for Data with dynamic shapes!"; - if (tensorDesc.getDims().empty() && tensorDesc.getLayout() != SCALAR) { - tensorDesc.setDims(_impl->pShape.to_shape()); - } - return tensorDesc.getDims(); -} - -// compatibility - -namespace InferenceEngine { - -INFERENCE_ENGINE_API_CPP(CNNLayerWeakPtr&) getCreatorLayer(const DataPtr& data); -INFERENCE_ENGINE_API_CPP(std::map&) getInputTo(const DataPtr& data); -INFERENCE_ENGINE_API_CPP(std::map&) getInputTo(Data* data); - -CNNLayerWeakPtr& getCreatorLayer(const DataPtr& data) { - return data->_impl->creatorLayer; -} - -std::map& getInputTo(const DataPtr& data) { - return data->_impl->inputTo; -} - -std::map& getInputTo(Data* data) { - return data->_impl->inputTo; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/ie_layouts.cpp b/src/inference/src/ie_layouts.cpp deleted file mode 100644 index 6c2543b36056be..00000000000000 --- a/src/inference/src/ie_layouts.cpp +++ /dev/null @@ -1,539 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ie_layouts.h" - -#include -#include - -using namespace InferenceEngine; -IE_SUPPRESS_DEPRECATED_START - -TensorDesc::TensorDesc(const Precision& precision, const SizeVector& dims, Layout layout) - : precision(precision), - blockingDesc(dims, layout) { - this->dims = dims; - this->layout = layout; -} - -TensorDesc::TensorDesc(const Precision& precision, Layout layout) : precision(precision), blockingDesc() { - this->layout = layout; -} - -TensorDesc::TensorDesc(const Precision& precision, const SizeVector& dims, const BlockingDesc& blockDesc) - : dims(dims), - precision(precision), - blockingDesc(blockDesc) { - if (dims.size() == 0 || blockingDesc.getBlockDims().size() == 0) { - layout = Layout::SCALAR; - return; - } - if (dims.size() != *std::max_element(blockDesc.getOrder().begin(), blockDesc.getOrder().end()) + 1) - IE_THROW() << "Cannot create TensorDesc! Blocked dims are inconsistent with original dims."; - - layout = Layout::BLOCKED; - if (dims.size() == blockingDesc.getBlockDims().size()) { - switch (dims.size()) { - case 1: - layout = Layout::C; - break; - case 2: - if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 1) - layout = Layout::NC; - else - layout = Layout::CN; - break; - case 3: - if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 1 && blockingDesc.getOrder()[2] == 2) { - layout = Layout::CHW; - } else if (blockingDesc.getOrder()[0] == 1 && blockingDesc.getOrder()[1] == 2 && - blockingDesc.getOrder()[2] == 0) { - layout = Layout::HWC; - } - break; - case 4: - if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 1 && blockingDesc.getOrder()[2] == 2 && - blockingDesc.getOrder()[3] == 3) { - layout = Layout::NCHW; - } else if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 2 && - blockingDesc.getOrder()[2] == 3 && blockingDesc.getOrder()[3] == 1) { - layout = Layout::NHWC; - } - break; - case 5: - if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 1 && blockingDesc.getOrder()[2] == 2 && - blockingDesc.getOrder()[3] == 3 && blockingDesc.getOrder()[4] == 4) { - layout = Layout::NCDHW; - } else if (blockingDesc.getOrder()[0] == 0 && blockingDesc.getOrder()[1] == 2 && - blockingDesc.getOrder()[2] == 3 && blockingDesc.getOrder()[3] == 4 && - blockingDesc.getOrder()[4] == 1) { - layout = Layout::NDHWC; - } - break; - default: - break; - } - } -} - -TensorDesc::TensorDesc() { - this->layout = Layout::ANY; - precision = Precision::UNSPECIFIED; -} - -void TensorDesc::setDims(const SizeVector& dims) { - if (layout == Layout::BLOCKED) { - auto newOrder = blockingDesc.getOrder(); - auto oldDims = blockingDesc.getBlockDims(); - - // {0} shape is fully dynamic shape with default (BLOCKED) layout, order is dummy - if (oldDims.size() == 1 && oldDims[0] == 0) - newOrder.resize(0); - - if (newOrder.empty()) { - for (size_t i = 0; i < dims.size(); i++) { - newOrder.push_back(i); - } - } - blockingDesc = BlockingDesc(dims, newOrder); - } else { - if (layout == Layout::SCALAR && (dims.size() > 1 || (dims.size() == 1 && dims[0] != 1))) - IE_THROW() << "Cannot set dimensions for SCALAR layout!"; - blockingDesc = BlockingDesc(dims, layout); - } - if (layout != Layout::SCALAR) - this->dims = dims; -} - -void TensorDesc::setLayout(Layout l) { - bool inconsistentLayout = true; - - switch (l) { - case Layout::SCALAR: - inconsistentLayout = !dims.empty(); - break; - case Layout::C: - inconsistentLayout = dims.size() != 1; - break; - case Layout::BLOCKED: - case Layout::ANY: - inconsistentLayout = false; - break; - case Layout::GOIDHW: - inconsistentLayout = dims.size() != 6; - break; - case Layout::NCDHW: - case Layout::NDHWC: - case Layout::OIDHW: - case Layout::GOIHW: - inconsistentLayout = dims.size() != 5; - break; - case Layout::OIHW: - case Layout::NCHW: - case Layout::NHWC: - inconsistentLayout = dims.size() != 4; - break; - case Layout::CHW: - case Layout::HWC: - inconsistentLayout = dims.size() != 3; - break; - case Layout::CN: - case Layout::NC: - case Layout::HW: - inconsistentLayout = dims.size() != 2; - break; - default: - break; - } - - if (inconsistentLayout) { - IE_THROW() << "Size of dims(" << std::to_string(dims.size()) << ") and format(" << l << ") are inconsistent."; - } - - // HACK: we need to update BlockingDesc after layout change, but if it was set manually not sure how to di this - // properly - const bool hasDefaultBlockingDesc = blockingDesc == BlockingDesc(dims, layout); - - layout = l; - - if (hasDefaultBlockingDesc) { - blockingDesc = BlockingDesc(dims, layout); - } -} - -bool TensorDesc::operator==(const TensorDesc& rhs) const { - return blockingDesc == rhs.blockingDesc && precision == rhs.precision && layout == rhs.layout && dims == rhs.dims; -} - -bool TensorDesc::operator!=(const TensorDesc& rhs) const { - return !(*this == rhs); -} - -Layout TensorDesc::getLayoutByRank(size_t rank) { - switch (rank) { - case 0: - return Layout::SCALAR; - case 1: - return Layout::C; - case 2: - return Layout::NC; - case 3: - return Layout::CHW; - case 4: - return Layout::NCHW; - case 5: - return Layout::NCDHW; - default: - return Layout::BLOCKED; - } -} - -Layout TensorDesc::getLayoutByDims(const SizeVector& dims) { - // {0} shape is fully dynamic shape with default (BLOCKED) layout - if (dims.size() == 1 && dims[0] == 0) - return Layout::BLOCKED; - - return getLayoutByRank(dims.size()); -} - -size_t TensorDesc::offset(const SizeVector& v) const { - if (layout == Layout::ANY) - IE_THROW() << "Cannot calculate offset for any format!"; - - if (layout == Layout::SCALAR) - return blockingDesc.getOffsetPadding(); - - SizeVector off_v = v; - const SizeVector& blockedDims = blockingDesc.getBlockDims(); - const SizeVector& strides = blockingDesc.getStrides(); - const SizeVector& order = blockingDesc.getOrder(); - - size_t n_blocked_dims = order.size(); - if (blockedDims.size() != n_blocked_dims || strides.size() != n_blocked_dims) { - IE_THROW() << "Cannot calculate offset. Incorrect primitive descriptor!"; - } - SizeVector blockedShift(n_blocked_dims); - for (size_t i = 1; i <= n_blocked_dims; i++) { - blockedShift[n_blocked_dims - i] = off_v[order[n_blocked_dims - i]] % blockedDims[n_blocked_dims - i]; - off_v[order[n_blocked_dims - i]] /= blockedDims[n_blocked_dims - i]; - } - size_t offset = blockingDesc.getOffsetPadding(); - for (size_t d = 0; d < n_blocked_dims; ++d) { - const size_t p = blockedShift[d] + blockingDesc.getOffsetPaddingToData()[d]; - offset += p * strides[d]; - } - return offset; -} - -size_t TensorDesc::offset(size_t l) const { - size_t n_dims = dims.size(); - SizeVector pos(n_dims); - for (size_t rd = 1; rd <= n_dims; ++rd) { - const size_t d = n_dims - rd; - const size_t cur_dim = dims[d]; - pos[d] = l % cur_dim; - l /= cur_dim; - } - return offset(pos); -} - -void TensorDesc::reshape(const SizeVector& dims, Layout layout) { - for (auto& padd : blockingDesc.getOffsetPaddingToData()) { - if (padd) - IE_THROW() << "Cannot reshape a non-packaged blob!"; - } - if (layout != Layout::ANY) { - blockingDesc = BlockingDesc(dims, layout); - this->layout = layout; - } else { - blockingDesc = BlockingDesc(dims, this->layout); - } - this->dims = dims; -} - -void TensorDesc::reshape(const SizeVector& dims, const BlockingDesc& blockDesc) { - blockingDesc = blockDesc; - this->dims = dims; - this->layout = Layout::BLOCKED; -} - -BlockingDesc::BlockingDesc(const SizeVector& block_dims, const SizeVector& order) : offsetPadding(0) { - this->order = order; - if (block_dims.empty() || order.empty()) - return; - fillDesc(block_dims, order); -} - -BlockingDesc::BlockingDesc() : BlockingDesc({}, Layout::ANY) {} - -BlockingDesc::BlockingDesc(const SizeVector& blocked_dims, const SizeVector& order, size_t offset) - : BlockingDesc(blocked_dims, order) { - this->offsetPadding = offset; -} - -BlockingDesc::BlockingDesc(const SizeVector& blocked_dims, - const SizeVector& order, - size_t offset, - const SizeVector& dimOffsets) - : BlockingDesc(blocked_dims, order) { - this->offsetPadding = offset; - if (blocked_dims.size() != dimOffsets.size()) - IE_THROW() << "Offsets are not initialized for all dimensions."; - this->offsetPaddingToData = dimOffsets; -} - -BlockingDesc::BlockingDesc(const SizeVector& blocked_dims, - const SizeVector& order, - size_t offset, - const SizeVector& dimOffsets, - const SizeVector& strides) - : BlockingDesc(blocked_dims, order) { - this->offsetPadding = offset; - if (blocked_dims.size() != strides.size()) - IE_THROW() << "Strides are not initialized for all dimensions."; - this->strides = strides; - if (blocked_dims.size() != dimOffsets.size()) - IE_THROW() << "Offsets are not initialized for all dimensions."; - this->offsetPaddingToData = dimOffsets; - - // check that strides are valid - if (!std::any_of(blocked_dims.begin(), blocked_dims.end(), [](const size_t dim) { - return dim == 0ul; - })) { - size_t denseStride = 1; - - for (size_t i = 1; i <= strides.size(); i++) { - if (denseStride > strides[strides.size() - i]) { - IE_THROW() << "Stride in " << (strides.size() - i) - << "-th dimension " - "is not valid; actual " - << strides[strides.size() - i] << ", should be >= " << denseStride << std::endl; - } - denseStride = std::max(strides[strides.size() - i], denseStride) * blocked_dims[blocked_dims.size() - i]; - } - } -} - -BlockingDesc::BlockingDesc(const SizeVector& dims, Layout layout) : offsetPadding(0) { - if (dims.empty()) - return; - - offsetPadding = 0; - auto checkDims = [](size_t r_size, size_t e_size) { - if (r_size != e_size) - IE_THROW() << "Dims and format are inconsistent."; - }; - SizeVector l_order; - SizeVector l_dims; - switch (layout) { - case Layout::SCALAR: - case Layout::ANY: - return; - case Layout::C: - checkDims(dims.size(), 1); - l_order = {0}; - l_dims = dims; - break; - case Layout::OIHW: - case Layout::NCHW: - checkDims(dims.size(), 4); - l_order = {0, 1, 2, 3}; - l_dims = dims; - break; - case Layout::OIDHW: - case Layout::GOIHW: - case Layout::NCDHW: - checkDims(dims.size(), 5); - l_order = {0, 1, 2, 3, 4}; - l_dims = dims; - break; - case Layout::GOIDHW: - checkDims(dims.size(), 6); - l_order = {0, 1, 2, 3, 4, 5}; - l_dims = dims; - break; - case Layout::NHWC: - checkDims(dims.size(), 4); - l_order = {0, 2, 3, 1}; - l_dims = {dims[0], dims[2], dims[3], dims[1]}; - break; - case Layout::NDHWC: - checkDims(dims.size(), 5); - l_order = {0, 2, 3, 4, 1}; - l_dims = {dims[0], dims[2], dims[3], dims[4], dims[1]}; - break; - case Layout::CHW: - checkDims(dims.size(), 3); - l_order = {0, 1, 2}; - l_dims = dims; - break; - case Layout::HWC: - checkDims(dims.size(), 3); - l_order = {1, 2, 0}; - l_dims = {dims[1], dims[2], dims[0]}; - break; - case Layout::CN: - checkDims(dims.size(), 2); - l_order = {1, 0}; - l_dims = {dims[1], dims[0]}; - break; - case Layout::NC: - case Layout::HW: - checkDims(dims.size(), 2); - l_order = {0, 1}; - l_dims = dims; - break; - case Layout::BLOCKED: - l_order.clear(); - for (size_t i = 0; i < dims.size(); i++) - l_order.push_back(i); - l_dims = dims; - break; - } - - fillDesc(l_dims, l_order); -} - -void BlockingDesc::fillDesc(const SizeVector& blocked_dims, const SizeVector& order) { - if (order.size() != blocked_dims.size()) - IE_THROW() << "Cannot fill descriptor. Size of dimensions (" << blocked_dims.size() << ") and order (" - << order.size() << ") vector don't match."; - if (blocked_dims.empty() || order.empty()) - IE_THROW() << "Cannot fill descriptor. Dimensions and order vector are empty."; - this->order = order; - this->blockedDims = blocked_dims; - offsetPadding = 0; - offsetPaddingToData.resize(order.size()); - strides.resize(order.size()); - strides[strides.size() - 1] = 1; - offsetPaddingToData[offsetPaddingToData.size() - 1] = 0; - for (size_t i = 2; i <= order.size(); i++) { - offsetPaddingToData[offsetPaddingToData.size() - i] = 0; - strides[strides.size() - i] = strides[strides.size() - (i - 1)] * blocked_dims[blocked_dims.size() - (i - 1)]; - } - - offsetPadding = 0; -} - -bool BlockingDesc::operator==(const BlockingDesc& rhs) const { - return blockedDims == rhs.blockedDims && strides == rhs.strides && offsetPaddingToData == rhs.offsetPaddingToData && - order == rhs.order && offsetPadding == rhs.offsetPadding; -} - -bool BlockingDesc::operator!=(const BlockingDesc& rhs) const { - return !(*this == rhs); -} - -namespace { - -struct DimSlice { - size_t startInd = 0; - size_t size = 0; - - DimSlice() = default; - - DimSlice(size_t startInd, size_t size) : startInd(startInd), size(size) {} -}; - -using TensorSlice = std::vector; - -void checkROI(const TensorDesc& origDesc, const TensorSlice& roi) { - const auto numDims = origDesc.getDims().size(); - - if (roi.size() != numDims) { - IE_THROW() << "ROI num dims " << roi.size() << " differs from original num dims " << numDims; - } - - // TensorDesc stores dimensions in standard layout, as well as roi vector - for (size_t dimInd = 0; dimInd < numDims; ++dimInd) { - const auto fullSize = origDesc.getDims()[dimInd]; - - const auto& roiSlice = roi[dimInd]; - const auto endInd = roiSlice.startInd + roiSlice.size; - - if (endInd > fullSize) { - IE_THROW() << "ROI [" << roiSlice.startInd << ", " << endInd << ")" - << " is out of range " << fullSize << " for dimension " << dimInd; - } - } -} - -TensorDesc make_roi_desc(const TensorDesc& origDesc, const TensorSlice& roi, bool useOrigMemDesc) { - const auto numDims = origDesc.getDims().size(); - - checkROI(origDesc, roi); - - const auto origPrecision = origDesc.getPrecision(); - - const auto& origBlkDesc = origDesc.getBlockingDesc(); - const auto& origBlkStrides = origBlkDesc.getStrides(); - const auto& origBlkOrder = origBlkDesc.getOrder(); - - SizeVector roiDims(numDims); - SizeVector roiBlkDims(numDims); - SizeVector roiBlkDimOffsets = origBlkDesc.getOffsetPaddingToData(); - size_t roiBlkOffset = origBlkDesc.getOffsetPadding(); - - IE_ASSERT(origBlkStrides.size() == numDims); - IE_ASSERT(origBlkOrder.size() == numDims); - IE_ASSERT(roiBlkDimOffsets.size() == numDims); - - // BlockingDesc stores dimensions in memory order, so we need to use origOrder array. - // Offsets in `roi` relates to `origDesc` dimensions, while offsets in `BlockingDesc` relates to top parent tensor - // dimensions. - for (size_t memInd = 0; memInd < numDims; ++memInd) { - const auto dimInd = origBlkOrder[memInd]; - const auto& roiSlice = roi[dimInd]; - - roiDims[dimInd] = roiSlice.size; - roiBlkDims[memInd] = roiSlice.size; - roiBlkDimOffsets[memInd] += roiSlice.startInd; - roiBlkOffset += roiSlice.startInd * origBlkStrides[memInd]; - } - - const auto roiBlkDesc = useOrigMemDesc - ? BlockingDesc(roiBlkDims, origBlkOrder, roiBlkOffset, roiBlkDimOffsets, origBlkStrides) - : BlockingDesc(roiBlkDims, origBlkOrder); - - const auto roiDesc = TensorDesc(origPrecision, roiDims, roiBlkDesc); - - return roiDesc; -} - -TensorSlice make_roi_slice(const TensorDesc& origDesc, const ROI& roi) { - const auto layout = origDesc.getLayout(); - if (layout != Layout::NCHW && layout != Layout::NHWC) { - IE_THROW() << "Unsupported layout " << layout; - } - - TensorSlice roiSlice(4); - roiSlice[0] = DimSlice{roi.id, 1}; // N - roiSlice[1] = DimSlice{0, origDesc.getDims()[1]}; // C - roiSlice[2] = DimSlice{roi.posY, roi.sizeY}; // H - roiSlice[3] = DimSlice{roi.posX, roi.sizeX}; // W - - return roiSlice; -} - -} // namespace - -TensorDesc InferenceEngine::make_roi_desc(const TensorDesc& origDesc, const ROI& roi, bool useOrigMemDesc) { - return make_roi_desc(origDesc, make_roi_slice(origDesc, roi), useOrigMemDesc); -} - -TensorDesc InferenceEngine::make_roi_desc(const TensorDesc& origDesc, - const std::vector& begin, - const std::vector& end, - bool useOrigMemDesc) { - if (begin.size() != end.size()) { - IE_THROW() << "`begin` vector size must match `end` vector size"; - } - TensorSlice slice; - for (size_t i = 0; i < begin.size(); ++i) { - IE_ASSERT(end[i] >= begin[i]); - slice.emplace_back(begin[i], end[i] - begin[i]); - } - return make_roi_desc(origDesc, slice, useOrigMemDesc); -} -IE_SUPPRESS_DEPRECATED_END diff --git a/src/inference/src/ie_network_reader.cpp b/src/inference/src/ie_network_reader.cpp deleted file mode 100644 index 9858dc01677740..00000000000000 --- a/src/inference/src/ie_network_reader.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ie_network_reader.hpp" - -#include -#include -#include -#include -#include -#include - -#include "cnn_network_ngraph_impl.hpp" -#include "cpp/ie_cnn_network.h" -#include "dev/converter_utils.hpp" -#include "ie_api.h" -#include "ie_common.h" -#include "ie_icnn_network.hpp" -#include "ie_input_info.hpp" -#include "itt.hpp" -#include "openvino/core/deprecated.hpp" -#include "openvino/core/except.hpp" -#include "openvino/core/preprocess/pre_post_process.hpp" -#include "openvino/core/type/element_type.hpp" -#include "openvino/frontend/manager.hpp" -#include "openvino/runtime/shared_buffer.hpp" -#include "openvino/runtime/so_ptr.hpp" -#include "openvino/util/file_util.hpp" -#include "openvino/util/shared_object.hpp" -#include "transformations/rt_info/old_api_map_order_attribute.hpp" -#include "transformations/utils/utils.hpp" - -namespace InferenceEngine { - -namespace { -CNNNetwork convert_to_cnnnetwork(std::shared_ptr& function, bool is_new_api, bool frontendMode = false) { - // only for IR cases we need preprocessing or postprocessing steps - if (function->has_rt_info("version") && function->get_rt_info("version") == 11 && !is_new_api) { - IR_READER_SCOPE(ir11_old_api); - ov::preprocess::PrePostProcessor prepost(function); - - const std::string& old_api_map_key_order = ov::OldApiMapOrder::get_type_info_static(); - const std::string& old_api_map_key_type = ov::OldApiMapElementType::get_type_info_static(); - - bool need_validate_nodes_and_infer_types = false; - auto& parameters = function->get_parameters(); - for (size_t i = 0; i < parameters.size(); ++i) { - const auto& parameter = parameters[i]; - ov::RTMap& rtInfo = parameter->get_rt_info(); - const auto it_type = rtInfo.find(old_api_map_key_type); - auto& pre_input = prepost.input(i); - if (it_type != rtInfo.end()) { - const auto old_api_map_type = it_type->second.as().value; - const auto param_type = parameter->get_element_type(); - - // In the following code we add Convert node from old_api_map_type to Parameter type - // using PrePostProcessor. As some plugins do not support uint8 type, Convert to uint8 leads - // to error, so for such case type is set directly to Parameter node instead of inserting Convert. - if ((param_type == ov::element::u8 && old_api_map_type.is_real())) { - parameter->set_element_type(old_api_map_type); - need_validate_nodes_and_infer_types = true; - } else { - pre_input.tensor().set_element_type(old_api_map_type); - } - - OPENVINO_ASSERT(!old_api_map_type.is_dynamic(), "Old API map does not support dynamic type"); - rtInfo.erase(it_type); - } - const auto it_order = rtInfo.find(old_api_map_key_order); - if (it_order != rtInfo.end()) { - const auto order = it_order->second.as().value; - pre_input.preprocess().convert_layout(order); - rtInfo.erase(it_order); - } - } - - auto& results = function->get_results(); - for (size_t i = 0; i < results.size(); ++i) { - const auto& result = results[i]; - ov::RTMap& rtInfo = result->get_rt_info(); - const auto it = rtInfo.find(old_api_map_key_order); - if (it == rtInfo.end()) - continue; - - const auto order = it->second.as().value; - auto& post_output = prepost.output(i); - post_output.postprocess().convert_layout(order); - - // remove old api once we applied it - rtInfo.erase(it); - } - - if (need_validate_nodes_and_infer_types) - function->validate_nodes_and_infer_types(); - - // Set version to 10 - function->set_rt_info(10, "version"); - - function = prepost.build(); - } - - OPENVINO_SUPPRESS_DEPRECATED_START - return CNNNetwork(std::make_shared(function, is_new_api)); - OPENVINO_SUPPRESS_DEPRECATED_END -} - -} // namespace - -CNNNetwork details::ReadNetwork(const std::string& modelPath, - const std::string& binPath, - const std::vector& ov_exts, - bool is_new_api, - bool enable_mmap) { - // Fix unicode name -#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) - std::wstring model_path = ov::util::string_to_wstring(modelPath.c_str()); -#else - std::string model_path = modelPath; -#endif - - // Try to load with FrontEndManager - ov::frontend::FrontEndManager manager; - ov::frontend::FrontEnd::Ptr FE; - ov::frontend::InputModel::Ptr inputModel; - - ov::AnyVector params{model_path}; - - if (!binPath.empty()) { -#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) - const std::wstring& weights_path = ov::util::string_to_wstring(binPath.c_str()); -#else - const std::string& weights_path = binPath; -#endif - params.emplace_back(weights_path); - } - params.emplace_back(enable_mmap); - - FE = manager.load_by_model(params); - if (FE) { - FE->add_extension(ov_exts); - inputModel = FE->load(params); - } - - if (inputModel) { - auto ngFunc = FE->convert(inputModel); - return convert_to_cnnnetwork(ngFunc, is_new_api); - } - - const auto fileExt = modelPath.substr(modelPath.find_last_of(".") + 1); - std::string FEs; - for (const auto& fe_name : manager.get_available_front_ends()) - FEs += fe_name + " "; - IE_THROW(NetworkNotRead) << "Unable to read the model: " << modelPath - << " Please check that model format: " << fileExt - << " is supported and the model is correct." - << " Available frontends: " << FEs; -} - -CNNNetwork details::ReadNetwork(const std::string& model, - const Blob::CPtr& weights, - const std::vector& ov_exts, - bool is_new_api, - bool frontendMode) { - std::istringstream modelStringStream(model); - std::istream& modelStream = modelStringStream; - - // Try to load with FrontEndManager - ov::frontend::FrontEndManager manager; - ov::frontend::FrontEnd::Ptr FE; - ov::frontend::InputModel::Ptr inputModel; - - ov::AnyVector params{&modelStream}; - if (weights) { - char* data = weights->cbuffer().as(); - std::shared_ptr weights_buffer = - std::make_shared>(data, weights->byteSize(), weights); - params.emplace_back(weights_buffer); - } - - FE = manager.load_by_model(params); - if (FE) { - FE->add_extension(ov_exts); - inputModel = FE->load(params); - } - if (inputModel) { - auto ngFunc = FE->convert(inputModel); - return convert_to_cnnnetwork(ngFunc, is_new_api, frontendMode); - } - - IE_THROW(NetworkNotRead) - << "Unable to read the model. Please check if the model format is supported and model is correct."; -} - -} // namespace InferenceEngine diff --git a/src/inference/src/ie_network_reader.hpp b/src/inference/src/ie_network_reader.hpp deleted file mode 100644 index 062ea26ac6f235..00000000000000 --- a/src/inference/src/ie_network_reader.hpp +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include - -#include "cpp/ie_cnn_network.h" -#include "ie_blob.h" -#include "openvino/core/extension.hpp" - -namespace InferenceEngine { -namespace details { - -/** - * @brief Reads IR xml and bin files - * @param modelPath path to IR file - * @param binPath path to bin file, if path is empty, will try to read bin file with the same name as xml and - * if bin file with the same name was not found, will load IR without weights. - * @param ov_exts vector with OpenVINO extensions - * @param enable_mmap boolean to enable/disable `mmap` use in Frontend - * @return CNNNetwork - */ -CNNNetwork ReadNetwork(const std::string& modelPath, - const std::string& binPath, - const std::vector& ov_exts, - bool is_new_api, - bool enable_mmap); -/** - * @brief Reads IR xml and bin (with the same name) files - * @param model string with IR - * @param weights shared pointer to constant blob with weights - * @param ov_exts vector with OpenVINO extensions - * @param frontendMode read network without post-processing or other transformations - * @return CNNNetwork - */ -CNNNetwork ReadNetwork(const std::string& model, - const Blob::CPtr& weights, - const std::vector& ov_exts, - bool is_new_api, - bool frontendMode = false); - -} // namespace details -} // namespace InferenceEngine diff --git a/src/inference/src/ie_ngraph_utils.cpp b/src/inference/src/ie_ngraph_utils.cpp deleted file mode 100644 index 1b30258fb6e06c..00000000000000 --- a/src/inference/src/ie_ngraph_utils.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "ie_ngraph_utils.hpp" - -#include "cnn_network_ngraph_impl.hpp" -#include "itt.hpp" - -namespace InferenceEngine { -namespace details { - -CNNNetwork cloneNetwork(const CNNNetwork& network) { - OV_ITT_SCOPED_TASK(ov::itt::domains::OV, "cloneNetwork"); - - if (network.getFunction()) { - IE_SUPPRESS_DEPRECATED_START - return CNNNetwork(std::make_shared(network)); - IE_SUPPRESS_DEPRECATED_END - } - - IE_THROW() << "InferenceEngine::details::cloneNetwork requires ngraph-based `network` object to clone"; -} - -} // namespace details -} // namespace InferenceEngine diff --git a/src/inference/src/infer_request.cpp b/src/inference/src/infer_request.cpp index 19954729400f68..18ee94904027e1 100644 --- a/src/inference/src/infer_request.cpp +++ b/src/inference/src/infer_request.cpp @@ -8,7 +8,6 @@ #include #include -#include "ie_common.h" #include "openvino/core/except.hpp" #include "openvino/core/node.hpp" #include "openvino/runtime/compiled_model.hpp" @@ -28,8 +27,6 @@ OPENVINO_SUPPRESS_DEPRECATED_START OPENVINO_SUPPRESS_DEPRECATED_START \ try { \ __VA_ARGS__; \ - } catch (const ::InferenceEngine::RequestBusy& ex) { \ - ov::Busy::create(ex.what()); \ } catch (const ov::Busy&) { \ throw; \ } catch (const ov::Cancelled&) { \ @@ -252,8 +249,6 @@ void InferRequest::wait() { _impl->wait(); } catch (const ov::Cancelled&) { throw; - } catch (const InferenceEngine::InferCancelled& e) { - Cancelled::create(e.what()); } catch (const std::exception& ex) { OPENVINO_THROW(ex.what()); } catch (...) { @@ -267,8 +262,8 @@ bool InferRequest::wait_for(const std::chrono::milliseconds timeout) { OPENVINO_SUPPRESS_DEPRECATED_START try { return _impl->wait_for(timeout); - } catch (const InferenceEngine::InferCancelled& e) { - Cancelled::create(e.what()); + } catch (const ov::Cancelled&) { + throw; } catch (const std::exception& ex) { OPENVINO_THROW(ex.what()); } catch (...) { diff --git a/src/inference/src/model_reader.cpp b/src/inference/src/model_reader.cpp index bc67f6d21b225a..2b3110720a0dad 100644 --- a/src/inference/src/model_reader.cpp +++ b/src/inference/src/model_reader.cpp @@ -4,7 +4,6 @@ #include "model_reader.hpp" -#include "cnn_network_ngraph_impl.hpp" #include "itt.hpp" #include "openvino/core/model.hpp" #include "openvino/core/preprocess/pre_post_process.hpp" @@ -15,6 +14,20 @@ #include "transformations/utils/utils.hpp" namespace { +ov::element::Type to_legacy_type(const ov::element::Type& legacy_type, bool input) { + if (input) { + return legacy_type == ov::element::f16 ? ov::element::f32 : legacy_type; + } else { + if (legacy_type == ov::element::i64 || legacy_type == ov::element::u64 || legacy_type == ov::element::i32 || + legacy_type == ov::element::u32) { + return ov::element::i32; + } else if (legacy_type != ov::element::f32) { + return ov::element::f32; + } + } + + return legacy_type; +} void update_v10_model(std::shared_ptr& model, bool frontendMode = false) { // only for IR cases we need preprocessing or postprocessing steps @@ -27,7 +40,7 @@ void update_v10_model(std::shared_ptr& model, bool frontendMode = fal for (size_t i = 0; i < inputs.size(); ++i) { if (!frontendMode) { const auto ov_type = inputs[i].get_element_type(); - const auto legacy_type = InferenceEngine::details::toLegacyType(ov_type, true); + const auto legacy_type = to_legacy_type(ov_type, true); prepost.input(i).tensor().set_element_type(legacy_type); } for (const auto& name : inputs[i].get_names()) { @@ -42,7 +55,7 @@ void update_v10_model(std::shared_ptr& model, bool frontendMode = fal for (size_t i = 0; i < outputs.size(); ++i) { if (!frontendMode) { const auto ov_type = outputs[i].get_element_type(); - const auto legacy_type = InferenceEngine::details::toLegacyType(ov_type, false); + const auto legacy_type = to_legacy_type(ov_type, false); prepost.output(i).tensor().set_element_type(legacy_type); } for (const auto& name : outputs[i].get_names()) { diff --git a/src/inference/src/openvino_shutdown.cpp b/src/inference/src/openvino_shutdown.cpp index 8096351bd0f2b7..c46f41a7fcc5f9 100644 --- a/src/inference/src/openvino_shutdown.cpp +++ b/src/inference/src/openvino_shutdown.cpp @@ -2,14 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "ie_core.hpp" #include "openvino/frontend/manager.hpp" #include "openvino/runtime/core.hpp" void ov::shutdown() { frontend::FrontEndManager::shutdown(); } - -void InferenceEngine::shutdown() { - ov::shutdown(); -} diff --git a/src/inference/src/os/lin/lin_system_conf.cpp b/src/inference/src/os/lin/lin_system_conf.cpp index 988fdab3baeba5..e322eb6d3b34c9 100644 --- a/src/inference/src/os/lin/lin_system_conf.cpp +++ b/src/inference/src/os/lin/lin_system_conf.cpp @@ -12,7 +12,6 @@ #include #include "dev/threading/parallel_custom_arena.hpp" -#include "ie_common.h" #include "openvino/core/except.hpp" #include "openvino/runtime/system_conf.hpp" #include "openvino/util/log.hpp" diff --git a/src/inference/src/system_allocator.cpp b/src/inference/src/system_allocator.cpp deleted file mode 100644 index a820893e4f049b..00000000000000 --- a/src/inference/src/system_allocator.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "system_allocator.hpp" - -namespace InferenceEngine { -IE_SUPPRESS_DEPRECATED_START - -INFERENCE_ENGINE_API_CPP(std::shared_ptr) CreateDefaultAllocator() noexcept { - try { - return std::make_shared(); - } catch (...) { - return nullptr; - } -} - -} // namespace InferenceEngine diff --git a/src/inference/src/system_allocator.hpp b/src/inference/src/system_allocator.hpp deleted file mode 100644 index 606cccf68e8cfb..00000000000000 --- a/src/inference/src/system_allocator.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include "ie_allocator.hpp" - -IE_SUPPRESS_DEPRECATED_START -namespace InferenceEngine { -class SystemMemoryAllocator : public InferenceEngine::IAllocator { -public: - void* lock(void* handle, InferenceEngine::LockOp = InferenceEngine::LOCK_FOR_WRITE) noexcept override { - return handle; - } - - void unlock(void* a) noexcept override {} - - void* alloc(size_t size) noexcept override { - try { - auto handle = reinterpret_cast(new char[size]); - return handle; - } catch (...) { - return nullptr; - } - } - - bool free(void* handle) noexcept override { - try { - delete[] reinterpret_cast(handle); - } catch (...) { - } - return true; - } -}; -IE_SUPPRESS_DEPRECATED_END - -} // namespace InferenceEngine diff --git a/src/inference/tests/functional/matmul_sr_tests.cpp b/src/inference/tests/functional/matmul_sr_tests.cpp index 9e073ed17185c4..21e9a02fad5528 100644 --- a/src/inference/tests/functional/matmul_sr_tests.cpp +++ b/src/inference/tests/functional/matmul_sr_tests.cpp @@ -8,7 +8,6 @@ #include #include -#include "cnn_network_ngraph_impl.hpp" #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/ov_test_utils.hpp" #include "common_test_utils/test_common.hpp" diff --git a/src/inference/tests/functional/ov_infer_request_test.cpp b/src/inference/tests/functional/ov_infer_request_test.cpp index 935b056b2fef7e..8a63a30912ef02 100644 --- a/src/inference/tests/functional/ov_infer_request_test.cpp +++ b/src/inference/tests/functional/ov_infer_request_test.cpp @@ -4,7 +4,6 @@ #include -#include #include #include #include diff --git a/src/inference/tests/functional/ov_remote_tensor.cpp b/src/inference/tests/functional/ov_remote_tensor.cpp index 512109589abbed..5bcaf57915a83a 100644 --- a/src/inference/tests/functional/ov_remote_tensor.cpp +++ b/src/inference/tests/functional/ov_remote_tensor.cpp @@ -4,7 +4,6 @@ #include -#include #include using namespace ::testing; diff --git a/src/inference/tests/functional/ov_shared_object_test.cpp b/src/inference/tests/functional/ov_shared_object_test.cpp index 424adb88cddcbc..85d438250337c8 100644 --- a/src/inference/tests/functional/ov_shared_object_test.cpp +++ b/src/inference/tests/functional/ov_shared_object_test.cpp @@ -7,7 +7,7 @@ #include #include "common_test_utils/file_utils.hpp" -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" +#include "openvino/runtime/iplugin.hpp" #include "openvino/util/shared_object.hpp" using namespace ::testing; @@ -25,7 +25,7 @@ class SharedObjectOVTests : public ::testing::Test { } std::shared_ptr shared_object; - using CreateF = void(std::shared_ptr&); + using CreateF = void(std::shared_ptr&); std::function make_std_function(const std::string& functionName) { std::function ptr( @@ -46,7 +46,7 @@ TEST_F(SharedObjectOVTests, loaderThrowsIfNoPlugin) { TEST_F(SharedObjectOVTests, canFindExistedMethod) { loadDll(get_mock_engine_name()); - auto factory = make_std_function("CreatePluginEngine"); + auto factory = make_std_function(ov::create_plugin_function); EXPECT_NE(nullptr, factory); } @@ -58,7 +58,7 @@ TEST_F(SharedObjectOVTests, throwIfMethodNofFoundInLibrary) { TEST_F(SharedObjectOVTests, canCallExistedMethod) { loadDll(get_mock_engine_name()); - auto factory = make_std_function("CreatePluginEngine"); - std::shared_ptr ptr; + auto factory = make_std_function(ov::create_plugin_function); + std::shared_ptr ptr; EXPECT_NO_THROW(factory(ptr)); } diff --git a/src/inference/tests/unit/compilation_context_test.cpp b/src/inference/tests/unit/compilation_context_test.cpp index d8f8bbf953d975..dbb241fbb917c0 100644 --- a/src/inference/tests/unit/compilation_context_test.cpp +++ b/src/inference/tests/unit/compilation_context_test.cpp @@ -13,7 +13,6 @@ #include "common_test_utils/common_utils.hpp" #include "common_test_utils/test_constants.hpp" -#include "cpp/ie_cnn_network.h" #include "openvino/core/preprocess/pre_post_process.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" diff --git a/src/inference/tests/unit/query_model_test.cpp b/src/inference/tests/unit/query_model_test.cpp index a2508185e9ab91..cd9856111c1156 100644 --- a/src/inference/tests/unit/query_model_test.cpp +++ b/src/inference/tests/unit/query_model_test.cpp @@ -6,7 +6,6 @@ #include #include -#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" diff --git a/src/plugins/intel_cpu/src/memory_desc/blocked_memory_desc.cpp b/src/plugins/intel_cpu/src/memory_desc/blocked_memory_desc.cpp index 7c17a1381b1a91..fb25a75c59530f 100644 --- a/src/plugins/intel_cpu/src/memory_desc/blocked_memory_desc.cpp +++ b/src/plugins/intel_cpu/src/memory_desc/blocked_memory_desc.cpp @@ -3,6 +3,9 @@ // #include "blocked_memory_desc.h" + +#include + #include "utils/general_utils.h" namespace ov { diff --git a/src/plugins/intel_cpu/src/memory_desc/cpu_memory_desc_utils.cpp b/src/plugins/intel_cpu/src/memory_desc/cpu_memory_desc_utils.cpp index b8078eeaed965c..4552c03372e65b 100644 --- a/src/plugins/intel_cpu/src/memory_desc/cpu_memory_desc_utils.cpp +++ b/src/plugins/intel_cpu/src/memory_desc/cpu_memory_desc_utils.cpp @@ -2,14 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include "memory_desc/cpu_blocked_memory_desc.h" #include "memory_desc/dnnl_blocked_memory_desc.h" #include "cpu_memory_desc.h" #include "memory_desc/cpu_memory_desc_utils.h" #include #include -#include #include #include #include diff --git a/src/plugins/intel_cpu/src/node.cpp b/src/plugins/intel_cpu/src/node.cpp index c7bdfcfbc5f00a..f5a145f63e8d9f 100644 --- a/src/plugins/intel_cpu/src/node.cpp +++ b/src/plugins/intel_cpu/src/node.cpp @@ -28,7 +28,6 @@ #include #include -#include #include "utils/general_utils.h" #include "utils/cpu_utils.hpp" #include "nodes/common/cpu_convert.h" diff --git a/src/plugins/intel_cpu/src/node.h b/src/plugins/intel_cpu/src/node.h index bc429fb12b00c2..631278e311ad45 100644 --- a/src/plugins/intel_cpu/src/node.h +++ b/src/plugins/intel_cpu/src/node.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include #include "cpu_memory.h" diff --git a/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp b/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp index bbfaa09413d734..0f656c70495766 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp @@ -25,8 +25,6 @@ #include "ov_optional.hpp" #include "utils/cpp/maybe_unused.hpp" -using namespace InferenceEngine; - namespace ov { namespace intel_cpu { diff --git a/src/plugins/intel_cpu/src/nodes/executors/precision_translation.cpp b/src/plugins/intel_cpu/src/nodes/executors/precision_translation.cpp index 7ab47477f72735..cda7b4e47a0c0b 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/precision_translation.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/precision_translation.cpp @@ -11,8 +11,6 @@ #include "openvino/core/type/element_type.hpp" #include "precision_matcher.hpp" -using namespace InferenceEngine; - namespace ov { namespace intel_cpu { diff --git a/src/plugins/intel_cpu/src/nodes/eye.cpp b/src/plugins/intel_cpu/src/nodes/eye.cpp index 867267de254f04..f32f67279b75d0 100644 --- a/src/plugins/intel_cpu/src/nodes/eye.cpp +++ b/src/plugins/intel_cpu/src/nodes/eye.cpp @@ -4,7 +4,6 @@ #include "eye.h" #include "openvino/op/eye.hpp" -#include #include #include "openvino/core/parallel.hpp" #include "shape_inference/shape_inference_ngraph.hpp" diff --git a/src/plugins/intel_cpu/src/serialize.h b/src/plugins/intel_cpu/src/serialize.h index b0c57a7ea9d91a..9149a04ed3941e 100644 --- a/src/plugins/intel_cpu/src/serialize.h +++ b/src/plugins/intel_cpu/src/serialize.h @@ -5,7 +5,7 @@ #include #include -#include "cpp/ie_cnn_network.h" +#include "openvino/core/model.hpp" namespace ov { namespace intel_cpu { diff --git a/src/plugins/intel_cpu/src/utils/blob_dump.cpp b/src/plugins/intel_cpu/src/utils/blob_dump.cpp index 26626404aeea98..3181c012a4556e 100644 --- a/src/plugins/intel_cpu/src/utils/blob_dump.cpp +++ b/src/plugins/intel_cpu/src/utils/blob_dump.cpp @@ -3,7 +3,6 @@ // #include "blob_dump.h" -#include "blob_factory.hpp" #include #include "dnnl_extension_utils.h" #include diff --git a/src/plugins/intel_cpu/src/utils/general_utils.h b/src/plugins/intel_cpu/src/utils/general_utils.h index 08fab4686bde85..804150a5c747d5 100644 --- a/src/plugins/intel_cpu/src/utils/general_utils.h +++ b/src/plugins/intel_cpu/src/utils/general_utils.h @@ -4,12 +4,13 @@ #pragma once -#include #include "cpu_shape.h" #include #include +#include "openvino/core/type/element_type.hpp" + namespace ov { namespace intel_cpu { diff --git a/src/plugins/intel_cpu/tests/unit/dnnl_memory_test.cpp b/src/plugins/intel_cpu/tests/unit/dnnl_memory_test.cpp index 3bab4621bf4010..dec7eb101b3fb7 100644 --- a/src/plugins/intel_cpu/tests/unit/dnnl_memory_test.cpp +++ b/src/plugins/intel_cpu/tests/unit/dnnl_memory_test.cpp @@ -4,10 +4,12 @@ #include -#include -#include +#include #include +#include "cpu_memory.h" +#include "memory_desc/cpu_blocked_memory_desc.h" + using namespace ov::intel_cpu; TEST(MemoryTest, SedDataCheck) { diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/custom_layer.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/custom_layer.hpp index 284297da3a217f..041a4ce6cf881a 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/plugin/custom_layer.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/custom_layer.hpp @@ -8,7 +8,6 @@ #include #include #include -#include #include "pugixml.hpp" #include "intel_gpu/runtime/tensor.hpp" diff --git a/src/plugins/intel_gpu/tests/unit/test_utils/test_utils.h b/src/plugins/intel_gpu/tests/unit/test_utils/test_utils.h index e3a0c41fe8853a..623b506285e3a5 100644 --- a/src/plugins/intel_gpu/tests/unit/test_utils/test_utils.h +++ b/src/plugins/intel_gpu/tests/unit/test_utils/test_utils.h @@ -591,7 +591,7 @@ inline cldnn::network::ptr get_network(cldnn::engine& engine, std::ostream out_mem(&mem_buf); cldnn::BinaryOutputBuffer ob = cldnn::BinaryOutputBuffer(out_mem); ob.set_stream(stream.get()); - cldnn::program::build_program(engine, topology, config, nullptr, false)->save(ob); + cldnn::program::build_program(engine, topology, config)->save(ob); } { std::istream in_mem(&mem_buf); diff --git a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp index b7f27d1819022e..b3021e97257640 100644 --- a/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp +++ b/src/tests/functional/plugin/shared/include/base/ov_behavior_test_utils.hpp @@ -265,7 +265,7 @@ class OVClassSeveralDevicesTests : public OVPluginTestBase, { \ try { \ __VA_ARGS__; \ - } catch (const InferenceEngine::NotImplemented&) { \ + } catch (const ov::NotImplemented&) { \ GTEST_SKIP(); \ } \ } diff --git a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_consistency.hpp b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_consistency.hpp index ee82e48642f0f9..35f9e44222be77 100644 --- a/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_consistency.hpp +++ b/src/tests/functional/plugin/shared/include/behavior/ov_infer_request/infer_consistency.hpp @@ -13,7 +13,6 @@ namespace ov { namespace test { namespace behavior { -namespace IE = InferenceEngine; // for deviceConfigs, the deviceConfigs[0] is target device which need to be tested. // deviceConfigs[1], deviceConfigs[2],deviceConfigs[n] are the devices which will // be compared with target device, the result of target should be in one of the compared diff --git a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp index ae619f66f2a2a4..49fa9bdd138ed4 100644 --- a/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp +++ b/src/tests/test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp @@ -12,7 +12,6 @@ #include #include -#include "description_buffer.hpp" #include "openvino/core/except.hpp" #include "openvino/runtime/common.hpp" #include "openvino/runtime/icore.hpp" From f5154711f7e78b67ddbd138d0f464092630471a3 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 7 Feb 2024 21:27:57 +0400 Subject: [PATCH 44/55] Added NPU plugin to wheel (#22263) ### Details: - Allow to include NPU plugin as part of OpenVINO wheel. ### Tickets: - CVS-130134 --- src/bindings/python/wheel/setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index cc24316539123e..eae764ddb88b40 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -85,6 +85,13 @@ "rpath": LIBS_RPATH, "binary_dir": OPENVINO_BINARY_DIR, }, + "npu_plugin": { + "name": "npu", + "prefix": f"{BUILD_BASE}/libs.npu", + "install_dir": OV_RUNTIME_LIBS_DIR, + "rpath": LIBS_RPATH, + "binary_dir": OPENVINO_BINARY_DIR, + }, "multi_plugin": { "name": "multi", "prefix": f"{BUILD_BASE}/libs.multi", From a7a9127ab6a30e53170ca09c6a77e4de9bedd47f Mon Sep 17 00:00:00 2001 From: Ivan Tikhonov Date: Wed, 7 Feb 2024 22:06:26 +0400 Subject: [PATCH 45/55] Fix hash inconsistency: ignore friendly names for hash calculation (#22705) partially reverts PR https://github.com/openvinotoolkit/openvino/pull/22208 fixes hash inconsistency ignoring friendly_names in "deterministic" mode of Serialize pass which used for Hash calculation. ### Tickets: - *CVS-129290* - *CVS-131722* --- .../common_optimizations/low_latency_v2_test.cpp | 5 ++--- .../tests/resolve_names_collisions.cpp | 1 - src/core/include/openvino/core/node.hpp | 1 - src/core/src/node.cpp | 7 +------ src/core/src/pass/serialize.cpp | 11 ++++------- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp index f56c34227a8be4..702b4cbdfeeb5b 100644 --- a/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp +++ b/src/common/transformations/tests/common_optimizations/low_latency_v2_test.cpp @@ -910,7 +910,6 @@ TEST_P(LLT2Sequence, RNNLowLatency_v2) { auto H = make_shared(element::f32, Shape{attrs.batch, attrs.num_dir, attrs.hidden_size}); auto C = make_shared(element::f32, Shape{attrs.batch, attrs.num_dir, attrs.hidden_size}); auto outputs = create_sequence(p.rnn_type, attrs, X, H, C); - outputs[0].get_node()->set_friendly_name("lstm_node"); ParameterVector params{X, H}; if (p.rnn_type == RNNType::LSTM) { params.push_back(C); @@ -931,9 +930,9 @@ TEST_P(LLT2Sequence, RNNLowLatency_v2) { auto H = make_shared(element::f32, Shape{attrs.batch, attrs.num_dir, attrs.hidden_size}); auto C = make_shared(element::f32, Shape{attrs.batch, attrs.num_dir, attrs.hidden_size}); auto variable_h = make_shared( - ov::op::util::VariableInfo{H->get_shape(), H->get_element_type(), "lstm_node/variable_0"}); + ov::op::util::VariableInfo{H->get_shape(), H->get_element_type(), "node_28/variable_0"}); auto variable_c = make_shared( - ov::op::util::VariableInfo{C->get_shape(), C->get_element_type(), "lstm_node/variable_1"}); + ov::op::util::VariableInfo{C->get_shape(), C->get_element_type(), "node_28/variable_1"}); auto read_val_H = create_read_value(H, variable_h); auto read_val_C = create_read_value(C, variable_c); diff --git a/src/common/transformations/tests/resolve_names_collisions.cpp b/src/common/transformations/tests/resolve_names_collisions.cpp index a4986e51119800..a67ce5ba44ea3d 100644 --- a/src/common/transformations/tests/resolve_names_collisions.cpp +++ b/src/common/transformations/tests/resolve_names_collisions.cpp @@ -19,7 +19,6 @@ TEST(ResolveNameCollisionsTest, FixGeneratedNames) { EXPECT_NE(std::string::npos, gen_friendly_name.find("Parameter_")); unsigned long long index = std::stoull(gen_friendly_name.substr(name.length())); name += std::to_string(++index); - name += "_autogenerated"; arg0->set_friendly_name(name); diff --git a/src/core/include/openvino/core/node.hpp b/src/core/include/openvino/core/node.hpp index 9006ab57a3a2a8..93b1e23db807e5 100644 --- a/src/core/include/openvino/core/node.hpp +++ b/src/core/include/openvino/core/node.hpp @@ -433,7 +433,6 @@ class OPENVINO_API Node : public std::enable_shared_from_this { std::vector> m_control_dependencies; size_t m_instance_id{m_next_instance_id.fetch_add(1)}; std::string m_friendly_name; - mutable std::string m_auto_generated_friendly_name; mutable std::string m_unique_name; mutable std::atomic_bool m_name_changing{false}; static std::atomic m_next_instance_id; diff --git a/src/core/src/node.cpp b/src/core/src/node.cpp index 13f31fa093b252..e152bcb7f4a63e 100644 --- a/src/core/src/node.cpp +++ b/src/core/src/node.cpp @@ -283,13 +283,8 @@ std::string ov::Node::description() const { } const std::string& ov::Node::get_friendly_name() const { - const auto& name = get_name(); - AtomicGuard lock(m_name_changing); if (m_friendly_name.empty()) { - if (m_auto_generated_friendly_name.empty()) { - m_auto_generated_friendly_name = name + "_" + "autogenerated"; - } - return m_auto_generated_friendly_name; + return get_name(); } return m_friendly_name; } diff --git a/src/core/src/pass/serialize.cpp b/src/core/src/pass/serialize.cpp index 187dfe9691d977..4d68132f4e6051 100644 --- a/src/core/src/pass/serialize.cpp +++ b/src/core/src/pass/serialize.cpp @@ -785,10 +785,6 @@ std::string generate_unique_name(const std::unordered_set& unique_n } } -bool is_name_auto_generated(const ov::Node& n) { - return n.get_friendly_name().find("autogenerated") != std::string::npos; -} - // TODO: remove when CNNNetwork will be supporting not-unique names std::string get_node_unique_name(std::unordered_set& unique_names, const ov::Node* n) { std::string name = n->get_friendly_name(); @@ -921,8 +917,8 @@ void ngfunction_2_ir(pugi::xml_node& netXml, ConstantWriter& constant_node_write_handler, int64_t version, bool deterministic) { - // If determinism is not required, do not include names into xml - // model name is not critial for hash computing + // If determinism is not required, include auto-generated names into xml + // model name is not critical for hash computing if (!deterministic) { netXml.append_attribute("name").set_value(model.get_friendly_name().c_str()); } @@ -968,7 +964,8 @@ void ngfunction_2_ir(pugi::xml_node& netXml, pugi::xml_node layer = layers.append_child("layer"); layer.append_attribute("id").set_value(layer_ids.find(node)->second); // If determinism is not required, include auto-generated names into xml - if (!deterministic || !is_name_auto_generated(*node)) { + // layer name is not critical for hash computing + if (!deterministic) { layer.append_attribute("name").set_value(get_node_unique_name(unique_names, node).c_str()); } layer.append_attribute("type").set_value(translate_type_name(node_type_name).c_str()); From 1ad96112046260328c8a304010727915642b9798 Mon Sep 17 00:00:00 2001 From: Luo Cheng Date: Thu, 8 Feb 2024 02:25:17 +0800 Subject: [PATCH 46/55] [CPU] Pastkv cache of SDPA supports int8 type (#22409) ### Details: - *Pastkv cache supports int8 type* - *Decompose SDPA if no concat fused* - *Reuse memory for the new prompt if possible* ### Tickets: - *128354* - *129488* --------- Co-authored-by: Li, Tingqian --- .../cross_compiled_disp_gen.cmake | 30 +- .../cross_compile/cross_compiled_func.cmake | 11 +- src/plugins/intel_cpu/CMakeLists.txt | 7 + src/plugins/intel_cpu/src/memory_state.cpp | 68 +- src/plugins/intel_cpu/src/memory_state.h | 11 + .../nodes/kernels/scaled_attn/attn_memcpy.cpp | 16 +- .../nodes/kernels/scaled_attn/attn_quant.cpp | 250 ++++++ .../nodes/kernels/scaled_attn/attn_quant.hpp | 32 + .../src/nodes/kernels/scaled_attn/common.hpp | 18 + .../kernels/scaled_attn/mha_single_token.cpp | 720 ++++++++++++++++-- .../kernels/scaled_attn/mha_single_token.hpp | 5 +- .../kernels/scaled_attn/softmax_kernel.hpp | 10 - .../intel_cpu/src/nodes/scaled_attn.cpp | 235 ++++-- src/plugins/intel_cpu/src/nodes/scaled_attn.h | 5 +- .../transformation_pipeline.cpp | 6 +- .../intel_cpu/src/utils/plain_tensor.hpp | 96 ++- 16 files changed, 1291 insertions(+), 229 deletions(-) create mode 100644 src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.cpp create mode 100644 src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.hpp diff --git a/cmake/developer_package/cross_compile/cross_compiled_disp_gen.cmake b/cmake/developer_package/cross_compile/cross_compiled_disp_gen.cmake index da543c910736dd..6ead2897e09843 100644 --- a/cmake/developer_package/cross_compile/cross_compiled_disp_gen.cmake +++ b/cmake/developer_package/cross_compile/cross_compiled_disp_gen.cmake @@ -7,7 +7,7 @@ # Generates cpp file with dispatcher for cross compiled function # Parameters: # XARCH_API_HEADER -- path to header with function declaration -# XARCH_FUNC_NAME -- name of function to dispatch +# XARCH_FUNC_NAMES -- names of functions to dispatch # XARCH_NAMESPACES -- full namespace used to keep ODR # XARCH_DISP_FILE -- dispatcher file name to generate # XARCH_SET -- set of ARCH supported by dispatcher. semicolon-delimited @@ -21,9 +21,6 @@ set(_CPU_CHECK_AVX2 "with_cpu_x86_avx2()") set(_CPU_CHECK_AVX512F "with_cpu_x86_avx512f()") function(_generate_dispatcher) - _find_signature_in_file(${XARCH_API_HEADER} ${XARCH_FUNC_NAME} SIGNATURE) - _generate_call_line_from_signature("${SIGNATURE}" CALL_LINE) - string(REPLACE "::" ";" XARCH_NAMESPACES "${XARCH_NAMESPACES}") list(GET XARCH_NAMESPACES -1 XARCH_CURRENT_NAMESPACE) @@ -46,20 +43,25 @@ function(_generate_dispatcher) "namespace ${_namespace} {\n") endforeach() - foreach(_arch ${XARCH_SET}) - string(APPEND DISP_CONTENT - "namespace ${_arch} {\n ${SIGNATURE}\; \n}\n") - endforeach() + foreach(_func_name ${XARCH_FUNC_NAMES}) + _find_signature_in_file(${XARCH_API_HEADER} ${_func_name} SIGNATURE) + _generate_call_line_from_signature("${SIGNATURE}" CALL_LINE) - string(APPEND DISP_CONTENT - "namespace ${XARCH_CURRENT_NAMESPACE} {\n\n${SIGNATURE} {\n") + foreach(_arch ${XARCH_SET}) + string(APPEND DISP_CONTENT + "namespace ${_arch} {\n ${SIGNATURE}\; \n}\n") + endforeach() - foreach(_arch ${XARCH_SET}) string(APPEND DISP_CONTENT - " if (${_CPU_CHECK_${_arch}}) {\n return ${_arch}::${CALL_LINE}\;\n }\n") - endforeach() + "namespace ${XARCH_CURRENT_NAMESPACE} {\n\n${SIGNATURE} {\n") + + foreach(_arch ${XARCH_SET}) + string(APPEND DISP_CONTENT + " if (${_CPU_CHECK_${_arch}}) {\n return ${_arch}::${CALL_LINE}\;\n }\n") + endforeach() - string(APPEND DISP_CONTENT "}\n\n}\n") + string(APPEND DISP_CONTENT "}\n\n}\n") + endforeach() foreach(_namespace ${PARENT_NAMESPACES}) string(APPEND DISP_CONTENT "} // namespace ${_namespace}\n") diff --git a/cmake/developer_package/cross_compile/cross_compiled_func.cmake b/cmake/developer_package/cross_compile/cross_compiled_func.cmake index c36cbe6762d9a0..51aa62014cc310 100644 --- a/cmake/developer_package/cross_compile/cross_compiled_func.cmake +++ b/cmake/developer_package/cross_compile/cross_compiled_func.cmake @@ -53,14 +53,15 @@ set(DISPATCHER_GEN_OPTIONS_HOLDER ${CMAKE_CURRENT_LIST_DIR}/cross_compiled_disp_ # AVX512F # API # NAMESPACE # like "IE::Ext::CPU::XARCH" -# NAME # like "my_fun" +# NAME # like "my_fun1 my_fun2" # ) # function(cross_compiled_file TARGET) set(oneValueArgs API ## Header with declaration of cross compiled function NAMESPACE ## The namespace where cross compiled function was declared - NAME) ## String with function signature to make cross compiled - set(multiValueArgs ARCH) ## List of architecture described in _ARCH_LIST + ) + set(multiValueArgs NAME ## String with function signatures to make cross compiled + ARCH) ## List of architecture described in _ARCH_LIST cmake_parse_arguments(X "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) ## verification @@ -92,7 +93,7 @@ function(cross_compiled_file TARGET) endif() endforeach() - _add_dispatcher_to_target(${TARGET} ${X_API} ${X_NAME} "${X_NAMESPACE}" "${_FULL_ARCH_SET}") + _add_dispatcher_to_target(${TARGET} ${X_API} "${X_NAME}" "${X_NAMESPACE}" "${_FULL_ARCH_SET}") endfunction() @@ -155,7 +156,7 @@ function(_add_dispatcher_to_target TARGET HEADER FUNC_NAME NAMESPACE ARCH_SET) add_custom_command( OUTPUT ${DISPATCHER_SOURCE} COMMAND ${CMAKE_COMMAND} - -D "XARCH_FUNC_NAME=${X_NAME}" + -D "XARCH_FUNC_NAMES=${X_NAME}" -D "XARCH_NAMESPACES=${NAMESPACE}" -D "XARCH_API_HEADER=${CMAKE_CURRENT_SOURCE_DIR}/${HEADER}" -D "XARCH_DISP_FILE=${CMAKE_CURRENT_BINARY_DIR}/${DISPATCHER_SOURCE}" diff --git a/src/plugins/intel_cpu/CMakeLists.txt b/src/plugins/intel_cpu/CMakeLists.txt index df9bddd23bc22e..63bb9db0e1f0b6 100644 --- a/src/plugins/intel_cpu/CMakeLists.txt +++ b/src/plugins/intel_cpu/CMakeLists.txt @@ -168,6 +168,13 @@ cross_compiled_file(${TARGET_NAME} NAME attn_memcpy NAMESPACE ov::Extensions::Cpu::XARCH ) +cross_compiled_file(${TARGET_NAME} + ARCH AVX512F AVX2 ANY + src/nodes/kernels/scaled_attn/attn_quant.cpp + API src/nodes/kernels/scaled_attn/attn_quant.hpp + NAME attn_quantkv attn_quant_u8 attn_dequant_u8 + NAMESPACE ov::Extensions::Cpu::XARCH +) # system dependencies must go last target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml) ov_set_threading_interface_for(${TARGET_NAME}) diff --git a/src/plugins/intel_cpu/src/memory_state.cpp b/src/plugins/intel_cpu/src/memory_state.cpp index 44b87a082fab3d..0632f42a55a66e 100644 --- a/src/plugins/intel_cpu/src/memory_state.cpp +++ b/src/plugins/intel_cpu/src/memory_state.cpp @@ -12,6 +12,9 @@ #include "utils/plain_tensor.hpp" #include "openvino/core/parallel.hpp" #include "nodes/common/cpu_convert.h" +#include "nodes/kernels/scaled_attn/attn_quant.hpp" + +using namespace ov::Extensions::Cpu::XARCH; namespace ov { namespace intel_cpu { @@ -195,14 +198,33 @@ ov::SoPtr VariableStateKVcache::get_state() const { auto H = pastkv.size(1); auto L0 = pastkv.size(2); auto S = pastkv.size(3); - parallel_for3d(B, H, L0, [&](size_t b, size_t h, size_t m) { - auto b_kv = static_cast(beam_table.at({b, m})); - cpu_convert(&pastkv.at({b_kv, h, m}), - &output.at({b, h, m}), - pastkv.m_dt, - output.m_dt, - S); - }); + if (pastkv.get_precision() == element::u8) { + auto nthr = parallel_get_max_threads(); + std::vector buffers(nthr); + parallel_for3d(B, H, L0, [&](size_t ithr, size_t b, size_t h, size_t m) { + auto b_kv = static_cast(beam_table.at({b, m})); + buffers[ithr].resize({S}); + attn_dequant_u8(pastkv.ptr(b_kv, h, m), + buffers[ithr].ptr(), + S, + m_scale_zp.ptr(b_kv, h, m)[0], + m_scale_zp.ptr(b_kv, h, m)[1]); + cpu_convert(buffers[ithr].ptr(), + output.ptr_v(b, h, m), + element::f32, + output.m_dt, + S); + }); + } else { + parallel_for3d(B, H, L0, [&](size_t b, size_t h, size_t m) { + auto b_kv = static_cast(beam_table.at({b, m})); + cpu_convert(pastkv.ptr_v(b_kv, h, m), + output.ptr_v(b, h, m), + pastkv.m_dt, + output.m_dt, + S); + }); + } return std::make_shared(external_mem); } @@ -218,7 +240,35 @@ void VariableStateKVcache::set_state_impl(const ov::SoPtr& state) { m_internal_mem = std::make_shared(get_engine(), dense_internal_desc); Memory external_mem(get_engine(), state_desc, m_state->data()); - m_internal_mem->load(external_mem); + if (dense_internal_desc->getPrecision() == element::u8) { + PlainTensor external, internal; + auto&& actual_internal_order = m_dense_internal_desc->getOrder(); + external.resize(external_mem.getStaticDims(), state_desc->getPrecision().size(), state_desc->getPrecision(), m_state->data()); + internal.reset(m_internal_mem); + external = external.permute(actual_internal_order); + internal = internal.permute(actual_internal_order); + auto B = internal.size(0); + auto H = internal.size(1); + auto L0 = internal.size(2); + auto S = internal.size(3); + auto nthr = parallel_get_max_threads(); + std::vector buffers(nthr); + parallel_for3d(B, H, L0, [&](size_t ithr, size_t b, size_t h, size_t m) { + buffers[ithr].resize({S}); + cpu_convert(external.ptr_v(b, h, m), + buffers[ithr].ptr(), + external.m_dt, + element::f32, + S); + attn_quant_u8(buffers[ithr].ptr(), + internal.ptr(b, h, m), + S, + m_scale_zp.at({b, h, m, size_t{0}}), + m_scale_zp.at({b, h, m, size_t{1}})); + }); + } else { + m_internal_mem->load(external_mem); + } //2. Reset the beam search table auto&& state_dims = dense_internal_desc->getShape().getStaticDims(); diff --git a/src/plugins/intel_cpu/src/memory_state.h b/src/plugins/intel_cpu/src/memory_state.h index c762c4afa2f142..f95186b92e48fc 100644 --- a/src/plugins/intel_cpu/src/memory_state.h +++ b/src/plugins/intel_cpu/src/memory_state.h @@ -8,6 +8,7 @@ #include "memory_desc/blocked_memory_desc.h" #include "openvino/runtime/ivariable_state.hpp" #include "openvino/runtime/tensor.hpp" +#include "utils/plain_tensor.hpp" namespace ov { namespace intel_cpu { @@ -128,6 +129,13 @@ class VariableStateKVcache : public VariableStateBase { m_hidden_state_max_size = max_size; } + PlainTensor& get_scale_zp() { + return m_scale_zp; + } + void set_scale_zp(const PlainTensor& t) { + m_scale_zp = t; + } + private: //ov::intel_cpu::VariableStateBase void set_state_impl(const ov::SoPtr& state) override; @@ -142,6 +150,9 @@ class VariableStateKVcache : public VariableStateBase { // this desc stores the internal prc and axis permutation BlockedMemoryDescPtr m_dense_internal_desc; + + // for u8 kv cache: [B, H, L, 2], 0 for scale, 1 for zp + PlainTensor m_scale_zp; }; using MemStatePtr = std::shared_ptr; diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_memcpy.cpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_memcpy.cpp index 41efa80cf40a82..f2147479d4be98 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_memcpy.cpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_memcpy.cpp @@ -52,11 +52,11 @@ void attn_memcpy_kernel(const ov::intel_cpu::PlainTensor& k_input, const ov::intel_cpu::PlainTensor& past_v_output) { size_t B = k_input.m_dims[0], H = k_input.m_dims[1], L1 = k_input.m_dims[2], S = k_input.m_dims[3]; parallel_for3d(B, H, L1, [&](size_t b, size_t h, size_t m) { - attn_copy(&past_k_output.at({b, h, m, 0}), - &k_input.at({b, h, m, 0}), + attn_copy(past_k_output.ptr(b, h, m, 0), + k_input.ptr(b, h, m, 0), S); - attn_copy(&past_v_output.at({b, h, m, 0}), - &v_input.at({b, h, m, 0}), + attn_copy(past_v_output.ptr(b, h, m, 0), + v_input.ptr(b, h, m, 0), S); }); } @@ -67,11 +67,11 @@ static void attn_memcpy_kernel(const ov::intel_cpu::PlainTensor& k_input, const ov::intel_cpu::PlainTensor& past_v_output) { size_t B = k_input.m_dims[0], H = k_input.m_dims[1], L1 = k_input.m_dims[2], S = k_input.m_dims[3]; parallel_for3d(B, H, L1, [&](size_t b, size_t h, size_t m) { - std::memcpy(&past_k_output.at({b, h, m, 0}), - &k_input.at({b, h, m, 0}), + std::memcpy(past_k_output.ptr_v(b, h, m, 0), + k_input.ptr_v(b, h, m, 0), S * k_input.m_element_size); - std::memcpy(&past_v_output.at({b, h, m, 0}), - &v_input.at({b, h, m, 0}), + std::memcpy(past_v_output.ptr_v(b, h, m, 0), + v_input.ptr_v(b, h, m, 0), S * v_input.m_element_size); }); } diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.cpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.cpp new file mode 100644 index 00000000000000..018b52b4bd1f75 --- /dev/null +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.cpp @@ -0,0 +1,250 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#include + +#include +#include +#include +#include +#include + +#if defined(HAVE_AVX2) || defined(HAVE_AVX512F) +# include +#endif + +#include "openvino/core/type/bfloat16.hpp" +#include "openvino/core/parallel.hpp" +#include "common.hpp" +#include "attn_quant.hpp" + +namespace ov { +namespace Extensions { +namespace Cpu { +namespace XARCH { + +using namespace ov; + +template +static void quant_u8(const T* src, uint8_t* dst, size_t n, float& scale, float& zp) { + size_t i = 0; + float max = -FLT_MAX; + float min = FLT_MAX; +#if defined(HAVE_AVX512F) + auto v0_max = _mm512_set1_ps(-FLT_MAX); + auto v0_min = _mm512_set1_ps(FLT_MAX); + auto v1_max = _mm512_set1_ps(-FLT_MAX); + auto v1_min = _mm512_set1_ps(FLT_MAX); + auto v2_max = _mm512_set1_ps(-FLT_MAX); + auto v2_min = _mm512_set1_ps(FLT_MAX); + auto v3_max = _mm512_set1_ps(-FLT_MAX); + auto v3_min = _mm512_set1_ps(FLT_MAX); + for (; i + 4 * vec_len_f32_avx512 <= n; i += vec_len_f32_avx512 * 4) { + auto v0 = mm512_uni_loadu_ps(src + i); + auto v1 = mm512_uni_loadu_ps(src + i + vec_len_f32_avx512); + auto v2 = mm512_uni_loadu_ps(src + i + 2 * vec_len_f32_avx512); + auto v3 = mm512_uni_loadu_ps(src + i + 3 * vec_len_f32_avx512); + v0_max = _mm512_max_ps(v0_max, v0); + v0_min = _mm512_min_ps(v0_min, v0); + v1_max = _mm512_max_ps(v1_max, v1); + v1_min = _mm512_min_ps(v1_min, v1); + v2_max = _mm512_max_ps(v2_max, v2); + v2_min = _mm512_min_ps(v2_min, v2); + v3_max = _mm512_max_ps(v3_max, v3); + v3_min = _mm512_min_ps(v3_min, v3); + } + if (i + 2 * vec_len_f32_avx512 <= n) { + auto v0 = mm512_uni_loadu_ps(src + i); + auto v1 = mm512_uni_loadu_ps(src + i + vec_len_f32_avx512); + v0_max = _mm512_max_ps(v0_max, v0); + v0_min = _mm512_min_ps(v0_min, v0); + v1_max = _mm512_max_ps(v1_max, v1); + v1_min = _mm512_min_ps(v1_min, v1); + i += 2 * vec_len_f32_avx512; + } + if (i + vec_len_f32_avx512 <= n) { + auto v0 = mm512_uni_loadu_ps(src + i); + v0_max = _mm512_max_ps(v0_max, v0); + v0_min = _mm512_min_ps(v0_min, v0); + i += vec_len_f32_avx512; + } + v0_max = _mm512_max_ps(v0_max, v1_max); + v0_min = _mm512_min_ps(v0_min, v1_min); + v2_max = _mm512_max_ps(v2_max, v3_max); + v2_min = _mm512_min_ps(v2_min, v3_min); + v0_max = _mm512_max_ps(v0_max, v2_max); + v0_min = _mm512_min_ps(v0_min, v2_min); + max = _mm512_reduce_max_ps(v0_max); + min = _mm512_reduce_min_ps(v0_min); +#elif defined(HAVE_AVX2) + auto v0_max = _mm256_set1_ps(-FLT_MAX); + auto v0_min = _mm256_set1_ps(FLT_MAX); + auto v1_max = _mm256_set1_ps(-FLT_MAX); + auto v1_min = _mm256_set1_ps(FLT_MAX); + auto v2_max = _mm256_set1_ps(-FLT_MAX); + auto v2_min = _mm256_set1_ps(FLT_MAX); + auto v3_max = _mm256_set1_ps(-FLT_MAX); + auto v3_min = _mm256_set1_ps(FLT_MAX); + for (; i + 4 * vec_len_f32_avx2 <= n; i += vec_len_f32_avx2 * 4) { + auto v0 = mm256_uni_loadu_ps(src + i); + auto v1 = mm256_uni_loadu_ps(src + i + vec_len_f32_avx2); + auto v2 = mm256_uni_loadu_ps(src + i + 2 * vec_len_f32_avx2); + auto v3 = mm256_uni_loadu_ps(src + i + 3 * vec_len_f32_avx2); + v0_max = _mm256_max_ps(v0_max, v0); + v0_min = _mm256_min_ps(v0_min, v0); + v1_max = _mm256_max_ps(v1_max, v1); + v1_min = _mm256_min_ps(v1_min, v1); + v2_max = _mm256_max_ps(v2_max, v2); + v2_min = _mm256_min_ps(v2_min, v2); + v3_max = _mm256_max_ps(v3_max, v3); + v3_min = _mm256_min_ps(v3_min, v3); + } + if (i + 2 * vec_len_f32_avx2 <= n) { + auto v0 = mm256_uni_loadu_ps(src + i); + auto v1 = mm256_uni_loadu_ps(src + i + vec_len_f32_avx2); + v0_max = _mm256_max_ps(v0_max, v0); + v0_min = _mm256_min_ps(v0_min, v0); + v1_max = _mm256_max_ps(v1_max, v1); + v1_min = _mm256_min_ps(v1_min, v1); + i += 2 * vec_len_f32_avx2; + } + if (i + vec_len_f32_avx2 <= n) { + auto v0 = mm256_uni_loadu_ps(src + i); + v0_max = _mm256_max_ps(v0_max, v0); + v0_min = _mm256_min_ps(v0_min, v0); + i += vec_len_f32_avx2; + } + v0_max = _mm256_max_ps(v0_max, v1_max); + v0_min = _mm256_min_ps(v0_min, v1_min); + v2_max = _mm256_max_ps(v2_max, v3_max); + v2_min = _mm256_min_ps(v2_min, v3_min); + v0_max = _mm256_max_ps(v0_max, v2_max); + v0_min = _mm256_min_ps(v0_min, v2_min); + hmax(v0_max); + hmin(v0_min); + max = _mm256_cvtss_f32(v0_max); + min = _mm256_cvtss_f32(v0_min); +#endif + for (; i < n; i++) { + float tmp = src[i]; + max = std::max(max, tmp); + min = std::min(min, tmp); + } + scale = (max - min) / 255; + zp = -min / scale; + + i = 0; +#if defined(HAVE_AVX512F) + auto v_scale = _mm512_set1_ps(1 / scale); + auto v_zp = _mm512_set1_ps(zp); + auto v_zero = _mm512_setzero_epi32(); + for (; i + vec_len_f32_avx512 <= n; i += vec_len_f32_avx512) { + auto v = mm512_uni_loadu_ps(src + i); + v = _mm512_fmadd_ps(v, v_scale, v_zp); + auto v_i32 = _mm512_cvt_roundps_epi32(v, _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC); + v_i32 = _mm512_max_epi32(v_i32, v_zero); + _mm512_mask_cvtusepi32_storeu_epi8(dst + i, 0xffff, v_i32); + } +#elif defined(HAVE_AVX2) + auto v_scale = _mm256_set1_ps(1 / scale); + auto v_zp = _mm256_set1_ps(zp); + for (; i + vec_len_f32_avx2 <= n; i += vec_len_f32_avx2) { + auto v = mm256_uni_loadu_ps(src + i); + v = _mm256_fmadd_ps(v, v_scale, v_zp); + v = _mm256_round_ps(v, _MM_ROUND_NEAREST); + auto v_i32 = _mm256_cvtps_epi32(v); + + auto high4 = _mm256_extractf128_si256(v_i32, 1); + auto low4 = _mm256_castsi256_si128(v_i32); + auto packed = _mm_packs_epi32(low4, high4); + packed = _mm_packus_epi16(packed, packed); + _mm_storel_epi64(reinterpret_cast<__m128i*>(dst + i), packed); + } +#endif + for (; i < n; i++) { + float tmp = src[i]; + dst[i] = static_cast(std::round(tmp / scale + zp)); + } +} + +template +static void attn_quant_mt(const ov::intel_cpu::PlainTensor& k_src, + const ov::intel_cpu::PlainTensor& v_src, + const ov::intel_cpu::PlainTensor& k_dst, + const ov::intel_cpu::PlainTensor& v_dst, + const ov::intel_cpu::PlainTensor& k_scale_zp, + const ov::intel_cpu::PlainTensor& v_scale_zp) { + size_t B = k_src.m_dims[0], H = k_src.m_dims[1], L1 = k_src.m_dims[2], S = k_src.m_dims[3]; + parallel_for3d(B, H, L1, [&](size_t b, size_t h, size_t m) { + auto p_k = k_scale_zp.ptr(b, h, m); + auto p_v = v_scale_zp.ptr(b, h, m); + quant_u8(k_src.ptr(b, h, m), + k_dst.ptr(b, h, m), + S, + p_k[0], + p_k[1]); + quant_u8(v_src.ptr(b, h, m), + v_dst.ptr(b, h, m), + S, + p_v[0], + p_v[1]); + }); +} + +void attn_quantkv(const ov::intel_cpu::PlainTensor& k_src, + const ov::intel_cpu::PlainTensor& v_src, + const ov::intel_cpu::PlainTensor& k_dst, + const ov::intel_cpu::PlainTensor& v_dst, + const ov::intel_cpu::PlainTensor& k_scale_zp, + const ov::intel_cpu::PlainTensor& v_scale_zp) { + if (k_src.get_precision() == ov::element::f32 && k_dst.get_precision() == ov::element::u8) { + attn_quant_mt(k_src, v_src, k_dst, v_dst, k_scale_zp, v_scale_zp); + } else if (k_src.get_precision() == ov::element::bf16 && k_dst.get_precision() == ov::element::u8) { + attn_quant_mt(k_src, v_src, k_dst, v_dst, k_scale_zp, v_scale_zp); + } else { + OPENVINO_THROW("unsupport src type: ", k_src.get_precision(), ", dst type: ", k_dst.get_precision(), " in attn_quantkv"); + } +} + +void attn_quant_u8(const float* src, uint8_t* dst, size_t n, float& scale, float& zp) { + quant_u8(src, dst, n, scale, zp); +} + +void attn_dequant_u8(const uint8_t* src, float* dst, size_t n, float scale, float zp) { + size_t i = 0; + // loadu_si128/epi64 does not support const qualifier + uint8_t* src_nc = const_cast(src); +#if defined(HAVE_AVX512F) + auto v_zp = _mm512_set1_ps(zp); + auto v_scale = _mm512_set1_ps(scale); + for (; i + vec_len_f32_avx512 <= n; i += vec_len_f32_avx512) { + auto v0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(src_nc + i)); + auto v0_512 = _mm512_cvtepu8_epi32(v0_128); + auto v0_value = _mm512_cvtepi32_ps(v0_512); + v0_value = _mm512_sub_ps(v0_value, v_zp); + auto v0_out = _mm512_mul_ps(v0_value, v_scale); + mm512_uni_storeu_ps(dst + i, v0_out); + } +#elif defined(HAVE_AVX2) + auto v_zp = _mm256_set1_ps(zp); + auto v_scale = _mm256_set1_ps(scale); + for (; i + vec_len_f32_avx2 <= n; i += vec_len_f32_avx2) { + auto v0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(src_nc + i)); + auto v0_256 = _mm256_cvtepu8_epi32(v0_128); + auto v0_value = _mm256_cvtepi32_ps(v0_256); + v0_value = _mm256_sub_ps(v0_value, v_zp); + auto v0_out = _mm256_mul_ps(v0_value, v_scale); + mm256_uni_storeu_ps(dst + i, v0_out); + } +#endif + for (; i < n; ++i) { + float tmp = src_nc[i]; + tmp = (tmp - zp) * scale; + dst[i] = tmp; + } +} + +} // namespace XARCH +} // namespace Cpu +} // namespace Extensions +} // namespace ov \ No newline at end of file diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.hpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.hpp new file mode 100644 index 00000000000000..a95aa8e630cf13 --- /dev/null +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant.hpp @@ -0,0 +1,32 @@ +// Copyright (C) 2018-2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// +#pragma once + +#include +#include +#include +#include +#include "openvino/core/type/element_type.hpp" +#include "utils/plain_tensor.hpp" + +namespace ov { +namespace Extensions { +namespace Cpu { +namespace XARCH { + +void attn_quantkv(const ov::intel_cpu::PlainTensor& k_src, + const ov::intel_cpu::PlainTensor& v_src, + const ov::intel_cpu::PlainTensor& k_dst, + const ov::intel_cpu::PlainTensor& v_dst, + const ov::intel_cpu::PlainTensor& k_scale_zp, + const ov::intel_cpu::PlainTensor& v_scale_zp); + +void attn_quant_u8(const float* src, uint8_t* dst, size_t n, float& scale, float& zp); + +void attn_dequant_u8(const uint8_t* src, float* dst, size_t n, float scale, float zp); + +} // namespace XARCH +} // namespace Cpu +} // namespace Extensions +} // namespace ov \ No newline at end of file diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/common.hpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/common.hpp index e624382fd2eb0f..231a9d2c51fbb2 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/common.hpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/common.hpp @@ -163,6 +163,24 @@ static constexpr size_t vec_len_f32_avx2 = vec_len_avx2 / sizeof(float); y = _mm256_permute2f128_ps(x, x, 1); // y: 4567 x x x 0123 x x x x = _mm256_add_ps(x, y); // x: 01234567 x x x x x x x } + inline void hmax(__m256& x) { + __m256 y; // x: 0 1 2 3 4 5 6 7 + y = _mm256_permute_ps(x, 0x39); // y: 1 2 3 0 5 6 7 4 + x = _mm256_max_ps(x, y); // X: 01 12 23 30 45 56 67 74 + y = _mm256_permute_ps(x, 0x4e); // y: 23 30 01 12 67 74 45 56 + x = _mm256_max_ps(x, y); // x: 0123 x x x 4567 x x x + y = _mm256_permute2f128_ps(x, x, 1); // y: 4567 x x x 0123 x x x + x = _mm256_max_ps(x, y); // x: 01234567 x x x x x x x + } + inline void hmin(__m256& x) { + __m256 y; // x: 0 1 2 3 4 5 6 7 + y = _mm256_permute_ps(x, 0x39); // y: 1 2 3 0 5 6 7 4 + x = _mm256_min_ps(x, y); // X: 01 12 23 30 45 56 67 74 + y = _mm256_permute_ps(x, 0x4e); // y: 23 30 01 12 67 74 45 56 + x = _mm256_min_ps(x, y); // x: 0123 x x x 4567 x x x + y = _mm256_permute2f128_ps(x, x, 1); // y: 4567 x x x 0123 x x x + x = _mm256_min_ps(x, y); // x: 01234567 x x x x x x x + } #endif } // namespace XARCH diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.cpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.cpp index 393d58fcfde958..aa9643fe7b09ff 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.cpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.cpp @@ -26,8 +26,22 @@ namespace XARCH { using namespace ov; +#if defined(HAVE_AVX2) + +#define prefetch_bytes(bytes, sel, advance, src) { \ + auto *p = reinterpret_cast(src); \ + for (size_t i = 0; i < bytes; i += 64) \ + _mm_prefetch(p + i + advance, sel); \ +} + +#else + +#define prefetch_bytes(bytes, sel, advance, src) + +#endif + template -void attn_acc_value(float* out, float weight, T* v, size_t S) { +static void attn_acc_value(float* out, float weight, T* v, size_t S, float* scale, float* zp) { size_t i = 0; #if defined(HAVE_AVX512F) auto attn_w_vec_fp32 = _mm512_set1_ps(weight); @@ -51,27 +65,328 @@ void attn_acc_value(float* out, float weight, T* v, size_t S) { } } +static void attn_acc_value(float* out, float weight, uint8_t* v, size_t S, float* scale, float* zp) { + size_t i = 0; + weight *= *scale; +#if defined(HAVE_AVX512F) + auto attn_w_vec_fp32 = _mm512_set1_ps(weight); + auto v_zp = _mm512_set1_ps(*zp); + for (; i + 4 * vec_len_f32_avx512 <= S; i += 4 * vec_len_f32_avx512) { + auto v0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i)); + auto v1_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx512)); + auto v2_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx512 * 2)); + auto v3_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx512 * 3)); + + auto v0_out = mm512_uni_loadu_ps(out + i); + auto v1_out = mm512_uni_loadu_ps(out + i + vec_len_f32_avx512); + auto v2_out = mm512_uni_loadu_ps(out + i + vec_len_f32_avx512 * 2); + auto v3_out = mm512_uni_loadu_ps(out + i + vec_len_f32_avx512 * 3); + + auto v0_256 = _mm512_cvtepu8_epi32(v0_128); + auto v1_256 = _mm512_cvtepu8_epi32(v1_128); + auto v2_256 = _mm512_cvtepu8_epi32(v2_128); + auto v3_256 = _mm512_cvtepu8_epi32(v3_128); + + auto v0_value = _mm512_cvtepi32_ps(v0_256); + auto v1_value = _mm512_cvtepi32_ps(v1_256); + auto v2_value = _mm512_cvtepi32_ps(v2_256); + auto v3_value = _mm512_cvtepi32_ps(v3_256); + + v0_value = _mm512_sub_ps(v0_value, v_zp); + v1_value = _mm512_sub_ps(v1_value, v_zp); + v2_value = _mm512_sub_ps(v2_value, v_zp); + v3_value = _mm512_sub_ps(v3_value, v_zp); + + v0_out = _mm512_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + v1_out = _mm512_fmadd_ps(attn_w_vec_fp32, v1_value, v1_out); + v2_out = _mm512_fmadd_ps(attn_w_vec_fp32, v2_value, v2_out); + v3_out = _mm512_fmadd_ps(attn_w_vec_fp32, v3_value, v3_out); + + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 0, v0_out); + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 1, v1_out); + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 2, v2_out); + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 3, v3_out); + } + if (i + 2 * vec_len_f32_avx512 <= S) { + auto v0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i)); + auto v1_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx512)); + + auto v0_out = mm512_uni_loadu_ps(out + i); + auto v1_out = mm512_uni_loadu_ps(out + i + vec_len_f32_avx512); + + auto v0_256 = _mm512_cvtepu8_epi32(v0_128); + auto v1_256 = _mm512_cvtepu8_epi32(v1_128); + + auto v0_value = _mm512_cvtepi32_ps(v0_256); + auto v1_value = _mm512_cvtepi32_ps(v1_256); + + v0_value = _mm512_sub_ps(v0_value, v_zp); + v1_value = _mm512_sub_ps(v1_value, v_zp); + + v0_out = _mm512_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + v1_out = _mm512_fmadd_ps(attn_w_vec_fp32, v1_value, v1_out); + + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 0, v0_out); + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 1, v1_out); + i += 2 * vec_len_f32_avx512; + } + if (i + vec_len_f32_avx512 <= S) { + auto v0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(v + i)); + auto v0_out = mm512_uni_loadu_ps(out + i); + auto v0_256 = _mm512_cvtepu8_epi32(v0_128); + auto v0_value = _mm512_cvtepi32_ps(v0_256); + v0_value = _mm512_sub_ps(v0_value, v_zp); + v0_out = _mm512_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + mm512_uni_storeu_ps(out + i + vec_len_f32_avx512 * 0, v0_out); + i += vec_len_f32_avx512; + } +#elif defined(HAVE_AVX2) + auto attn_w_vec_fp32 = _mm256_set1_ps(weight); + auto v_zp = _mm256_set1_ps(*zp); + for (; i + 4 * vec_len_f32_avx2 <= S; i += 4 * vec_len_f32_avx2) { + auto v0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i)); + auto v1_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx2)); + auto v2_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx2 * 2)); + auto v3_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx2 * 3)); + + auto v0_out = mm256_uni_loadu_ps(out + i); + auto v1_out = mm256_uni_loadu_ps(out + i + vec_len_f32_avx2); + auto v2_out = mm256_uni_loadu_ps(out + i + vec_len_f32_avx2 * 2); + auto v3_out = mm256_uni_loadu_ps(out + i + vec_len_f32_avx2 * 3); + + auto v0_256 = _mm256_cvtepu8_epi32(v0_128); + auto v1_256 = _mm256_cvtepu8_epi32(v1_128); + auto v2_256 = _mm256_cvtepu8_epi32(v2_128); + auto v3_256 = _mm256_cvtepu8_epi32(v3_128); + + auto v0_value = _mm256_cvtepi32_ps(v0_256); + auto v1_value = _mm256_cvtepi32_ps(v1_256); + auto v2_value = _mm256_cvtepi32_ps(v2_256); + auto v3_value = _mm256_cvtepi32_ps(v3_256); + + v0_value = _mm256_sub_ps(v0_value, v_zp); + v1_value = _mm256_sub_ps(v1_value, v_zp); + v2_value = _mm256_sub_ps(v2_value, v_zp); + v3_value = _mm256_sub_ps(v3_value, v_zp); + + v0_out = _mm256_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + v1_out = _mm256_fmadd_ps(attn_w_vec_fp32, v1_value, v1_out); + v2_out = _mm256_fmadd_ps(attn_w_vec_fp32, v2_value, v2_out); + v3_out = _mm256_fmadd_ps(attn_w_vec_fp32, v3_value, v3_out); + + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 0, v0_out); + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 1, v1_out); + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 2, v2_out); + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 3, v3_out); + } + if (i + 2 * vec_len_f32_avx2 <= S) { + auto v0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i)); + auto v1_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i + vec_len_f32_avx2)); + + auto v0_out = mm256_uni_loadu_ps(out + i); + auto v1_out = mm256_uni_loadu_ps(out + i + vec_len_f32_avx2); + + auto v0_256 = _mm256_cvtepu8_epi32(v0_128); + auto v1_256 = _mm256_cvtepu8_epi32(v1_128); + + auto v0_value = _mm256_cvtepi32_ps(v0_256); + auto v1_value = _mm256_cvtepi32_ps(v1_256); + + v0_value = _mm256_sub_ps(v0_value, v_zp); + v1_value = _mm256_sub_ps(v1_value, v_zp); + + v0_out = _mm256_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + v1_out = _mm256_fmadd_ps(attn_w_vec_fp32, v1_value, v1_out); + + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 0, v0_out); + mm256_uni_storeu_ps(out + i + vec_len_f32_avx2 * 1, v1_out); + i += 2 * vec_len_f32_avx2; + } + if (i + vec_len_f32_avx2 <= S) { + auto v0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(v + i)); + auto v0_out = mm256_uni_loadu_ps(out + i); + auto v0_256 = _mm256_cvtepu8_epi32(v0_128); + auto v0_value = _mm256_cvtepi32_ps(v0_256); + v0_value = _mm256_sub_ps(v0_value, v_zp); + v0_out = _mm256_fmadd_ps(attn_w_vec_fp32, v0_value, v0_out); + mm256_uni_storeu_ps(out + i, v0_out); + i += vec_len_f32_avx2; + } +#endif + for (; i < S; i++) { + out[i] += weight * (v[i] - *zp); + } +} + +template +static float sum_q_head(T* a, size_t n) { + float sum = 0.0f; + size_t i = 0; +#if defined(HAVE_AVX512F) + auto vsum0 = _mm512_set1_ps(0.0f); + auto vsum1 = _mm512_set1_ps(0.0f); + auto vsum2 = _mm512_set1_ps(0.0f); + auto vsum3 = _mm512_set1_ps(0.0f); + for (; i + 4 * vec_len_f32_avx512 <= n; i += vec_len_f32_avx512 * 4) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + auto va2 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 2); + auto va3 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 3); + + vsum0 = _mm512_add_ps(va0, vsum0); + vsum1 = _mm512_add_ps(va1, vsum1); + vsum2 = _mm512_add_ps(va2, vsum2); + vsum3 = _mm512_add_ps(va3, vsum3); + } + if (i + 2 * vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + + vsum0 = _mm512_add_ps(va0, vsum0); + vsum1 = _mm512_add_ps(va1, vsum1); + i += 2 * vec_len_f32_avx512; + } + if (i + vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + vsum0 = _mm512_add_ps(va0, vsum0); + i += vec_len_f32_avx512; + } + vsum0 = _mm512_add_ps(vsum0, vsum1); + vsum2 = _mm512_add_ps(vsum2, vsum3); + vsum0 = _mm512_add_ps(vsum0, vsum2); + sum = _mm512_reduce_add_ps(vsum0); +#elif defined(HAVE_AVX2) + auto vsum0 = _mm256_set1_ps(0.0f); + auto vsum1 = _mm256_set1_ps(0.0f); + auto vsum2 = _mm256_set1_ps(0.0f); + auto vsum3 = _mm256_set1_ps(0.0f); + for (; i + 4 * vec_len_f32_avx2 <= n; i += vec_len_f32_avx2 * 4) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + auto va2 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 2); + auto va3 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 3); + + vsum0 = _mm256_add_ps(va0, vsum0); + vsum1 = _mm256_add_ps(va1, vsum1); + vsum2 = _mm256_add_ps(va2, vsum2); + vsum3 = _mm256_add_ps(va3, vsum3); + } + if (i + 2 * vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + + vsum0 = _mm256_add_ps(va0, vsum0); + vsum1 = _mm256_add_ps(va1, vsum1); + i += 2 * vec_len_f32_avx2; + } + if (i + vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + vsum0 = _mm256_add_ps(va0, vsum0); + i += vec_len_f32_avx2; + } + vsum0 = _mm256_add_ps(vsum0, vsum1); + vsum2 = _mm256_add_ps(vsum2, vsum3); + vsum0 = _mm256_add_ps(vsum0, vsum2); + hsum(vsum0); + sum = _mm256_cvtss_f32(vsum0); +#endif + + for (; i < n; i++) { + float tmp = a[i]; + sum += tmp; + } + return sum; +} + template -float dot_product(TA* a, TB* b, size_t n) { +static float dot_product(TA* a, TB* b, size_t n, float* scale, float* zp, float* head_sum) { size_t i = 0; float sum = 0.0f; #if defined(HAVE_AVX512F) - auto vsum = _mm512_setzero_ps(); - for (; i + vec_len_f32_avx512 <= n; i += vec_len_f32_avx512) { - auto va = mm512_uni_loadu_ps(a + i); - auto vb = mm512_uni_loadu_ps(b + i); - vsum = _mm512_fmadd_ps(va, vb, vsum); + auto vsum0 = _mm512_setzero_ps(); + auto vsum1 = _mm512_setzero_ps(); + auto vsum2 = _mm512_setzero_ps(); + auto vsum3 = _mm512_setzero_ps(); + for (; i + 4 * vec_len_f32_avx512 <= n; i += 4 * vec_len_f32_avx512) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + auto va2 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 2); + auto va3 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 3); + + auto vb0 = mm512_uni_loadu_ps(b + i); + auto vb1 = mm512_uni_loadu_ps(b + i + vec_len_f32_avx512); + auto vb2 = mm512_uni_loadu_ps(b + i + vec_len_f32_avx512 * 2); + auto vb3 = mm512_uni_loadu_ps(b + i + vec_len_f32_avx512 * 3); + + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm512_fmadd_ps(va1, vb1, vsum1); + vsum2 = _mm512_fmadd_ps(va2, vb2, vsum2); + vsum3 = _mm512_fmadd_ps(va3, vb3, vsum3); + } + if (i + 2 * vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + + auto vb0 = mm512_uni_loadu_ps(b + i); + auto vb1 = mm512_uni_loadu_ps(b + i + vec_len_f32_avx512); + + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm512_fmadd_ps(va1, vb1, vsum1); + i += 2 * vec_len_f32_avx512; + } + if (i + vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto vb0 = mm512_uni_loadu_ps(b + i); + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + i += vec_len_f32_avx512; } - sum = _mm512_reduce_add_ps(vsum); + vsum0 = _mm512_add_ps(vsum0, vsum1); + vsum2 = _mm512_add_ps(vsum2, vsum3); + vsum0 = _mm512_add_ps(vsum0, vsum2); + sum = _mm512_reduce_add_ps(vsum0); #elif defined(HAVE_AVX2) - auto vsum = _mm256_set1_ps(0.0f); - for (; i + vec_len_f32_avx2 <= n; i += vec_len_f32_avx2) { - auto va = mm256_uni_loadu_ps(a + i); - auto vb = mm256_uni_loadu_ps(b + i); - vsum = _mm256_fmadd_ps(va, vb, vsum); - } - hsum(vsum); - sum = _mm256_cvtss_f32(vsum); + auto vsum0 = _mm256_set1_ps(0.0f); + auto vsum1 = _mm256_set1_ps(0.0f); + auto vsum2 = _mm256_set1_ps(0.0f); + auto vsum3 = _mm256_set1_ps(0.0f); + for (; i + 4 * vec_len_f32_avx2 <= n; i += vec_len_f32_avx2 * 4) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + auto va2 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 2); + auto va3 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 3); + + auto vb0 = mm256_uni_loadu_ps(b + i); + auto vb1 = mm256_uni_loadu_ps(b + i + vec_len_f32_avx2); + auto vb2 = mm256_uni_loadu_ps(b + i + vec_len_f32_avx2 * 2); + auto vb3 = mm256_uni_loadu_ps(b + i + vec_len_f32_avx2 * 3); + + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm256_fmadd_ps(va1, vb1, vsum1); + vsum2 = _mm256_fmadd_ps(va2, vb2, vsum2); + vsum3 = _mm256_fmadd_ps(va3, vb3, vsum3); + } + if (i + 2 * vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + + auto vb0 = mm256_uni_loadu_ps(b + i); + auto vb1 = mm256_uni_loadu_ps(b + i + vec_len_f32_avx2); + + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm256_fmadd_ps(va1, vb1, vsum1); + i += 2 * vec_len_f32_avx2; + } + if (i + vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto vb0 = mm256_uni_loadu_ps(b + i); + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + i += vec_len_f32_avx2; + } + vsum0 = _mm256_add_ps(vsum0, vsum1); + vsum2 = _mm256_add_ps(vsum2, vsum3); + vsum0 = _mm256_add_ps(vsum0, vsum2); + hsum(vsum0); + sum = _mm256_cvtss_f32(vsum0); #endif for (; i < n; i++) { sum += a[i] * b[i]; @@ -79,15 +394,168 @@ float dot_product(TA* a, TB* b, size_t n) { return sum; } +template +static float dot_product(TA* a, uint8_t* b, size_t n, float* scale, float* zp, float* head_sum) { + size_t i = 0; + float sum = 0.0f; +#if defined(HAVE_AVX512F) + auto vsum0 = _mm512_set1_ps(0.0f); + auto vsum1 = _mm512_set1_ps(0.0f); + auto vsum2 = _mm512_set1_ps(0.0f); + auto vsum3 = _mm512_set1_ps(0.0f); + auto v_zp = _mm512_set1_ps(*zp); + for (; i + 4 * vec_len_f32_avx512 <= n; i += vec_len_f32_avx512 * 4) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + auto va2 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 2); + auto va3 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512 * 3); + + auto vb0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i)); + auto vb1_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx512)); + auto vb2_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx512 * 2)); + auto vb3_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx512 * 3)); + + auto vb0_256 = _mm512_cvtepu8_epi32(vb0_128); + auto vb1_256 = _mm512_cvtepu8_epi32(vb1_128); + auto vb2_256 = _mm512_cvtepu8_epi32(vb2_128); + auto vb3_256 = _mm512_cvtepu8_epi32(vb3_128); + + auto vb0 = _mm512_cvtepi32_ps(vb0_256); + auto vb1 = _mm512_cvtepi32_ps(vb1_256); + auto vb2 = _mm512_cvtepi32_ps(vb2_256); + auto vb3 = _mm512_cvtepi32_ps(vb3_256); + + vb0 = _mm512_sub_ps(vb0, v_zp); + vb1 = _mm512_sub_ps(vb1, v_zp); + vb2 = _mm512_sub_ps(vb2, v_zp); + vb3 = _mm512_sub_ps(vb3, v_zp); + + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm512_fmadd_ps(va1, vb1, vsum1); + vsum2 = _mm512_fmadd_ps(va2, vb2, vsum2); + vsum3 = _mm512_fmadd_ps(va3, vb3, vsum3); + } + if (i + 2 * vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto va1 = mm512_uni_loadu_ps(a + i + vec_len_f32_avx512); + + auto vb0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i)); + auto vb1_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx512)); + + auto vb0_256 = _mm512_cvtepu8_epi32(vb0_128); + auto vb1_256 = _mm512_cvtepu8_epi32(vb1_128); + + auto vb0 = _mm512_cvtepi32_ps(vb0_256); + auto vb1 = _mm512_cvtepi32_ps(vb1_256); + + vb0 = _mm512_sub_ps(vb0, v_zp); + vb1 = _mm512_sub_ps(vb1, v_zp); + + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm512_fmadd_ps(va1, vb1, vsum1); + i += 2 * vec_len_f32_avx512; + } + if (i + vec_len_f32_avx512 <= n) { + auto va0 = mm512_uni_loadu_ps(a + i); + auto vb0_128 = _mm_loadu_si128(reinterpret_cast<__m128i*>(b + i)); + auto vb0_256 = _mm512_cvtepu8_epi32(vb0_128); + auto vb0 = _mm512_cvtepi32_ps(vb0_256); + vb0 = _mm512_sub_ps(vb0, v_zp); + vsum0 = _mm512_fmadd_ps(va0, vb0, vsum0); + i += vec_len_f32_avx512; + } + vsum0 = _mm512_add_ps(vsum0, vsum1); + vsum2 = _mm512_add_ps(vsum2, vsum3); + vsum0 = _mm512_add_ps(vsum0, vsum2); + sum = _mm512_reduce_add_ps(vsum0); + for (; i < n; i++) { + sum += a[i] * (b[i] - *zp); + } + return scale[0] * sum; + +#elif defined(HAVE_AVX2) + auto vsum0 = _mm256_set1_ps(0.0f); + auto vsum1 = _mm256_set1_ps(0.0f); + auto vsum2 = _mm256_set1_ps(0.0f); + auto vsum3 = _mm256_set1_ps(0.0f); + for (; i + 4 * vec_len_f32_avx2 <= n; i += vec_len_f32_avx2 * 4) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + auto va2 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 2); + auto va3 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2 * 3); + + auto vb0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i)); + auto vb1_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx2)); + auto vb2_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx2 * 2)); + auto vb3_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx2 * 3)); + + auto vb0_256 = _mm256_cvtepu8_epi32(vb0_128); + auto vb1_256 = _mm256_cvtepu8_epi32(vb1_128); + auto vb2_256 = _mm256_cvtepu8_epi32(vb2_128); + auto vb3_256 = _mm256_cvtepu8_epi32(vb3_128); + + auto vb0 = _mm256_cvtepi32_ps(vb0_256); + auto vb1 = _mm256_cvtepi32_ps(vb1_256); + auto vb2 = _mm256_cvtepi32_ps(vb2_256); + auto vb3 = _mm256_cvtepi32_ps(vb3_256); + + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm256_fmadd_ps(va1, vb1, vsum1); + vsum2 = _mm256_fmadd_ps(va2, vb2, vsum2); + vsum3 = _mm256_fmadd_ps(va3, vb3, vsum3); + } + if (i + 2 * vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto va1 = mm256_uni_loadu_ps(a + i + vec_len_f32_avx2); + + auto vb0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i)); + auto vb1_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i + vec_len_f32_avx2)); + + auto vb0_256 = _mm256_cvtepu8_epi32(vb0_128); + auto vb1_256 = _mm256_cvtepu8_epi32(vb1_128); + + auto vb0 = _mm256_cvtepi32_ps(vb0_256); + auto vb1 = _mm256_cvtepi32_ps(vb1_256); + + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + vsum1 = _mm256_fmadd_ps(va1, vb1, vsum1); + i += 2 * vec_len_f32_avx2; + } + if (i + vec_len_f32_avx2 <= n) { + auto va0 = mm256_uni_loadu_ps(a + i); + auto vb0_128 = _mm_loadl_epi64(reinterpret_cast<__m128i*>(b + i)); + auto vb0_256 = _mm256_cvtepu8_epi32(vb0_128); + auto vb0 = _mm256_cvtepi32_ps(vb0_256); + vsum0 = _mm256_fmadd_ps(va0, vb0, vsum0); + i += vec_len_f32_avx2; + } + vsum0 = _mm256_add_ps(vsum0, vsum1); + vsum2 = _mm256_add_ps(vsum2, vsum3); + vsum0 = _mm256_add_ps(vsum0, vsum2); + hsum(vsum0); + sum = _mm256_cvtss_f32(vsum0); + for (; i < n; i++) { + sum += a[i] * b[i]; + } + // B = scale * (b - zero) + // Σ (A * B) = Σ (a * scale * (b - zero)) = scale * (Σ a * b - zero Σ a) = scale * (sum - zp * head_sum) + return scale[0] * (sum - zp[0] * head_sum[0]); +#else + for (; i < n; i++) { + sum += a[i] * (b[i] - *zp); + } + return scale[0] * sum; +#endif +} + template -void attn_reduce(T* dst, float* temp, size_t M, size_t S, size_t temp_stride) { +static void attn_reduce(T* dst, float* temp, size_t M, size_t S, size_t temp_stride) { size_t i = 0; #if defined(HAVE_AVX512F) for (; i + vec_len_f32_avx512 <= S; i+= vec_len_f32_avx512) { auto* src = temp + i; auto result_vec_fp32 = _mm512_setzero_ps(); for (size_t m = 0; m < M; m++) { - //auto* temp = &m_temp.at({ithr, b, pq, h, 0}); auto o_vec_fp32 = _mm512_loadu_ps(src); result_vec_fp32 = _mm512_add_ps(result_vec_fp32, o_vec_fp32); src += temp_stride; @@ -120,7 +588,7 @@ void attn_reduce(T* dst, float* temp, size_t M, size_t S, size_t temp_stride) { } template -void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, +static void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, const ov::intel_cpu::PlainTensor& present_key, const ov::intel_cpu::PlainTensor& present_value, const ov::intel_cpu::PlainTensor& alibi_mask, @@ -131,7 +599,10 @@ void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, ov::intel_cpu::PlainTensor& buf_attn_score, bool has_out_transpose, bool auto_causal, - float d_scale) { + float d_scale, + const ov::intel_cpu::PlainTensor& past_k_scale_zp, + const ov::intel_cpu::PlainTensor& past_v_scale_zp, + ov::intel_cpu::PlainTensor& head_sum) { ov::intel_cpu::PlainTensor causal_mask; bool select_nfltmax_at_0 = false; auto B = query.size(0); @@ -146,27 +617,67 @@ void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, } if (d_scale == 0.0f) d_scale = 1.0f / sqrt(S); + auto nthr = parallel_get_max_threads(); // use per-token kernel, for each k,v token // attn mask is a matrix of q_len(kv_len) buf_attn_w.resize({B, H, q_len, kv_len}); +#if defined(HAVE_AVX2) && !defined(HAVE_AVX512F) + // avx2 will pre-compute the zero point and try to save the sub instruction in the dot_product, + // but it seems not necessary for avx512. Possible reason may be that for avx2 the cost of dot_product + // is larger than the memory access time, but for avx512 is not and the cost of pre-compute is a pure increase. + bool pastkv_is_int8 = past_k_scale_zp; + if (pastkv_is_int8) { + // be sure no false sharing + head_sum.resize({B, H, q_len, 16}); + parallel_for3d(B, H, q_len, [&](size_t b, size_t h, size_t pq) { + *head_sum.ptr(b, h, pq) = sum_q_head(query.ptr(b, h, pq), S); + }); + } +#endif + parallel_nt_static(nthr, [&](const size_t ithr, const size_t nthr) { + size_t start{0}, end{0}; + splitter(B * h_group_num * kv_len, nthr, ithr, start, end); - bool is_abcd = present_key.stride(1) >= present_key.stride(2); - size_t dim0 = is_abcd ? B : kv_len; - size_t dim1 = is_abcd ? h_group_num : B; - size_t dim2 = is_abcd ? kv_len : h_group_num; - - parallel_for3d(dim0, dim1, dim2, [&](size_t d0, size_t d1, size_t d2) { - size_t b = is_abcd ? d0 : d1; - size_t h_group = is_abcd ? d1 : d2; - size_t pk = is_abcd ? d2 : d0; - - // which batch item should be used at postion pk? - auto b_kv = beams ? beams.at({b, pk}) : b; - for (size_t pq = 0; pq < q_len; pq++) { - for (size_t h = h_group * h_each_group_len; h < (h_group + 1) * h_each_group_len; h++) { - buf_attn_w.at({b, h, pq, pk}) = - dot_product(&query.at({b, h, pq, 0}), &present_key.at({b_kv, h_group, pk, 0}, true), S); + size_t b, h_group, pk; + if (start < end) { + parallel_it_init(start, b, B, h_group, h_group_num, pk, kv_len); + if (q_len == 1 && h_each_group_len == 1) { + if (B == 1) { + // the memory will be continuous when b==1 + for (size_t iwork = start; iwork < end; ++iwork) { + auto p = past_k_scale_zp.ptr(0, h_group, pk); + auto p_k = present_key.ptr(0, h_group, pk); + prefetch_bytes(S, _MM_HINT_T0, 4096, p_k); + buf_attn_w.ptr(0, h_group, 0)[pk] = + dot_product(query.ptr(0, h_group), p_k, + S, p, p + 1, head_sum.ptr(0, h_group)); + parallel_it_step(b, B, h_group, h_group_num, pk, kv_len); + } + } else { + for (size_t iwork = start; iwork < end; ++iwork) { + auto b_kv = beams ? beams.ptr(b)[pk] : b; + auto p = past_k_scale_zp.ptr(b_kv, h_group, pk); + auto p_k = present_key.ptr(b_kv, h_group, pk); + buf_attn_w.ptr(b, h_group, 0)[pk] = + dot_product(query.ptr(b, h_group), p_k, + S, p, p + 1, head_sum.ptr(b, h_group)); + parallel_it_step(b, B, h_group, h_group_num, pk, kv_len); + } + } + } else { + for (size_t iwork = start; iwork < end; ++iwork) { + auto b_kv = beams ? beams.ptr(b)[pk] : b; + for (size_t pq = 0; pq < q_len; pq++) { + auto p = past_k_scale_zp.ptr(b_kv, h_group, pk); + for (size_t h = h_group * h_each_group_len; h < (h_group + 1) * h_each_group_len; h++) { + buf_attn_w.ptr(b, h, pq)[pk] = + dot_product(query.ptr(b, h, pq), present_key.ptr(b_kv, h_group, pk), + S, p, p + 1, head_sum.ptr(b, h, pq)); + } + } + parallel_it_step(b, B, h_group, h_group_num, pk, kv_len); + } } } }); @@ -177,10 +688,10 @@ void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, float* alibi_ptr = alibi_mask ? &alibi_mask.at({b, h, pq, 0}, true) : nullptr; uint8_t* attn_mask_ptr = nullptr; auto attn_mask_prec = attention_mask.get_precision(); - attn_mask_ptr = reinterpret_cast(&attention_mask.at({b, h, 0, 0}, true)); + attn_mask_ptr = reinterpret_cast(&attention_mask.at({b, h, pq, 0}, true)); uint8_t* cmask_ptr = causal_mask ? &causal_mask.at({b, h, pq, 0}, true) : nullptr; - attn_softmax_kernel(&buf_attn_w.at({b, h, pq, 0}), - &buf_attn_w.at({b, h, pq, 0}), + attn_softmax_kernel(buf_attn_w.ptr(b, h, pq), + buf_attn_w.ptr(b, h, pq), d_scale, alibi_ptr, attn_mask_ptr, @@ -193,44 +704,55 @@ void mha_single_token_kernel(const ov::intel_cpu::PlainTensor& query, }); // attn_w * V - auto nthr = parallel_get_max_threads(); buf_attn_score.resize({static_cast(nthr), B, q_len, H, S}); // buf_attn_w {B, H, q_len, kv_len} parallel_nt_static(nthr, [&](const size_t ithr, const size_t nthr) { size_t start{0}, end{0}; splitter(B * h_group_num * kv_len, nthr, ithr, start, end); - memset(&buf_attn_score.at({ithr, 0, 0, 0, 0}), 0, buf_attn_score.stride(0) * sizeof(float)); + memset(buf_attn_score.ptr(ithr, 0, 0, 0, 0), 0, buf_attn_score.stride(0) * sizeof(float)); size_t b, h_group, pv; if (start < end) { - if (is_abcd) - parallel_it_init(start, b, B, h_group, h_group_num, pv, kv_len); - else - parallel_it_init(start, pv, kv_len, b, B, h_group, h_group_num); - for (size_t iwork = start; iwork < end; ++iwork) { - auto b_kv = beams ? beams.at({b, pv}) : b; - auto* v = &present_value.at({b_kv, h_group, pv, 0}, true); - for (size_t pq = 0; pq < q_len; pq++) { - for (size_t h = h_group * h_each_group_len; h < (h_group + 1) * h_each_group_len; h++) { - attn_acc_value(&buf_attn_score.at({ithr, b, pq, h, 0}), - buf_attn_w.at({b, h, pq, pv}), - v, - S); - } + parallel_it_init(start, b, B, h_group, h_group_num, pv, kv_len); + if (q_len == 1 && h_each_group_len == 1) { + for (size_t iwork = start; iwork < end; ++iwork) { + auto b_kv = beams ? beams.ptr(b)[pv] : b; + auto* v = present_value.ptr(b_kv, h_group, pv); + auto p = past_v_scale_zp.ptr(b_kv, h_group, pv); + attn_acc_value(buf_attn_score.ptr(ithr, b, 0, h_group), + buf_attn_w.ptr(b, h_group, 0, pv)[0], + v, + S, + p + 0, + p + 1); + parallel_it_step(b, B, h_group, h_group_num, pv, kv_len); } - if (is_abcd) + } else { + for (size_t iwork = start; iwork < end; ++iwork) { + auto b_kv = beams ? beams.ptr(b)[pv] : b; + auto* v = present_value.ptr(b_kv, h_group, pv); + auto p = past_v_scale_zp.ptr(b_kv, h_group, pv); + for (size_t pq = 0; pq < q_len; pq++) { + for (size_t h = h_group * h_each_group_len; h < (h_group + 1) * h_each_group_len; h++) { + attn_acc_value(buf_attn_score.ptr(ithr, b, pq, h), + buf_attn_w.ptr(b, h, pq)[pv], + v, + S, + p + 0, + p + 1); + } + } parallel_it_step(b, B, h_group, h_group_num, pv, kv_len); - else - parallel_it_step(pv, kv_len, b, B, h_group, h_group_num); + } } } }); parallel_for3d(B, H, q_len, [&](size_t b, size_t h, size_t pq) { - auto* temp = &buf_attn_score.at({0, b, pq, h, 0}); + auto* temp = buf_attn_score.ptr(0, b, pq, h); size_t temp_stride = buf_attn_score.stride(0); - auto* dst = has_out_transpose ? &output_emb.at({b, pq, h * S}) : &output_emb.at({b, h, pq}); + auto* dst = has_out_transpose ? output_emb.ptr(b, pq, h * S) : output_emb.ptr(b, h, pq); attn_reduce(dst, temp, nthr, S, temp_stride); }); } @@ -246,22 +768,62 @@ void mha_single_token(const ov::intel_cpu::PlainTensor& query, ov::intel_cpu::PlainTensor& buf_attn_score, bool has_out_transpose, bool auto_causal, - float d_scale) { + float d_scale, + const ov::intel_cpu::PlainTensor& past_k_scale_zp, + const ov::intel_cpu::PlainTensor& past_v_scale_zp, + ov::intel_cpu::PlainTensor& head_sum) { if (query.get_precision() == ov::element::bf16) { - mha_single_token_kernel(query, - present_key, - present_value, - alibi_mask, - attention_mask, - beams, - output_emb, - buf_attn_w, - buf_attn_score, - has_out_transpose, - auto_causal, - d_scale); + if (present_key.get_precision() == ov::element::u8) { + mha_single_token_kernel(query, + present_key, + present_value, + alibi_mask, + attention_mask, + beams, + output_emb, + buf_attn_w, + buf_attn_score, + has_out_transpose, + auto_causal, + d_scale, + past_k_scale_zp, + past_v_scale_zp, + head_sum); + } else { + mha_single_token_kernel(query, + present_key, + present_value, + alibi_mask, + attention_mask, + beams, + output_emb, + buf_attn_w, + buf_attn_score, + has_out_transpose, + auto_causal, + d_scale, + past_k_scale_zp, + past_v_scale_zp, + head_sum); + } } else if (query.get_precision() == ov::element::f32) { - if (present_key.get_precision() == ov::element::f16) { + if (present_key.get_precision() == ov::element::u8) { + mha_single_token_kernel(query, + present_key, + present_value, + alibi_mask, + attention_mask, + beams, + output_emb, + buf_attn_w, + buf_attn_score, + has_out_transpose, + auto_causal, + d_scale, + past_k_scale_zp, + past_v_scale_zp, + head_sum); + } else if (present_key.get_precision() == ov::element::f16) { mha_single_token_kernel(query, present_key, present_value, @@ -273,7 +835,10 @@ void mha_single_token(const ov::intel_cpu::PlainTensor& query, buf_attn_score, has_out_transpose, auto_causal, - d_scale); + d_scale, + past_k_scale_zp, + past_v_scale_zp, + head_sum); } else { mha_single_token_kernel(query, present_key, @@ -286,7 +851,10 @@ void mha_single_token(const ov::intel_cpu::PlainTensor& query, buf_attn_score, has_out_transpose, auto_causal, - d_scale); + d_scale, + past_k_scale_zp, + past_v_scale_zp, + head_sum); } } else { OPENVINO_THROW("Unsupported precision: ", query.get_precision()); diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.hpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.hpp index 239527c8c7ad8a..8bf05a2d9dadf0 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.hpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/mha_single_token.hpp @@ -26,7 +26,10 @@ void mha_single_token(const ov::intel_cpu::PlainTensor& query, ov::intel_cpu::PlainTensor& buf_attn_score, bool has_out_transpose, bool auto_causal, - float d_scale); + float d_scale, + const ov::intel_cpu::PlainTensor& past_k_scale_zp, + const ov::intel_cpu::PlainTensor& past_v_scale_zp, + ov::intel_cpu::PlainTensor& head_sum); } // namespace XARCH } // namespace Cpu diff --git a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/softmax_kernel.hpp b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/softmax_kernel.hpp index 4d85af64d137aa..500ae6e184f1f1 100644 --- a/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/softmax_kernel.hpp +++ b/src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/softmax_kernel.hpp @@ -17,16 +17,6 @@ namespace Cpu { namespace XARCH { #if defined(HAVE_AVX2) -inline void hmax(__m256& x) { - __m256 y; // x: 0 1 2 3 4 5 6 7 - y = _mm256_permute_ps(x, 0x39); // y: 1 2 3 0 5 6 7 4 - x = _mm256_max_ps(x, y); // X: 01 12 23 30 45 56 67 74 - y = _mm256_permute_ps(x, 0x4e); // y: 23 30 01 12 67 74 45 56 - x = _mm256_max_ps(x, y); // x: 0123 x x x 4567 x x x - y = _mm256_permute2f128_ps(x, x, 1); // y: 4567 x x x 0123 x x x - x = _mm256_max_ps(x, y); // x: 01234567 x x x x x x x -} - inline void exp_ps_avx2(__m256& src) { static __m256 exp_ln_flt_min_f = _mm256_castsi256_ps(_mm256_set1_epi32(0xc2aeac50)); // log(FLT_MIN) static __m256 exp_ln_flt_max_f = _mm256_castsi256_ps(_mm256_set1_epi32(0x42b17218)); // log(FLT_MAX) diff --git a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp index 594306b4b2d169..acae41d7546b8e 100644 --- a/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp +++ b/src/plugins/intel_cpu/src/nodes/scaled_attn.cpp @@ -27,6 +27,7 @@ #include "kernels/scaled_attn/softmax.hpp" #include "kernels/scaled_attn/mha_single_token.hpp" #include "kernels/scaled_attn/attn_memcpy.hpp" +#include "kernels/scaled_attn/attn_quant.hpp" #include "kernels/x64/brgemm_kernel.hpp" #include "nodes/common/cpu_convert.h" @@ -142,7 +143,7 @@ struct MHAKernel { for (size_t m = 0; m < q_len; m++) { // dot-product to get attention scores - auto* q = &query.at({b, h, m, 0}); + auto* q = query.ptr(b, h, m, 0); // how many key/values can be accessed causally auto ncausal = kv_len; // no causall mask is set and it's not fused into attention_mask @@ -248,12 +249,7 @@ struct MHAKernel { MHAKernel() = delete; explicit MHAKernel(GraphContext::CPtr ctx) - : context(ctx), - fp32_out(true), - qk_scratch_a(true), - qk_scratch_b(true), - wv_scratch_a(true), - wv_scratch_b(true) {} + : context(ctx) {} dnnl::memory::dims make_dnnl_dims(const std::vector& dims) { dnnl::memory::dims dnnl_dims(dims.size()); @@ -472,16 +468,16 @@ struct MHAKernel { } void exec_qk(dnnl::stream strm, PlainTensor& query, PlainTensor& present_key) { - dnnl::memory q(q_md, strm.get_engine(), query.data()); - dnnl::memory k(k_md, strm.get_engine(), present_key.data()); + dnnl::memory q(q_md, strm.get_engine(), query.ptr()); + dnnl::memory k(k_md, strm.get_engine(), present_key.ptr()); qk_prim.execute(strm, {{DNNL_ARG_SRC, q}, {DNNL_ARG_WEIGHTS, k}, {DNNL_ARG_DST, attn_score}}); } void exec_kv(dnnl::stream strm, PlainTensor& present_value, PlainTensor& output_emb) { - dnnl::memory v(v_md, strm.get_engine(), present_value.data()); - dnnl::memory out(out_md, strm.get_engine(), output_emb.data()); + dnnl::memory v(v_md, strm.get_engine(), present_value.ptr()); + dnnl::memory out(out_md, strm.get_engine(), output_emb.ptr()); wv_prim.execute(strm, {{DNNL_ARG_SRC, attn_weight}, {DNNL_ARG_WEIGHTS, v}, {DNNL_ARG_DST, out}}); } @@ -579,7 +575,7 @@ struct MHAKernel { explicit MHAKernel(GraphContext::CPtr ctx): context(ctx) { m_block_size = 4; select_nfltmax_at_0 = false; - qk_buffers.resize(parallel_get_max_threads(), PlainTensor(true)); + qk_buffers.resize(parallel_get_max_threads()); } PlainTensor causal_mask; @@ -730,8 +726,9 @@ struct MHAKernel { struct MHASingleToken { PlainTensor m_attn_w; PlainTensor m_temp; + PlainTensor m_head_sum; - MHASingleToken() : m_attn_w(true), m_temp(true) {} + MHASingleToken() {} // Q, K, V is ready, do attention // query [B, H, q_len, S] @@ -749,9 +746,11 @@ struct MHASingleToken { const PlainTensor& beams, bool has_out_transpose, bool auto_causal, - float d_scale = 0.0f) { + float d_scale, + const PlainTensor& k_scale_zp, + const PlainTensor& v_scale_zp) { mha_single_token(query, present_key, present_value, alibi_mask, attention_mask, beams, output_emb, - m_attn_w, m_temp, has_out_transpose, auto_causal, d_scale); + m_attn_w, m_temp, has_out_transpose, auto_causal, d_scale, k_scale_zp, v_scale_zp, m_head_sum); } }; @@ -763,17 +762,18 @@ struct ScaledDotProductAttention::AttentionExecutor : public ScaledDotProductAtt MHAKernel kernel; MHASingleToken kernel_single_token; - AttentionExecutor(GraphContext::CPtr ctx) : context(ctx), attn_buf(true), kernel(context) {} + AttentionExecutor(GraphContext::CPtr ctx) : context(ctx), kernel(context) {} void prepare_attn_mask(MemoryPtr attn_input) { attn_buf.resize(attn_input->getStaticDims()); auto p = attn_input->getDataAs(); for (size_t i = 0; i < attn_input->getSize(); i++) - attn_buf.data()[i] = p[i] ? 0.0f : -FLT_MAX; + attn_buf.ptr()[i] = p[i] ? 0.0f : -FLT_MAX; } void execute(dnnl::stream strm, const Config& config, const std::vector& inputs, const MemoryPtr output, - const MemoryPtr presentk_input, const MemoryPtr presentv_input, const MemoryPtr beam_input) override { + const MemoryPtr presentk_input, const MemoryPtr presentv_input, const MemoryPtr beam_input, + const PlainTensor& k_scale_zp, const PlainTensor& v_scale_zp) override { bool has_out_transpose = config.config.output_BLHxS; bool fuse_causal_attn = config.config.fuse_causal_attn; bool is_causal = config.config.is_causal; @@ -881,13 +881,13 @@ struct ScaledDotProductAttention::AttentionExecutor : public ScaledDotProductAtt // 2, using float will save the repack cost which typically is required for bf16/int8 opt // 3, using dot product can leverage the SIMD while easily adapt to indirect kv cache kernel_single_token(q_input, present_key, present_value, {}, use_attn_mask ? attn_mask : PlainTensor(), - output_emb, beam_table, has_out_transpose, auto_causal, scale_input); + output_emb, beam_table, has_out_transpose, auto_causal, scale_input, k_scale_zp, v_scale_zp); } } }; ScaledDotProductAttention::ScaledDotProductAttention(const std::shared_ptr& op, const GraphContext::CPtr context) - : Node(op, context, SDPAShapeInferFactory(op)), m_tmp_reorder(true) { + : Node(op, context, SDPAShapeInferFactory(op)) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { OPENVINO_THROW("CPU: " + errorMessage); @@ -1012,6 +1012,7 @@ void ScaledDotProductAttention::execute(dnnl::stream strm) { inputs[i] = getSrcMemoryAtPort(i); } + PlainTensor k_scale_zp, v_scale_zp; if (m_config.config.fuse_concat) { // initialization will be also completed in this func gatherConcatPastkv(inputs[1], inputs[2], getSrcMemoryAtPort(orginSDPInputNumber)); @@ -1019,11 +1020,13 @@ void ScaledDotProductAttention::execute(dnnl::stream strm) { presentk_input = m_k_state->internal_state_mem(); presentv_input = m_v_state->internal_state_mem(); beam_input = m_k_state->hidden_state_mem(); + k_scale_zp = m_k_state->get_scale_zp(); + v_scale_zp = m_v_state->get_scale_zp(); } else { presentk_input = inputs[1]; presentv_input = inputs[2]; } - m_executor->execute(strm, m_config, inputs, output, presentk_input, presentv_input, beam_input); + m_executor->execute(strm, m_config, inputs, output, presentk_input, presentv_input, beam_input, k_scale_zp, v_scale_zp); } bool ScaledDotProductAttention::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { @@ -1110,7 +1113,7 @@ void ScaledDotProductAttention::resetBeamTablePastkv(const MemoryPtr& mem_cur_k, }; // 1. check beam idx if it's valid - auto* table = beam_idx.data(); + auto* table = beam_idx.ptr(); for (size_t i = 0; i < B; i++) { OPENVINO_ASSERT(static_cast(table[i]) < B_state, "beam_idx[", i, "]=", table[i], " should less than batch of previous pastkv: ", B_state); @@ -1150,6 +1153,27 @@ void ScaledDotProductAttention::resetBeamTablePastkv(const MemoryPtr& mem_cur_k, S * old_past_v.m_element_size); }); } + if (kvcache_precision == ov::element::u8) { + auto& old_scale_zp_k = m_k_state->get_scale_zp(); + auto& old_scale_zp_v = m_v_state->get_scale_zp(); + PlainTensor new_scale_zp_k, new_scale_zp_v; + + new_scale_zp_k.resize({B, H, (L0 + L1) * 2, 2}); + new_scale_zp_v.resize({B, H, (L0 + L1) * 2, 2}); + parallel_for2d(B, H, [&](size_t b, size_t h) { + auto idx = static_cast(table[b]); + for (size_t m = 0; m < L0; m++) { + auto b_kv = static_cast(old_beam_table_k.at({idx, m})); + new_scale_zp_k.at({b, h, m, 0}) = old_scale_zp_k.at({b_kv, h, m, 0}); + new_scale_zp_k.at({b, h, m, 1}) = old_scale_zp_k.at({b_kv, h, m, 1}); + new_scale_zp_v.at({b, h, m, 0}) = old_scale_zp_v.at({b_kv, h, m, 0}); + new_scale_zp_v.at({b, h, m, 1}) = old_scale_zp_v.at({b_kv, h, m, 1}); + } + }); + + m_k_state->set_scale_zp(new_scale_zp_k); + m_v_state->set_scale_zp(new_scale_zp_v); + } auto new_shape = {B, H, (L0 + L1), S}; mem_desc = std::make_shared(kvcache_precision, @@ -1161,7 +1185,13 @@ void ScaledDotProductAttention::resetBeamTablePastkv(const MemoryPtr& mem_cur_k, mem_desc->getStrides()); new_internal_mem_k->redefineDesc(mem_desc); new_internal_mem_v->redefineDesc(mem_desc); - attn_memcpy(cur_k, cur_v, new_pastk.slice(2, L0, L0 + L1), new_pastv.slice(2, L0, L0 + L1)); + if (kvcache_precision == ov::element::u8) { + attn_quantkv(cur_k, cur_v, + new_pastk.slice(2, L0, L0 + L1), new_pastv.slice(2, L0, L0 + L1), + m_k_state->get_scale_zp().slice(2, L0, L0 + L1), m_v_state->get_scale_zp().slice(2, L0, L0 + L1)); + } else { + attn_memcpy(cur_k, cur_v, new_pastk.slice(2, L0, L0 + L1), new_pastv.slice(2, L0, L0 + L1)); + } m_k_state->assign_internal_state(new_internal_mem_k); m_v_state->assign_internal_state(new_internal_mem_v); @@ -1251,7 +1281,8 @@ void ScaledDotProductAttention::updateBeamTable(const MemoryPtr& mem_beam_idx, s OPENVINO_ASSERT(B == B_state, "beam idx batch: ", B, " is not equal to batch of state: ", B_state); OPENVINO_ASSERT(B * (L0 + L1) > 0, "B or (L0+L1) is zero, B: ", B, ", L0: ", L0, ", L1: ", L1); // resize buffer - if (is_reset || B * (L0 + L1) > m_k_state->hidden_state_max_size()) { + bool need_redefine = true; + if (B * (L0 + L1) > m_k_state->hidden_state_max_size()) { auto mem_desc = std::make_shared(ov::element::i32, Shape{B, (L0 + L1) * 2}); auto new_hidden_state_k = std::make_shared(getEngine(), mem_desc); @@ -1263,8 +1294,8 @@ void ScaledDotProductAttention::updateBeamTable(const MemoryPtr& mem_beam_idx, s beam_table_k.reset(hidden_state_k); beam_table_v.reset(hidden_state_v); for (size_t b = 0; b < B; b++) { - std::memcpy(&new_beam_table_k.at({b}), &beam_table_k.at({b}), sizeof(int32_t) * L0); - std::memcpy(&new_beam_table_v.at({b}), &beam_table_v.at({b}), sizeof(int32_t) * L0); + std::memcpy(new_beam_table_k.ptr(b), beam_table_k.ptr(b), sizeof(int32_t) * L0); + std::memcpy(new_beam_table_v.ptr(b), beam_table_v.ptr(b), sizeof(int32_t) * L0); } } m_k_state->assign_hidden_state(new_hidden_state_k); @@ -1275,17 +1306,37 @@ void ScaledDotProductAttention::updateBeamTable(const MemoryPtr& mem_beam_idx, s hidden_state_v = new_hidden_state_v; beam_table_k = new_beam_table_k; beam_table_v = new_beam_table_v; + } else if (is_reset) { + // when reset and not resize, just reset the desc + need_redefine = false; + auto size = m_k_state->hidden_state_max_size(); + auto max_l = size / B; + VectorDims strides(2); + strides[0] = max_l; + strides[1] = 1; + std::vector new_shape{B, (L0 + L1)}; + auto mem_desc = std::make_shared(ov::element::i32, + Shape(new_shape), + new_shape, + VectorDims{0, 1}, + 0, + VectorDims{}, + strides); + hidden_state_k->redefineDesc(mem_desc); + hidden_state_v->redefineDesc(mem_desc); + } + if (need_redefine) { + std::vector new_shape{B, (L0 + L1)}; + auto mem_desc = std::make_shared(ov::element::i32, + Shape(new_shape), + new_shape, + VectorDims{0, 1}, + 0, + VectorDims{}, + hidden_state_k->getDescWithType()->getStrides()); + hidden_state_k->redefineDesc(mem_desc); + hidden_state_v->redefineDesc(mem_desc); } - std::vector new_shape{B, (L0 + L1)}; - auto mem_desc = std::make_shared(ov::element::i32, - Shape(new_shape), - new_shape, - VectorDims{0, 1}, - 0, - VectorDims{}, - hidden_state_k->getDescWithType()->getStrides()); - hidden_state_k->redefineDesc(mem_desc); - hidden_state_v->redefineDesc(mem_desc); if (!beam_table_k) { beam_table_k.reset(hidden_state_k); @@ -1306,7 +1357,7 @@ void ScaledDotProductAttention::updateBeamTable(const MemoryPtr& mem_beam_idx, s // beam order is like [0, 1, 2,...] bool no_reorder = true; for (size_t i = 0; i < B; i++) { - if (beam_idx.data()[i] != static_cast(i)) { + if (beam_idx.ptr()[i] != static_cast(i)) { no_reorder = false; break; } @@ -1314,20 +1365,16 @@ void ScaledDotProductAttention::updateBeamTable(const MemoryPtr& mem_beam_idx, s // reorder if (!no_reorder) { - m_tmp_reorder.resize({B, L0}); + auto* table = beam_idx.ptr(); + // beam table is same for both k,v state for (size_t i = 0; i < B; i++) { - std::memcpy(&m_tmp_reorder.at({i}), - &beam_table_k.at({i}), + std::memcpy(beam_table_k.ptr(i), + beam_table_v.ptr(table[i]), sizeof(int32_t) * L0); } - auto* table = beam_idx.data(); - // beam table is same for both k,v state for (size_t i = 0; i < B; i++) { - std::memcpy(&beam_table_k.at({i}), - &m_tmp_reorder.at({static_cast(table[i])}), - sizeof(int32_t) * L0); - std::memcpy(&beam_table_v.at({i}), - &m_tmp_reorder.at({static_cast(table[i])}), + std::memcpy(beam_table_v.ptr(i), + beam_table_k.ptr(i), sizeof(int32_t) * L0); } } @@ -1375,7 +1422,8 @@ void ScaledDotProductAttention::updatePastkv(const MemoryPtr& mem_cur_k, const M OPENVINO_ASSERT(B * (L0 + L1) > 0, "B or (L0+L1) is zero, B: ", B, ", L0: ", L0, ", L1: ", L1); // resize buffer ov::element::Type kvcache_precision = m_k_state->internal_desc()->getPrecision(); - if (is_reset || B * H * (L0 + L1) * S > m_k_state->internal_state_max_size()) { + bool need_redefine = true; + if (B * H * (L0 + L1) * S > m_k_state->internal_state_max_size()) { auto new_shape = {B, H, (L0 + L1) * 2, S}; auto mem_desc = std::make_shared(kvcache_precision, Shape(reverse(new_shape)), @@ -1405,17 +1453,69 @@ void ScaledDotProductAttention::updatePastkv(const MemoryPtr& mem_cur_k, const M m_v_state->assign_internal_state(new_internal_mem_v); m_k_state->assign_internal_state_max_size(B * H * (L0 + L1) * 2 * S); m_v_state->assign_internal_state_max_size(B * H * (L0 + L1) * 2 * S); + if (kvcache_precision == ov::element::u8) { + auto& old_scale_zp_k = m_k_state->get_scale_zp(); + auto& old_scale_zp_v = m_v_state->get_scale_zp(); + PlainTensor new_scale_zp_k, new_scale_zp_v; + + new_scale_zp_k.resize({B, H, (L0 + L1) * 2, 2}); + new_scale_zp_v.resize({B, H, (L0 + L1) * 2, 2}); + if (L0 > 0 && !is_reset) { + parallel_for2d(B, H, [&](size_t b, size_t h) { + memcpy(new_scale_zp_k.ptr(b, h), + old_scale_zp_k.ptr(b, h), + sizeof(float) * L0 * 2); + memcpy(new_scale_zp_v.ptr(b, h), + old_scale_zp_v.ptr(b, h), + sizeof(float) * L0 * 2); + }); + } + + m_k_state->set_scale_zp(new_scale_zp_k); + m_v_state->set_scale_zp(new_scale_zp_v); + } + } else if (is_reset) { + // when reset and not resize, just reset the desc + need_redefine = false; + auto size = m_k_state->internal_state_max_size(); + auto max_l = size / (B * H * S); + VectorDims strides(4); + strides[0] = H * max_l * S; + strides[1] = max_l * S; + strides[2] = S; + strides[3] = 1; + auto new_shape = {B, H, (L0 + L1), S}; + auto mem_desc = std::make_shared(kvcache_precision, + Shape(reverse(new_shape)), + new_shape, + order, + 0, + VectorDims{}, + strides); + internal_mem_k->redefineDesc(mem_desc); + internal_mem_v->redefineDesc(mem_desc); + if (kvcache_precision == ov::element::u8) { + auto& old_scale_zp_k = m_k_state->get_scale_zp(); + auto& old_scale_zp_v = m_v_state->get_scale_zp(); + // only dim0, dim1 need change + old_scale_zp_k.m_strides[0] = H * max_l * 2; + old_scale_zp_k.m_strides[1] = max_l * 2; + old_scale_zp_v.m_strides[0] = H * max_l * 2; + old_scale_zp_v.m_strides[1] = max_l * 2; + } + } + if (need_redefine) { + auto new_shape = {B, H, (L0 + L1), S}; + auto mem_desc = std::make_shared(kvcache_precision, + Shape(reverse(new_shape)), + new_shape, + order, + 0, + VectorDims{}, + internal_mem_k->getDescWithType()->getStrides()); + internal_mem_k->redefineDesc(mem_desc); + internal_mem_v->redefineDesc(mem_desc); } - auto new_shape = {B, H, (L0 + L1), S}; - auto mem_desc = std::make_shared(kvcache_precision, - Shape(reverse(new_shape)), - new_shape, - order, - 0, - VectorDims{}, - internal_mem_k->getDescWithType()->getStrides()); - internal_mem_k->redefineDesc(mem_desc); - internal_mem_v->redefineDesc(mem_desc); if (!past_k) { past_k.reset(internal_mem_k); @@ -1435,11 +1535,21 @@ void ScaledDotProductAttention::updatePastkv(const MemoryPtr& mem_cur_k, const M init_v.reset(v_mem); init_k = init_k.permute(order); init_v = init_v.permute(order); - attn_memcpy(init_k, init_v, past_k, past_v); + if (kvcache_precision == ov::element::u8) { + attn_quantkv(init_k, init_v, past_k, past_v, m_k_state->get_scale_zp(), m_v_state->get_scale_zp()); + } else { + attn_memcpy(init_k, init_v, past_k, past_v); + } } } - attn_memcpy(cur_k, cur_v, past_k.slice(2, L0, L0 + L1), past_v.slice(2, L0, L0 + L1)); + if (kvcache_precision == ov::element::u8) { + attn_quantkv(cur_k, cur_v, + past_k.slice(2, L0, L0 + L1), past_v.slice(2, L0, L0 + L1), + m_k_state->get_scale_zp().slice(2, L0, L0 + L1), m_v_state->get_scale_zp().slice(2, L0, L0 + L1)); + } else { + attn_memcpy(cur_k, cur_v, past_k.slice(2, L0, L0 + L1), past_v.slice(2, L0, L0 + L1)); + } } ov::element::Type ScaledDotProductAttention::getKVCachePrecision() { @@ -1447,6 +1557,11 @@ ov::element::Type ScaledDotProductAttention::getKVCachePrecision() { auto rtPrecision = getRuntimePrecision(); bool enableKVCacheFP16 = m_config.config.fuse_concat && mayiuse(cpu_isa_t::avx2) && rtPrecision != ov::element::bf16; kvcache_precision = enableKVCacheFP16 ? ov::element::f16 : rtPrecision; + bool use_int8_kv_cache_precision = false; + if (use_int8_kv_cache_precision) + kvcache_precision = ov::element::u8; + else + kvcache_precision = enableKVCacheFP16 ? ov::element::f16 : rtPrecision; return kvcache_precision; } diff --git a/src/plugins/intel_cpu/src/nodes/scaled_attn.h b/src/plugins/intel_cpu/src/nodes/scaled_attn.h index cd1fd0da46bfff..b7e59927a6a5d6 100644 --- a/src/plugins/intel_cpu/src/nodes/scaled_attn.h +++ b/src/plugins/intel_cpu/src/nodes/scaled_attn.h @@ -59,7 +59,8 @@ class ScaledDotProductAttention : public Node { struct Executor { virtual void execute(dnnl::stream strm, const Config& config, const std::vector& inputs, const MemoryPtr output, - const MemoryPtr presentk_input, const MemoryPtr presentv_input, const MemoryPtr beam_input) = 0; + const MemoryPtr presentk_input, const MemoryPtr presentv_input, const MemoryPtr beam_input, + const PlainTensor& k_scale_zp, const PlainTensor& v_scale_zp) = 0; }; Config m_config; @@ -69,8 +70,6 @@ class ScaledDotProductAttention : public Node { std::shared_ptr m_k_state; std::shared_ptr m_v_state; - - PlainTensor m_tmp_reorder; }; } // namespace node diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index 470454573c012b..7c9e6036d7c24a 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -482,9 +482,11 @@ void Transformations::PreLpt(const std::vector& defaultPrecis CPU_SET_CALLBACK_COMMON(manager, nmsCallback, ov::pass::ConvertMulticlassNmsToMulticlassNmsIE); CPU_SET_CALLBACK_COMMON(manager, nmsCallback, ov::pass::ConvertMatrixNmsToMatrixNmsIE); CPU_SET_CALLBACK_X64(manager, - [](const_node_ptr &node) -> bool { + [this](const_node_ptr &node) -> bool { std::string errorMsg; - return node::ScaledDotProductAttention::isSupportedOperation(node, errorMsg); + // Current SDPA impl is optimized only for LLM models, so we decompose it for others to avoid perf regression. + // Matching the pattern is a little complicated, so we just check if there is any state nodes. + return node::ScaledDotProductAttention::isSupportedOperation(node, errorMsg) && model->get_variables().size() > 0; }, ov::pass::ScaledDotProductAttentionDecomposition); diff --git a/src/plugins/intel_cpu/src/utils/plain_tensor.hpp b/src/plugins/intel_cpu/src/utils/plain_tensor.hpp index 91db670748de73..45548faaac606e 100644 --- a/src/plugins/intel_cpu/src/utils/plain_tensor.hpp +++ b/src/plugins/intel_cpu/src/utils/plain_tensor.hpp @@ -93,15 +93,15 @@ struct PlainTensor { size_t m_strides[PLAINTENSOR_RANK_MAX]; size_t m_dims[PLAINTENSOR_RANK_MAX]; size_t m_rank = 0; - void* m_ptr = nullptr; + std::shared_ptr m_ptr; size_t m_capacity = 0; - bool with_storage = false; size_t m_element_size = 0; + size_t m_offset = 0; ov::element::Type_t m_dt = ov::element::Type_t::undefined; MemoryPtr m_mem; // hold memory ptr reference operator bool() const { - return static_cast(m_ptr); + return m_ptr != nullptr; } VectorDims shape() const { @@ -133,32 +133,18 @@ struct PlainTensor { PlainTensor() = default; - PlainTensor(bool _with_storage) { - with_storage = _with_storage; - } - - // copy construct (always not take ownership) PlainTensor operator=(const PlainTensor& other) { - OPENVINO_ASSERT(!with_storage); memcpy(&m_strides, &other.m_strides, sizeof(m_strides)); memcpy(&m_dims, &other.m_dims, sizeof(m_dims)); m_rank = other.m_rank; m_ptr = other.m_ptr; m_dt = other.m_dt; m_element_size = other.m_element_size; + m_capacity = other.m_capacity; + m_offset = other.m_offset; return *this; } - ~PlainTensor() { - if (with_storage && m_capacity > 0) { -#ifdef _WIN32 - _aligned_free(m_ptr); -#else - ::free(m_ptr); -#endif - } - } - void reset(MemoryPtr mem) { auto mem_desc = mem->getDescWithType(); // not support block layout @@ -235,7 +221,8 @@ struct PlainTensor { i_src++; } sub_tensor.m_rank = i_dst; // index may imply squeeze - sub_tensor.m_ptr = reinterpret_cast(reinterpret_cast(m_ptr) + off * m_element_size); + sub_tensor.m_ptr = m_ptr; + sub_tensor.m_offset = m_offset + off; sub_tensor.m_dt = m_dt; sub_tensor.m_element_size = m_element_size; return sub_tensor; @@ -268,8 +255,8 @@ struct PlainTensor { } auto off = start * m_strides[axis]; - auto* data = reinterpret_cast(m_ptr) + off * m_element_size; - sub_tensor.m_ptr = reinterpret_cast(data); + sub_tensor.m_ptr = m_ptr; + sub_tensor.m_offset = m_offset + off; sub_tensor.m_dt = m_dt; sub_tensor.m_element_size = m_element_size; @@ -307,7 +294,7 @@ struct PlainTensor { // only valid for dense memory PlainTensor new_tensor_view; assert(is_dense()); - new_tensor_view.resize(target_shape, m_element_size, m_dt, m_ptr); + new_tensor_view.resize(target_shape, m_element_size, m_dt, static_cast(m_ptr.get() + m_element_size * m_offset)); return new_tensor_view; } @@ -315,10 +302,12 @@ struct PlainTensor { PlainTensor new_tensor_view; assert(order.size() == m_rank); new_tensor_view.m_capacity = 0; + // not hold memory reference new_tensor_view.m_ptr = m_ptr; new_tensor_view.m_rank = m_rank; new_tensor_view.m_dt = m_dt; new_tensor_view.m_element_size = m_element_size; + new_tensor_view.m_offset = m_offset; auto it_order = order.begin(); // also should check order has no repeat element for (size_t i = 0; i < m_rank; i++) { @@ -346,21 +335,29 @@ struct PlainTensor { if (!data) { auto capacity_new = m_strides[0] * m_dims[0] * m_element_size; if (capacity_new > m_capacity) { - if (!with_storage) { - throw std::bad_alloc(); - } + void* ptr; #ifdef _WIN32 - m_ptr = _aligned_malloc(capacity_new, 64); + ptr = _aligned_malloc(capacity_new, 64); #else - int rc = ::posix_memalign(&m_ptr, 64, capacity_new); - if (rc) m_ptr = nullptr; + int rc = ::posix_memalign(&ptr, 64, capacity_new); + if (rc) { + OPENVINO_ASSERT(false, "PlainTensor call posix_memalign failed: ", rc); + } #endif + m_ptr = std::shared_ptr(static_cast(ptr), [](uint8_t* ptr) { + #ifdef _WIN32 + _aligned_free(ptr); + #else + ::free(ptr); + #endif + }); m_capacity = capacity_new; + m_offset = 0; } } else { // m_capacity is zero to indicate that we don't own the memory m_capacity = 0; - m_ptr = data; + m_ptr = std::shared_ptr(static_cast(data), [](uint8_t*) {}); } } @@ -369,9 +366,26 @@ struct PlainTensor { resize(new_dims, sizeof(DT), precision_of
::value, data, strides); } - template - DT* data() const { - return reinterpret_cast(m_ptr); + template + int64_t offset() const { + return m_offset; + } + template + int64_t offset(I i) const { + return m_offset + i * m_strides[dim]; + } + template + int64_t offset(I i, Is... indices) const { + return i * m_strides[dim] + offset(indices...); + } + template + DT* ptr(Is... indices) const { + return reinterpret_cast(m_ptr.get()) + offset<0>(indices...); + } + + template + void* ptr_v(Is... indices) const { + return reinterpret_cast(m_ptr.get() + offset<0>(indices...) * m_element_size); } // when allow_broadcast is true, index to size-1 dim will always access 0. @@ -389,14 +403,14 @@ struct PlainTensor { } off += m_strides[i] * coordinate; } - return (reinterpret_cast(reinterpret_cast(m_ptr) + off * m_element_size))[0]; + return (reinterpret_cast(m_ptr.get() + (off + m_offset) * m_element_size))[0]; } template PlainTensor& operator=(const DT& value) { // assign every element to value std::vector index(m_rank, 0); - auto* dst = reinterpret_cast(m_ptr); + auto* dst = reinterpret_cast(m_ptr.get() + m_offset * m_element_size); while (1) { size_t off = 0; for (int i = m_rank - 1; i >= 0; i--) { @@ -490,17 +504,17 @@ struct PlainTensor { // display current element if we still have buget if (cur_row_lines_left > 0) { if (m_dt == ov::element::Type_t::f32) - ss << reinterpret_cast(m_ptr)[i] << ","; + ss << (ptr())[i] << ","; else if (m_dt == ov::element::Type_t::bf16) - ss << reinterpret_cast(m_ptr)[i] << ","; + ss << (ptr())[i] << ","; else if (m_dt == ov::element::Type_t::f16) - ss << reinterpret_cast(m_ptr)[i] << ","; + ss << (ptr())[i] << ","; else if (m_dt == ov::element::Type_t::i32) - ss << reinterpret_cast(m_ptr)[i] << ","; + ss << (ptr())[i] << ","; else if (m_dt == ov::element::Type_t::i8) - ss << static_cast(reinterpret_cast(m_ptr)[i]) << ","; + ss << (ptr())[i] << ","; else if (m_dt == ov::element::Type_t::u8) - ss << static_cast(reinterpret_cast(m_ptr)[i]) << ","; + ss << (ptr())[i] << ","; else ss << "?,"; cur_line_elecnt++; From 53878b608586e53b42c04b277b645144057454a7 Mon Sep 17 00:00:00 2001 From: Pawel Raasz Date: Wed, 7 Feb 2024 20:56:43 +0100 Subject: [PATCH 47/55] [core] Move validation_util header under openvino/core (#22707) ### Details: - Move validation_util.hpp under `openvino/core` to include it same way as others OV code `#include "openvino/core/validation_util.hpp"` ### Tickets: - [CVS-131972](https://jira.devtools.intel.com/browse/CVS-131972) --- .../src/concat.cpp | 5 +- .../src/gather.cpp | 5 +- .../src/network_helper.cpp | 5 +- .../src/reduce_base_transformation.cpp | 5 +- .../src/shuffle_channels.cpp | 5 +- .../src/split.cpp | 5 +- .../src/strided_slice.cpp | 5 +- .../src/compress_quantize_weigths.cpp | 2 +- .../src/pruning/init_masks.cpp | 2 +- .../src/pruning/propagate_masks.cpp | 2 +- .../src/pruning/shrink_weights.cpp | 2 +- .../snippets/src/pass/collapse_subgraph.cpp | 33 ++- .../snippets/src/pass/mha_tokenization.cpp | 16 +- .../snippets/src/pass/set_softmax_ports.cpp | 13 +- .../src/pass/softmax_reshape_elimination.cpp | 10 +- src/common/snippets/src/pass/validate.cpp | 21 +- .../add_fake_quantize_fusion.cpp | 2 +- .../conv_to_binary_conv.cpp | 2 +- .../convert_quantize_dequantize.cpp | 2 +- .../common_optimizations/fq_mul_fusion.cpp | 2 +- .../fuse_rotary_positional_embeddings.cpp | 2 +- .../common_optimizations/lstm_cell_fusion.cpp | 2 +- .../matmul_multiply_fusion.cpp | 2 +- .../common_optimizations/mul_conv_fusion.cpp | 2 +- .../mul_fake_quantize_fusion.cpp | 2 +- .../common_optimizations/nop_elimination.cpp | 2 +- .../common_optimizations/pad_fusion.cpp | 2 +- .../pull_through_reduce.cpp | 2 +- .../pull_transpose_through_fq.cpp | 2 +- .../push_constant_to_subgraph.cpp | 2 +- .../random_uniform_fusion.cpp | 2 +- .../common_optimizations/reduce_merge.cpp | 2 +- .../reverse_shape_and_type_infer.cpp | 2 +- .../common_optimizations/ric_fusion.cpp | 2 +- .../simplify_shape_of_sub_graph.cpp | 2 +- ...plit_concat_pair_to_interpolate_fusion.cpp | 2 +- .../strides_optimization.cpp | 2 +- .../transpose_sinking.cpp | 2 +- .../control_flow/unroll_if.cpp | 2 +- .../batch_norm_decomposition.cpp | 2 +- .../op_conversions/convert_divide.cpp | 2 +- .../convert_interpolate1_to_interpolate4.cpp | 2 +- .../convert_scatter_elements_to_scatter.cpp | 2 +- .../convert_slice_to_strided_slice.cpp | 2 +- .../convert_softmax_downgrade.cpp | 2 +- .../op_conversions/convert_subtract.cpp | 2 +- .../convert_ti_to_sequences.cpp | 2 +- .../op_conversions/einsum_decomposition.cpp | 2 +- .../smart_reshape/shape_of_const_folding.cpp | 2 +- .../smart_reshape/strided_slice_squeeze.cpp | 2 +- .../dereshape_matmul.cpp | 2 +- .../symbolic_optimizations.cpp | 2 +- .../transpose_sinking/ts_reduction.cpp | 2 +- .../transpose_sinking/ts_squeeze.cpp | 2 +- .../transpose_sinking/ts_unsqueeze.cpp | 2 +- .../src/transformations/utils/utils.cpp | 2 +- .../dereshape_matmul.cpp | 2 +- .../{ => openvino/core}/validation_util.hpp | 0 .../include/concat_shape_inference.hpp | 2 +- .../include/fft_common_validation.hpp | 2 +- .../gather_elements_shape_inference.hpp | 2 +- .../include/gather_shape_inference.hpp | 2 +- .../include/one_hot_shape_inference.hpp | 2 +- .../include/region_yolo_shape_inference.hpp | 2 +- .../reverse_sequence_shape_inference.hpp | 2 +- .../include/roll_shape_inference.hpp | 2 +- ...catter_elements_update_shape_inference.hpp | 2 +- .../shuffle_channels_shape_inference.hpp | 2 +- .../include/slice_shape_inference.hpp | 2 +- .../include/slice_shape_inference_utils.hpp | 2 +- .../include/split_shape_inference.hpp | 2 +- .../include/squeeze_shape_inference.hpp | 2 +- .../include/topk_shape_inference.hpp | 2 +- .../include/transpose_shape_inference.hpp | 2 +- .../include/unsqueeze_shape_inference.hpp | 2 +- src/core/shape_inference/include/utils.hpp | 2 +- .../variadic_split_shape_inference.hpp | 2 +- src/core/src/bound_evaluate.cpp | 2 +- src/core/src/op/batch_norm.cpp | 2 +- src/core/src/op/concat.cpp | 2 +- src/core/src/op/convert.cpp | 2 +- src/core/src/op/convolution.cpp | 2 +- src/core/src/op/divide.cpp | 2 +- src/core/src/op/gather.cpp | 2 +- src/core/src/op/grid_sample.cpp | 2 +- src/core/src/op/group_conv.cpp | 2 +- src/core/src/op/group_normalization.cpp | 2 +- src/core/src/op/if.cpp | 2 +- src/core/src/op/loop.cpp | 2 +- src/core/src/op/lrn.cpp | 2 +- src/core/src/op/max_pool.cpp | 2 +- src/core/src/op/mod.cpp | 2 +- src/core/src/op/non_max_suppression.cpp | 2 +- src/core/src/op/non_zero.cpp | 2 +- src/core/src/op/normalize_l2.cpp | 2 +- src/core/src/op/read_value.cpp | 2 +- src/core/src/op/reduce_prod.cpp | 2 +- src/core/src/op/reverse_sequence.cpp | 2 +- src/core/src/op/scatter_update.cpp | 2 +- src/core/src/op/shuffle_channels.cpp | 2 +- src/core/src/op/slice.cpp | 2 +- src/core/src/op/softmax.cpp | 2 +- src/core/src/op/split.cpp | 2 +- src/core/src/op/squeeze.cpp | 2 +- src/core/src/op/strided_slice.cpp | 2 +- src/core/src/op/tile.cpp | 2 +- src/core/src/op/transpose.cpp | 2 +- src/core/src/op/unique.cpp | 6 +- src/core/src/op/unsqueeze.cpp | 2 +- src/core/src/op/util/axes_util.cpp | 2 +- src/core/src/op/util/broadcast_base.cpp | 2 +- src/core/src/op/util/gather_base.cpp | 2 +- src/core/src/op/util/pad_base.cpp | 2 +- src/core/src/op/util/reduction_base.cpp | 2 +- src/core/src/op/util/scatter_base.cpp | 2 +- .../op/util/scatter_elements_update_base.cpp | 2 +- src/core/src/op/util/topk_base.cpp | 2 +- src/core/src/op/variadic_split.cpp | 2 +- src/core/src/partial_shape.cpp | 2 +- src/core/src/shape.cpp | 2 +- src/core/src/shape_util.cpp | 2 +- src/core/src/validation_util.cpp | 2 +- src/core/tests/type_prop/broadcast.cpp | 2 +- src/core/tests/type_prop/variadic_split.cpp | 2 +- src/core/tests/validation_utils.cpp | 2 +- src/frontends/ir/src/input_model.cpp | 2 +- src/frontends/onnx/frontend/src/op/clip.cpp | 2 +- .../frontend/src/op/dequantize_linear.cpp | 2 +- .../onnx/frontend/src/op/flatten.cpp | 2 +- .../onnx/frontend/src/op/hardmax.cpp | 2 +- .../onnx/frontend/src/op/log_softmax.cpp | 2 +- .../onnx/frontend/src/op/lp_norm.cpp | 2 +- .../src/op/mean_variance_normalization.cpp | 2 +- .../onnx/frontend/src/op/quantize_linear.cpp | 2 +- .../onnx/frontend/src/op/reverse_sequence.cpp | 2 +- src/frontends/onnx/frontend/src/op/scan.cpp | 2 +- .../src/utils/arg_min_max_factory.cpp | 2 +- src/frontends/pytorch/src/node_context.cpp | 2 +- .../softmax_reshape_elimination.cpp | 4 +- .../include/helper_ops/sparse_segment_ops.hpp | 2 +- .../tensorflow_common/include/utils.hpp | 2 +- .../src/graph/impls/ocl/convolution.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/pooling.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/swiglu.cpp | 7 +- src/plugins/intel_gpu/src/graph/pooling.cpp | 2 +- .../intel_gpu/src/plugin/ops/cum_sum.cpp | 10 +- src/plugins/intel_gpu/src/plugin/ops/dft.cpp | 12 +- .../intel_gpu/src/plugin/ops/interpolate.cpp | 10 +- src/plugins/intel_gpu/src/plugin/ops/mvn.cpp | 11 +- .../plugin/ops/scatter_elements_update.cpp | 9 +- .../src/plugin/ops/shuffle_channels.cpp | 7 +- .../intel_gpu/src/plugin/ops/softmax.cpp | 11 +- .../intel_gpu/src/plugin/ops/unique.cpp | 9 +- .../src/plugin/transformations/op/swiglu.cpp | 4 +- .../src/plugin/transformations_pipeline.cpp | 195 +++++++++--------- .../subgraphs_dumper/src/utils/node.cpp | 4 +- .../src/subgraph/mul_conv_fusion.cpp | 2 +- .../quantized_convolution_batch_norm.cpp | 6 +- 158 files changed, 326 insertions(+), 367 deletions(-) rename src/core/dev_api/{ => openvino/core}/validation_util.hpp (100%) diff --git a/src/common/low_precision_transformations/src/concat.cpp b/src/common/low_precision_transformations/src/concat.cpp index c0ddb6b13d596b..e505f38a007259 100644 --- a/src/common/low_precision_transformations/src/concat.cpp +++ b/src/common/low_precision_transformations/src/concat.cpp @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/concat.hpp" - #include #include #include @@ -12,10 +10,11 @@ #include "itt.hpp" #include "low_precision/common/fake_quantize_dequantization.hpp" #include "low_precision/common/ie_lpt_exception.hpp" +#include "low_precision/concat.hpp" #include "low_precision/network_helper.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/gather.cpp b/src/common/low_precision_transformations/src/gather.cpp index 86e699030fda4d..1d6fc95a35c5b7 100644 --- a/src/common/low_precision_transformations/src/gather.cpp +++ b/src/common/low_precision_transformations/src/gather.cpp @@ -2,19 +2,18 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/gather.hpp" - #include #include "itt.hpp" +#include "low_precision/gather.hpp" #include "low_precision/network_helper.hpp" #include "low_precision/rt_info/precision_preserved_attribute.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset7.hpp" #include "openvino/opsets/opset8.hpp" #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/network_helper.cpp b/src/common/low_precision_transformations/src/network_helper.cpp index be575495ff1052..e2b3f470daad8b 100644 --- a/src/common/low_precision_transformations/src/network_helper.cpp +++ b/src/common/low_precision_transformations/src/network_helper.cpp @@ -2,8 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/network_helper.hpp" - #include #include #include @@ -18,14 +16,15 @@ #include "low_precision/common/ie_lpt_exception.hpp" #include "low_precision/layer_transformation.hpp" +#include "low_precision/network_helper.hpp" #include "low_precision/rt_info/intervals_alignment_attribute.hpp" #include "low_precision/rt_info/precision_preserved_attribute.hpp" #include "low_precision/rt_info/quantization_alignment_attribute.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset3.hpp" #include "openvino/opsets/opset6.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp index deff7b513862f7..f6115d8001fff0 100644 --- a/src/common/low_precision_transformations/src/reduce_base_transformation.cpp +++ b/src/common/low_precision_transformations/src/reduce_base_transformation.cpp @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/reduce_base_transformation.hpp" - #include #include "low_precision/network_helper.hpp" -#include "validation_util.hpp" +#include "low_precision/reduce_base_transformation.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/shuffle_channels.cpp b/src/common/low_precision_transformations/src/shuffle_channels.cpp index 332ddd0a8eb235..129a89e7ff98cf 100644 --- a/src/common/low_precision_transformations/src/shuffle_channels.cpp +++ b/src/common/low_precision_transformations/src/shuffle_channels.cpp @@ -2,15 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/shuffle_channels.hpp" - #include #include "itt.hpp" #include "low_precision/network_helper.hpp" +#include "low_precision/shuffle_channels.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/split.cpp b/src/common/low_precision_transformations/src/split.cpp index 3a3a9eac953485..a8025a5e4b3943 100644 --- a/src/common/low_precision_transformations/src/split.cpp +++ b/src/common/low_precision_transformations/src/split.cpp @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/split.hpp" - #include "itt.hpp" #include "low_precision/network_helper.hpp" +#include "low_precision/split.hpp" #include "openvino/core/node.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/low_precision_transformations/src/strided_slice.cpp b/src/common/low_precision_transformations/src/strided_slice.cpp index 3a067d2ee8265a..bf9f4058a70375 100644 --- a/src/common/low_precision_transformations/src/strided_slice.cpp +++ b/src/common/low_precision_transformations/src/strided_slice.cpp @@ -2,14 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "low_precision/strided_slice.hpp" - #include #include "itt.hpp" #include "low_precision/network_helper.hpp" +#include "low_precision/strided_slice.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/offline_transformations/src/compress_quantize_weigths.cpp b/src/common/offline_transformations/src/compress_quantize_weigths.cpp index 51d9c8ed47e731..765ebb9ab6e7aa 100644 --- a/src/common/offline_transformations/src/compress_quantize_weigths.cpp +++ b/src/common/offline_transformations/src/compress_quantize_weigths.cpp @@ -4,6 +4,7 @@ #include "compress_quantize_weights.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/divide.hpp" @@ -18,7 +19,6 @@ #include "openvino/reference/convert.hpp" #include "openvino/reference/fake_quantize.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" static bool has_dequantization_subgraph(const std::shared_ptr& fq, std::shared_ptr& convert_to_low_precision, diff --git a/src/common/offline_transformations/src/pruning/init_masks.cpp b/src/common/offline_transformations/src/pruning/init_masks.cpp index 5c5a04756fe2f6..858fbd8de5a79f 100644 --- a/src/common/offline_transformations/src/pruning/init_masks.cpp +++ b/src/common/offline_transformations/src/pruning/init_masks.cpp @@ -3,11 +3,11 @@ // #include "mask_attribute.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset6.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "openvino/util/log.hpp" #include "pruning.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/offline_transformations/src/pruning/propagate_masks.cpp b/src/common/offline_transformations/src/pruning/propagate_masks.cpp index bc9d6a7f8c7d99..58a96449002793 100644 --- a/src/common/offline_transformations/src/pruning/propagate_masks.cpp +++ b/src/common/offline_transformations/src/pruning/propagate_masks.cpp @@ -8,6 +8,7 @@ #include "mask_attribute.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/gelu.hpp" #include "openvino/op/max_pool.hpp" #include "openvino/op/shape_of.hpp" @@ -19,7 +20,6 @@ #include "openvino/reference/utils/coordinate_transform.hpp" #include "openvino/util/log.hpp" #include "pruning.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/offline_transformations/src/pruning/shrink_weights.cpp b/src/common/offline_transformations/src/pruning/shrink_weights.cpp index 8bd032a467dbab..13b782752438c2 100644 --- a/src/common/offline_transformations/src/pruning/shrink_weights.cpp +++ b/src/common/offline_transformations/src/pruning/shrink_weights.cpp @@ -6,12 +6,12 @@ #include "mask_attribute.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset6.hpp" #include "openvino/pass/manager.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "openvino/util/log.hpp" #include "pruning.hpp" -#include "validation_util.hpp" template static std::string vec_to_str(const std::vector m) { diff --git a/src/common/snippets/src/pass/collapse_subgraph.cpp b/src/common/snippets/src/pass/collapse_subgraph.cpp index be16726b97d43f..bdbf0cb1a3cd37 100644 --- a/src/common/snippets/src/pass/collapse_subgraph.cpp +++ b/src/common/snippets/src/pass/collapse_subgraph.cpp @@ -2,30 +2,27 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/remarks.hpp" -#include "snippets/itt.hpp" +#include +#include +#include +#include +#include +#include +#include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/util/attr_types.hpp" +#include "openvino/opsets/opset1.hpp" +#include "snippets/itt.hpp" +#include "snippets/op/subgraph.hpp" #include "snippets/pass/collapse_subgraph.hpp" +#include "snippets/pass/fq_decomposition.hpp" +#include "snippets/pass/fuse_transpose_brgemm.hpp" #include "snippets/pass/tokenization.hpp" #include "snippets/pass/transpose_decomposition.hpp" -#include "snippets/pass/fuse_transpose_brgemm.hpp" -#include "snippets/pass/fq_decomposition.hpp" -#include "snippets/op/subgraph.hpp" +#include "snippets/remarks.hpp" #include "snippets/utils.hpp" - -#include "openvino/opsets/opset1.hpp" -#include "openvino/core/rt_info.hpp" #include "transformations/utils/utils.hpp" -#include "openvino/op/util/attr_types.hpp" -#include "validation_util.hpp" - -#include -#include -#include -#include -#include -#include - namespace ov { namespace snippets { diff --git a/src/common/snippets/src/pass/mha_tokenization.cpp b/src/common/snippets/src/pass/mha_tokenization.cpp index fa6fa584a2a9c7..3912d75b226e73 100644 --- a/src/common/snippets/src/pass/mha_tokenization.cpp +++ b/src/common/snippets/src/pass/mha_tokenization.cpp @@ -2,21 +2,17 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/pass/mha_tokenization.hpp" - - +#include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/pass/pattern/op/wrap_type.hpp" #include "snippets/itt.hpp" +#include "snippets/op/brgemm.hpp" +#include "snippets/op/subgraph.hpp" #include "snippets/pass/collapse_subgraph.hpp" #include "snippets/pass/explicit_transpose_matmul_inputs.hpp" -#include "snippets/op/subgraph.hpp" -#include "snippets/op/brgemm.hpp" +#include "snippets/pass/mha_tokenization.hpp" #include "snippets/utils.hpp" -#include "openvino/core/rt_info.hpp" -#include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" - - namespace { bool is_supported_tensor(const ov::descriptor::Tensor& t) { return t.get_partial_shape().is_static() && ov::snippets::utils::one_of(t.get_shape().size(), 3lu, 4lu); diff --git a/src/common/snippets/src/pass/set_softmax_ports.cpp b/src/common/snippets/src/pass/set_softmax_ports.cpp index dce45fc0881608..025ce3abcd74e0 100644 --- a/src/common/snippets/src/pass/set_softmax_ports.cpp +++ b/src/common/snippets/src/pass/set_softmax_ports.cpp @@ -2,16 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/pass/set_softmax_ports.hpp" - -#include "snippets/itt.hpp" -#include "snippets/lowered/port_descriptor.hpp" - +#include "openvino/core/validation_util.hpp" #include "openvino/op/softmax.hpp" -#include "openvino/pass/pattern/op/wrap_type.hpp" #include "openvino/pass/pattern/op/or.hpp" -#include "validation_util.hpp" - +#include "openvino/pass/pattern/op/wrap_type.hpp" +#include "snippets/itt.hpp" +#include "snippets/lowered/port_descriptor.hpp" +#include "snippets/pass/set_softmax_ports.hpp" ov::snippets::pass::SetSoftmaxPorts::SetSoftmaxPorts() { MATCHER_SCOPE(SetSoftmaxPorts); diff --git a/src/common/snippets/src/pass/softmax_reshape_elimination.cpp b/src/common/snippets/src/pass/softmax_reshape_elimination.cpp index 4b590b7fa96549..7ea708b93596d9 100644 --- a/src/common/snippets/src/pass/softmax_reshape_elimination.cpp +++ b/src/common/snippets/src/pass/softmax_reshape_elimination.cpp @@ -2,16 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/pass/pattern/op/wrap_type.hpp" #include "snippets/itt.hpp" -#include "snippets/remarks.hpp" - #include "snippets/pass/softmax_reshape_elimination.hpp" +#include "snippets/remarks.hpp" #include "snippets/snippets_isa.hpp" -#include "openvino/core/rt_info.hpp" -#include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" - ov::snippets::pass::SoftmaxReshapeElimination::SoftmaxReshapeElimination() { MATCHER_SCOPE(SoftmaxReshapeElimination); const auto m_reshape0 = ov::pass::pattern::wrap_type(ov::pass::pattern::has_static_shape()); diff --git a/src/common/snippets/src/pass/validate.cpp b/src/common/snippets/src/pass/validate.cpp index 1a1155d189a70c..1b88b2e8332f65 100644 --- a/src/common/snippets/src/pass/validate.cpp +++ b/src/common/snippets/src/pass/validate.cpp @@ -2,23 +2,20 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "snippets/pass/validate.hpp" - +#include "openvino/core/validation_util.hpp" +#include "openvino/op/broadcast.hpp" +#include "openvino/op/fake_quantize.hpp" +#include "openvino/op/matmul.hpp" +#include "openvino/op/reshape.hpp" +#include "openvino/op/softmax.hpp" +#include "openvino/op/transpose.hpp" +#include "snippets/itt.hpp" #include "snippets/op/convert_saturation.hpp" #include "snippets/op/convert_truncation.hpp" #include "snippets/pass/explicit_transpose_matmul_inputs.hpp" #include "snippets/pass/fq_decomposition.hpp" +#include "snippets/pass/validate.hpp" #include "snippets/utils.hpp" -#include "snippets/itt.hpp" - -#include "openvino/op/fake_quantize.hpp" -#include "openvino/op/broadcast.hpp" -#include "openvino/op/matmul.hpp" -#include "openvino/op/reshape.hpp" -#include "openvino/op/transpose.hpp" -#include "openvino/op/softmax.hpp" -#include "validation_util.hpp" - namespace ov { namespace snippets { diff --git a/src/common/transformations/src/transformations/common_optimizations/add_fake_quantize_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/add_fake_quantize_fusion.cpp index 5b7953648a48de..4e7e49c263a2d9 100644 --- a/src/common/transformations/src/transformations/common_optimizations/add_fake_quantize_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/add_fake_quantize_fusion.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" @@ -20,7 +21,6 @@ #include "openvino/op/subtract.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" ov::pass::AddFakeQuantizeFusion::AddFakeQuantizeFusion() { MATCHER_SCOPE(AddFakeQuantizeFusion); diff --git a/src/common/transformations/src/transformations/common_optimizations/conv_to_binary_conv.cpp b/src/common/transformations/src/transformations/common_optimizations/conv_to_binary_conv.cpp index f4c5b2bf87cb7d..d6a5538500da50 100644 --- a/src/common/transformations/src/transformations/common_optimizations/conv_to_binary_conv.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/conv_to_binary_conv.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/binary_convolution.hpp" #include "openvino/op/constant.hpp" @@ -18,7 +19,6 @@ #include "openvino/op/reduce_sum.hpp" #include "openvino/op/reshape.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" static std::vector binarize_weights(const std::vector& weights) { std::vector out; diff --git a/src/common/transformations/src/transformations/common_optimizations/convert_quantize_dequantize.cpp b/src/common/transformations/src/transformations/common_optimizations/convert_quantize_dequantize.cpp index b91af780ee7733..509c58f1ce225c 100644 --- a/src/common/transformations/src/transformations/common_optimizations/convert_quantize_dequantize.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/convert_quantize_dequantize.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/fake_quantize.hpp" @@ -16,7 +17,6 @@ #include "openvino/op/subtract.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" // ConvertQuantizeDequantize converts Quantize/Dequantize pair to a single FakeQuantize. // Since Quantize is decomposed to FakeQuantize and Dequantize is decomposed to Subtract->Multiply, diff --git a/src/common/transformations/src/transformations/common_optimizations/fq_mul_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/fq_mul_fusion.cpp index 5885c8c068a1ed..a478de541166a0 100644 --- a/src/common/transformations/src/transformations/common_optimizations/fq_mul_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/fq_mul_fusion.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convolution.hpp" #include "openvino/op/fake_quantize.hpp" @@ -17,7 +18,6 @@ #include "openvino/op/reshape.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" // This transformation multiplies the "output_low" and "output_high" inputs of the FQ operation // by the constant value that before transormation is used to multiply the output of FQ. diff --git a/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp b/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp index 15125e2650ec1a..4da2f2643ca907 100644 --- a/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp @@ -5,6 +5,7 @@ #include "transformations/common_optimizations/fuse_rotary_positional_embeddings.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/multiply.hpp" @@ -13,7 +14,6 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "ov_ops/rotary_positional_embeddings.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using ov::op::v0::Concat; using ov::op::v1::Add; diff --git a/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp index da83ddfdfb14c9..0ae27695fae6ce 100644 --- a/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp @@ -6,6 +6,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" @@ -21,7 +22,6 @@ #include "openvino/op/variadic_split.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" /* The following graph is fused to LSTMCell diff --git a/src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp index 520ee14e5d703b..bfb12ad7b3290a 100644 --- a/src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp @@ -5,6 +5,7 @@ #include "transformations/common_optimizations/matmul_multiply_fusion.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/matmul.hpp" #include "openvino/op/multiply.hpp" @@ -12,7 +13,6 @@ #include "openvino/op/transpose.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/common_optimizations/mul_conv_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/mul_conv_fusion.cpp index 1870c4f7b1cf9d..6d80be4319b431 100644 --- a/src/common/transformations/src/transformations/common_optimizations/mul_conv_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/mul_conv_fusion.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convolution.hpp" #include "openvino/op/group_conv.hpp" @@ -17,7 +18,6 @@ #include "openvino/pass/pattern/matcher.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" ov::pass::MultiplyConvolutionFusion::MultiplyConvolutionFusion() { MATCHER_SCOPE(MultiplyConvolutionFusion); diff --git a/src/common/transformations/src/transformations/common_optimizations/mul_fake_quantize_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/mul_fake_quantize_fusion.cpp index 27be26ec5a0206..ba1f400cc52369 100644 --- a/src/common/transformations/src/transformations/common_optimizations/mul_fake_quantize_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/mul_fake_quantize_fusion.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/divide.hpp" @@ -17,7 +18,6 @@ #include "openvino/op/reshape.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" ov::pass::MulFakeQuantizeFusion::MulFakeQuantizeFusion() { MATCHER_SCOPE(MulFakeQuantizeFusion); diff --git a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp index e7a9e19be6439e..a88d66756fd9eb 100644 --- a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp @@ -10,6 +10,7 @@ #include "compare.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" @@ -37,7 +38,6 @@ #include "openvino/util/log.hpp" #include "openvino/util/util.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace std; using namespace ov; diff --git a/src/common/transformations/src/transformations/common_optimizations/pad_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/pad_fusion.cpp index 800857a9b315c7..9f71ba9248fe33 100644 --- a/src/common/transformations/src/transformations/common_optimizations/pad_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/pad_fusion.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/avg_pool.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convolution.hpp" @@ -16,7 +17,6 @@ #include "openvino/op/util/pad_base.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/common_optimizations/pull_through_reduce.cpp b/src/common/transformations/src/transformations/common_optimizations/pull_through_reduce.cpp index 5b791b5d7656b3..c162f9482bdf49 100644 --- a/src/common/transformations/src/transformations/common_optimizations/pull_through_reduce.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/pull_through_reduce.cpp @@ -8,6 +8,7 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/unsqueeze.hpp" @@ -16,7 +17,6 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "sequnce_generator.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace { // Adjust axes of Unsqueeze/Reduce ops after Unsqueeze pulling diff --git a/src/common/transformations/src/transformations/common_optimizations/pull_transpose_through_fq.cpp b/src/common/transformations/src/transformations/common_optimizations/pull_transpose_through_fq.cpp index ce0b777ce239c3..01a3a27efd09d7 100644 --- a/src/common/transformations/src/transformations/common_optimizations/pull_transpose_through_fq.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/pull_transpose_through_fq.cpp @@ -9,13 +9,13 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/fake_quantize.hpp" #include "openvino/op/transpose.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" ov::pass::PullTransposeThroughFQUp::PullTransposeThroughFQUp() { MATCHER_SCOPE(PullTransposeThroughFQUp); diff --git a/src/common/transformations/src/transformations/common_optimizations/push_constant_to_subgraph.cpp b/src/common/transformations/src/transformations/common_optimizations/push_constant_to_subgraph.cpp index 5173742681870e..fe9c359be00830 100644 --- a/src/common/transformations/src/transformations/common_optimizations/push_constant_to_subgraph.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/push_constant_to_subgraph.cpp @@ -5,9 +5,9 @@ #include "transformations/common_optimizations/push_constant_to_subgraph.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/util/multi_subgraph_base.hpp" -#include "validation_util.hpp" using MultiSubGraphOp = ov::op::util::MultiSubGraphOp; diff --git a/src/common/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp index cfdd6463cbc8b9..455e32087e5a62 100644 --- a/src/common/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp @@ -8,6 +8,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" @@ -16,7 +17,6 @@ #include "openvino/pass/pattern/op/optional.hpp" #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" ov::pass::RandomUniformFusion::RandomUniformFusion() { MATCHER_SCOPE(RandomUniformFusion); diff --git a/src/common/transformations/src/transformations/common_optimizations/reduce_merge.cpp b/src/common/transformations/src/transformations/common_optimizations/reduce_merge.cpp index daff4afbc239b3..6352156d97a17b 100644 --- a/src/common/transformations/src/transformations/common_optimizations/reduce_merge.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/reduce_merge.cpp @@ -8,6 +8,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/reduce_l1.hpp" @@ -22,7 +23,6 @@ #include "openvino/op/unsqueeze.hpp" #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::pass; diff --git a/src/common/transformations/src/transformations/common_optimizations/reverse_shape_and_type_infer.cpp b/src/common/transformations/src/transformations/common_optimizations/reverse_shape_and_type_infer.cpp index 8d3e6e6212bcf5..b8224184b28731 100644 --- a/src/common/transformations/src/transformations/common_optimizations/reverse_shape_and_type_infer.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/reverse_shape_and_type_infer.cpp @@ -6,6 +6,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/convert_like.hpp" #include "openvino/op/convolution.hpp" @@ -20,7 +21,6 @@ #include "openvino/op/util/binary_elementwise_arithmetic.hpp" #include "openvino/op/util/pad_base.hpp" #include "openvino/op/util/unary_elementwise_arithmetic.hpp" -#include "validation_util.hpp" bool ov::pass::ReverseShapeAndTypeInfer::inherit_output_shape(const std::shared_ptr& node, const std::vector& input_idxs) { diff --git a/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp index 0934bc17463257..a60b5a57e30ec0 100644 --- a/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp @@ -10,6 +10,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" @@ -28,7 +29,6 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "openvino/util/log.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace ov { namespace pass { diff --git a/src/common/transformations/src/transformations/common_optimizations/simplify_shape_of_sub_graph.cpp b/src/common/transformations/src/transformations/common_optimizations/simplify_shape_of_sub_graph.cpp index ed20857de40d20..d9868f4537af48 100644 --- a/src/common/transformations/src/transformations/common_optimizations/simplify_shape_of_sub_graph.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/simplify_shape_of_sub_graph.cpp @@ -10,6 +10,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/fake_quantize.hpp" @@ -23,7 +24,6 @@ #include "transformations/common_optimizations/nop_elimination.hpp" #include "transformations/common_optimizations/shared_ops_optimization.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::op; diff --git a/src/common/transformations/src/transformations/common_optimizations/split_concat_pair_to_interpolate_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/split_concat_pair_to_interpolate_fusion.cpp index a9aefacbd1a670..3c3b81403e95ec 100644 --- a/src/common/transformations/src/transformations/common_optimizations/split_concat_pair_to_interpolate_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/split_concat_pair_to_interpolate_fusion.cpp @@ -14,6 +14,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" @@ -25,7 +26,6 @@ #include "openvino/op/strided_slice.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/rt_info/disable_constant_folding.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/common_optimizations/strides_optimization.cpp b/src/common/transformations/src/transformations/common_optimizations/strides_optimization.cpp index 6af066d05f58f6..813aedb046fe27 100644 --- a/src/common/transformations/src/transformations/common_optimizations/strides_optimization.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/strides_optimization.cpp @@ -7,6 +7,7 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convolution.hpp" @@ -18,7 +19,6 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/rt_info/strides_property.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace std; using namespace ov; diff --git a/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp b/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp index 60e6b4ebadfbb2..5570e3b9196c68 100644 --- a/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/transpose_sinking.cpp @@ -10,6 +10,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/fake_quantize.hpp" @@ -19,7 +20,6 @@ #include "openvino/op/unsqueeze.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/control_flow/unroll_if.cpp b/src/common/transformations/src/transformations/control_flow/unroll_if.cpp index 18a62a4e661161..9321b111dc7a33 100644 --- a/src/common/transformations/src/transformations/control_flow/unroll_if.cpp +++ b/src/common/transformations/src/transformations/control_flow/unroll_if.cpp @@ -10,11 +10,11 @@ #include "openvino/core/descriptor/tensor.hpp" #include "openvino/core/graph_util.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/if.hpp" #include "openvino/op/result.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" bool ov::pass::UnrollIf::run_on_model(const std::shared_ptr& f) { RUN_ON_FUNCTION_SCOPE(UnrollIf); diff --git a/src/common/transformations/src/transformations/op_conversions/batch_norm_decomposition.cpp b/src/common/transformations/src/transformations/op_conversions/batch_norm_decomposition.cpp index 751159dc3b670f..2efac27b933dd2 100644 --- a/src/common/transformations/src/transformations/op_conversions/batch_norm_decomposition.cpp +++ b/src/common/transformations/src/transformations/op_conversions/batch_norm_decomposition.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/batch_norm.hpp" #include "openvino/op/broadcast.hpp" @@ -22,7 +23,6 @@ #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp b/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp index 6c38646ab3125a..939a7ab42d4095 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_divide.cpp @@ -9,6 +9,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/divide.hpp" #include "openvino/op/multiply.hpp" @@ -17,7 +18,6 @@ #include "openvino/util/log.hpp" #include "transformations/rt_info/nonconvertible_divide.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace { bool convert_divide(std::shared_ptr node) { diff --git a/src/common/transformations/src/transformations/op_conversions/convert_interpolate1_to_interpolate4.cpp b/src/common/transformations/src/transformations/op_conversions/convert_interpolate1_to_interpolate4.cpp index 309894b472698c..b6f285bda7da72 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_interpolate1_to_interpolate4.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_interpolate1_to_interpolate4.cpp @@ -10,12 +10,12 @@ #include "itt.hpp" #include "openvino/core/core.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/divide.hpp" #include "openvino/op/interpolate.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" ov::pass::ConvertInterpolate1ToInterpolate4::ConvertInterpolate1ToInterpolate4() { MATCHER_SCOPE(ConvertInterpolate1ToInterpolate4); diff --git a/src/common/transformations/src/transformations/op_conversions/convert_scatter_elements_to_scatter.cpp b/src/common/transformations/src/transformations/op_conversions/convert_scatter_elements_to_scatter.cpp index 2cdc7c1a156018..c59322e03055e3 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_scatter_elements_to_scatter.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_scatter_elements_to_scatter.cpp @@ -10,13 +10,13 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/scatter_elements_update.hpp" #include "openvino/op/scatter_update.hpp" #include "openvino/op/squeeze.hpp" -#include "validation_util.hpp" ov::pass::ConvertScatterElementsToScatter::ConvertScatterElementsToScatter() { MATCHER_SCOPE(ConvertScatterElementsToScatter); diff --git a/src/common/transformations/src/transformations/op_conversions/convert_slice_to_strided_slice.cpp b/src/common/transformations/src/transformations/op_conversions/convert_slice_to_strided_slice.cpp index 82f50a6c8e8052..d4f1bf6418d0a0 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_slice_to_strided_slice.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_slice_to_strided_slice.cpp @@ -10,6 +10,7 @@ #include "itt.hpp" #include "openvino/core/node.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/scatter_update.hpp" #include "openvino/op/slice.hpp" @@ -17,7 +18,6 @@ #include "openvino/op/util/op_types.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/op_conversions/convert_softmax_downgrade.cpp b/src/common/transformations/src/transformations/op_conversions/convert_softmax_downgrade.cpp index 33ef591c77cfa9..f53750079a4eda 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_softmax_downgrade.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_softmax_downgrade.cpp @@ -6,9 +6,9 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/softmax.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" ov::pass::ConvertSoftMax8ToSoftMax1::ConvertSoftMax8ToSoftMax1() { MATCHER_SCOPE(ConvertSoftMax8ToSoftMax1); diff --git a/src/common/transformations/src/transformations/op_conversions/convert_subtract.cpp b/src/common/transformations/src/transformations/op_conversions/convert_subtract.cpp index fbaf3fd38499a3..786237239e9907 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_subtract.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_subtract.cpp @@ -6,13 +6,13 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/multiply.hpp" #include "openvino/op/subtract.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/rt_info/dequantization_node.hpp" -#include "validation_util.hpp" using namespace ov; diff --git a/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp b/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp index 669f0e6072f1f8..0dd2bdb725c78f 100644 --- a/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp +++ b/src/common/transformations/src/transformations/op_conversions/convert_ti_to_sequences.cpp @@ -11,6 +11,7 @@ #include "openvino/core/graph_util.hpp" #include "openvino/core/node.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/add.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/constant.hpp" @@ -36,7 +37,6 @@ #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace { bool convertTensorIteratorToSequence(const std::shared_ptr& ti, diff --git a/src/common/transformations/src/transformations/op_conversions/einsum_decomposition.cpp b/src/common/transformations/src/transformations/op_conversions/einsum_decomposition.cpp index 62af31c2059808..32f88c0a4ed1b8 100644 --- a/src/common/transformations/src/transformations/op_conversions/einsum_decomposition.cpp +++ b/src/common/transformations/src/transformations/op_conversions/einsum_decomposition.cpp @@ -8,6 +8,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/einsum.hpp" @@ -22,7 +23,6 @@ #include "openvino/op/unsqueeze.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" namespace { /// \brief Check if the EinsumDecomposition transformation is applicable to a given Einsum. diff --git a/src/common/transformations/src/transformations/smart_reshape/shape_of_const_folding.cpp b/src/common/transformations/src/transformations/smart_reshape/shape_of_const_folding.cpp index 8eac887b1f1be6..081a9371393e4b 100644 --- a/src/common/transformations/src/transformations/smart_reshape/shape_of_const_folding.cpp +++ b/src/common/transformations/src/transformations/smart_reshape/shape_of_const_folding.cpp @@ -6,10 +6,10 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/shape_of.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" ov::pass::ShapeOfConstFolding::ShapeOfConstFolding() { MATCHER_SCOPE(ShapeOfConstFolding); diff --git a/src/common/transformations/src/transformations/smart_reshape/strided_slice_squeeze.cpp b/src/common/transformations/src/transformations/smart_reshape/strided_slice_squeeze.cpp index e3ebaadbc8d0fd..562dbbddcba774 100644 --- a/src/common/transformations/src/transformations/smart_reshape/strided_slice_squeeze.cpp +++ b/src/common/transformations/src/transformations/smart_reshape/strided_slice_squeeze.cpp @@ -6,6 +6,7 @@ #include "itt.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/squeeze.hpp" #include "openvino/op/strided_slice.hpp" @@ -13,7 +14,6 @@ #include "openvino/pass/pattern/matcher.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations_visibility.hpp" -#include "validation_util.hpp" ov::pass::StridedSliceSqueeze::StridedSliceSqueeze() { // TODO: enable conditional compile diff --git a/src/common/transformations/src/transformations/symbolic_transformations/dereshape_matmul.cpp b/src/common/transformations/src/transformations/symbolic_transformations/dereshape_matmul.cpp index 3d31a3fe0fd70a..99b498c9ad54ec 100644 --- a/src/common/transformations/src/transformations/symbolic_transformations/dereshape_matmul.cpp +++ b/src/common/transformations/src/transformations/symbolic_transformations/dereshape_matmul.cpp @@ -6,6 +6,7 @@ #include "itt.hpp" #include "openvino/core/dimension_tracker.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/matmul.hpp" @@ -15,7 +16,6 @@ #include "openvino/pass/pattern/op/wrap_type.hpp" #include "transformations/symbolic_transformations/utils.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov::symbol::util; diff --git a/src/common/transformations/src/transformations/symbolic_transformations/symbolic_optimizations.cpp b/src/common/transformations/src/transformations/symbolic_transformations/symbolic_optimizations.cpp index 2e92e5ade0062a..4ab4e069299c84 100644 --- a/src/common/transformations/src/transformations/symbolic_transformations/symbolic_optimizations.cpp +++ b/src/common/transformations/src/transformations/symbolic_transformations/symbolic_optimizations.cpp @@ -6,6 +6,7 @@ #include "itt.hpp" #include "openvino/core/dimension_tracker.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/util/symbolic_info.hpp" #include "openvino/pass/manager.hpp" @@ -23,7 +24,6 @@ #include "transformations/symbolic_transformations/nop_broadcast.hpp" #include "transformations/symbolic_transformations/reshape_optimizations.hpp" #include "transformations/symbolic_transformations/utils.hpp" -#include "validation_util.hpp" using namespace ov::pass; using namespace ov::symbol::util; diff --git a/src/common/transformations/src/transformations/transpose_sinking/ts_reduction.cpp b/src/common/transformations/src/transformations/transpose_sinking/ts_reduction.cpp index 17544b1d08045a..dfefcc9a867479 100644 --- a/src/common/transformations/src/transformations/transpose_sinking/ts_reduction.cpp +++ b/src/common/transformations/src/transformations/transpose_sinking/ts_reduction.cpp @@ -8,6 +8,7 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/transpose.hpp" #include "openvino/op/util/arithmetic_reductions_keep_dims.hpp" @@ -16,7 +17,6 @@ #include "transformations/rt_info/transpose_sinking_attr.hpp" #include "transformations/transpose_sinking/ts_utils.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::pass::pattern; diff --git a/src/common/transformations/src/transformations/transpose_sinking/ts_squeeze.cpp b/src/common/transformations/src/transformations/transpose_sinking/ts_squeeze.cpp index d51f66bf6f466a..413751a9e06fe4 100644 --- a/src/common/transformations/src/transformations/transpose_sinking/ts_squeeze.cpp +++ b/src/common/transformations/src/transformations/transpose_sinking/ts_squeeze.cpp @@ -8,6 +8,7 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/squeeze.hpp" @@ -17,7 +18,6 @@ #include "transformations/rt_info/transpose_sinking_attr.hpp" #include "transformations/transpose_sinking/ts_utils.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::pass::pattern; diff --git a/src/common/transformations/src/transformations/transpose_sinking/ts_unsqueeze.cpp b/src/common/transformations/src/transformations/transpose_sinking/ts_unsqueeze.cpp index db349acbc02054..6d98d8247b48e3 100644 --- a/src/common/transformations/src/transformations/transpose_sinking/ts_unsqueeze.cpp +++ b/src/common/transformations/src/transformations/transpose_sinking/ts_unsqueeze.cpp @@ -8,6 +8,7 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/transpose.hpp" @@ -16,7 +17,6 @@ #include "transformations/rt_info/transpose_sinking_attr.hpp" #include "transformations/transpose_sinking/ts_utils.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::pass::pattern; diff --git a/src/common/transformations/src/transformations/utils/utils.cpp b/src/common/transformations/src/transformations/utils/utils.cpp index e1eb03030472ad..60cfdd744050d9 100644 --- a/src/common/transformations/src/transformations/utils/utils.cpp +++ b/src/common/transformations/src/transformations/utils/utils.cpp @@ -9,13 +9,13 @@ #include #include +#include "openvino/core/validation_util.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/gather.hpp" #include "openvino/op/reshape.hpp" #include "openvino/opsets/opset1.hpp" #include "openvino/opsets/opset3.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/common/transformations/tests/symbolic_transformations/dereshape_matmul.cpp b/src/common/transformations/tests/symbolic_transformations/dereshape_matmul.cpp index 40d8aef121ab4d..013540af3bd6c0 100644 --- a/src/common/transformations/tests/symbolic_transformations/dereshape_matmul.cpp +++ b/src/common/transformations/tests/symbolic_transformations/dereshape_matmul.cpp @@ -9,11 +9,11 @@ #include "common_test_utils/ov_test_utils.hpp" #include "openvino/core/dimension_tracker.hpp" #include "openvino/core/model.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/matmul.hpp" #include "openvino/op/parameter.hpp" #include "openvino/op/reshape.hpp" #include "transformations/utils/utils.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::op; diff --git a/src/core/dev_api/validation_util.hpp b/src/core/dev_api/openvino/core/validation_util.hpp similarity index 100% rename from src/core/dev_api/validation_util.hpp rename to src/core/dev_api/openvino/core/validation_util.hpp diff --git a/src/core/shape_inference/include/concat_shape_inference.hpp b/src/core/shape_inference/include/concat_shape_inference.hpp index d76e16e725dcfa..1f5d04b52fd7c3 100644 --- a/src/core/shape_inference/include/concat_shape_inference.hpp +++ b/src/core/shape_inference/include/concat_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/fft_common_validation.hpp b/src/core/shape_inference/include/fft_common_validation.hpp index 728509ae85d3fb..b81a351f8c77b5 100644 --- a/src/core/shape_inference/include/fft_common_validation.hpp +++ b/src/core/shape_inference/include/fft_common_validation.hpp @@ -5,9 +5,9 @@ #pragma once #include "openvino/core/axis_vector.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/fft_base.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/gather_elements_shape_inference.hpp b/src/core/shape_inference/include/gather_elements_shape_inference.hpp index b8b84c35b5d6ef..471e72e01cea25 100644 --- a/src/core/shape_inference/include/gather_elements_shape_inference.hpp +++ b/src/core/shape_inference/include/gather_elements_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/gather_elements.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/gather_shape_inference.hpp b/src/core/shape_inference/include/gather_shape_inference.hpp index 0782a9577c02b7..22704dbc6aa71e 100644 --- a/src/core/shape_inference/include/gather_shape_inference.hpp +++ b/src/core/shape_inference/include/gather_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/gather_base.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/one_hot_shape_inference.hpp b/src/core/shape_inference/include/one_hot_shape_inference.hpp index 04faa27ddee488..76ede5b1814788 100644 --- a/src/core/shape_inference/include/one_hot_shape_inference.hpp +++ b/src/core/shape_inference/include/one_hot_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/one_hot.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/region_yolo_shape_inference.hpp b/src/core/shape_inference/include/region_yolo_shape_inference.hpp index 380c8e6ad62873..a565db63e45bc1 100644 --- a/src/core/shape_inference/include/region_yolo_shape_inference.hpp +++ b/src/core/shape_inference/include/region_yolo_shape_inference.hpp @@ -6,9 +6,9 @@ #include +#include "openvino/core/validation_util.hpp" #include "openvino/op/region_yolo.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/reverse_sequence_shape_inference.hpp b/src/core/shape_inference/include/reverse_sequence_shape_inference.hpp index f7e2da88b64e8e..f7b918068bf190 100644 --- a/src/core/shape_inference/include/reverse_sequence_shape_inference.hpp +++ b/src/core/shape_inference/include/reverse_sequence_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/reverse_sequence.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/roll_shape_inference.hpp b/src/core/shape_inference/include/roll_shape_inference.hpp index 426e0b6f52a0e0..39097c032844b7 100644 --- a/src/core/shape_inference/include/roll_shape_inference.hpp +++ b/src/core/shape_inference/include/roll_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/roll.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/scatter_elements_update_shape_inference.hpp b/src/core/shape_inference/include/scatter_elements_update_shape_inference.hpp index 46ffdcaa73b679..68ace70f0d3d56 100644 --- a/src/core/shape_inference/include/scatter_elements_update_shape_inference.hpp +++ b/src/core/shape_inference/include/scatter_elements_update_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/scatter_elements_update.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/shuffle_channels_shape_inference.hpp b/src/core/shape_inference/include/shuffle_channels_shape_inference.hpp index ef4a72cbb72a46..1456b24d9e45b5 100644 --- a/src/core/shape_inference/include/shuffle_channels_shape_inference.hpp +++ b/src/core/shape_inference/include/shuffle_channels_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/shuffle_channels.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/slice_shape_inference.hpp b/src/core/shape_inference/include/slice_shape_inference.hpp index 0685c5a83ffb66..414e76a729323b 100644 --- a/src/core/shape_inference/include/slice_shape_inference.hpp +++ b/src/core/shape_inference/include/slice_shape_inference.hpp @@ -6,9 +6,9 @@ #include +#include "openvino/core/validation_util.hpp" #include "openvino/op/slice.hpp" #include "slice_shape_inference_utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/slice_shape_inference_utils.hpp b/src/core/shape_inference/include/slice_shape_inference_utils.hpp index 2797163e408bec..d76ac6bb2d8453 100644 --- a/src/core/shape_inference/include/slice_shape_inference_utils.hpp +++ b/src/core/shape_inference/include/slice_shape_inference_utils.hpp @@ -5,10 +5,10 @@ #pragma once #include "dimension_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "sequnce_generator.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/split_shape_inference.hpp b/src/core/shape_inference/include/split_shape_inference.hpp index f413ee46541b2d..0ac913d82aef67 100644 --- a/src/core/shape_inference/include/split_shape_inference.hpp +++ b/src/core/shape_inference/include/split_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/split.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/squeeze_shape_inference.hpp b/src/core/shape_inference/include/squeeze_shape_inference.hpp index 20c18f02a2b17f..cd3dda050fb9cc 100644 --- a/src/core/shape_inference/include/squeeze_shape_inference.hpp +++ b/src/core/shape_inference/include/squeeze_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/squeeze.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/topk_shape_inference.hpp b/src/core/shape_inference/include/topk_shape_inference.hpp index 25354aabd11048..1cf3bf708e970d 100644 --- a/src/core/shape_inference/include/topk_shape_inference.hpp +++ b/src/core/shape_inference/include/topk_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/topk.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/transpose_shape_inference.hpp b/src/core/shape_inference/include/transpose_shape_inference.hpp index 0fd930c227bf18..81092017434a4f 100644 --- a/src/core/shape_inference/include/transpose_shape_inference.hpp +++ b/src/core/shape_inference/include/transpose_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/transpose.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/unsqueeze_shape_inference.hpp b/src/core/shape_inference/include/unsqueeze_shape_inference.hpp index 4ed59851738e38..116a10e7306bcf 100644 --- a/src/core/shape_inference/include/unsqueeze_shape_inference.hpp +++ b/src/core/shape_inference/include/unsqueeze_shape_inference.hpp @@ -3,9 +3,9 @@ // #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/unsqueeze.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/shape_inference/include/utils.hpp b/src/core/shape_inference/include/utils.hpp index 18d6158b41675e..41e43ee8764304 100644 --- a/src/core/shape_inference/include/utils.hpp +++ b/src/core/shape_inference/include/utils.hpp @@ -8,11 +8,11 @@ #include "element_visitor.hpp" #include "openvino/core/bound_evaluation_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset1.hpp" #include "ov_optional.hpp" #include "shape_infer_type_utils.hpp" #include "tensor_data_accessor.hpp" -#include "validation_util.hpp" namespace ov { diff --git a/src/core/shape_inference/include/variadic_split_shape_inference.hpp b/src/core/shape_inference/include/variadic_split_shape_inference.hpp index 00a93c466ce7a7..d1f75c6c463777 100644 --- a/src/core/shape_inference/include/variadic_split_shape_inference.hpp +++ b/src/core/shape_inference/include/variadic_split_shape_inference.hpp @@ -4,9 +4,9 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/op/variadic_split.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/bound_evaluate.cpp b/src/core/src/bound_evaluate.cpp index a574c0bf72c738..881762cce8f794 100644 --- a/src/core/src/bound_evaluate.cpp +++ b/src/core/src/bound_evaluate.cpp @@ -7,11 +7,11 @@ #include "openvino/core/dimension_tracker.hpp" #include "openvino/core/rt_info.hpp" #include "openvino/core/shape_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/symbolic_info.hpp" #include "openvino/opsets/opset10.hpp" #include "transformations/rt_info/decompression.hpp" #include "transformations/rt_info/is_shape_subgraph.hpp" -#include "validation_util.hpp" namespace { using namespace ov; diff --git a/src/core/src/op/batch_norm.cpp b/src/core/src/op/batch_norm.cpp index 0ddb5cba090071..16d826266151d4 100644 --- a/src/core/src/op/batch_norm.cpp +++ b/src/core/src/op/batch_norm.cpp @@ -10,7 +10,7 @@ #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/type.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/concat.cpp b/src/core/src/op/concat.cpp index 57a3fb24762aab..b086c400aae1b3 100644 --- a/src/core/src/op/concat.cpp +++ b/src/core/src/op/concat.cpp @@ -8,8 +8,8 @@ #include "concat_shape_inference.hpp" #include "itt.hpp" #include "openvino/core/dimension_tracker.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/concat.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/convert.cpp b/src/core/src/op/convert.cpp index a79922dcacd42f..2ddc6c1a01704c 100644 --- a/src/core/src/op/convert.cpp +++ b/src/core/src/op/convert.cpp @@ -6,10 +6,10 @@ #include "element_visitor.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/equal.hpp" #include "openvino/op/select.hpp" #include "openvino/reference/convert.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/convolution.cpp b/src/core/src/op/convolution.cpp index 0bc9a6862cd69e..d95a13c39a36e6 100644 --- a/src/core/src/op/convolution.cpp +++ b/src/core/src/op/convolution.cpp @@ -8,8 +8,8 @@ #include "convolution_backprop_shape_inference.hpp" #include "convolution_shape_inference.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" -#include "validation_util.hpp" using namespace std; diff --git a/src/core/src/op/divide.cpp b/src/core/src/op/divide.cpp index 67a0b6c7265b4a..f2bcfa5c911ffa 100644 --- a/src/core/src/op/divide.cpp +++ b/src/core/src/op/divide.cpp @@ -7,6 +7,7 @@ #include "bound_evaluate.hpp" #include "element_visitor.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/equal.hpp" #include "openvino/op/less.hpp" @@ -16,7 +17,6 @@ #include "openvino/op/select.hpp" #include "openvino/reference/divide.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/gather.cpp b/src/core/src/op/gather.cpp index 941637781b0ba6..75db201dd2b2a1 100644 --- a/src/core/src/op/gather.cpp +++ b/src/core/src/op/gather.cpp @@ -5,7 +5,7 @@ #include "openvino/op/gather.hpp" #include "itt.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/grid_sample.cpp b/src/core/src/op/grid_sample.cpp index d5ed0790d4ae12..c1e4cfd8ac9fc4 100644 --- a/src/core/src/op/grid_sample.cpp +++ b/src/core/src/op/grid_sample.cpp @@ -7,8 +7,8 @@ #include "element_visitor.hpp" #include "grid_sample_shape_inference.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/grid_sample.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/group_conv.cpp b/src/core/src/op/group_conv.cpp index d8913c60af6c07..de382ca4e4cc3a 100644 --- a/src/core/src/op/group_conv.cpp +++ b/src/core/src/op/group_conv.cpp @@ -8,8 +8,8 @@ #include "group_convolution_backprop_shape_inference.hpp" #include "group_convolution_shape_inference.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" -#include "validation_util.hpp" //------------------------------------------------------------------------------ // v1::GroupConvolution diff --git a/src/core/src/op/group_normalization.cpp b/src/core/src/op/group_normalization.cpp index 6313df17c9a59e..6c7e95936d7836 100644 --- a/src/core/src/op/group_normalization.cpp +++ b/src/core/src/op/group_normalization.cpp @@ -7,7 +7,7 @@ #include "group_normalization_shape_inference.hpp" #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { op::v12::GroupNormalization::GroupNormalization() : m_num_groups{0}, m_epsilon{0} {} diff --git a/src/core/src/op/if.cpp b/src/core/src/op/if.cpp index fd1fa0e743df2b..89d1816cc8edc3 100644 --- a/src/core/src/op/if.cpp +++ b/src/core/src/op/if.cpp @@ -9,9 +9,9 @@ #include "itt.hpp" #include "openvino/core/graph_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/multi_subgraph_base.hpp" #include "openvino/reference/if.hpp" -#include "validation_util.hpp" ov::op::v8::If::If() : MultiSubGraphOp(2) {} diff --git a/src/core/src/op/loop.cpp b/src/core/src/op/loop.cpp index f7589b1268986a..2a1a32b2883980 100644 --- a/src/core/src/op/loop.cpp +++ b/src/core/src/op/loop.cpp @@ -7,10 +7,10 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/tensor_iterator.hpp" #include "openvino/reference/loop.hpp" #include "openvino/runtime/tensor.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/lrn.cpp b/src/core/src/op/lrn.cpp index 908f3f6c5d97f6..d212d8c4718fb9 100644 --- a/src/core/src/op/lrn.cpp +++ b/src/core/src/op/lrn.cpp @@ -6,9 +6,9 @@ #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/multiply.hpp" -#include "validation_util.hpp" namespace ov { op::v0::LRN::LRN(const Output& arg, double alpha, double beta, double bias, size_t size) diff --git a/src/core/src/op/max_pool.cpp b/src/core/src/op/max_pool.cpp index 204e72a6cbf962..689beda575c271 100644 --- a/src/core/src/op/max_pool.cpp +++ b/src/core/src/op/max_pool.cpp @@ -7,8 +7,8 @@ #include "itt.hpp" #include "max_pool_shape_inference.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/max_pool.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/mod.cpp b/src/core/src/op/mod.cpp index 79cc4158b90f65..0305136d8f58e3 100644 --- a/src/core/src/op/mod.cpp +++ b/src/core/src/op/mod.cpp @@ -7,13 +7,13 @@ #include "bound_evaluate.hpp" #include "element_visitor.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/equal.hpp" #include "openvino/op/logical_or.hpp" #include "openvino/op/select.hpp" #include "openvino/reference/mod.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace util { diff --git a/src/core/src/op/non_max_suppression.cpp b/src/core/src/op/non_max_suppression.cpp index ead5205593b17d..801d4f16ada788 100644 --- a/src/core/src/op/non_max_suppression.cpp +++ b/src/core/src/op/non_max_suppression.cpp @@ -10,9 +10,9 @@ #include "itt.hpp" #include "nms_shape_inference.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/util/op_types.hpp" -#include "validation_util.hpp" namespace ov { // ------------------------------ V1 ------------------------------ diff --git a/src/core/src/op/non_zero.cpp b/src/core/src/op/non_zero.cpp index 06c0df37d585a0..f3bc6ea6e7d5bd 100644 --- a/src/core/src/op/non_zero.cpp +++ b/src/core/src/op/non_zero.cpp @@ -9,8 +9,8 @@ #include "element_visitor.hpp" #include "itt.hpp" #include "openvino/core/type/element_type_traits.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/non_zero.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/normalize_l2.cpp b/src/core/src/op/normalize_l2.cpp index a5dc52b40b9945..f111224efc6a2c 100644 --- a/src/core/src/op/normalize_l2.cpp +++ b/src/core/src/op/normalize_l2.cpp @@ -5,7 +5,7 @@ #include "openvino/op/normalize_l2.hpp" #include "itt.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" using namespace std; diff --git a/src/core/src/op/read_value.cpp b/src/core/src/op/read_value.cpp index 25d763627dd2f5..6511c55fc1c9e2 100644 --- a/src/core/src/op/read_value.cpp +++ b/src/core/src/op/read_value.cpp @@ -5,9 +5,9 @@ #include "openvino/op/read_value.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/util/variable_context.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/reduce_prod.cpp b/src/core/src/op/reduce_prod.cpp index f8b1adeb2a77d0..72bdd48ea5721b 100644 --- a/src/core/src/op/reduce_prod.cpp +++ b/src/core/src/op/reduce_prod.cpp @@ -8,9 +8,9 @@ #include "element_visitor.hpp" #include "itt.hpp" #include "openvino/core/shape_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/axes_util.hpp" #include "openvino/reference/reduce_prod.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/reverse_sequence.cpp b/src/core/src/op/reverse_sequence.cpp index eefc6f633a90f4..ea18211e067d6a 100644 --- a/src/core/src/op/reverse_sequence.cpp +++ b/src/core/src/op/reverse_sequence.cpp @@ -9,8 +9,8 @@ #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "reverse_sequence_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { op::v0::ReverseSequence::ReverseSequence(const Output& arg, diff --git a/src/core/src/op/scatter_update.cpp b/src/core/src/op/scatter_update.cpp index f32b6e55c280e0..ca7c3edeadedec 100644 --- a/src/core/src/op/scatter_update.cpp +++ b/src/core/src/op/scatter_update.cpp @@ -9,10 +9,10 @@ #include "openvino/core/shape.hpp" #include "openvino/core/type/element_type.hpp" #include "openvino/core/type/element_type_traits.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/reference/scatter_update.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/shuffle_channels.cpp b/src/core/src/op/shuffle_channels.cpp index 29f998dbd7ea25..33304a3d9b76ae 100644 --- a/src/core/src/op/shuffle_channels.cpp +++ b/src/core/src/op/shuffle_channels.cpp @@ -8,9 +8,9 @@ #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/shuffle_channels.hpp" #include "shuffle_channels_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/slice.cpp b/src/core/src/op/slice.cpp index 03811bd10ed6f1..e1cc3a7d079055 100644 --- a/src/core/src/op/slice.cpp +++ b/src/core/src/op/slice.cpp @@ -6,9 +6,9 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/slice.hpp" #include "slice_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/softmax.cpp b/src/core/src/op/softmax.cpp index 5166a42446f74c..6a5a1021ecfd18 100644 --- a/src/core/src/op/softmax.cpp +++ b/src/core/src/op/softmax.cpp @@ -9,8 +9,8 @@ #include "element_visitor.hpp" #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/softmax.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/split.cpp b/src/core/src/op/split.cpp index 7567fc3e7e043a..5372ab8da72a63 100644 --- a/src/core/src/op/split.cpp +++ b/src/core/src/op/split.cpp @@ -8,9 +8,9 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/split.hpp" #include "split_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/squeeze.cpp b/src/core/src/op/squeeze.cpp index 86e99677b5a25a..4161fd60c72583 100644 --- a/src/core/src/op/squeeze.cpp +++ b/src/core/src/op/squeeze.cpp @@ -8,9 +8,9 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "squeeze_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/strided_slice.cpp b/src/core/src/op/strided_slice.cpp index bb2da1e9d5d062..48b7acdf0efc59 100644 --- a/src/core/src/op/strided_slice.cpp +++ b/src/core/src/op/strided_slice.cpp @@ -11,6 +11,7 @@ #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/shape_of.hpp" @@ -20,7 +21,6 @@ #include "openvino/reference/strided_slice.hpp" #include "strided_slice_shape_inference.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/tile.cpp b/src/core/src/op/tile.cpp index 6f56996435acba..e5e20ad9b41295 100644 --- a/src/core/src/op/tile.cpp +++ b/src/core/src/op/tile.cpp @@ -6,10 +6,10 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" #include "openvino/reference/tile.hpp" #include "tile_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/transpose.cpp b/src/core/src/op/transpose.cpp index e4cb7d7ae32105..72ab396835fb9a 100644 --- a/src/core/src/op/transpose.cpp +++ b/src/core/src/op/transpose.cpp @@ -6,9 +6,9 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/transpose.hpp" #include "transpose_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/unique.cpp b/src/core/src/op/unique.cpp index b9c6016334a11b..25aca0628cdbf3 100644 --- a/src/core/src/op/unique.cpp +++ b/src/core/src/op/unique.cpp @@ -2,13 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/reference/unique.hpp" +#include "openvino/op/unique.hpp" #include "element_visitor.hpp" #include "itt.hpp" -#include "openvino/op/unique.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/op_types.hpp" -#include "validation_util.hpp" +#include "openvino/reference/unique.hpp" namespace ov { namespace { diff --git a/src/core/src/op/unsqueeze.cpp b/src/core/src/op/unsqueeze.cpp index 61600c0e30d446..74a74afbf8afe8 100644 --- a/src/core/src/op/unsqueeze.cpp +++ b/src/core/src/op/unsqueeze.cpp @@ -10,8 +10,8 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "unsqueeze_shape_inference.hpp" -#include "validation_util.hpp" ov::op::v0::Unsqueeze::Unsqueeze(const ov::Output& data, const ov::Output& axes) : Op({data, axes}) { diff --git a/src/core/src/op/util/axes_util.cpp b/src/core/src/op/util/axes_util.cpp index 6b5539cae881d4..965ac057e2f6a5 100644 --- a/src/core/src/op/util/axes_util.cpp +++ b/src/core/src/op/util/axes_util.cpp @@ -4,8 +4,8 @@ #include "openvino/op/util/axes_util.hpp" +#include "openvino/core/validation_util.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/util/broadcast_base.cpp b/src/core/src/op/util/broadcast_base.cpp index adf496d43f869c..b0ffd1ad671cff 100644 --- a/src/core/src/op/util/broadcast_base.cpp +++ b/src/core/src/op/util/broadcast_base.cpp @@ -8,10 +8,10 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" #include "openvino/reference/broadcast.hpp" -#include "validation_util.hpp" ov::op::util::BroadcastBase::BroadcastBase(const Output& arg, const Output& target_shape, diff --git a/src/core/src/op/util/gather_base.cpp b/src/core/src/op/util/gather_base.cpp index dcfac60c659eb7..e9bbaff21e329c 100644 --- a/src/core/src/op/util/gather_base.cpp +++ b/src/core/src/op/util/gather_base.cpp @@ -8,11 +8,11 @@ #include "element_visitor.hpp" #include "gather_shape_inference.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/squeeze.hpp" #include "openvino/reference/gather.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/util/pad_base.cpp b/src/core/src/op/util/pad_base.cpp index 0b6a90ee773a1b..dfd1095dc9a40f 100644 --- a/src/core/src/op/util/pad_base.cpp +++ b/src/core/src/op/util/pad_base.cpp @@ -5,12 +5,12 @@ #include "bound_evaluate.hpp" #include "itt.hpp" #include "openvino/core/attribute_visitor.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/pad.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" #include "openvino/reference/pad.hpp" #include "pad_shape_inference.hpp" -#include "validation_util.hpp" namespace ov { op::util::PadBase::PadBase(const Output& arg, diff --git a/src/core/src/op/util/reduction_base.cpp b/src/core/src/op/util/reduction_base.cpp index f6d665d7da295d..406da53e7642fb 100644 --- a/src/core/src/op/util/reduction_base.cpp +++ b/src/core/src/op/util/reduction_base.cpp @@ -4,9 +4,9 @@ #include "openvino/op/util/reduction_base.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "reduce_shape_inference.hpp" -#include "validation_util.hpp" ov::op::util::ReductionBase::ReductionBase() = default; diff --git a/src/core/src/op/util/scatter_base.cpp b/src/core/src/op/util/scatter_base.cpp index 602f79013651fc..27d3b8a185fd96 100644 --- a/src/core/src/op/util/scatter_base.cpp +++ b/src/core/src/op/util/scatter_base.cpp @@ -5,7 +5,7 @@ #include "openvino/op/util/scatter_base.hpp" #include "itt.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" ov::op::util::ScatterBase::ScatterBase(const Output& data, const Output& indices, diff --git a/src/core/src/op/util/scatter_elements_update_base.cpp b/src/core/src/op/util/scatter_elements_update_base.cpp index 0c65ddf80061f4..11c2e9be68e236 100644 --- a/src/core/src/op/util/scatter_elements_update_base.cpp +++ b/src/core/src/op/util/scatter_elements_update_base.cpp @@ -6,9 +6,9 @@ #include "bound_evaluate.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "scatter_elements_update_shape_inference.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace ov { namespace op { diff --git a/src/core/src/op/util/topk_base.cpp b/src/core/src/op/util/topk_base.cpp index 80c23c59edc9e6..7857741e22f019 100644 --- a/src/core/src/op/util/topk_base.cpp +++ b/src/core/src/op/util/topk_base.cpp @@ -7,9 +7,9 @@ #include #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/util/precision_sensitive_attribute.hpp" #include "topk_shape_inference.hpp" -#include "validation_util.hpp" namespace { constexpr auto UNKNOWN_NORMALIZED_AXIS = std::numeric_limits::max(); diff --git a/src/core/src/op/variadic_split.cpp b/src/core/src/op/variadic_split.cpp index 7a8d4e55528774..ec3fe39b8a1fe6 100644 --- a/src/core/src/op/variadic_split.cpp +++ b/src/core/src/op/variadic_split.cpp @@ -9,8 +9,8 @@ #include "bound_evaluate.hpp" #include "compare.hpp" #include "itt.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/reference/slice.hpp" -#include "validation_util.hpp" #include "variadic_split_shape_inference.hpp" namespace ov { diff --git a/src/core/src/partial_shape.cpp b/src/core/src/partial_shape.cpp index 993a957e447fec..efc4c65e2aaed5 100644 --- a/src/core/src/partial_shape.cpp +++ b/src/core/src/partial_shape.cpp @@ -10,8 +10,8 @@ #include "openvino/core/dimension_tracker.hpp" #include "openvino/core/shape_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/util/common_util.hpp" -#include "validation_util.hpp" ov::PartialShape::PartialShape() : PartialShape(std::initializer_list{}) {} diff --git a/src/core/src/shape.cpp b/src/core/src/shape.cpp index dbc57212952710..306dcbee8e69d7 100644 --- a/src/core/src/shape.cpp +++ b/src/core/src/shape.cpp @@ -5,8 +5,8 @@ #include "openvino/core/shape.hpp" #include "openvino/core/shape_util.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/util/common_util.hpp" -#include "validation_util.hpp" std::ostream& ov::operator<<(std::ostream& s, const Shape& shape) { s << "["; diff --git a/src/core/src/shape_util.cpp b/src/core/src/shape_util.cpp index ae89c4fe106cb5..6e0457f7841f21 100644 --- a/src/core/src/shape_util.cpp +++ b/src/core/src/shape_util.cpp @@ -7,7 +7,7 @@ #include #include "openvino/core/partial_shape.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { template diff --git a/src/core/src/validation_util.cpp b/src/core/src/validation_util.cpp index 963a229799106b..be6006448db8c4 100644 --- a/src/core/src/validation_util.cpp +++ b/src/core/src/validation_util.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" #include #include diff --git a/src/core/tests/type_prop/broadcast.cpp b/src/core/tests/type_prop/broadcast.cpp index 04f93d08b798e6..33d4cf2d5ce030 100644 --- a/src/core/tests/type_prop/broadcast.cpp +++ b/src/core/tests/type_prop/broadcast.cpp @@ -9,6 +9,7 @@ #include "common_test_utils/test_assertions.hpp" #include "common_test_utils/type_prop.hpp" #include "openvino/core/dimension_tracker.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/equal.hpp" @@ -17,7 +18,6 @@ #include "openvino/op/shape_of.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/op/util/attr_types.hpp" -#include "validation_util.hpp" using namespace std; using namespace testing; diff --git a/src/core/tests/type_prop/variadic_split.cpp b/src/core/tests/type_prop/variadic_split.cpp index 84d3463ef78f53..caf6466aeddd49 100644 --- a/src/core/tests/type_prop/variadic_split.cpp +++ b/src/core/tests/type_prop/variadic_split.cpp @@ -7,10 +7,10 @@ #include "common_test_utils/test_assertions.hpp" #include "common_test_utils/type_prop.hpp" #include "openvino/core/dimension_tracker.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/broadcast.hpp" #include "openvino/op/shape_of.hpp" #include "sequnce_generator.hpp" -#include "validation_util.hpp" using namespace std; using namespace ov; diff --git a/src/core/tests/validation_utils.cpp b/src/core/tests/validation_utils.cpp index 21001e48480256..67c050fe9c072e 100644 --- a/src/core/tests/validation_utils.cpp +++ b/src/core/tests/validation_utils.cpp @@ -5,9 +5,9 @@ #include #include "openvino/core/type.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/opsets/opset8.hpp" #include "openvino/util/common_util.hpp" -#include "validation_util.hpp" TEST(get_constant_from_source, invalidation_check) { auto a = ov::opset8::Constant::create(ov::element::i64, {100}, {123}); diff --git a/src/frontends/ir/src/input_model.cpp b/src/frontends/ir/src/input_model.cpp index 750d6739e3a903..90939db2229c30 100644 --- a/src/frontends/ir/src/input_model.cpp +++ b/src/frontends/ir/src/input_model.cpp @@ -8,6 +8,7 @@ #include "ir_deserializer.hpp" #include "openvino/core/except.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/concat.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/subtract.hpp" @@ -17,7 +18,6 @@ #include "openvino/util/common_util.hpp" #include "openvino/util/xml_parse_utils.hpp" #include "utils.hpp" -#include "validation_util.hpp" namespace { void parse_pre_process(pugi::xml_node& root, diff --git a/src/frontends/onnx/frontend/src/op/clip.cpp b/src/frontends/onnx/frontend/src/op/clip.cpp index 5442b54465cda8..a49d2cf4224fc9 100644 --- a/src/frontends/onnx/frontend/src/op/clip.cpp +++ b/src/frontends/onnx/frontend/src/op/clip.cpp @@ -7,10 +7,10 @@ #include #include "core/null_node.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/clamp.hpp" #include "openvino/op/maximum.hpp" #include "openvino/op/minimum.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp index 4082368fd68163..19577d40ba7d31 100644 --- a/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/dequantize_linear.cpp @@ -8,6 +8,7 @@ #include #include "core/null_node.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" @@ -15,7 +16,6 @@ #include "openvino/op/reshape.hpp" #include "openvino/op/subtract.hpp" #include "utils/common.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/flatten.cpp b/src/frontends/onnx/frontend/src/op/flatten.cpp index 2e07903270e051..5200bc0226f19b 100644 --- a/src/frontends/onnx/frontend/src/op/flatten.cpp +++ b/src/frontends/onnx/frontend/src/op/flatten.cpp @@ -5,8 +5,8 @@ #include "op/flatten.hpp" #include "exceptions.hpp" +#include "openvino/core/validation_util.hpp" #include "utils/reshape.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/hardmax.cpp b/src/frontends/onnx/frontend/src/op/hardmax.cpp index 10a5e254abbdce..782ceae1c641a3 100644 --- a/src/frontends/onnx/frontend/src/op/hardmax.cpp +++ b/src/frontends/onnx/frontend/src/op/hardmax.cpp @@ -5,6 +5,7 @@ #include "op/hardmax.hpp" #include "exceptions.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/gather.hpp" @@ -14,7 +15,6 @@ #include "openvino/op/topk.hpp" #include "utils/common.hpp" #include "utils/reshape.hpp" -#include "validation_util.hpp" using namespace ov::op; using ov::Shape; diff --git a/src/frontends/onnx/frontend/src/op/log_softmax.cpp b/src/frontends/onnx/frontend/src/op/log_softmax.cpp index 1a660d535f251b..4559406ad801cb 100644 --- a/src/frontends/onnx/frontend/src/op/log_softmax.cpp +++ b/src/frontends/onnx/frontend/src/op/log_softmax.cpp @@ -4,6 +4,7 @@ #include "op/log_softmax.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/log.hpp" @@ -11,7 +12,6 @@ #include "openvino/op/reshape.hpp" #include "openvino/op/shape_of.hpp" #include "utils/reshape.hpp" -#include "validation_util.hpp" using namespace ov::op; using ov::Shape; diff --git a/src/frontends/onnx/frontend/src/op/lp_norm.cpp b/src/frontends/onnx/frontend/src/op/lp_norm.cpp index 836be70c76eb83..2b08b64222b140 100644 --- a/src/frontends/onnx/frontend/src/op/lp_norm.cpp +++ b/src/frontends/onnx/frontend/src/op/lp_norm.cpp @@ -5,10 +5,10 @@ #include "op/lp_norm.hpp" #include "exceptions.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/divide.hpp" #include "utils/norm.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp index b92acbdc1cca8d..286303bb77f0c1 100644 --- a/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp +++ b/src/frontends/onnx/frontend/src/op/mean_variance_normalization.cpp @@ -4,9 +4,9 @@ #include "op/mean_variance_normalization.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/mvn.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp index b19f78dbcf0255..3a0ba924a15bff 100644 --- a/src/frontends/onnx/frontend/src/op/quantize_linear.cpp +++ b/src/frontends/onnx/frontend/src/op/quantize_linear.cpp @@ -5,6 +5,7 @@ #include "op/quantize_linear.hpp" #include "exceptions.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" @@ -12,7 +13,6 @@ #include "openvino/op/multiply.hpp" #include "openvino/op/subtract.hpp" #include "utils/reshape.hpp" -#include "validation_util.hpp" using namespace ov::op; using ov::Shape; diff --git a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp index 127bab0bc4f148..91e98ee4419647 100644 --- a/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp +++ b/src/frontends/onnx/frontend/src/op/reverse_sequence.cpp @@ -6,10 +6,10 @@ #include "core/node.hpp" #include "openvino/core/type/element_type.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/reverse_sequence.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/op/scan.cpp b/src/frontends/onnx/frontend/src/op/scan.cpp index d91c90b047a2ba..b51a2dbde2bbaf 100644 --- a/src/frontends/onnx/frontend/src/op/scan.cpp +++ b/src/frontends/onnx/frontend/src/op/scan.cpp @@ -7,12 +7,12 @@ #include "core/graph.hpp" #include "core/null_node.hpp" #include "exceptions.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/squeeze.hpp" #include "openvino/op/tensor_iterator.hpp" #include "openvino/op/unsqueeze.hpp" #include "openvino/op/util/op_types.hpp" -#include "validation_util.hpp" using namespace ov::op; diff --git a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp index 0359e32e02cf59..1a5492154784e7 100644 --- a/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp +++ b/src/frontends/onnx/frontend/src/utils/arg_min_max_factory.cpp @@ -4,6 +4,7 @@ #include "utils/arg_min_max_factory.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert.hpp" #include "openvino/op/gather.hpp" @@ -12,7 +13,6 @@ #include "openvino/op/squeeze.hpp" #include "openvino/op/subtract.hpp" #include "openvino/op/topk.hpp" -#include "validation_util.hpp" using namespace ov; using namespace ov::op; diff --git a/src/frontends/pytorch/src/node_context.cpp b/src/frontends/pytorch/src/node_context.cpp index 4d0fd1acfeba47..441f1c75d8fe38 100644 --- a/src/frontends/pytorch/src/node_context.cpp +++ b/src/frontends/pytorch/src/node_context.cpp @@ -4,6 +4,7 @@ #include "openvino/frontend/pytorch/node_context.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/exception.hpp" #include "openvino/frontend/pytorch/decoder.hpp" #include "openvino/op/constant.hpp" @@ -11,7 +12,6 @@ #include "openvino/util/log.hpp" #include "pt_framework_node.hpp" #include "translate_session.hpp" -#include "validation_util.hpp" namespace ov { namespace frontend { diff --git a/src/frontends/pytorch/src/transforms/softmax_reshape_elimination.cpp b/src/frontends/pytorch/src/transforms/softmax_reshape_elimination.cpp index 65a059778924fa..e3e322e53a628d 100644 --- a/src/frontends/pytorch/src/transforms/softmax_reshape_elimination.cpp +++ b/src/frontends/pytorch/src/transforms/softmax_reshape_elimination.cpp @@ -5,10 +5,10 @@ #include "softmax_reshape_elimination.hpp" #include "openvino/core/rt_info.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/softmax.hpp" #include "openvino/pass/pattern/op/wrap_type.hpp" -#include "validation_util.hpp" namespace ov { namespace frontend { @@ -78,4 +78,4 @@ SoftmaxReshapeElimination::SoftmaxReshapeElimination() { } // namespace pass } // namespace pytorch } // namespace frontend -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/frontends/tensorflow_common/include/helper_ops/sparse_segment_ops.hpp b/src/frontends/tensorflow_common/include/helper_ops/sparse_segment_ops.hpp index 9267bd7662dad2..0bac15056e68a8 100644 --- a/src/frontends/tensorflow_common/include/helper_ops/sparse_segment_ops.hpp +++ b/src/frontends/tensorflow_common/include/helper_ops/sparse_segment_ops.hpp @@ -8,7 +8,7 @@ #include #include "helper_ops/internal_operation.hpp" -#include "validation_util.hpp" +#include "openvino/core/validation_util.hpp" namespace ov { namespace frontend { diff --git a/src/frontends/tensorflow_common/include/utils.hpp b/src/frontends/tensorflow_common/include/utils.hpp index ec0d789a5a7703..4d0e4a74c06898 100644 --- a/src/frontends/tensorflow_common/include/utils.hpp +++ b/src/frontends/tensorflow_common/include/utils.hpp @@ -4,13 +4,13 @@ #pragma once +#include "openvino/core/validation_util.hpp" #include "openvino/frontend/node_context.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/convert_like.hpp" #include "openvino/op/reshape.hpp" #include "openvino/op/transpose.hpp" #include "openvino/pass/graph_rewrite.hpp" -#include "validation_util.hpp" namespace ov { namespace frontend { diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp index ab73f9e11d69f2..d9524e54fd2cc0 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp @@ -8,8 +8,8 @@ #include "convolution_shape_inference.hpp" #include "intel_gpu/plugin/common_utils.hpp" #include "kernel_base.h" +#include "openvino/core/validation_util.hpp" #include "primitive_base.hpp" -#include "validation_util.hpp" namespace cldnn { namespace ocl { diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp index 4a52cfaabceb2b..37458a9da04653 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/core/validation_util.hpp" #include "pooling/pooling_kernel_base.h" #include "pooling/pooling_kernel_selector.h" #include "pooling_inst.h" #include "pooling_shape_inference_util.hpp" #include "primitive_base.hpp" -#include "validation_util.hpp" namespace cldnn { namespace ocl { diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp index 5e628ff50a6656..4d2296a50b1961 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/swiglu.cpp @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/core/validation_util.hpp" #include "primitive_base.hpp" -#include "validation_util.hpp" - -#include "swiglu_inst.h" -#include "swiglu/swiglu_kernel_selector.h" #include "swiglu/swiglu_kernel_ref.h" +#include "swiglu/swiglu_kernel_selector.h" +#include "swiglu_inst.h" namespace cldnn { namespace ocl { diff --git a/src/plugins/intel_gpu/src/graph/pooling.cpp b/src/plugins/intel_gpu/src/graph/pooling.cpp index 7b1df0f985836e..0179a8ff531ff7 100644 --- a/src/plugins/intel_gpu/src/graph/pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/pooling.cpp @@ -7,10 +7,10 @@ #include "intel_gpu/runtime/error_handler.hpp" #include "json_object.h" #include "max_pool_shape_inference.hpp" +#include "openvino/core/validation_util.hpp" #include "pooling_inst.h" #include "primitive_type_base.h" #include "sliding_window_utils.hpp" -#include "validation_util.hpp" using namespace ov::intel_gpu; diff --git a/src/plugins/intel_gpu/src/plugin/ops/cum_sum.cpp b/src/plugins/intel_gpu/src/plugin/ops/cum_sum.cpp index ce467c0c9dbcf4..dcc0058cc7d39a 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/cum_sum.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/cum_sum.cpp @@ -2,14 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/cum_sum.hpp" -#include "openvino/op/constant.hpp" -#include "validation_util.hpp" - -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" - +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/cum_sum.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/cum_sum.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/dft.cpp b/src/plugins/intel_gpu/src/plugin/ops/dft.cpp index 28a7f3b3596bd6..382fad62d0408b 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/dft.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/dft.cpp @@ -2,16 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 // +#include +#include + +#include "intel_gpu/plugin/program_builder.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/constant.hpp" #include "openvino/op/dft.hpp" #include "openvino/op/idft.hpp" -#include "openvino/op/rdft.hpp" #include "openvino/op/irdft.hpp" -#include "validation_util.hpp" - -#include -#include "intel_gpu/plugin/program_builder.hpp" -#include +#include "openvino/op/rdft.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp b/src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp index 79d732c46f6fdf..54a7aadc7564ff 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/interpolate.cpp @@ -2,14 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/interpolate.hpp" -#include "openvino/op/constant.hpp" -#include "validation_util.hpp" +#include -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/resample.hpp" -#include +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/interpolate.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/mvn.cpp b/src/plugins/intel_gpu/src/plugin/ops/mvn.cpp index a1385c7ac0ffcb..42ef8c6b4c72e4 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/mvn.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/mvn.cpp @@ -2,15 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/mvn.hpp" -#include "openvino/op/constant.hpp" -#include "validation_util.hpp" +#include -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/mvn.hpp" - -#include +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/mvn.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/scatter_elements_update.cpp b/src/plugins/intel_gpu/src/plugin/ops/scatter_elements_update.cpp index 268c938c65f808..91a85397c3360f 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/scatter_elements_update.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/scatter_elements_update.cpp @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/scatter_elements_update.hpp" -#include "openvino/op/constant.hpp" -#include "validation_util.hpp" - -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/scatter_elements_update.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/scatter_elements_update.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/shuffle_channels.cpp b/src/plugins/intel_gpu/src/plugin/ops/shuffle_channels.cpp index 80827bb31c4ebd..4135735829022a 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/shuffle_channels.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/shuffle_channels.cpp @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/shuffle_channels.hpp" -#include "validation_util.hpp" - -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/shuffle_channels.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/shuffle_channels.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/softmax.cpp b/src/plugins/intel_gpu/src/plugin/ops/softmax.cpp index 946323105cad6a..cbd1ab702891e8 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/softmax.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/softmax.cpp @@ -2,14 +2,13 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/softmax.hpp" -#include "openvino/op/log_softmax.hpp" -#include "validation_util.hpp" - -#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/plugin/common_utils.hpp" -#include "intel_gpu/primitives/softmax.hpp" +#include "intel_gpu/plugin/program_builder.hpp" #include "intel_gpu/primitives/activation.hpp" +#include "intel_gpu/primitives/softmax.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/log_softmax.hpp" +#include "openvino/op/softmax.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/ops/unique.cpp b/src/plugins/intel_gpu/src/plugin/ops/unique.cpp index 47fcaab97d51fd..10bd110b4442ca 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/unique.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/unique.cpp @@ -2,12 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/unique.hpp" -#include "openvino/op/constant.hpp" -#include "validation_util.hpp" - -#include "intel_gpu/primitives/unique.hpp" #include "intel_gpu/plugin/program_builder.hpp" +#include "intel_gpu/primitives/unique.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/unique.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp b/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp index e2d87fae0a24ba..4154f489fe18e3 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/op/swiglu.cpp @@ -3,10 +3,10 @@ // #include "intel_gpu/op/swiglu.hpp" -#include "validation_util.hpp" -#include "variadic_split_shape_inference.hpp" #include "openvino/core/partial_shape.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/op/variadic_split.hpp" +#include "variadic_split_shape_inference.hpp" namespace ov { namespace intel_gpu { diff --git a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp index 4b0dafa847cc1d..69caa4ff53f531 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations_pipeline.cpp @@ -2,147 +2,136 @@ // SPDX-License-Identifier: Apache-2.0 // -#include #include -#include -#include -#include -#include -#include #include +#include +#include +#include #include +#include +#include +#include #include "intel_gpu/plugin/transformations_pipeline.hpp" - -#include "openvino/op/reduce_sum.hpp" -#include "openvino/op/reduce_mean.hpp" -#include "openvino/op/reduce_max.hpp" -#include "openvino/op/rnn_cell.hpp" +#include "intel_gpu/runtime/itt.hpp" +#include "low_precision/convolution.hpp" +#include "low_precision/convolution_backprop_data.hpp" +#include "low_precision/group_convolution.hpp" +#include "low_precision/low_precision.hpp" +#include "low_precision/mat_mul.hpp" +#include "low_precision/multiply_to_group_convolution.hpp" +#include "low_precision/network_helper.hpp" +#include "low_precision/pull_reshape_through_dequantization.hpp" +#include "low_precision/pull_transpose_through_dequantization.hpp" +#include "low_precision/recurrent_cell.hpp" +#include "low_precision/strided_slice.hpp" +#include "openvino/core/deprecated.hpp" +#include "openvino/core/validation_util.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/convolution.hpp" +#include "openvino/op/gather.hpp" +#include "openvino/op/group_conv.hpp" #include "openvino/op/gru_cell.hpp" -#include "openvino/op/lstm_cell.hpp" -#include "openvino/op/rnn_sequence.hpp" #include "openvino/op/gru_sequence.hpp" +#include "openvino/op/lstm_cell.hpp" #include "openvino/op/lstm_sequence.hpp" +#include "openvino/op/multiply.hpp" #include "openvino/op/mvn.hpp" -#include "openvino/op/constant.hpp" #include "openvino/op/normalize_l2.hpp" -#include "openvino/op/convolution.hpp" -#include "openvino/op/group_conv.hpp" -#include "openvino/op/multiply.hpp" +#include "openvino/op/reduce_max.hpp" +#include "openvino/op/reduce_mean.hpp" +#include "openvino/op/reduce_sum.hpp" +#include "openvino/op/rnn_cell.hpp" +#include "openvino/op/rnn_sequence.hpp" #include "openvino/op/util/sub_graph_base.hpp" -#include "openvino/op/gather.hpp" - -#include "openvino/pass/manager.hpp" #include "openvino/pass/constant_folding.hpp" -#include "openvino/core/deprecated.hpp" -#include "validation_util.hpp" - +#include "openvino/pass/manager.hpp" #include "openvino/pass/visualize_tree.hpp" -#include "transformations/einsum_decomposition.hpp" -#include "transformations/convert_pooling_to_reduce.hpp" -#include "transformations/decompose_reduce_for_false_keepdims.hpp" -#include "transformations/convert_shapeof.hpp" - -#include "transformations/opset_conversions/convert_opset3_to_opset2.hpp" -#include "transformations/opset_conversions/convert_opset2_to_opset1.hpp" - -#include "transformations/control_flow/unroll_tensor_iterator.hpp" -#include "transformations/resolve_names_collisions.hpp" - -#include "transformations/fp16_compression/mark_decompression_convert_constant_folding.hpp" -#include "transformations/fp16_compression/convert_compression_only_to_legacy.hpp" -#include "transformations/fp16_compression/mark_decompression_convert_constant_folding.hpp" -#include "transformations/common_optimizations/common_optimizations.hpp" +#include "plugin/transformations/binary_conv_to_conv.hpp" +#include "plugin/transformations/clamp_fp16_output.hpp" +#include "plugin/transformations/convert_fc_to_compressed.hpp" +#include "plugin/transformations/convert_gather_to_compressed.hpp" +#include "plugin/transformations/convert_matmul_to_fc.hpp" +#include "plugin/transformations/fc_convert_fusion.hpp" +#include "plugin/transformations/kv_cache_fusion.hpp" +#include "plugin/transformations/move_convert_after_gather.hpp" +#include "plugin/transformations/move_fc_reshape_to_weights.hpp" +#include "plugin/transformations/rms_fusion.hpp" +#include "plugin/transformations/swiglu_fusion.hpp" +#include "plugin/transformations/transpose_matmul_fusion.hpp" #include "transformations/common_optimizations/broadcast_elementwise_fusion.hpp" #include "transformations/common_optimizations/broadcast_transition.hpp" +#include "transformations/common_optimizations/common_optimizations.hpp" +#include "transformations/common_optimizations/convert_quantize_dequantize.hpp" #include "transformations/common_optimizations/lin_op_sequence_fusion.hpp" #include "transformations/common_optimizations/lstm_cell_fusion.hpp" +#include "transformations/common_optimizations/mvn_fusion.hpp" +#include "transformations/common_optimizations/softmax_fusion.hpp" +#include "transformations/common_optimizations/transpose_sinking.hpp" #include "transformations/common_optimizations/weights_dequantize_to_fake_quantize.hpp" -#include "transformations/common_optimizations/convert_quantize_dequantize.hpp" #include "transformations/common_optimizations/wrap_interpolate_into_transposes.hpp" -#include "transformations/common_optimizations/transpose_sinking.hpp" -#include "transformations/common_optimizations/softmax_fusion.hpp" -#include "transformations/common_optimizations/mvn_fusion.hpp" - +#include "transformations/control_flow/unroll_tensor_iterator.hpp" +#include "transformations/convert_pooling_to_reduce.hpp" +#include "transformations/convert_precision.hpp" +#include "transformations/convert_shapeof.hpp" +#include "transformations/decompose_reduce_for_false_keepdims.hpp" +#include "transformations/einsum_decomposition.hpp" +#include "transformations/fp16_compression/convert_compression_only_to_legacy.hpp" +#include "transformations/fp16_compression/mark_decompression_convert_constant_folding.hpp" +#include "transformations/init_node_info.hpp" +#include "transformations/low_precision/mark_dequantization_subgraph.hpp" +#include "transformations/op_conversions/bidirectional_sequences_decomposition.hpp" +#include "transformations/op_conversions/convert_batch_to_space.hpp" +#include "transformations/op_conversions/convert_broadcast3.hpp" +#include "transformations/op_conversions/convert_deformable_conv_v8_to_v1.hpp" #include "transformations/op_conversions/convert_depth_to_space.hpp" -#include "transformations/op_conversions/convert_space_to_depth.hpp" +#include "transformations/op_conversions/convert_gather_0d.hpp" +#include "transformations/op_conversions/convert_gather_downgrade.hpp" #include "transformations/op_conversions/convert_gelu.hpp" +#include "transformations/op_conversions/convert_gp9_to_gp_ie_internal.hpp" +#include "transformations/op_conversions/convert_interpolate1_to_interpolate4.hpp" +#include "transformations/op_conversions/convert_matrix_nms_to_matrix_nms_ie.hpp" #include "transformations/op_conversions/convert_mod.hpp" -#include "transformations/op_conversions/convert_broadcast3.hpp" -#include "transformations/op_conversions/reduce_l1_decomposition.hpp" -#include "transformations/op_conversions/reduce_l2_decomposition.hpp" +#include "transformations/op_conversions/convert_multiclass_nms_to_multiclass_nms_ie.hpp" +#include "transformations/op_conversions/convert_nms9_to_nms_ie_internal.hpp" +#include "transformations/op_conversions/convert_nms_rotated_to_nms_ie_internal.hpp" +#include "transformations/op_conversions/convert_pad12_downgrade.hpp" #include "transformations/op_conversions/convert_pad_to_group_conv.hpp" -#include "transformations/op_conversions/softplus_decomposition.hpp" -#include "transformations/op_conversions/convert_space_to_batch.hpp" -#include "transformations/op_conversions/convert_batch_to_space.hpp" +#include "transformations/op_conversions/convert_previous_nms_to_nms_9.hpp" +#include "transformations/op_conversions/convert_prior_box_v8_to_v0.hpp" #include "transformations/op_conversions/convert_reduce_to_pooling.hpp" #include "transformations/op_conversions/convert_reduce_to_reshape.hpp" -#include "transformations/op_conversions/convert_shuffle_channels3.hpp" -#include "transformations/op_conversions/hswish_decomposition.hpp" -#include "transformations/op_conversions/hsigmoid_decomposition.hpp" -#include "transformations/op_conversions/log_softmax_decomposition.hpp" #include "transformations/op_conversions/convert_sequences_to_tensor_iterator.hpp" +#include "transformations/op_conversions/convert_shapeof3.hpp" +#include "transformations/op_conversions/convert_shuffle_channels3.hpp" +#include "transformations/op_conversions/convert_softmax_downgrade.hpp" +#include "transformations/op_conversions/convert_space_to_batch.hpp" +#include "transformations/op_conversions/convert_space_to_depth.hpp" #include "transformations/op_conversions/convert_subtract.hpp" #include "transformations/op_conversions/convert_ti_to_sequences.hpp" +#include "transformations/op_conversions/convert_topk11_downgrade.hpp" +#include "transformations/op_conversions/eye_decomposition.hpp" +#include "transformations/op_conversions/gelu7_downgrade.hpp" #include "transformations/op_conversions/gru_cell_decomposition.hpp" +#include "transformations/op_conversions/hsigmoid_decomposition.hpp" +#include "transformations/op_conversions/hswish_decomposition.hpp" +#include "transformations/op_conversions/log_softmax_decomposition.hpp" #include "transformations/op_conversions/lstm_cell_decomposition.hpp" -#include "transformations/op_conversions/rnn_cell_decomposition.hpp" #include "transformations/op_conversions/mvn6_decomposition.hpp" #include "transformations/op_conversions/normalize_l2_decomposition.hpp" -#include "transformations/op_conversions/bidirectional_sequences_decomposition.hpp" -#include "transformations/op_conversions/convert_previous_nms_to_nms_9.hpp" -#include "transformations/op_conversions/convert_nms9_to_nms_ie_internal.hpp" -#include "transformations/op_conversions/convert_nms_rotated_to_nms_ie_internal.hpp" -#include "transformations/op_conversions/convert_matrix_nms_to_matrix_nms_ie.hpp" -#include "transformations/op_conversions/convert_interpolate1_to_interpolate4.hpp" -#include "transformations/op_conversions/convert_gather_downgrade.hpp" -#include "transformations/op_conversions/convert_gather_0d.hpp" -#include "transformations/op_conversions/convert_deformable_conv_v8_to_v1.hpp" -#include "transformations/op_conversions/convert_gp9_to_gp_ie_internal.hpp" -#include "transformations/op_conversions/convert_multiclass_nms_to_multiclass_nms_ie.hpp" +#include "transformations/op_conversions/reduce_l1_decomposition.hpp" +#include "transformations/op_conversions/reduce_l2_decomposition.hpp" +#include "transformations/op_conversions/rnn_cell_decomposition.hpp" #include "transformations/op_conversions/simplify_ctc_greedy_decoder_seq_len.hpp" #include "transformations/op_conversions/softmax_decomposition.hpp" -#include "transformations/op_conversions/gelu7_downgrade.hpp" -#include "transformations/op_conversions/convert_softmax_downgrade.hpp" -#include "transformations/op_conversions/convert_prior_box_v8_to_v0.hpp" -#include "transformations/op_conversions/convert_shapeof3.hpp" -#include "transformations/op_conversions/convert_topk11_downgrade.hpp" -#include "transformations/op_conversions/eye_decomposition.hpp" -#include "transformations/op_conversions/convert_pad12_downgrade.hpp" -#include "transformations/convert_precision.hpp" -#include "transformations/init_node_info.hpp" +#include "transformations/op_conversions/softplus_decomposition.hpp" +#include "transformations/opset_conversions/convert_opset2_to_opset1.hpp" +#include "transformations/opset_conversions/convert_opset3_to_opset2.hpp" +#include "transformations/resolve_names_collisions.hpp" #include "transformations/rt_info/fused_names_attribute.hpp" #include "transformations/rt_info/keep_const_precision.hpp" #include "transformations/smart_reshape/matmul_sr.hpp" -#include "plugin/transformations/convert_matmul_to_fc.hpp" -#include "plugin/transformations/move_fc_reshape_to_weights.hpp" -#include "plugin/transformations/convert_fc_to_compressed.hpp" -#include "plugin/transformations/convert_gather_to_compressed.hpp" -#include "plugin/transformations/rms_fusion.hpp" -#include "plugin/transformations/binary_conv_to_conv.hpp" -#include "plugin/transformations/move_convert_after_gather.hpp" -#include "plugin/transformations/kv_cache_fusion.hpp" -#include "plugin/transformations/fc_convert_fusion.hpp" -#include "plugin/transformations/clamp_fp16_output.hpp" -#include "plugin/transformations/transpose_matmul_fusion.hpp" -#include "plugin/transformations/swiglu_fusion.hpp" - -#include "transformations/low_precision/mark_dequantization_subgraph.hpp" -#include "low_precision/pull_reshape_through_dequantization.hpp" -#include "low_precision/pull_transpose_through_dequantization.hpp" -#include "low_precision/convolution.hpp" -#include "low_precision/convolution_backprop_data.hpp" -#include "low_precision/group_convolution.hpp" -#include "low_precision/low_precision.hpp" -#include "low_precision/mat_mul.hpp" -#include "low_precision/multiply_to_group_convolution.hpp" -#include "low_precision/strided_slice.hpp" -#include "low_precision/network_helper.hpp" -#include "low_precision/recurrent_cell.hpp" - -#include "intel_gpu/runtime/itt.hpp" - namespace { template static bool disable_reduce_decomposition(const std::shared_ptr node) { diff --git a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/node.cpp b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/node.cpp index 29fad4668db272..76282bfa41130d 100644 --- a/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/node.cpp +++ b/src/tests/functional/plugin/conformance/subgraphs_dumper/src/utils/node.cpp @@ -1,8 +1,8 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 +#include "openvino/core/validation_util.hpp" #include "utils/node.hpp" -#include "validation_util.hpp" namespace ov { namespace util { @@ -186,4 +186,4 @@ std::string get_node_version(const ov::NodeTypeInfo& node_type_info) { } } // namespace util -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/tests/functional/shared_test_classes/src/subgraph/mul_conv_fusion.cpp b/src/tests/functional/shared_test_classes/src/subgraph/mul_conv_fusion.cpp index 1c053abb5ac314..94e34b1dca2437 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/mul_conv_fusion.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/mul_conv_fusion.cpp @@ -4,10 +4,10 @@ #include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/node_builders/constant.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/pass/manager.hpp" #include "shared_test_classes/subgraph/mul_conv_fusion.hpp" #include "transformations/common_optimizations/mul_conv_fusion.hpp" -#include "validation_util.hpp" namespace ov { namespace test { diff --git a/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_batch_norm.cpp b/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_batch_norm.cpp index 91fbce8c33f1f0..3beb4a36423354 100644 --- a/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_batch_norm.cpp +++ b/src/tests/functional/shared_test_classes/src/subgraph/quantized_convolution_batch_norm.cpp @@ -2,11 +2,11 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "shared_test_classes/subgraph/quantized_convolution_batch_norm.hpp" +#include "common_test_utils/node_builders/constant.hpp" #include "functional_test_utils/skip_tests_config.hpp" +#include "openvino/core/validation_util.hpp" #include "openvino/runtime/exec_model_info.hpp" -#include "common_test_utils/node_builders/constant.hpp" -#include "validation_util.hpp" +#include "shared_test_classes/subgraph/quantized_convolution_batch_norm.hpp" namespace ov { namespace test { From 4c69237c3bcaf0fb1ec4fcd4e59b3ee2390a7b0d Mon Sep 17 00:00:00 2001 From: Vishniakov Nikolai Date: Wed, 7 Feb 2024 22:15:56 +0100 Subject: [PATCH 48/55] [OV JS] Fix infer async windows compilation (#22599) ### Tickets: - CVS-131123 --- src/bindings/js/node/README.md | 11 ++-- .../js/node/include/infer_request.hpp | 3 -- src/bindings/js/node/src/infer_request.cpp | 8 +-- .../js/node/tests/infer_request.test.js | 54 +++++++++---------- 4 files changed, 31 insertions(+), 45 deletions(-) diff --git a/src/bindings/js/node/README.md b/src/bindings/js/node/README.md index 544eb7e60f27f3..cba6f4310181a9 100644 --- a/src/bindings/js/node/README.md +++ b/src/bindings/js/node/README.md @@ -11,9 +11,7 @@ - Make sure that all submodules are updated `git submodule update --init --recursive` - Create build dir `mkdir build && cd build` -- To configure binaries building run: - - ### Linux x86, Linux arm, Mac x86, Mac arm +- Configure binaries building: ```bash cmake \ -DCMAKE_BUILD_TYPE=Release \ @@ -28,9 +26,10 @@ -DCMAKE_INSTALL_PREFIX=../src/bindings/js/node/bin \ .. ``` - -- To get binaries for openvinojs-node package run compilation: - `make --jobs=$(nproc --all) install` +- Build bindings: + `cmake --build . --config Release --verbose -j4` +- Install binaries for openvinojs-node package: + `cmake --install .` - Go to npm package folder `cd ../src/bindings/js/node` - Now you can install dependencies packages and transpile ts to js code. Run `npm install` - Run tests `npm run test` to make sure that **openvinojs-node** built successfully diff --git a/src/bindings/js/node/include/infer_request.hpp b/src/bindings/js/node/include/infer_request.hpp index 483ac422e69426..e7f68a4b48fc1b 100644 --- a/src/bindings/js/node/include/infer_request.hpp +++ b/src/bindings/js/node/include/infer_request.hpp @@ -102,11 +102,8 @@ class InferRequestWrap : public Napi::ObjectWrap { /** @brief Checks incoming Napi::Value and calls overloaded infer() method */ Napi::Value infer_dispatch(const Napi::CallbackInfo& info); -// 131123 -#ifndef _WIN32 /** @brief Checks incoming Napi::Value and asynchronously returns the result of inference. */ Napi::Value infer_async(const Napi::CallbackInfo& info); -#endif /** @brief Infers specified inputs in synchronous mode. * @param inputs An object with a collection of pairs key (input_name) and a value (tensor, tensor's data) diff --git a/src/bindings/js/node/src/infer_request.cpp b/src/bindings/js/node/src/infer_request.cpp index b8e1f809af2e2a..7e5bee9b915f5f 100644 --- a/src/bindings/js/node/src/infer_request.cpp +++ b/src/bindings/js/node/src/infer_request.cpp @@ -31,10 +31,7 @@ Napi::Function InferRequestWrap::get_class(Napi::Env env) { InstanceMethod("getInputTensor", &InferRequestWrap::get_input_tensor), InstanceMethod("getOutputTensor", &InferRequestWrap::get_output_tensor), InstanceMethod("infer", &InferRequestWrap::infer_dispatch), - // 128760 -#ifndef _WIN32 InstanceMethod("inferAsync", &InferRequestWrap::infer_async), -#endif InstanceMethod("getCompiledModel", &InferRequestWrap::get_compiled_model), }); } @@ -198,8 +195,6 @@ void InferRequestWrap::infer(const Napi::Object& inputs) { Napi::Value InferRequestWrap::get_compiled_model(const Napi::CallbackInfo& info) { return CompiledModelWrap::wrap(info.Env(), _infer_request.get_compiled_model()); } -// 131123 -#ifndef _WIN32 void FinalizerCallback(Napi::Env env, void* finalizeData, TsfnContext* context) { context->native_thread.join(); delete context; @@ -233,7 +228,7 @@ void performInferenceThread(TsfnContext* context) { for (const auto& [key, tensor] : res) { outputs_obj.Set(key, TensorWrap::wrap(env, tensor)); } - context->deferred.Resolve({outputs_obj}); + context->deferred.Resolve(outputs_obj); }; context->tsfn.BlockingCall(context, callback); @@ -261,4 +256,3 @@ Napi::Value InferRequestWrap::infer_async(const Napi::CallbackInfo& info) { context->native_thread = std::thread(performInferenceThread, context); return context->deferred.Promise(); } -#endif diff --git a/src/bindings/js/node/tests/infer_request.test.js b/src/bindings/js/node/tests/infer_request.test.js index bd05da9400c998..513a2a3324bcbf 100644 --- a/src/bindings/js/node/tests/infer_request.test.js +++ b/src/bindings/js/node/tests/infer_request.test.js @@ -2,7 +2,6 @@ // Copyright (C) 2018-2023 Intel Corporation // SPDX-License-Identifier: Apache-2.0 -const os = require('node:os'); const { addon: ov } = require('..'); const assert = require('assert'); const { describe, it } = require('node:test'); @@ -79,38 +78,35 @@ describe('InferRequest', () => { }); }); - // 131123 - if (os.platform() !== 'win32') { - it('Test inferAsync(inputData: { [inputName: string]: Tensor })', () => { - inferRequestAsync.inferAsync({ data: tensor }).then(result => { - assert.ok(result['fc_out'] instanceof ov.Tensor); - assert.deepStrictEqual(Object.keys(result), ['fc_out']); - assert.deepStrictEqual(result['fc_out'].data.length, 10);} - ); - }); + it('Test inferAsync(inputData: { [inputName: string]: Tensor })', () => { + inferRequestAsync.inferAsync({ data: tensor }).then(result => { + assert.ok(result['fc_out'] instanceof ov.Tensor); + assert.deepStrictEqual(Object.keys(result), ['fc_out']); + assert.deepStrictEqual(result['fc_out'].data.length, 10);} + ); + }); - it('Test inferAsync(inputData: Tensor[])', () => { - inferRequestAsync.inferAsync([ tensor ]).then(result => { - assert.ok(result['fc_out'] instanceof ov.Tensor); - assert.deepStrictEqual(Object.keys(result), ['fc_out']); - assert.deepStrictEqual(result['fc_out'].data.length, 10); - }); + it('Test inferAsync(inputData: Tensor[])', () => { + inferRequestAsync.inferAsync([ tensor ]).then(result => { + assert.ok(result['fc_out'] instanceof ov.Tensor); + assert.deepStrictEqual(Object.keys(result), ['fc_out']); + assert.deepStrictEqual(result['fc_out'].data.length, 10); }); + }); - it('Test inferAsync([data]) throws: Cannot create a tensor from the passed Napi::Value.', () => { - assert.throws( - () => inferRequestAsync.inferAsync(['string']).then(), - /Cannot create a tensor from the passed Napi::Value./ - ); - }); + it('Test inferAsync([data]) throws: Cannot create a tensor from the passed Napi::Value.', () => { + assert.throws( + () => inferRequestAsync.inferAsync(['string']).then(), + /Cannot create a tensor from the passed Napi::Value./ + ); + }); - it('Test inferAsync({ data: "string"}) throws: Cannot create a tensor from the passed Napi::Value.', () => { - assert.throws( - () => inferRequestAsync.inferAsync({data: 'string'}).then(), - /Cannot create a tensor from the passed Napi::Value./ - ); - }); - } + it('Test inferAsync({ data: "string"}) throws: Cannot create a tensor from the passed Napi::Value.', () => { + assert.throws( + () => inferRequestAsync.inferAsync({data: 'string'}).then(), + /Cannot create a tensor from the passed Napi::Value./ + ); + }); it('Test setInputTensor(tensor)', () => { inferRequest.setInputTensor(tensor); From 88e9a2ce6f163fc1433a1f8acd4a59911ce89650 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 8 Feb 2024 01:51:33 +0400 Subject: [PATCH 49/55] Don't use NPU in Debian / RPM logic (#22712) ### Details: - *item1* - *...* ### Tickets: - CVS-130134 --- cmake/packaging/debian.cmake | 4 ++-- cmake/packaging/rpm.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/packaging/debian.cmake b/cmake/packaging/debian.cmake index 49b913ffe11306..1d8d4a8cc7522b 100644 --- a/cmake/packaging/debian.cmake +++ b/cmake/packaging/debian.cmake @@ -51,8 +51,8 @@ macro(ov_cpack_settings) NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO}_python.*" AND # because in case of .deb package, pyopenvino_package_python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} is installed (NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*" OR ENABLE_PYTHON_PACKAGING) AND - # temporary block nvidia - NOT item STREQUAL "nvidia" AND + # temporary block NVIDIA and NPU + NOT item MATCHES "^(nvidia|npu)$" AND # don't install Intel OpenMP NOT item STREQUAL "omp" AND # the same for pugixml diff --git a/cmake/packaging/rpm.cmake b/cmake/packaging/rpm.cmake index c36610ce8c749f..55d52a4035815b 100644 --- a/cmake/packaging/rpm.cmake +++ b/cmake/packaging/rpm.cmake @@ -37,8 +37,8 @@ macro(ov_cpack_settings) NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO}_python.*" AND # because in case of .rpm package, pyopenvino_package_python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR} is installed (NOT item MATCHES "^${OV_CPACK_COMP_PYTHON_OPENVINO_PACKAGE}_python.*" OR ENABLE_PYTHON_PACKAGING) AND - # temporary block nvidia - NOT item STREQUAL "nvidia" AND + # temporary block NVIDIA and NPU + NOT item MATCHES "^(nvidia|npu)$" AND # don't install Intel OpenMP NOT item STREQUAL "omp" AND # the same for pugixml From 8fd1738546251222419ac6d719a69b60945d512a Mon Sep 17 00:00:00 2001 From: Ekaterina Aidova Date: Thu, 8 Feb 2024 02:31:14 +0400 Subject: [PATCH 50/55] [PT FE]: fix aten::sum for uint8 input (#22699) ### Details: - *fix accuracy of aten::sum translation for uint8 inputs* - *update aten::sum support with type and out arguments* ### Tickets: - *CVS-123277* --- src/frontends/pytorch/src/op/sum.cpp | 51 +++++++-- tests/layer_tests/pytorch_tests/test_sum.py | 121 ++++++++++++-------- 2 files changed, 116 insertions(+), 56 deletions(-) diff --git a/src/frontends/pytorch/src/op/sum.cpp b/src/frontends/pytorch/src/op/sum.cpp index 41a699d924b858..d3cf73dabecf97 100644 --- a/src/frontends/pytorch/src/op/sum.cpp +++ b/src/frontends/pytorch/src/op/sum.cpp @@ -13,25 +13,60 @@ namespace pytorch { namespace op { OutputVector translate_sum(const NodeContext& context) { - num_inputs_check(context, 1, 3); + // aten::sum.dim_IntList(Tensor self, int[1]? dim, bool keepdim=False, *, ScalarType? dtype=None) -> Tensor + // aten::sum(Tensor self, *, ScalarType? dtype=None) -> Tensor + // aten::sum.IntList_out(Tensor self, int[1]? dim, bool keepdim=False, *, ScalarType? dtype=None, Tensor(a!) out) + // aten::sum.out(Tensor self, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!) + // aten::sum.int(int[] self) -> int + // aten::sum.float(float[] self) -> float + // aten::sum.bool(bool[] self) -> int + num_inputs_check(context, 1, 5); bool keep_dims = false; + auto num_inputs = context.get_input_size(); + size_t axis_idx; + size_t dtype_idx; + size_t keep_dims_idx; + size_t out_idx; ov::Output axes; + if (num_inputs < 4) { + // move parameters that not in signature out of number of inputs range + keep_dims_idx = 4; + axis_idx = 3; + dtype_idx = 1; + out_idx = 2; + } else { + axis_idx = 1; + keep_dims_idx = 2; + dtype_idx = 3; + out_idx = 4; + } auto data = context.get_input(0); auto data_dtype = simplified_type_interpret(context.get_input_type(0)); - if (data.get_element_type() == element::boolean || - (data_dtype.is() && data_dtype.as() == element::boolean)) { + // PyTorch sum converts bool and uint8 to i64 for preventing overflow + if ((data.get_element_type() == element::boolean || data.get_element_type() == element::u8) || + (data_dtype.is() && + (data_dtype.as() == element::boolean || data_dtype.as() == element::u8))) { data = context.mark_node(std::make_shared(data, element::i64)); } - if (context.input_is_none(1)) { + if (context.input_is_none(axis_idx)) { axes = get_axes_range(context, 0); } else { - axes = context.get_input(1); + axes = context.get_input(static_cast(axis_idx)); + } + if (!context.input_is_none(keep_dims_idx)) { + keep_dims = context.const_input(keep_dims_idx); } - if (!context.input_is_none(2)) { - keep_dims = context.const_input(2); + + Output sum = context.mark_node(std::make_shared(data, axes, keep_dims)); + + if (!context.input_is_none(dtype_idx)) { + sum = apply_dtype(context, dtype_idx, sum); } - return {context.mark_node(std::make_shared(data, axes, keep_dims))}; + if (!context.input_is_none(out_idx)) { + context.mutate_input(out_idx, sum); + } + return {sum}; }; } // namespace op diff --git a/tests/layer_tests/pytorch_tests/test_sum.py b/tests/layer_tests/pytorch_tests/test_sum.py index de5768e8ed66c2..d73e6913a18282 100644 --- a/tests/layer_tests/pytorch_tests/test_sum.py +++ b/tests/layer_tests/pytorch_tests/test_sum.py @@ -7,72 +7,97 @@ class TestSum(PytorchLayerTest): - def _prepare_input(self): - import numpy as np + def _prepare_input(self, out=False, input_dtype="float32", out_dtype="float32"): # This test had sporadically failed by accuracy. Try to resolve that by using int numbers in input - return (np.random.randint(-10, 10, (1, 3, 224, 224)).astype(np.float32),) - - def create_model(self, axes, keep_dims): + import numpy as np + min_value = -10 if input_dtype not in ["uint8", "bool"] else 0 + max_value = 10 if input_dtype != "bool" else 2 + input = np.random.randint(min_value, max_value, (1, 3, 5, 5)).astype(input_dtype) + if not out: + return (input, ) + if out_dtype is None: + out_dtype = input_dtype if input_dtype not in ["uint8", "bool"] else "int64" + out = np.zeros((1, 3, 5, 5), dtype=out_dtype) + return input, out + + def create_model(self, axes, keep_dims, out, dtype, input_dtype): import torch + dtype_mapping = { + "bool": torch.bool, + "uint8": torch.uint8, + "float32": torch.float32, + "int64": torch.int64 + } + torch_dtype = dtype_mapping[dtype] if dtype is not None else None + input_torch_dtype = dtype_mapping[input_dtype] + class aten_sum(torch.nn.Module): - def __init__(self, axes=None, keep_dims=None): + def __init__(self, input_dtype, axes=None, keep_dims=None, dtype=None, out=None): super(aten_sum, self).__init__() self.axes = axes self.keep_dims = keep_dims + self.dtype = dtype + self.out = out + self.input_dtype = input_dtype + if out: + self.forward = self.forward_out def forward(self, x): + x = x.to(self.input_dtype) if self.axes is None and self.keep_dims is None: - return torch.sum(x) + if self.dtype is None: + return torch.sum(x) + else: + return torch.sum(x, dtype=self.dtype) if self.axes is not None and self.keep_dims is None: - return torch.sum(x, self.axes) - return torch.sum(x, self.axes, self.keep_dims) - - ref_net = None - - return aten_sum(axes, keep_dims), ref_net, "aten::sum" - - @pytest.mark.parametrize("axes,keep_dim", - [(None, None), (None, False), (-1, None), (1, None), ((2, 3), False), ((3, 2), True)]) - @pytest.mark.nightly - @pytest.mark.precommit - def test_sum(self, axes, keep_dim, ie_device, precision, ir_version): - self._test(*self.create_model(axes, keep_dim), - ie_device, precision, ir_version) - - -class TestSumBool(PytorchLayerTest): - def _prepare_input(self): - import numpy as np - return (np.random.randint(0, 2, (1, 3, 20, 24)).astype(bool),) - - def create_model(self, axes, keep_dims): - - import torch - - class aten_sum(torch.nn.Module): - def __init__(self, axes=None, keep_dims=None): - super(aten_sum, self).__init__() - self.axes = axes - self.keep_dims = keep_dims - - def forward(self, x): - x = x.to(torch.bool) + if self.dtype is None: + return torch.sum(x, self.axes) + else: + return torch.sum(x, self.axes, dtype=self.dtype) + + if self.dtype is not None: + return torch.sum(x, self.axes, self.keep_dims, dtype=self.dtype) + else: + return torch.sum(x, self.axes, self.keep_dims) + + def forward_out(self, x, out): + x = x.to(self.input_dtype) + if self.axes is None and self.keep_dims is None: + if self.dtype is None: + return torch.sum(x, out=out), out + else: + return torch.sum(x, out=out, dtype=self.dtype), out if self.axes is None and self.keep_dims is None: - return torch.sum(x) + if self.dtype is not None: + return torch.sum(x, dtype=self.dtype, out=out), out + else: + return torch.sum(x, out=out), out if self.axes is not None and self.keep_dims is None: - return torch.sum(x, self.axes) - return torch.sum(x, self.axes, self.keep_dims) + if self.dtype is not None: + return torch.sum(x, self.axes, dtype=self.dtype, out=out), out + else: + return torch.sum(x, self.axes, out=out), out + + if self.dtype is not None: + return torch.sum(x, self.axes, self.keep_dims, dtype=self.dtype, out=out), out + else: + return torch.sum(x, self.axes, self.keep_dims, out=out), out ref_net = None - return aten_sum(axes, keep_dims), ref_net, "aten::sum" + return aten_sum(input_torch_dtype, axes, keep_dims, torch_dtype, out), ref_net, "aten::sum" - @pytest.mark.parametrize("axes,keep_dim", + @pytest.mark.parametrize("axes,keep_dims", [(None, None), (None, False), (-1, None), (1, None), ((2, 3), False), ((3, 2), True)]) + @pytest.mark.parametrize("dtype", [None, "float32", "int64"]) + @pytest.mark.parametrize("out", [True, False]) + @pytest.mark.parametrize("input_dtype", ["float32", "uint8", "bool", "int64"]) @pytest.mark.nightly @pytest.mark.precommit - def test_sum(self, axes, keep_dim, ie_device, precision, ir_version): - self._test(*self.create_model(axes, keep_dim), - ie_device, precision, ir_version) \ No newline at end of file + def test_sum(self, axes, keep_dims, out, dtype, input_dtype, ie_device, precision, ir_version): + self._test(*self.create_model(axes, keep_dims, out, dtype, input_dtype), + ie_device, precision, ir_version, + kwargs_to_prepare_input={"out": out, "input_dtype": input_dtype, "out_dtype": dtype} + ) From 3b7b30c5f331e807ae53a04a59993229856a1547 Mon Sep 17 00:00:00 2001 From: Eddy Kim Date: Thu, 8 Feb 2024 11:26:53 +0900 Subject: [PATCH 51/55] [GPU] Fix gemm_ref and gemm_tiled_opt (#22617) ### Details: - Fixed `gemm::calc_output_layout()` to consider `output_order` - Fixed `gemm_ref` for output transposed cases - Fixed wrong matmul axis (K- axis) selection for 2/3 dim inputs - Updated `gemm_tiled_opt` to support padded inputs ### Tickets: - 131014 --- src/plugins/intel_gpu/src/graph/gemm.cpp | 25 +++++++ .../prepare_primitive_fusing.cpp | 9 +++ .../kernel_selector/cl_kernels/gemm_ref.cl | 20 +++-- .../cl_kernels/gemm_tiled_opt.cl | 14 ++-- .../kernels/gemm/gemm_kernel_base.cpp | 26 ++++++- .../kernels/gemm/gemm_kernel_ref.cpp | 22 ++++++ .../kernels/gemm/gemm_kernel_tiled_opt.cpp | 73 +++++-------------- .../passes/prepare_buffer_fusing_test.cpp | 2 +- 8 files changed, 122 insertions(+), 69 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/gemm.cpp b/src/plugins/intel_gpu/src/graph/gemm.cpp index 51f984bb6666ea..0b30b6a4b821de 100644 --- a/src/plugins/intel_gpu/src/graph/gemm.cpp +++ b/src/plugins/intel_gpu/src/graph/gemm.cpp @@ -49,6 +49,17 @@ layout gemm_inst::calc_output_layout(gemm_node const& node, kernel_impl_params c return input_shape_update; }; + auto transpose_shape = [](const ov::Shape& shape, const std::vector& order) { + auto shape_transposed = ov::Shape(shape); + auto rank_diff = shape.size() - order.size(); + for (size_t i = 0; i < order.size(); i++) { + size_t idx = static_cast(order[i]); + shape_transposed[i + rank_diff] = shape[idx + rank_diff]; + } + + return shape_transposed; + }; + auto input0_shape_update = update_input_shape(input0_shape, input_rank, input0_order, true); auto input1_shape_update = update_input_shape(input1_shape, weight_rank, input1_order, false); @@ -72,6 +83,9 @@ layout gemm_inst::calc_output_layout(gemm_node const& node, kernel_impl_params c size_t ones_to_add = 4 - std::min(output_shape.size(), static_cast(4)); output_shape.insert(output_shape.begin(), ones_to_add, 1); + if (prim->output_order.size() > 0) + output_shape = transpose_shape(output_shape, prim->output_order); + auto output_type = input0_layout.data_type; if ((output_type == data_types::u8 || output_type == data_types::i8) && prim->output_data_types[0]) output_type = *prim->output_data_types[0]; @@ -216,6 +230,17 @@ layout gemm_inst::transform_output_layout(const std::shared_ptr prim output_pshape[get_spatial_idx(updated_output_layout.format, 0)] = std::move(N); output_pshape[get_spatial_idx(updated_output_layout.format, 1)] = std::move(M); + + if (primitive->output_order.size() > 0) { + ov::PartialShape transposed_output_pshape = output_pshape; + auto rank_diff = output_pshape.size() - primitive->output_order.size(); + for (size_t i = 0; i < primitive->output_order.size(); ++i) { + size_t idx = static_cast(primitive->output_order[i]); + transposed_output_pshape[i + rank_diff] = std::move(output_pshape[idx + rank_diff]); + } + output_pshape = transposed_output_pshape; + } + updated_output_layout.set_partial_shape(output_pshape); } return updated_output_layout; diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp index 89f37276f7d56d..13960c14ec45ed 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/prepare_primitive_fusing.cpp @@ -513,6 +513,15 @@ void prepare_primitive_fusing::fuse_simple_primitives(program &p) { } } + auto gemm_prim = node.get_primitive(); + for (size_t idx = 0; idx < gemm_prim->output_order.size(); ++idx) { + size_t output_order_idx = static_cast(gemm_prim->output_order[idx]); + if (idx != output_order_idx) { + does_support_fusings = false; + break; + } + } + return does_support_fusings; }; diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_ref.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_ref.cl index fa1ac644fb7ab4..63af13c5d5e42e 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_ref.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_ref.cl @@ -67,6 +67,9 @@ inline uint FUNC(get_input2_index)(OPTIONAL_SHAPE_INFO_ARG uint b, uint f, uint } #endif // INPUT2_TYPE +#define INPUT0_SIZE_F INPUT0_FEATURE_NUM +#define INPUT0_SIZE_B INPUT0_BATCH_NUM + KERNEL(gemm_ref)( OPTIONAL_SHAPE_INFO_ARG const __global INPUT0_TYPE* input0, @@ -84,13 +87,13 @@ KERNEL(gemm_ref)( const uint y = (uint)get_global_id(1); uint bidx = get_global_id(2); - const uint b = bidx % OUTPUT_BATCH_NUM; - bidx /= OUTPUT_BATCH_NUM; - const uint f = bidx % OUTPUT_FEATURE_NUM; - bidx /= OUTPUT_FEATURE_NUM; - const uint z = bidx % OUTPUT_SIZE_Z; - bidx /= OUTPUT_SIZE_Z; - const uint w = bidx % OUTPUT_SIZE_W; + const uint b = bidx % TR_OUTPUT_BATCH_NUM; + bidx /= TR_OUTPUT_BATCH_NUM; + const uint f = bidx % TR_OUTPUT_FEATURE_NUM; + bidx /= TR_OUTPUT_FEATURE_NUM; + const uint z = bidx % TR_OUTPUT_SIZE_Z; + bidx /= TR_OUTPUT_SIZE_Z; + const uint w = bidx % TR_OUTPUT_SIZE_W; const uint K = CAT(INPUT0_SIZE_, MATMUL_AXIS); @@ -129,3 +132,6 @@ KERNEL(gemm_ref)( output[dst_index] = dequantized; #endif } + +#undef INPUT0_SIZE_F +#undef INPUT0_SIZE_B \ No newline at end of file diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_tiled_opt.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_tiled_opt.cl index 85371273899795..c9183822ccb803 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_tiled_opt.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gemm_tiled_opt.cl @@ -124,7 +124,7 @@ KERNEL(gemm_tiled_opt)( // Start pointers offsets #if TRANSPOSE_INPUT0 == TRANSPOSE_X_LAST const __global INPUT0_TYPE* a_ptr = input0 + batch_offset_input0; - #if HAS_DYNAMIC_K_PADDING + #if HAS_DYNAMIC_K_PADDING || INPUT0_HAS_PADDING const uint input0_offset = FUNC_CALL(get_input0_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, (y+1), 0) - batch_offset_input0; const uint input0_offset1 = FUNC_CALL(get_input0_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, y, (TILE_K)) - batch_offset_input0; #else @@ -133,7 +133,7 @@ KERNEL(gemm_tiled_opt)( #endif #elif TRANSPOSE_INPUT0 == TRANSPOSE_Y_LAST const __global INPUT0_TYPE* a_ptr = input0 + batch_offset_input0; - #if HAS_DYNAMIC_K_PADDING + #if HAS_DYNAMIC_K_PADDING || INPUT0_HAS_PADDING const uint input0_offset = FUNC_CALL(get_input0_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, y, 1) - batch_offset_input0; const uint input0_offset1 = FUNC_CALL(get_input0_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, y, (TILE_K)) - batch_offset_input0; #else @@ -143,14 +143,14 @@ KERNEL(gemm_tiled_opt)( #endif // TRANSPOSE_INPUT0 #if TRANSPOSE_INPUT1 == TRANSPOSE_X_LAST const __global INPUT1_TYPE* b_ptr = input1 + batch_offset_input1; - #if HAS_DYNAMIC_K_PADDING + #if HAS_DYNAMIC_K_PADDING || INPUT1_HAS_PADDING const uint input1_offset = FUNC_CALL(get_input1_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, 1, tile_n_offset) - batch_offset_input1; #else const uint input1_offset = FUNC_CALL(get_input1_index)(OPTIONAL_SHAPE_INFO_TENSOR 0, 0, 0, 0, 1, 0); #endif #elif TRANSPOSE_INPUT1 == TRANSPOSE_Y_LAST const __global INPUT1_TYPE* b_ptr = input1 + batch_offset_input1; - #if HAS_DYNAMIC_K_PADDING + #if HAS_DYNAMIC_K_PADDING || INPUT1_HAS_PADDING const uint input1_offset = FUNC_CALL(get_input1_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, 0, (tile_n_offset + 1)) - batch_offset_input1; const uint input1_offset1 = FUNC_CALL(get_input1_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, (TILE_K), tile_n_offset) - batch_offset_input1; #else @@ -187,7 +187,7 @@ KERNEL(gemm_tiled_opt)( unroll_for (uint b_load_id = 0; b_load_id < TILE_K; b_load_id++) { #if IS_DYNAMIC #if TRANSPOSE_INPUT1 == TRANSPOSE_X_LAST -#if HAS_DYNAMIC_N_PADDING +#if HAS_DYNAMIC_N_PADDING || INPUT1_HAS_PADDING b_tile[b_load_id] = b_raw_global_id > N - 1 ? 0 : b_ptr[sglid]; #else b_tile[b_load_id] = TILE_N_NOT_DIVISIBLE ? (b_raw_global_id > N - 1 ? 0 : b_ptr[sglid]) : BLOCK_READ_B(b_ptr, 0); @@ -229,7 +229,7 @@ KERNEL(gemm_tiled_opt)( unroll_for (uint dot_id = 0; dot_id < tile_m_iterations; dot_id++) { #if TRANSPOSE_INPUT0 == TRANSPOSE_X_LAST #if IS_DYNAMIC -#if HAS_DYNAMIC_K_PADDING +#if HAS_DYNAMIC_K_PADDING || INPUT0_HAS_PADDING // In case of dynamic padding we can't guarantee memory access alignment for // block reads (4 bytes), so use scattered read uint a_idx = FUNC_CALL(get_input0_index)(OPTIONAL_SHAPE_INFO_TENSOR b, f, w, z, (y + dot_id), (k * TILE_K + sglid)); @@ -286,7 +286,7 @@ KERNEL(gemm_tiled_opt)( // Loading leftovers of the matrix B unroll_for (uint b_load_id = 0; b_load_id < TILE_K_LEFTOVER; b_load_id++) { #if TRANSPOSE_INPUT1 == TRANSPOSE_X_LAST - #if HAS_DYNAMIC_N_PADDING + #if HAS_DYNAMIC_N_PADDING || INPUT1_HAS_PADDING b_tile[b_load_id] = b_raw_global_id > N - 1 ? 0 : b_ptr[sglid]; #else b_tile[b_load_id] = TILE_N_NOT_DIVISIBLE ? (b_raw_global_id > N - 1 ? 0 : b_ptr[sglid]) : BLOCK_READ_B(b_ptr, 0); diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_base.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_base.cpp index 2e3333a517112e..eb61f0156fb4e8 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_base.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_base.cpp @@ -180,13 +180,37 @@ JitConstants GemmKernelBase::GetJitConstants(const gemm_params& params) const { MakeJitConstant("QUANTIZATION_TERM", params.quantization != QuantizationType::NONE), }); + auto get_output_size = [this](const std::vector& output_order_idx, const int target_idx) { + auto output_dims_order = GetDimsOrder(output_order_idx); + + switch (output_dims_order.at(target_idx)) { + case 'b': + return "OUTPUT_BATCH_NUM"; + case 'f': + return "OUTPUT_FEATURE_NUM"; + case 'w': + return "OUTPUT_SIZE_W"; + case 'z': + return "OUTPUT_SIZE_Z"; + case 'y': + return "OUTPUT_SIZE_Y"; + case 'x': + return "OUTPUT_SIZE_X"; + default: + return ""; + } + }; + jit.AddConstants({ MakeJitConstant("TRANSPOSE_X_LAST", 0), MakeJitConstant("TRANSPOSE_Y_LAST", 1), MakeJitConstant("TRANSPOSE_OTHER", 2), MakeJitConstant("INPUT0_DIMS_ORDER", GetDimsOrder(params.input0_order)), MakeJitConstant("INPUT1_DIMS_ORDER", GetDimsOrder(params.input1_order)), - MakeJitConstant("MATMUL_AXIS", static_cast(std::toupper(GetDimsOrder(params.input0_order).at(10)))), + MakeJitConstant("TR_OUTPUT_SIZE_Z", get_output_size(params.output_order, 6)), + MakeJitConstant("TR_OUTPUT_SIZE_W", get_output_size(params.output_order, 4)), + MakeJitConstant("TR_OUTPUT_FEATURE_NUM", get_output_size(params.output_order, 2)), + MakeJitConstant("TR_OUTPUT_BATCH_NUM", get_output_size(params.output_order, 0)), }); return jit; diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_ref.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_ref.cpp index 0149527d658360..2c849033c19f45 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_ref.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_ref.cpp @@ -63,7 +63,29 @@ JitConstants GemmKernelRef::GetJitConstants(const gemm_params& params) const { jit.Merge(MakeTypeJitConstants(Datatype::F32, "ACTIVATION")); } + auto get_matmul_axis = [](const std::vector& order_idx) { + auto last_idx = static_cast(order_idx.back()); + last_idx = (last_idx >= order_idx.size()) ? (order_idx.size() - 1) : last_idx; + + std::vector dims; + if (order_idx.size() == 1) { + dims = {"X"}; + } else if (order_idx.size() == 2) { + dims = {"Y", "X"}; + } else if (order_idx.size() == 3) { + dims = {"F", "Y", "X"}; + } else if (order_idx.size() == 4) { + dims = {"B", "F", "Y", "X"}; + } else if (order_idx.size() == 5) { + dims = {"B", "F", "Z", "Y", "X"}; + } else if (order_idx.size() == 6) { + dims = {"B", "F", "W", "Z", "Y", "X"}; + } + return dims[last_idx]; + }; + jit.AddConstants({ + MakeJitConstant("MATMUL_AXIS", get_matmul_axis(params.input0_order)), MakeJitConstant("TR_B", GetTransposedDims(params.output_order).at(0)), MakeJitConstant("TR_F", GetTransposedDims(params.output_order).at(1)), MakeJitConstant("TR_W", GetTransposedDims(params.output_order).at(4)), diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_tiled_opt.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_tiled_opt.cpp index 577e0fbea79106..4044f1400b2a59 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_tiled_opt.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/gemm/gemm_kernel_tiled_opt.cpp @@ -107,31 +107,9 @@ GemmKernelTiledOpt::GemmTuningData GemmKernelTiledOpt::SetTuningParams(const gem JitConstants GemmKernelTiledOpt::GetJitConstants(const gemm_params& params) const { JitConstants jit = Parent::GetJitConstants(params); - const auto& output = params.outputs[0]; GemmTuningData tuning_data = SetTuningParams(params); auto b_vec_size = tuning_data.tile_n_size / tuning_data.simd_size; - auto get_output_size = [this](const std::vector& output_order_idx, const int target_idx) { - auto output_dims_order = Parent::GetDimsOrder(output_order_idx); - - switch (output_dims_order.at(target_idx)) { - case 'b': - return "OUTPUT_BATCH_NUM"; - case 'f': - return "OUTPUT_FEATURE_NUM"; - case 'w': - return "OUTPUT_SIZE_W"; - case 'z': - return "OUTPUT_SIZE_Z"; - case 'y': - return "OUTPUT_SIZE_Y"; - case 'x': - return "OUTPUT_SIZE_X"; - default: - return ""; - } - }; - jit.Merge(MakeTypeJitConstants(params.inputs[0].GetDType(), "ACCUMULATOR")); if (params.has_dynamic_tensors()) { DimensionAccessHelper dims0(params.inputs[0]); @@ -178,10 +156,6 @@ JitConstants GemmKernelTiledOpt::GetJitConstants(const gemm_params& params) cons MakeJitConstant("TR_Z", GetTransposedDims(params.output_order, true).at(5)), MakeJitConstant("TR_Y", GetTransposedDims(params.output_order, true).at(6)), MakeJitConstant("TR_X", GetTransposedDims(params.output_order, true).at(7)), - MakeJitConstant("TR_OUTPUT_SIZE_Z", get_output_size(params.output_order, 6)), - MakeJitConstant("TR_OUTPUT_SIZE_W", get_output_size(params.output_order, 4)), - MakeJitConstant("TR_OUTPUT_FEATURE_NUM", get_output_size(params.output_order, 2)), - MakeJitConstant("TR_OUTPUT_BATCH_NUM", get_output_size(params.output_order, 0)), }); bool has_dynamic_k_padding = params.transpose_input0 ? params.inputs[0].Y().pad.is_dynamic @@ -193,28 +167,25 @@ JitConstants GemmKernelTiledOpt::GetJitConstants(const gemm_params& params) cons if (has_dynamic_n_padding) jit.AddConstant(MakeJitConstant("HAS_DYNAMIC_N_PADDING", 1)); } else { - auto get_untransposed_dim_size = [](const kernel_selector::DataTensor &data_tensor, - const std::vector& dims_order, const std::string dim) { + auto get_transposed_dim_size = [](const kernel_selector::DataTensor &data_tensor, + const std::vector& dims_order, const std::string dim) { int64_t target_dim_idx; const size_t rank = data_tensor.GetDims().size(); - if (dim.compare("Y") == 0) { + if (dims_order.size() > 1 && dim.compare("Y") == 0) { + target_dim_idx = dims_order.at(dims_order.size() - 2); + } else if (dims_order.size() > 0 && dim.compare("X") == 0) { + target_dim_idx = dims_order.back(); + } else if (dims_order.size() == 0 && dim.compare("Y") == 0) { target_dim_idx = rank - 2; - } else if (dim.compare("X") == 0) { + } else if (dims_order.size() == 0 && dim.compare("X") == 0) { target_dim_idx = rank - 1; } else { OPENVINO_THROW("Unsupported dimension: ", dim); } - size_t loc = (dims_order.size() < rank) ? (rank - dims_order.size()) : 0; - if (dims_order.size() == 0) { - loc = static_cast(target_dim_idx); - } else { - target_dim_idx = (dims_order.size() < rank) ? (target_dim_idx + dims_order.size() - rank) : target_dim_idx; - for (auto dim_idx : dims_order) { - if (dim_idx == target_dim_idx) - break; - loc += 1; - } + size_t loc = static_cast(target_dim_idx); + if (dims_order.size() > 0) { + loc += (dims_order.size() < rank) ? (rank - dims_order.size()) : 0; } if (loc == 0) { @@ -233,9 +204,9 @@ JitConstants GemmKernelTiledOpt::GetJitConstants(const gemm_params& params) cons OPENVINO_THROW("Target dimension is not found."); }; - auto m_size = get_untransposed_dim_size(output, params.output_order, "Y"); - auto n_size = get_untransposed_dim_size(output, params.output_order, "X"); - auto k_size = get_untransposed_dim_size(params.inputs[0], params.input0_order, "X"); + auto m_size = get_transposed_dim_size(params.inputs[0], params.input0_order, "Y"); + auto n_size = get_transposed_dim_size(params.inputs[1], params.input1_order, "X"); + auto k_size = get_transposed_dim_size(params.inputs[0], params.input0_order, "X"); auto leftover_m = m_size % tuning_data.tile_m_size; auto leftover_n = n_size % tuning_data.tile_n_size; auto leftover_k = k_size % tuning_data.tile_k_size; @@ -263,11 +234,12 @@ JitConstants GemmKernelTiledOpt::GetJitConstants(const gemm_params& params) cons MakeJitConstant("TR_Z", GetTransposedDims(params.output_order, true).at(5)), MakeJitConstant("TR_Y", GetTransposedDims(params.output_order, true).at(6)), MakeJitConstant("TR_X", GetTransposedDims(params.output_order, true).at(7)), - MakeJitConstant("TR_OUTPUT_SIZE_Z", get_output_size(params.output_order, 6)), - MakeJitConstant("TR_OUTPUT_SIZE_W", get_output_size(params.output_order, 4)), - MakeJitConstant("TR_OUTPUT_FEATURE_NUM", get_output_size(params.output_order, 2)), - MakeJitConstant("TR_OUTPUT_BATCH_NUM", get_output_size(params.output_order, 0)), }); + + if (params.inputs[0].LogicalSize() != params.inputs[0].PhysicalSize()) + jit.AddConstant(MakeJitConstant("INPUT0_HAS_PADDING", 1)); + if (params.inputs[1].LogicalSize() != params.inputs[1].PhysicalSize()) + jit.AddConstant(MakeJitConstant("INPUT1_HAS_PADDING", 1)); } if (tuning_data.tile_k_size > tuning_data.simd_size) { @@ -362,12 +334,7 @@ bool GemmKernelTiledOpt::Validate(const Params& params, const optional_params& o return false; } - bool gemm_leftovers = gmm_params.inputs[0].X().v % 16 || gmm_params.inputs[0].Y().v % 16 || - gmm_params.inputs[1].X().v % 16 || gmm_params.inputs[1].Y().v % 16; - // If gmm_params has dynamic inputs, the correct dimension value cannot be obtained - // and leftovers cannot be calculated, so it returns false - if ((gmm_params.transpose_input0 || gmm_params.transpose_input1) && (gemm_leftovers || gmm_params.has_dynamic_inputs()) && - !gmm_params.is_shape_agnostic) + if (gmm_params.has_dynamic_inputs() && !gmm_params.is_shape_agnostic) return false; for (size_t i = 1; i < gmm_params.inputs.size(); i++) diff --git a/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp b/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp index 0be5445aa29584..132edab6de7d04 100644 --- a/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/passes/prepare_buffer_fusing_test.cpp @@ -668,7 +668,7 @@ TEST(prepare_buffer_fusing, test_implicit_crop_and_outerpadding) { cldnn::mem_lock output_ptr(output, get_test_stream()); ExecutionConfig ref_config = get_test_default_config(engine); - config.set_property(ov::intel_gpu::optimize_data(false)); + ref_config.set_property(ov::intel_gpu::optimize_data(false)); cldnn::network ref_network(engine, topology, ref_config); ref_network.set_input_data("Input", in_input); ref_network.set_input_data("Input_idx_1", input_idx1); From 963e33d0ab7d43b75985479a60553c259d98a689 Mon Sep 17 00:00:00 2001 From: Kelvin Choi Date: Thu, 8 Feb 2024 12:55:49 +0900 Subject: [PATCH 52/55] [GPU] Support dynamic for LSTMCell (#22419) ### Details: - *Support dynamic lstm_elt* - *Support dynamic crop with dynamic reference_input* ### Tickets: - *122739* - *100238* --- src/plugins/intel_gpu/src/graph/lstm_elt.cpp | 17 +- src/plugins/intel_gpu/src/plugin/ops/rnn.cpp | 64 +++++-- .../single_layer_tests/dynamic/lstmcell.cpp | 166 ++++++++++++++++++ 3 files changed, 229 insertions(+), 18 deletions(-) create mode 100644 src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/lstmcell.cpp diff --git a/src/plugins/intel_gpu/src/graph/lstm_elt.cpp b/src/plugins/intel_gpu/src/graph/lstm_elt.cpp index 709f498bfd6cd6..5b70a8a8c5afb2 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_elt.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_elt.cpp @@ -37,9 +37,20 @@ std::vector lstm_elt_inst::calc_output_layouts(lstm_elt_node const& node OPENVINO_ASSERT(static_cast(impl_param.desc->output_data_types[0]) == false, "Output data type forcing is not supported for lstm_elt_node!"); OPENVINO_ASSERT(input_pshape.rank().get_length() == 2, "input_layout rank should be 2 on dynamic shape."); - auto lstm_input_size = static_cast(input_pshape[1].get_length()); - auto lstm_batch_size = static_cast(input_pshape[0].get_length()); - auto lstm_hidden_size = static_cast(lstm_input_size / 4); + int lstm_input_size, lstm_batch_size, lstm_hidden_size; + if (input_pshape[input_pshape.size() - 1].is_static()) { + lstm_input_size = input_pshape[input_pshape.size() - 1].get_length(); + lstm_hidden_size = lstm_input_size / 4; + } else { + lstm_input_size = -1; + lstm_hidden_size = -1; + } + + if (input_pshape[input_pshape.size() - 2].is_static()) { + lstm_batch_size = input_pshape[input_pshape.size() - 2].get_length(); + } else { + lstm_batch_size = -1; + } return {cldnn::layout{ov::PartialShape{lstm_batch_size, 2, 1, lstm_hidden_size}, input_layout.data_type, input_layout.format}}; } diff --git a/src/plugins/intel_gpu/src/plugin/ops/rnn.cpp b/src/plugins/intel_gpu/src/plugin/ops/rnn.cpp index 8453227bfd2dbf..5878b391d0a5b1 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/rnn.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/rnn.cpp @@ -14,6 +14,7 @@ #include "intel_gpu/primitives/lstm.hpp" #include "intel_gpu/primitives/crop.hpp" #include "intel_gpu/primitives/concatenation.hpp" +#include "intel_gpu/primitives/data.hpp" namespace ov { namespace intel_gpu { @@ -73,16 +74,23 @@ static void CreateLSTMCellOp(ProgramBuilder& p, const std::shared_ptrget_input_shape(0); - const auto out_dims0 = op->get_output_shape(0); - - OPENVINO_ASSERT((op->get_input_shape(0).size() == 2 && - op->get_input_shape(1).size() == 2 && - op->get_input_shape(2).size() == 2), "Wrong input shapes for LSTMCell op ", op->get_friendly_name()); - - lstm_input_size = static_cast(in_dims0.back()); - lstm_batch_size = static_cast(in_dims0.at(in_dims0.size()-2)); - lstm_hidden_size = static_cast(out_dims0.back()); + const auto in0_pshape = op->get_input_partial_shape(0); + const auto out0_pshape = op->get_output_partial_shape(0); + + if (in0_pshape[in0_pshape.size() - 1].is_static()) + lstm_input_size = in0_pshape[in0_pshape.size() - 1].get_length(); + else + lstm_input_size = -1; + + if (in0_pshape[in0_pshape.size() - 2].is_static()) + lstm_batch_size = in0_pshape[in0_pshape.size() - 2].get_length(); + else + lstm_batch_size = -1; + + if (out0_pshape[out0_pshape.size() - 1].is_static()) + lstm_hidden_size = out0_pshape[out0_pshape.size() - 1].get_length(); + else + lstm_hidden_size = -1; } std::vector activations; @@ -102,23 +110,49 @@ static void CreateLSTMCellOp(ProgramBuilder& p, const std::shared_ptrget_output_partial_shape(0).to_shape(); + auto outSz = op->get_output_partial_shape(0); std::vector outSzPt; - for (auto i : outSz) { - outSzPt.push_back(i); + for (auto pshape : outSz) { + if (pshape.is_static()) + outSzPt.push_back(pshape.get_length()); + else + outSzPt.push_back(-1); } + cldnn::crop_ngraph_op_mode op_mode = cldnn::crop_ngraph_op_mode::split; + size_t num_splits = 2; cldnn::tensor hiddenSz = cldnn::tensor{ lstm_batch_size, 1, lstm_hidden_size, 1 }; cldnn::primitive_id outputHiddenCropID = layerName + "_hc"; cldnn::primitive_id outputHiddenID = layerName + ".out0"; - p.add_primitive(*op, cldnn::crop(outputHiddenCropID, cldnn::input_info(lstm_elt_id), hiddenSz, cldnn::tensor{0, 0, 0, 0})); + cldnn::primitive_id outputDataID = layerName + "_data"; + + cldnn::layout constLayout = cldnn::layout({}, cldnn::data_types::i64, cldnn::format::bfyx); + cldnn::memory::ptr data_mem = p.get_engine().allocate_memory(constLayout, false); + auto& stream = p.get_engine().get_service_stream(); + cldnn::mem_lock lock{data_mem, stream}; + auto buf = lock.data(); + const size_t axis = 1; + std::memcpy(&buf[0], &axis, constLayout.bytes_count()); + p.add_primitive(*op, cldnn::data(outputDataID, data_mem)); + + p.add_primitive(*op, + cldnn::crop(outputHiddenCropID, + {cldnn::input_info(lstm_elt_id), cldnn::input_info(outputDataID)}, + hiddenSz, + cldnn::tensor{0, 0, 0, 0}, + op_mode, 0, num_splits)); p.add_primitive(*op, cldnn::reshape(outputHiddenID, cldnn::input_info(outputHiddenCropID), false, outSzPt, op->get_output_partial_shape(0)), {layerName}); cldnn::primitive_id outputCellCropID = layerName + "_cc"; cldnn::primitive_id outputCellID = layerName + ".out1"; - p.add_primitive(*op, cldnn::crop(outputCellCropID, cldnn::input_info(lstm_elt_id), hiddenSz, cldnn::tensor{0, 1, 0, 0})); + p.add_primitive(*op, + cldnn::crop(outputCellCropID, + {cldnn::input_info(lstm_elt_id), cldnn::input_info(outputDataID)}, + hiddenSz, + cldnn::tensor{0, 1, 0, 0}, + op_mode, 1, num_splits)); p.add_primitive(*op, cldnn::reshape(outputCellID, cldnn::input_info(outputCellCropID), false, outSzPt, op->get_output_partial_shape(1))); } else { diff --git a/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/lstmcell.cpp b/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/lstmcell.cpp new file mode 100644 index 00000000000000..886508fec0e19f --- /dev/null +++ b/src/plugins/intel_gpu/tests/functional/single_layer_tests/dynamic/lstmcell.cpp @@ -0,0 +1,166 @@ +// Copyright (C) 2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/ov_tensor_utils.hpp" +#include "common_test_utils/test_enums.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" + +#include "openvino/op/parameter.hpp" +#include "openvino/op/constant.hpp" +#include "openvino/op/result.hpp" +#include "openvino/op/lstm_cell.hpp" + +namespace { +using ov::test::InputShape; +using ov::test::utils::InputLayerType; + +typedef std::tuple< + size_t, // batch + size_t, // hidden size + size_t, // input size + ov::test::utils::InputLayerType, // W input type (Constant or Parameter) + ov::test::utils::InputLayerType, // R input type (Constant or Parameter) + ov::test::utils::InputLayerType, // B input type (Constant or Parameter) + ov::element::Type, // Network precision + std::string // Device name +> LSTMCellLayerParamSet; + +class LSTMCellLayerGPUTest : public testing::WithParamInterface, + virtual public ov::test::SubgraphBaseTest { +public: + static std::string getTestCaseName(const testing::TestParamInfo& obj) { + size_t batch; + size_t hidden_size; + size_t input_size; + InputLayerType WType; + InputLayerType RType; + InputLayerType BType; + ov::element::Type model_type; + std::string targetDevice; + std::tie(batch, hidden_size, input_size, WType, RType, BType, + model_type, targetDevice) = obj.param; + std::ostringstream result; + result << "batch=" << batch << "_"; + result << "hidden_size=" << hidden_size << "_"; + result << "input_size=" << input_size << "_"; + result << "WType=" << WType << "_"; + result << "RType=" << RType << "_"; + result << "BType=" << BType << "_"; + result << "modelType=" << model_type.get_type_name() << "_"; + result << "targetDevice=" << targetDevice << "_"; + return result.str(); + } + +protected: + void SetUp() override { + size_t batch; + size_t hidden_size; + size_t input_size; + InputLayerType WType; + InputLayerType RType; + InputLayerType BType; + ov::element::Type model_type; + std::tie(batch, hidden_size, input_size, WType, RType, BType, + model_type, targetDevice) = this->GetParam(); + + int32_t is = input_size; + int32_t hs = hidden_size; + + std::vector init_dyn_shapes = { + {-1, is}, + {-1, hs}, + {-1, hs}, + {4 * hs, is}, + {4 * hs, hs}, + {4 * hs} + }; + + std::vector init_shapes = { + {batch, input_size}, + {batch, hidden_size}, + {batch, hidden_size}, + {4 * hidden_size, input_size}, + {4 * hidden_size, hidden_size}, + {4 * hidden_size} + }; + + std::vector input_shapes; + for (size_t i = 0; i < init_dyn_shapes.size(); i++) { + input_shapes.push_back({init_dyn_shapes[i], {init_shapes[i]}}); + } + + init_input_shapes(input_shapes); + + ov::ParameterVector params{std::make_shared(model_type, inputDynamicShapes[0]), + std::make_shared(model_type, inputDynamicShapes[1]), + std::make_shared(model_type, inputDynamicShapes[2])}; + + + ov::NodeVector inputs{params[0], params[1], params[2]}; + if (WType == InputLayerType::PARAMETER) { + auto param = std::make_shared(model_type, inputDynamicShapes[params.size()]); + params.push_back(param); + inputs.push_back(param); + } else { + auto tensor = ov::test::utils::create_and_fill_tensor(model_type, init_shapes[3]); + auto constant = std::make_shared(tensor); + inputs.push_back(constant); + } + + if (RType == InputLayerType::PARAMETER) { + auto param = std::make_shared(model_type, inputDynamicShapes[params.size()]); + params.push_back(param); + inputs.push_back(param); + } else { + auto tensor = ov::test::utils::create_and_fill_tensor(model_type, init_shapes[4]); + auto constant = std::make_shared(tensor); + inputs.push_back(constant); + } + + if (BType == InputLayerType::PARAMETER) { + auto param = std::make_shared(model_type, inputDynamicShapes[params.size()]); + params.push_back(param); + inputs.push_back(param); + } else { + auto tensor = ov::test::utils::create_and_fill_tensor(model_type, init_shapes[5]); + auto constant = std::make_shared(tensor); + inputs.push_back(constant); + } + + auto lstm_cell = std::make_shared(inputs[0], inputs[1], inputs[2], inputs[3], inputs[4], inputs[5], + hidden_size); + + ov::ResultVector results{std::make_shared(lstm_cell->output(0)), + std::make_shared(lstm_cell->output(1))}; + function = std::make_shared(results, params, "lstm_cell"); + } +}; + +TEST_P(LSTMCellLayerGPUTest, Inference) { + run(); +} + +std::vector batch{1, 2, 5}; +std::vector hidden_size{8}; +std::vector input_size{10}; +std::vector layer_types = { + ov::test::utils::InputLayerType::PARAMETER +}; +std::vector netPrecisions = { + ov::element::f32, +}; + +INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_LSTMCell_dynamic_batch, LSTMCellLayerGPUTest, + ::testing::Combine( + ::testing::ValuesIn(batch), + ::testing::ValuesIn(hidden_size), + ::testing::ValuesIn(input_size), + ::testing::ValuesIn(layer_types), + ::testing::ValuesIn(layer_types), + ::testing::ValuesIn(layer_types), + ::testing::ValuesIn(netPrecisions), + ::testing::Values(ov::test::utils::DEVICE_GPU)), + LSTMCellLayerGPUTest::getTestCaseName); + +} // namespace From fb6d987c434af9a8f199a678b3f2e674c8cea063 Mon Sep 17 00:00:00 2001 From: Steve Yoo Date: Thu, 8 Feb 2024 13:09:07 +0900 Subject: [PATCH 53/55] [GPU] Skip if the node type is cpu impl. (#22524) ### Details: - *Add condition to skippable_node to skip if the node type is cpu impl* ### Tickets: - *130483* --- .../mark_runtime_skippable_nodes.cpp | 3 + .../unit/dynamic_execution/stateful_model.cpp | 57 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp index 81d7ee3a39bc21..a79c37437fac16 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp @@ -15,6 +15,9 @@ void mark_runtime_skippable_nodes::run(program& p) { auto itr = p.get_processing_order().begin(); while (itr != p.get_processing_order().end()) { auto& node = *itr++; + // Skip if the node is impl_types::cpu + if (node->get_preferred_impl_type() == impl_types::cpu) + return; // Set gathers that might be skipped at runtime as can_be_optimized. // If not set, memory dependency will not work for the nodes that are skipped at runtime program_helpers::do_for_types(*node, [](gather_node& node){ diff --git a/src/plugins/intel_gpu/tests/unit/dynamic_execution/stateful_model.cpp b/src/plugins/intel_gpu/tests/unit/dynamic_execution/stateful_model.cpp index fe43601affde29..808e8779058ab5 100644 --- a/src/plugins/intel_gpu/tests/unit/dynamic_execution/stateful_model.cpp +++ b/src/plugins/intel_gpu/tests/unit/dynamic_execution/stateful_model.cpp @@ -130,6 +130,63 @@ TEST(stateful_model, not_skip_gather_at_runtime) { ASSERT_EQ(gather_inst->can_be_optimized(), false); } +TEST(stateful_model, not_skip_gather_in_cpuimpl) { + auto& engine = get_test_engine(); + + auto input_kv_lay = layout{ov::PartialShape{-1, 32, -1, 128}, data_types::f32, format::bfyx}; + auto input_present_lay = layout{ov::PartialShape{-1, 32, -1, 128}, data_types::f32, format::bfyx}; + auto input_beam_idx_lay = layout{ov::PartialShape{-1}, data_types::i32, format::bfyx}; + + topology topology(input_layout("kv_cache", input_kv_lay), + input_layout("beam_idx", input_beam_idx_lay), + input_layout("present", input_present_lay), + gather("gather", + input_info("kv_cache"), + input_info("beam_idx"), + 0, // axis + input_kv_lay.get_partial_shape().size(), // input rank + ov::Shape{}, // output shape + 0, // batch_dim + true), // support_neg_ind + concatenation("concat", {input_info("gather"), input_info("present")}, 0), + reorder("reorder", input_info("concat"), format::bfyx, data_types::f32)); /*output padding*/ + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); + config.set_property(ov::intel_gpu::force_implementations(ov::intel_gpu::ImplForcingMap{ {"gather", {format::bfyx, "", impl_types::cpu}} })); + + network network(engine, topology, config); + auto gather_inst = network.get_primitive("gather"); + ASSERT_EQ(gather_inst->get_node().can_be_optimized(), false); + ASSERT_EQ(gather_inst->can_be_optimized(), false); + + auto KV_SIZE = 24; + auto BATCH_SIZE = 1; + auto kv_cache_mem = engine.allocate_memory({{KV_SIZE, 32, BATCH_SIZE, 128}, data_types::f32, format::bfyx}); + auto present_mem = engine.allocate_memory({{1, 32, BATCH_SIZE, 128}, data_types::f32, format::bfyx}); + auto beam_idx_mem = engine.allocate_memory({{KV_SIZE}, data_types::i32, format::bfyx}); + std::vector kv_input_data(kv_cache_mem->get_layout().count()); + std::vector present_input_data(present_mem->get_layout().count()); + std::vector beam_idx_input_data(beam_idx_mem->get_layout().count()); + std::iota(kv_input_data.begin(), kv_input_data.end(), 0.f); + std::iota(present_input_data.begin(), present_input_data.end(), 0.f); + std::iota(beam_idx_input_data.begin(), beam_idx_input_data.end(), 0); + set_values(kv_cache_mem, kv_input_data); + set_values(present_mem, present_input_data); + set_values(beam_idx_mem, beam_idx_input_data); + + network.set_input_data("kv_cache", kv_cache_mem); + network.set_input_data("present", present_mem); + network.set_input_data("beam_idx", beam_idx_mem); + network.execute(); + ASSERT_EQ(gather_inst->can_be_optimized(), false); + auto gather_output_mem = network.get_output_memory("gather"); + cldnn::mem_lock gather_output_ptr(gather_output_mem, get_test_stream()); + for (size_t i = 0; i < gather_output_mem->get_layout().count(); ++i) { + ASSERT_EQ(gather_output_ptr[i], kv_input_data[i]); + } +} + TEST(stateful_model, check_dynamic_pad_for_kv_cache) { auto& engine = get_test_engine(); From 133d03ed760219647d3ad7719d00ee2de3a4808b Mon Sep 17 00:00:00 2001 From: Andrew Kwangwoong Park Date: Thu, 8 Feb 2024 15:00:31 +0900 Subject: [PATCH 54/55] [GPU] Skip redundant strided slice in stateful model (#22669) ### Details: - Skip strided slice at runtime if all begin axes are zero, strides are one, end axes are full range - Update strided slice prim API to get constant begin/end/strides data ### Tickets: - 131094 --------- Signed-off-by: Andrew Park --- .../intel_gpu/primitives/strided_slice.hpp | 35 ++++++++++++++++ .../mark_runtime_skippable_nodes.cpp | 42 ++++++++++++++++++- .../src/graph/impls/ocl/primitive_base.hpp | 6 ++- .../src/graph/include/primitive_inst.h | 1 + .../src/graph/include/strided_slice_inst.h | 5 +++ .../intel_gpu/src/graph/primitive_inst.cpp | 28 ++++++++++++- .../intel_gpu/src/graph/strided_slice.cpp | 19 +++++++++ .../src/plugin/ops/strided_slice.cpp | 8 ++-- 8 files changed, 136 insertions(+), 8 deletions(-) diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/strided_slice.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/strided_slice.hpp index 47fe4fde1e2d0b..903580c47d74a1 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/primitives/strided_slice.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/strided_slice.hpp @@ -86,6 +86,41 @@ struct strided_slice : public primitive_base { ellipsis_mask(ellipsis_mask), out_size(out_size) {} + /// @brief Constructs strided_slice primitive with constant begin/end/stride + /// @param id This primitive id. + /// @param inputs Array of input primitive ids. + /// @param begin Begin indexes for input. + /// @param end End indexes for input. + /// @param strides Strides for input. + /// @param begin_mask Array of bits, that provide replace begin[i] to max possible range in that dimension. + /// @param end_mask Array of bits, that provide replace end[i] to max possible range in that dimension. + /// @param new_axis_mask Array of bits, that provide adding a new length 1 dimension at ith position in the output tensor. + /// @param shrink_axis_mask Array of bits, that provide shrinks the dimensionality by 1, taking on the value at index begin[i]. + /// @param ellipsis_mask Array of bits, that provide inserts missing dimensions on a position of a non-zero bit. + /// @param out_size Size of output tensor + strided_slice(const primitive_id& id, + const std::vector& inputs, + const std::vector& begin, + const std::vector& end, + const std::vector& strides, + const std::vector& begin_mask, + const std::vector& end_mask, + const std::vector& new_axis_mask, + const std::vector& shrink_axis_mask, + const std::vector& ellipsis_mask, + const ov::Shape out_size, + const padding& output_padding = padding()) + : primitive_base(id, inputs, {output_padding}), + begin(begin), + end(end), + strides(strides), + begin_mask(begin_mask), + end_mask(end_mask), + new_axis_mask(new_axis_mask), + shrink_axis_mask(shrink_axis_mask), + ellipsis_mask(ellipsis_mask), + out_size(out_size) {} + /// @brief Begin indexes for input std::vector begin; /// @brief End indexes for input diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp index a79c37437fac16..6c46f06b3371fb 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_runtime_skippable_nodes.cpp @@ -5,6 +5,7 @@ #include "pass_manager.h" #include "gather_inst.h" #include "permute_inst.h" +#include "strided_slice_inst.h" #include "kv_cache_inst.h" #include "gemm_inst.h" #include "program_helpers.h" @@ -38,7 +39,7 @@ void mark_runtime_skippable_nodes::run(program& p) { || impl_params->get_input_layout(0).get_partial_shape()[axis] == impl_params->get_input_layout(1).get_partial_shape()[0]) { // May be skipepd node.can_be_optimized(true); - GPU_DEBUG_TRACE_DETAIL << "[mark_runtime_skippable_nodes] : " << node.id() << "can_be_optimized" << std::endl; + GPU_DEBUG_TRACE_DETAIL << "[mark_runtime_skippable_nodes] : " << node.id() << " can_be_optimized" << std::endl; } }); program_helpers::do_for_types(*node, [](permute_node& node){ @@ -57,8 +58,45 @@ void mark_runtime_skippable_nodes::run(program& p) { if (node.have_user_with_type() && node.get_users().size() == 1) return; node.can_be_optimized(true); - GPU_DEBUG_TRACE_DETAIL << "[mark_runtime_skippable_nodes] : " << node.id() << "can_be_optimized" << std::endl; + GPU_DEBUG_TRACE_DETAIL << "[mark_runtime_skippable_nodes] : " << node.id() << " can_be_optimized" << std::endl; } }); + program_helpers::do_for_types(*node, [](strided_slice_node& node){ + auto impl_params = node.get_kernel_impl_params(); + if (node.is_output() + || node.has_fused_primitives() + || (impl_params->get_input_layout(0).format != impl_params->get_output_layout().format) + || (impl_params->get_input_layout(0).data_type != impl_params->get_output_layout().data_type)) + return; + + auto prim = impl_params->typed_desc(); + auto begin = prim->begin; + auto strides = prim->strides; + auto begin_mask = prim->begin_mask; + if (prim->end_mask.empty() + || !prim->new_axis_mask.empty() + || !prim->shrink_axis_mask.empty() + || !prim->ellipsis_mask.empty() + || !(all_zeroes(begin) || all_ones(begin_mask)) + || !all_ones(strides)) + return; + + auto end = prim->end; + auto end_mask = prim->end_mask; + auto in_ps = impl_params->get_input_layout(0).get_partial_shape(); + bool is_valid = false; + bool is_equal_size = (end.size() == end_mask.size()); + for (size_t i = 0; i < end.size(); i++) { + if ((is_equal_size && end_mask[i] == 1) || (in_ps[i].is_static() && end[i] == in_ps[i].get_length())) { + is_valid = true; + } else { + is_valid = false; + } + } + if (!end.empty() && !is_valid) + return; + node.can_be_optimized(true); + GPU_DEBUG_TRACE_DETAIL << "[mark_runtime_skippable_nodes] : " << node.id() << " can_be_optimized" << std::endl; + }); } } diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp index 485a8255f15b17..51c3721075b2d6 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp @@ -20,6 +20,7 @@ #include "concatenation_inst.h" #include "gather_inst.h" #include "permute_inst.h" +#include "strided_slice_inst.h" #include #include @@ -84,7 +85,10 @@ struct typed_primitive_impl_ocl : public typed_primitive_impl { static std::unique_ptr create(const typed_program_node& arg, const kernel_impl_params& impl_param) { // concat buffer fusing for dynamic shape is adaptively applied at runtime. So we need to build dynamic impl at build time. if (impl_param.can_be_optimized() && - !((impl_param.is_type() || impl_param.is_type() || impl_param.is_type()) && impl_param.is_dynamic())) { + !((impl_param.is_type() || + impl_param.is_type() || + impl_param.is_type() || + impl_param.is_type()) && impl_param.is_dynamic())) { return make_unique(kernel_selector::kernel_data{}); } auto kernel_params = ImplType::get_kernel_params(ImplType::static_canonicalize_shapes(impl_param)); diff --git a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h index 99805e947081c0..42b2a8962e2279 100644 --- a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h @@ -234,6 +234,7 @@ class primitive_inst { void do_runtime_skip_reorder(); void do_runtime_skip_gather(); void do_runtime_skip_permute(); + void do_runtime_skip_strided_slice(); void do_runtime_in_place_concat(); void do_runtime_in_place_kv_cache(); void configure_shape_of_dependencies(); diff --git a/src/plugins/intel_gpu/src/graph/include/strided_slice_inst.h b/src/plugins/intel_gpu/src/graph/include/strided_slice_inst.h index d51f7a3c783eb7..3a682fe2bbf35f 100644 --- a/src/plugins/intel_gpu/src/graph/include/strided_slice_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/strided_slice_inst.h @@ -40,6 +40,11 @@ class typed_primitive_inst : public typed_primitive_inst_base; diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp index 30dbb7a4246dcd..21e1fdef6816b9 100644 --- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp +++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp @@ -22,6 +22,7 @@ #include "deconvolution_inst.h" #include "shape_of_inst.h" #include "softmax_inst.h" +#include "strided_slice_inst.h" #include "gemm_inst.h" #include "assign_inst.h" #include "read_value_inst.h" @@ -531,7 +532,7 @@ event::ptr primitive_inst::realloc_if_needed() { } // Clear out memory if if was previously reused, but now primitive can't be optimized - if (_node->is_type() || _node->is_type() || _node->is_type() || _node->is_type()) { + if (_node->is_type() || _node->is_type() || _node->is_type() || _node->is_type() || _node->is_type()) { if (can_be_optimized()) { _max_output_layout_count = _deps[0].first->_max_output_layout_count; return ev; @@ -1109,6 +1110,30 @@ void primitive_inst::do_runtime_skip_permute() { set_can_be_optimized(true); } +void primitive_inst::do_runtime_skip_strided_slice() { + OV_ITT_SCOPED_TASK(ov::intel_gpu::itt::domains::intel_gpu_plugin, openvino::itt::handle("do_runtime_skip_strided_slice: " + id())); + // Check pattern + if (!get_node().is_type() || !get_node().can_be_optimized()) + return; + + GPU_DEBUG_TRACE_DETAIL << "[do_runtime_skip_strided_slice] " << id() << " : check optimizability" << std::endl; + auto input_layout = _impl_params->get_input_layout(0); + auto output_layout = _impl_params->get_output_layout(); + + // Check runtime shape (need to reset can_be_optimized) + if (input_layout != output_layout) { + set_can_be_optimized(false); + GPU_DEBUG_TRACE_DETAIL << "--- Cannot optimize because input layout(" << input_layout.to_short_string() + << ") != output layout(" << output_layout.to_short_string() << ")" << std::endl; + return; + } + + GPU_DEBUG_TRACE_DETAIL << "[do_runtime_skip_strided_slice] " << id() << " : can_be_optimized" << std::endl; + GPU_DEBUG_TRACE_DETAIL << " - Input layout : " << _impl_params->get_input_layout(0).to_short_string() << std::endl; + GPU_DEBUG_TRACE_DETAIL << " - Output layout : " << _impl_params->get_output_layout().to_short_string() << std::endl; + set_can_be_optimized(true); +} + void primitive_inst::do_runtime_in_place_concat() { OV_ITT_SCOPED_TASK(ov::intel_gpu::itt::domains::intel_gpu_plugin, openvino::itt::handle("do_runtime_in_place_concat: " + id())); GPU_DEBUG_GET_INSTANCE(debug_config); @@ -1232,6 +1257,7 @@ event::ptr primitive_inst::execute(const std::vector& events) { update_paddings(); do_runtime_in_place_kv_cache(); do_runtime_skip_permute(); + do_runtime_skip_strided_slice(); if (!is_valid_fusion()) { OV_ITT_SCOPED_TASK(ov::intel_gpu::itt::domains::intel_gpu_plugin, openvino::itt::handle("unfused_subgraph_exec: " + id())); diff --git a/src/plugins/intel_gpu/src/graph/strided_slice.cpp b/src/plugins/intel_gpu/src/graph/strided_slice.cpp index 980a102c31aa92..6842261b29f0e2 100644 --- a/src/plugins/intel_gpu/src/graph/strided_slice.cpp +++ b/src/plugins/intel_gpu/src/graph/strided_slice.cpp @@ -186,6 +186,25 @@ std::string strided_slice_inst::to_string(strided_slice_node const& node) { return primitive_description.str(); } +void strided_slice_inst::on_execute() { + update_output_memory(); +} + +void strided_slice_inst::update_output_memory() { + if (!can_be_optimized()) + return; + if (static_cast(_outputs[0]) && _network.get_engine().is_the_same_buffer(output_memory(), input_memory())) + return; + + if (_node != nullptr) + build_deps(); + + GPU_DEBUG_TRACE_DETAIL << id() << " : update_output_memory with mem of input " << get_node().get_dependency(0).id() + << " : " << input_memory_ptr()->buffer_ptr() << std::endl; + _outputs[0] = input_memory_ptr(); + _mem_allocated = false; +} + strided_slice_inst::typed_primitive_inst(network& network, strided_slice_node const& node) : parent(network, node) {} diff --git a/src/plugins/intel_gpu/src/plugin/ops/strided_slice.cpp b/src/plugins/intel_gpu/src/plugin/ops/strided_slice.cpp index 242e3d566f914e..a45e2fb2d3a24a 100644 --- a/src/plugins/intel_gpu/src/plugin/ops/strided_slice.cpp +++ b/src/plugins/intel_gpu/src/plugin/ops/strided_slice.cpp @@ -257,10 +257,10 @@ static void CreateStridedSliceOp(ProgramBuilder& p, const std::shared_ptr(layerName, - inputs[0], - inputs[1], - inputs[2], - inputs[3], + inputs, + begin, + end, + strides, op->get_begin_mask(), op->get_end_mask(), op->get_new_axis_mask(), From 46a27344e5e81dd72ec417c39c358ac0b0047e1e Mon Sep 17 00:00:00 2001 From: Roman Lyamin Date: Thu, 8 Feb 2024 11:13:43 +0400 Subject: [PATCH 55/55] [GPU] Fix of the processing of negative indices in Gather in dynamic case (#22716) ### Tickets: - *131414* --- .../kernel_selector/cl_kernels/gather_ref.cl | 6 +-- .../kernels/gather/gather_kernel_ref.cpp | 13 ++++-- .../tests/unit/test_cases/gather_gpu_test.cpp | 46 +++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gather_ref.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gather_ref.cl index 7339e38ce093b2..cc8f139b0389a2 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gather_ref.cl +++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/gather_ref.cl @@ -6,14 +6,14 @@ #include "include/batch_headers/int4_utils.cl" #ifdef INDEX_DIM -inline uint FUNC(get_positive_index)(int in) +inline uint FUNC(get_positive_index)(OPTIONAL_SHAPE_INFO_ARG int in) { - if(in < 0) + if (in < 0) return in + INDEX_DIM; else return in; } -#define INPUT_AXIS_INDEX (uint)FUNC_CALL(get_positive_index)(indices[indices_idx]) +#define INPUT_AXIS_INDEX (uint)FUNC_CALL(get_positive_index)(OPTIONAL_SHAPE_INFO_TENSOR indices[indices_idx]) #else #define INPUT_AXIS_INDEX (uint)(indices[indices_idx]) #endif diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/gather/gather_kernel_ref.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/gather/gather_kernel_ref.cpp index b8dcff190d7d1b..a2c8b86aab64be 100644 --- a/src/plugins/intel_gpu/src/kernel_selector/kernels/gather/gather_kernel_ref.cpp +++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/gather/gather_kernel_ref.cpp @@ -240,10 +240,17 @@ JitConstants GatherKernelRef::GetJitConstants(const gather_params& params) const jit.AddConstant(MakeJitConstant("DICTIONARY_INDEX_ORDER", GetDictionaryIndexOrder(params, GetGatherChannelIndex(params)))); jit.AddConstant(MakeJitConstant("INDICES_INDEX_ORDER", GetIndicesIdxOrder(params, GetGatherChannelIndex(params), GetGatherBatchDim(params)))); - if (params.support_neg_ind) - jit.AddConstant(MakeJitConstant("INDEX_DIM", GetGatherMaxIndexDim(params))); - if (!GetGatherIndexDim(params).is_dynamic) + bool dyn_gather_idx_dim = GetGatherIndexDim(params).is_dynamic; + if (params.support_neg_ind) { + if (!dyn_gather_idx_dim) { + jit.AddConstant(MakeJitConstant("INDEX_DIM", GetGatherMaxIndexDim(params))); + } else { + jit.AddConstant(MakeJitConstant("INDEX_DIM", "shape_info[" + std::to_string(GetGatherAxisIndexInShapeInfo(params)) + "]")); + } + } + + if (!dyn_gather_idx_dim) jit.AddConstant(MakeJitConstant("AXIS_DIM", GetGatherMaxIndexDim(params))); if (params.is_shape_agnostic) diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp index 89daf802143fd9..85b680238c7bb0 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/gather_gpu_test.cpp @@ -2327,3 +2327,49 @@ TEST_F(gather_gpu_tests, compressed_scale_fp16) { TEST_F(gather_gpu_tests, compressed_scale_fp16_cached) { this->test_compressed_scale_fp16(true); } + +TEST(gather_gpu_fp32, dynamic_support_neg_ind) { + auto& engine = get_test_engine(); + + ov::Shape data_shape = { 3, 3 }; + ov::Shape indices_shape = {}; + int64_t axis = 1; + + auto data_layout = layout{ov::PartialShape::dynamic(data_shape.size()), data_types::f32, format::bfyx}; + auto indices_layout = layout{ov::PartialShape::dynamic(indices_shape.size()), data_types::i32, format::bfyx}; + + auto data_mem = engine.allocate_memory(layout{ov::PartialShape(data_shape), data_types::f32, format::bfyx}); + auto indices_mem = engine.allocate_memory(layout{ov::PartialShape(indices_shape), data_types::i32, format::bfyx}); + + set_values(data_mem, { 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f }); + set_values(indices_mem, { -1 }); + + topology topology; + topology.add(input_layout("data", data_layout)); + topology.add(input_layout("indices", indices_layout)); + topology.add(gather("gather", input_info("data"), input_info("indices"), axis, data_shape.size(), ov::Shape{}, 0, true)); + + ExecutionConfig config = get_test_default_config(engine); + config.set_property(ov::intel_gpu::allow_new_shape_infer(true)); + network network(engine, topology, config); + + network.set_input_data("data", data_mem); + network.set_input_data("indices", indices_mem); + + auto inst = network.get_primitive("gather"); + auto impl = inst->get_impl(); + ASSERT_TRUE(impl != nullptr); + ASSERT_TRUE(impl->is_dynamic()); + + auto outputs = network.execute(); + + auto output = outputs.at("gather").get_memory(); + cldnn::mem_lock output_ptr(output, get_test_stream()); + + std::vector expected_results = { 2.f, 5.f, 8.f }; + + ASSERT_EQ(expected_results.size(), output_ptr.size()); + for (size_t i = 0; i < expected_results.size(); ++i) { + ASSERT_EQ(expected_results[i], output_ptr[i]) << i; + } +}