From 0ab9694d429689f60c2a135289ce089def2b39df Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 19 Jan 2024 20:45:48 +0400 Subject: [PATCH] Removed ngraph/pattern (#22275) --- .../include/ngraph/pass/graph_rewrite.hpp | 1 - src/core/include/ngraph/pattern/matcher.hpp | 44 ------------ src/core/include/ngraph/pattern/op/any.hpp | 27 -------- src/core/include/ngraph/pattern/op/any_of.hpp | 27 -------- .../include/ngraph/pattern/op/any_output.hpp | 27 -------- src/core/include/ngraph/pattern/op/branch.hpp | 27 -------- .../include/ngraph/pattern/op/capture.hpp | 27 -------- src/core/include/ngraph/pattern/op/label.hpp | 29 -------- src/core/include/ngraph/pattern/op/or.hpp | 27 -------- .../include/ngraph/pattern/op/pattern.hpp | 69 ------------------- src/core/include/ngraph/pattern/op/skip.hpp | 27 -------- src/core/include/ngraph/pattern/op/true.hpp | 27 -------- .../include/ngraph/pattern/op/wrap_type.hpp | 29 -------- .../cpu_opset/common/pass/rope_fusion.cpp | 54 ++++++++------- 14 files changed, 28 insertions(+), 414 deletions(-) delete mode 100644 src/core/include/ngraph/pattern/matcher.hpp delete mode 100644 src/core/include/ngraph/pattern/op/any.hpp delete mode 100644 src/core/include/ngraph/pattern/op/any_of.hpp delete mode 100644 src/core/include/ngraph/pattern/op/any_output.hpp delete mode 100644 src/core/include/ngraph/pattern/op/branch.hpp delete mode 100644 src/core/include/ngraph/pattern/op/capture.hpp delete mode 100644 src/core/include/ngraph/pattern/op/label.hpp delete mode 100644 src/core/include/ngraph/pattern/op/or.hpp delete mode 100644 src/core/include/ngraph/pattern/op/pattern.hpp delete mode 100644 src/core/include/ngraph/pattern/op/skip.hpp delete mode 100644 src/core/include/ngraph/pattern/op/true.hpp delete mode 100644 src/core/include/ngraph/pattern/op/wrap_type.hpp diff --git a/src/core/include/ngraph/pass/graph_rewrite.hpp b/src/core/include/ngraph/pass/graph_rewrite.hpp index 0931a9c704f7a0..ea11d0dff9351c 100644 --- a/src/core/include/ngraph/pass/graph_rewrite.hpp +++ b/src/core/include/ngraph/pass/graph_rewrite.hpp @@ -19,7 +19,6 @@ #include #include "ngraph/pass/pass.hpp" -#include "ngraph/pattern/matcher.hpp" #include "openvino/pass/graph_rewrite.hpp" namespace ngraph { diff --git a/src/core/include/ngraph/pattern/matcher.hpp b/src/core/include/ngraph/pattern/matcher.hpp deleted file mode 100644 index c37244bed60834..00000000000000 --- a/src/core/include/ngraph/pattern/matcher.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/any.hpp" -#include "ngraph/pattern/op/any_of.hpp" -#include "ngraph/pattern/op/any_output.hpp" -#include "ngraph/pattern/op/label.hpp" -#include "ngraph/pattern/op/skip.hpp" -#include "openvino/pass/pattern/matcher.hpp" - -namespace ov { -namespace pass { -class GraphRewrite; -} -} // namespace ov -namespace ngraph { -namespace pass { -using ov::pass::GraphRewrite; -} - -namespace pattern { -using ov::pass::pattern::Matcher; -using ov::pass::pattern::MatcherState; -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/any.hpp b/src/core/include/ngraph/pattern/op/any.hpp deleted file mode 100644 index a7a5aaf194ca25..00000000000000 --- a/src/core/include/ngraph/pattern/op/any.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/any.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Any; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/any_of.hpp b/src/core/include/ngraph/pattern/op/any_of.hpp deleted file mode 100644 index fbf6652f273d90..00000000000000 --- a/src/core/include/ngraph/pattern/op/any_of.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/any_of.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::AnyOf; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/any_output.hpp b/src/core/include/ngraph/pattern/op/any_output.hpp deleted file mode 100644 index 4f733d48d4187d..00000000000000 --- a/src/core/include/ngraph/pattern/op/any_output.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/any_output.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::AnyOutput; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/branch.hpp b/src/core/include/ngraph/pattern/op/branch.hpp deleted file mode 100644 index e93b7b1b00976b..00000000000000 --- a/src/core/include/ngraph/pattern/op/branch.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/branch.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Branch; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/capture.hpp b/src/core/include/ngraph/pattern/op/capture.hpp deleted file mode 100644 index 25031c5c3cdc71..00000000000000 --- a/src/core/include/ngraph/pattern/op/capture.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/capture.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Capture; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/label.hpp b/src/core/include/ngraph/pattern/op/label.hpp deleted file mode 100644 index c780effa3130c6..00000000000000 --- a/src/core/include/ngraph/pattern/op/label.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/label.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Label; -} // namespace op - -using ov::pass::pattern::any_input; -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/or.hpp b/src/core/include/ngraph/pattern/op/or.hpp deleted file mode 100644 index 2c6926aa7d99cd..00000000000000 --- a/src/core/include/ngraph/pattern/op/or.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/or.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Or; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/pattern.hpp b/src/core/include/ngraph/pattern/op/pattern.hpp deleted file mode 100644 index 1ff997f306a4a2..00000000000000 --- a/src/core/include/ngraph/pattern/op/pattern.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "openvino/pass/pattern/op/pattern.hpp" - -namespace ov { -namespace pass { -namespace pattern { -namespace op { -class Label; -} - -class Matcher; -class MatchState; -} // namespace pattern -} // namespace pass -} // namespace ov -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Label; -} - -using ov::pass::pattern::Matcher; -using ov::pass::pattern::MatcherState; - -using ov::pass::pattern::PatternValueMap; -using ov::pass::pattern::PatternValueMaps; -using ov::pass::pattern::RPatternValueMap; - -using ov::pass::pattern::PatternMap; - -using ov::pass::pattern::as_pattern_map; -using ov::pass::pattern::as_pattern_value_map; -using ov::pass::pattern::consumers_count; -using ov::pass::pattern::has_class; -using ov::pass::pattern::has_static_dim; -using ov::pass::pattern::has_static_dims; -using ov::pass::pattern::has_static_rank; -using ov::pass::pattern::has_static_shape; -using ov::pass::pattern::rank_equals; -using ov::pass::pattern::type_matches; -using ov::pass::pattern::type_matches_any; - -namespace op { -using ov::pass::pattern::op::NodePredicate; -using ov::pass::pattern::op::ValuePredicate; - -using ov::pass::pattern::op::as_value_predicate; -using ov::pass::pattern::op::Pattern; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/skip.hpp b/src/core/include/ngraph/pattern/op/skip.hpp deleted file mode 100644 index 9cfb2f967b0e39..00000000000000 --- a/src/core/include/ngraph/pattern/op/skip.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/skip.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::Skip; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/true.hpp b/src/core/include/ngraph/pattern/op/true.hpp deleted file mode 100644 index 62a564a96f1258..00000000000000 --- a/src/core/include/ngraph/pattern/op/true.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/true.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::True; -} // namespace op -} // namespace pattern -} // namespace ngraph diff --git a/src/core/include/ngraph/pattern/op/wrap_type.hpp b/src/core/include/ngraph/pattern/op/wrap_type.hpp deleted file mode 100644 index 50a3a781bc7745..00000000000000 --- a/src/core/include/ngraph/pattern/op/wrap_type.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#if !defined(IN_OV_COMPONENT) && !defined(NGRAPH_LEGACY_HEADER_INCLUDED) -# define NGRAPH_LEGACY_HEADER_INCLUDED -# ifdef _MSC_VER -# pragma message( \ - "The nGraph 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 nGraph 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 "ngraph/node.hpp" -#include "ngraph/pattern/op/pattern.hpp" -#include "openvino/pass/pattern/op/wrap_type.hpp" - -namespace ngraph { -namespace pattern { -namespace op { -using ov::pass::pattern::op::WrapType; -} // namespace op - -using ov::pass::pattern::wrap_type; -} // namespace pattern -} // namespace ngraph diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rope_fusion.cpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rope_fusion.cpp index b4fded221efcbe..8552013de64294 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rope_fusion.cpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rope_fusion.cpp @@ -6,13 +6,15 @@ #include #include -#include + +#include "openvino/core/rt_info.hpp" #include "openvino/opsets/opset1.hpp" -#include -#include -#include -#include -#include +#include "openvino/opsets/opset6.hpp" +#include "openvino/opsets/opset8.hpp" +#include "openvino/pass/pattern/op/or.hpp" +#include "openvino/pass/pattern/op/wrap_type.hpp" +#include "openvino/pass/pattern/matcher.hpp" +#include "transformations/utils/utils.hpp" #include "itt.hpp" #include "ov_ops/type_relaxed.hpp" @@ -55,7 +57,7 @@ ov::intel_cpu::RoPEFusionGPTNEOX::RoPEFusionGPTNEOX() { // [x1, x2]*cos + [-x2, x1]*sin auto result = makePattern({mul_cos, mul_sin}, {{"auto_broadcast", "numpy"}}); - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { PatternValidator validator(m); if (!validator) { return false; @@ -94,7 +96,7 @@ ov::intel_cpu::RoPEFusionGPTNEOX::RoPEFusionGPTNEOX() { return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } @@ -154,7 +156,7 @@ ov::intel_cpu::RoPEFusionCosSinPreprocess::RoPEFusionCosSinPreprocess() { auto x = makePattern(ov::Rank(4)); auto rope = makePattern({x, cos_tab, sin_tab}); - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { PatternValidator validator(m); if (!validator) { return false; @@ -186,7 +188,7 @@ ov::intel_cpu::RoPEFusionCosSinPreprocess::RoPEFusionCosSinPreprocess() { register_new_node(rope_node); return true; }; - auto m = std::make_shared(rope, matcher_name); + auto m = std::make_shared(rope, matcher_name); this->register_matcher(m, callback); } @@ -202,7 +204,7 @@ ov::intel_cpu::RoPEFusionIOSlicing::RoPEFusionIOSlicing() { auto x_emb = makePattern({x, {}, {}}) | makePattern({x, {}, {}, {}}); auto result = makePattern({x_emb, y}, {{"axis", -1}}); - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { const auto& pattern_map = m.get_pattern_value_map(); auto root = m.get_match_root(); @@ -229,7 +231,7 @@ ov::intel_cpu::RoPEFusionIOSlicing::RoPEFusionIOSlicing() { register_new_node(rope_node); return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } @@ -250,7 +252,7 @@ ov::intel_cpu::RoPEFusionPreprocess::RoPEFusionPreprocess() { auto x = makePattern({input_slice | input_to_trans, {0, 2, 1, 3}}); auto result = makePattern({x, {}, {}}) | makePattern({x, {}, {}, {}}); - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { PatternValidator validator(m); if (!validator) { return false; @@ -279,17 +281,17 @@ ov::intel_cpu::RoPEFusionPreprocess::RoPEFusionPreprocess() { register_new_node(rope_node); return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } // remove stridedslice from 0 to int32_max with stride 1 ov::intel_cpu::EliminateStridedSlice::EliminateStridedSlice() { MATCHER_SCOPE(EliminateStridedSlice); - auto data = ov::pass::pattern::any_input(ngraph::pattern::has_static_rank()); - auto begin = ov::pass::pattern::wrap_type(ngraph::pattern::type_matches(ov::element::i32)); - auto end = ov::pass::pattern::wrap_type(ngraph::pattern::type_matches(ov::element::i32)); - auto stride = ov::pass::pattern::wrap_type(ngraph::pattern::type_matches(ov::element::i32)); + auto data = ov::pass::pattern::any_input(ov::pass::pattern::has_static_rank()); + auto begin = ov::pass::pattern::wrap_type(ov::pass::pattern::type_matches(ov::element::i32)); + auto end = ov::pass::pattern::wrap_type(ov::pass::pattern::type_matches(ov::element::i32)); + auto stride = ov::pass::pattern::wrap_type(ov::pass::pattern::type_matches(ov::element::i32)); auto strided_slice = ov::pass::pattern::wrap_type({data, begin, end, stride}, [](const Output& value) { @@ -351,12 +353,12 @@ ov::intel_cpu::EliminateStridedSlice::EliminateStridedSlice() { return true; }); - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { auto root = m.get_match_root(); return replace_output_update_name(root->output(0), root->input_value(0)); }; - auto m = std::make_shared(strided_slice, matcher_name); + auto m = std::make_shared(strided_slice, matcher_name); this->register_matcher(m, callback); } @@ -423,7 +425,7 @@ ov::intel_cpu::RoPEFusionGPTJ::RoPEFusionGPTJ() { auto result = permute_Transpose_1213; - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { const auto& pattern_map = m.get_pattern_value_map(); auto root = m.get_match_root(); PatternValidator validator(m); @@ -451,7 +453,7 @@ ov::intel_cpu::RoPEFusionGPTJ::RoPEFusionGPTJ() { return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } @@ -539,7 +541,7 @@ ov::intel_cpu::RoPEFusionChatGLM::RoPEFusionChatGLM(int split_output_id) { auto result = cat_Concat_505; - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { const auto& pattern_map = m.get_pattern_value_map(); auto root = m.get_match_root(); PatternValidator validator(m); @@ -576,7 +578,7 @@ ov::intel_cpu::RoPEFusionChatGLM::RoPEFusionChatGLM(int split_output_id) { return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } @@ -679,7 +681,7 @@ ov::intel_cpu::RoPEFusionQwen::RoPEFusionQwen(int split_output_id) { auto result = add_Add_597; - matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { + matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) { const auto& pattern_map = m.get_pattern_value_map(); auto root = m.get_match_root(); PatternValidator validator(m); @@ -715,6 +717,6 @@ ov::intel_cpu::RoPEFusionQwen::RoPEFusionQwen(int split_output_id) { return true; }; - auto m = std::make_shared(result, matcher_name); + auto m = std::make_shared(result, matcher_name); this->register_matcher(m, callback); } \ No newline at end of file