From 19e7dae3555825b7bbabd9696a825ec98fe8a400 Mon Sep 17 00:00:00 2001 From: Roman Kazantsev Date: Thu, 19 Dec 2024 17:40:34 +0400 Subject: [PATCH 1/5] [TF FE] Stabilize tests for unary operation defined on full real domain (#28111) **Details:** Stabilize tests for unary operation defined on full real domain **Ticket:** TBD --------- Signed-off-by: Kazantsev, Roman --- .../tensorflow_tests/test_tf_UnaryOps.py | 51 +++----------- .../test_tf_UnaryOpsAllRealDomain.py | 70 +++++++++++++++++++ 2 files changed, 78 insertions(+), 43 deletions(-) create mode 100644 tests/layer_tests/tensorflow_tests/test_tf_UnaryOpsAllRealDomain.py diff --git a/tests/layer_tests/tensorflow_tests/test_tf_UnaryOps.py b/tests/layer_tests/tensorflow_tests/test_tf_UnaryOps.py index 902adebc2226fc..69f08acd9754d2 100644 --- a/tests/layer_tests/tensorflow_tests/test_tf_UnaryOps.py +++ b/tests/layer_tests/tensorflow_tests/test_tf_UnaryOps.py @@ -1,11 +1,10 @@ # Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -import platform -import sys - import numpy as np +import platform import pytest +import sys from common.tf_layer_test_class import CommonTFLayerTest @@ -14,7 +13,7 @@ class TestUnaryOps(CommonTFLayerTest): def _prepare_input(self, inputs_dict): non_negative = ['Sqrt', 'Log'] - narrow_borders = ["Sinh", "Cosh", "Tanh", "Exp", "Selu"] + narrow_borders = ["Tanh"] within_one = ['Asin', 'Acos', 'Atanh'] from_one = ['Acosh'] @@ -76,25 +75,14 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte 'Asin': tf.math.asin, 'Asinh': tf.math.asinh, 'Atan': tf.math.atan, - 'Atanh': tf.math.atanh, 'BitwiseNot': tf.bitwise.invert, 'Ceiling': tf.math.ceil, - 'Cos': tf.math.cos, - 'Cosh': tf.math.cosh, - 'Elu': tf.nn.elu, - 'Erf': tf.math.erf, - 'Exp': tf.math.exp, 'Floor': tf.math.floor, 'Log': tf.math.log, 'LogicalNot': tf.math.logical_not, # 'Mish': tfa.activations.mish, # temporarily moved to `create_net_with_mish()` 'Negative': tf.math.negative, - 'Selu': tf.nn.selu, - 'Sigmoid': tf.nn.sigmoid, 'Sign': tf.math.sign, - 'Sin': tf.math.sin, - 'Sinh': tf.math.sinh, - 'SoftPlus': tf.nn.softplus, 'Square': tf.math.square, 'Tan': tf.math.tan, 'Tanh': tf.math.tanh, @@ -126,15 +114,8 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte test_data_precommit = [dict(shape=[4, 6, 8, 10, 12])] @pytest.mark.parametrize("params", test_data_precommit) - @pytest.mark.parametrize("op_type", ['Elu', - 'Sigmoid', - 'Sin', - 'Sinh', - 'Cos', - 'Cosh', - 'Abs', + @pytest.mark.parametrize("op_type", ['Abs', 'Negative', - 'Exp', 'Tan', 'Tanh', 'Floor', @@ -145,15 +126,11 @@ def create_net_with_unary_op(self, shape, ir_version, op_type, use_legacy_fronte 'Atan', 'Log', 'Sign', - 'SoftPlus', - 'Atanh', 'Acosh', 'Asinh', 'LogicalNot', 'Square', - 'Erf', - 'BitwiseNot' - ]) + 'BitwiseNot']) @pytest.mark.nightly def test_unary_op_precommit(self, params, ie_device, precision, ir_version, temp_dir, op_type, use_legacy_frontend): @@ -188,15 +165,8 @@ def test_unary_op_mish_precommit(self, params, ie_device, precision, ir_version, dict(shape=[4, 6, 8, 10, 12])] @pytest.mark.parametrize("params", test_data) - @pytest.mark.parametrize("op_type", ['Elu', - 'Sigmoid', - 'Sin', - 'Sinh', - 'Cos', - 'Cosh', - 'Abs', + @pytest.mark.parametrize("op_type", ['Abs', 'Negative', - 'Exp', 'Tan', 'Tanh', 'Floor', @@ -206,17 +176,12 @@ def test_unary_op_mish_precommit(self, params, ie_device, precision, ir_version, 'Acos', 'Atan', 'Log', - 'LogicalNot', 'Sign', - 'SoftPlus', - 'Atanh', 'Acosh', 'Asinh', + 'LogicalNot', 'Square', - 'Erf', - 'Selu', - 'BitwiseNot' - ]) + 'BitwiseNot']) @pytest.mark.nightly @pytest.mark.skipif(sys.platform == 'darwin', reason="Ticket - 122182") @pytest.mark.xfail(platform.machine() in ["aarch64", "arm64", "ARM64"], reason='Ticket - 122716') diff --git a/tests/layer_tests/tensorflow_tests/test_tf_UnaryOpsAllRealDomain.py b/tests/layer_tests/tensorflow_tests/test_tf_UnaryOpsAllRealDomain.py new file mode 100644 index 00000000000000..4ff4d589cbae32 --- /dev/null +++ b/tests/layer_tests/tensorflow_tests/test_tf_UnaryOpsAllRealDomain.py @@ -0,0 +1,70 @@ +# Copyright (C) 2018-2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +import numpy as np +import platform +import pytest +import tensorflow as tf +from common.tf_layer_test_class import CommonTFLayerTest + +rng = np.random.default_rng(253512) + + +class TestUnaryOpsAllRealDomain(CommonTFLayerTest): + def _prepare_input(self, inputs_info): + assert 'x:0' in inputs_info, "Test error: inputs_info must contain `x`" + x_shape = inputs_info['x:0'] + inputs_data = {} + inputs_data['x:0'] = rng.uniform(-5.0, 5.0, x_shape).astype(self.input_type) + return inputs_data + + def create_unary_net(self, input_shape, input_type, op_type): + op_type_map = { + 'Elu': lambda x: tf.raw_ops.Elu(features=x), + 'Sigmoid': tf.raw_ops.Sigmoid, + 'Sin': tf.raw_ops.Sin, + 'Sinh': tf.raw_ops.Sinh, + 'Cos': tf.raw_ops.Cos, + 'Cosh': tf.raw_ops.Cosh, + 'Exp': tf.raw_ops.Exp, + 'Atan': tf.raw_ops.Atan, + 'Softplus': lambda x: tf.raw_ops.Softplus(features=x), + 'Erf': tf.raw_ops.Erf, + 'Selu': lambda x: tf.raw_ops.Selu(features=x) + } + + self.input_type = input_type + tf.compat.v1.reset_default_graph() + # Create the graph and model + with tf.compat.v1.Session() as sess: + x = tf.compat.v1.placeholder(input_type, input_shape, 'x') + op_type_map[op_type](x=x) + tf.compat.v1.global_variables_initializer() + + tf_net = sess.graph_def + + return tf_net, None + + @pytest.mark.parametrize("input_shape", [[], [2], [3, 4], [3, 2, 4]]) + @pytest.mark.parametrize("input_type", [np.float16, np.float32, np.float64]) + @pytest.mark.parametrize("op_type", ['Elu', + 'Sigmoid', + 'Sin', + 'Sinh', + 'Cos', + 'Cosh', + 'Exp', + 'Atan', + 'Softplus', + 'Erf', + 'Selu']) + @pytest.mark.precommit + @pytest.mark.nightly + def test_unary_ops(self, input_shape, input_type, op_type, + ie_device, precision, ir_version, temp_dir, + use_legacy_frontend): + if platform.machine() in ["aarch64", "arm64", "ARM64"] and op_type in ['Cos', 'Cosh', 'Sinh', 'Exp']: + pytest.skip("159585: accuracy error on ARM") + self._test(*self.create_unary_net(input_shape, input_type, op_type), + ie_device, precision, ir_version, temp_dir=temp_dir, + use_legacy_frontend=use_legacy_frontend, custom_eps=1e-3) From dac42a9301f237bd30052b32fa350fc4865b5d44 Mon Sep 17 00:00:00 2001 From: Andrei Kashchikhin Date: Thu, 19 Dec 2024 14:45:57 +0000 Subject: [PATCH 2/5] [CI] [GHA] Add retries and timeout for Fedora, use `dnf` (#27882) ### Details: - Should mitigate things like in https://github.com/openvinotoolkit/openvino/actions/runs/12081540979/job/33691617750 ### Tickets: - *158474* --------- Co-authored-by: Mikhail Ryzhov --- .github/dockerfiles/docker_tag | 2 +- .github/dockerfiles/ov_build/fedora_29/Dockerfile | 6 +++++- .github/dockerfiles/ov_test/fedora_33/Dockerfile | 6 +++++- .github/workflows/fedora_29.yml | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag index bcfa07fb5c24b3..1dc77e89521bfe 100644 --- a/.github/dockerfiles/docker_tag +++ b/.github/dockerfiles/docker_tag @@ -1 +1 @@ -pr-27597 +pr-27882 diff --git a/.github/dockerfiles/ov_build/fedora_29/Dockerfile b/.github/dockerfiles/ov_build/fedora_29/Dockerfile index e5f400e2915e9c..0b9911ac707b13 100644 --- a/.github/dockerfiles/ov_build/fedora_29/Dockerfile +++ b/.github/dockerfiles/ov_build/fedora_29/Dockerfile @@ -3,7 +3,11 @@ FROM ${REGISTRY}/library/fedora:29 USER root -RUN yum update -y && yum install -y \ +# dnf configuration +RUN echo "timeout=60" >> /etc/dnf/dnf.conf && \ + echo "retries=10" >> /etc/dnf/dnf.conf + +RUN dnf update -y && dnf install -y \ git \ curl \ python3 \ diff --git a/.github/dockerfiles/ov_test/fedora_33/Dockerfile b/.github/dockerfiles/ov_test/fedora_33/Dockerfile index 6e0fcc7d35156b..4c5b2037e60578 100644 --- a/.github/dockerfiles/ov_test/fedora_33/Dockerfile +++ b/.github/dockerfiles/ov_test/fedora_33/Dockerfile @@ -3,7 +3,11 @@ FROM ${REGISTRY}/library/fedora:33 USER root -RUN yum update -y && yum install -y \ +# dnf configuration +RUN echo "timeout=60" >> /etc/dnf/dnf.conf && \ + echo "retries=10" >> /etc/dnf/dnf.conf + +RUN dnf update -y && dnf install -y \ git \ curl \ python3 \ diff --git a/.github/workflows/fedora_29.yml b/.github/workflows/fedora_29.yml index 0dd101225dc533..6d128f33fca274 100644 --- a/.github/workflows/fedora_29.yml +++ b/.github/workflows/fedora_29.yml @@ -131,10 +131,10 @@ jobs: # install previous release version mv /tmp/openvino-2023.repo /etc/yum.repos.d - yum install -y openvino + dnf install -y openvino # install current version - yum install --allowerasing -y *.rpm + dnf install --allowerasing -y *.rpm working-directory: ${{ env.RPM_PACKAGES_DIR }} - name: Test RPM packages From e9400c5f1f451a686a9365027a024a7501670890 Mon Sep 17 00:00:00 2001 From: Gorokhov Dmitriy Date: Thu, 19 Dec 2024 19:20:04 +0400 Subject: [PATCH 3/5] [CPU] Enable compressed FC via oneDNN Matmul primitive (#27459) ### Details: - This PR enables execution FullyConnected operations via OneDNN Matmul Primitive - Matmul_weights_decompression tests are splitted on x64 and arm instances, ARM tests run well via ref matmul. - Newly added functionality is still under debug caps. To try it out: -- Build OV with: -DENABLE_DEBUG_CAPS=ON cmake option -- export OV_CPU_ENABLE_DNNL_MAMTUL_FOR_FC=1 --- src/plugins/intel_cpu/src/cpu_memory.cpp | 2 +- .../intel_cpu/src/dnnl_postops_composer.cpp | 68 +++++- .../intel_cpu/src/dnnl_postops_composer.h | 15 +- .../src/nodes/common/cpu_convert.cpp | 13 +- .../dnnl/dnnl_fullyconnected_primitive.cpp | 16 +- .../executors/dnnl/dnnl_matmul_primitive.cpp | 90 +++++--- .../executors/dnnl/dnnl_matmul_primitive.hpp | 2 + .../fullyconnected_implementations.cpp | 5 +- .../intel_cpu/src/nodes/fullyconnected.cpp | 40 +++- .../intel_cpu/src/nodes/fullyconnected.h | 2 + .../convert_to_cpu_specific_opset.hpp | 25 +-- .../aarch64/pass/snippets_mark_skipped.cpp | 16 ++ .../transformation_pipeline.cpp | 21 +- .../src/arm/matmul_weights_decompression.cpp | 86 ++++++++ .../classes/matmul_weights_decompression.cpp | 167 ++++++++++++++ .../classes/matmul_weights_decompression.hpp | 79 +++++++ .../src/x64/matmul_weights_decompression.cpp | 204 +----------------- .../skip_tests_config.cpp | 1 - 18 files changed, 574 insertions(+), 278 deletions(-) create mode 100644 src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/arm/matmul_weights_decompression.cpp create mode 100644 src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.cpp create mode 100644 src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp diff --git a/src/plugins/intel_cpu/src/cpu_memory.cpp b/src/plugins/intel_cpu/src/cpu_memory.cpp index 7cb4abc2161f14..71851c529c6095 100644 --- a/src/plugins/intel_cpu/src/cpu_memory.cpp +++ b/src/plugins/intel_cpu/src/cpu_memory.cpp @@ -45,7 +45,7 @@ void transferData(const IMemory& src, const IMemory& dst, bool ftz) { if (!ftz) { return; } - if (src.getDesc().getPrecision() != ov::element::f32 || dst.getDesc().getPrecision() == ov::element::bf16) { + if (src.getDesc().getPrecision() != ov::element::f32 || dst.getDesc().getPrecision() != ov::element::f32) { return; } size_t offset = 0; diff --git a/src/plugins/intel_cpu/src/dnnl_postops_composer.cpp b/src/plugins/intel_cpu/src/dnnl_postops_composer.cpp index 9b86a1433acb06..be0c8a2a62d954 100644 --- a/src/plugins/intel_cpu/src/dnnl_postops_composer.cpp +++ b/src/plugins/intel_cpu/src/dnnl_postops_composer.cpp @@ -628,13 +628,71 @@ static MemoryPtr prepackDecompressionParams(const MemoryCPtr& paramsPtr, auto srcMem = std::make_shared(engine, srcMemoryDesc, paramsPtr->getData()); dstMem->load(*srcMem); - return dstMem; } +static dnnl::memory::dims getGroupDims(const VectorDims& weiDims, const VectorDims& scaleDims) { + if (scaleDims[0] == 1 && scaleDims[1] == 1) + return {}; + + int N = weiDims[weiDims.size() - 2]; + int K = weiDims[weiDims.size() - 1]; + dnnl::memory::dim groupN = N / scaleDims[0]; + dnnl::memory::dim groupK = K / scaleDims[1]; + + return {groupK, groupN}; +} + +static int getMask(const VectorDims& weiDims, const dnnl::memory::dims& groupDims) { + const int maskN = 1 << (weiDims.size() - 1); + const int maskK = 1 << (weiDims.size() - 2); + int N = weiDims[weiDims.size() - 2]; + int K = weiDims[weiDims.size() - 1]; + int mask = 0; + if (!groupDims.empty() && groupDims[1] != N) + mask += maskN; + if (!groupDims.empty() && groupDims[0] != K) + mask += maskK; + + return mask; +} + void DnnlPostOpsComposer::appendDecompressionScales(const MemoryCPtr& scales_ptr, bool needTranspose, - ov::element::Type dstPrecision) { + ov::element::Type dstPrecision, + const VectorDims& weiDims) { + if (scales_ptr == nullptr) + return; + + auto scaleMem = prepackDecompressionParams(scales_ptr, needTranspose, dstPrecision, engine); + auto groupDims = getGroupDims(weiDims, scaleMem->getStaticDims()); + auto mask = getMask(weiDims, groupDims); + + attr.set_scales(DNNL_ARG_WEIGHTS, mask, groupDims, DnnlExtensionUtils::ElementTypeToDataType(dstPrecision)); + cpuArgs[DNNL_ARG_ATTR_SCALES | DNNL_ARG_WEIGHTS] = std::move(scaleMem); + dnnlArgs[DNNL_ARG_ATTR_SCALES | DNNL_ARG_WEIGHTS] = + cpuArgs[DNNL_ARG_ATTR_SCALES | DNNL_ARG_WEIGHTS]->getPrimitive(); +} + +void DnnlPostOpsComposer::appendDecompressionZeroPoints(const MemoryCPtr& zero_points_ptr, + bool needTranspose, + ov::element::Type dstPrecision, + const VectorDims& weiDims) { + if (zero_points_ptr == nullptr) + return; + + auto zeroPointsMem = prepackDecompressionParams(zero_points_ptr, needTranspose, dstPrecision, engine); + auto groupDims = getGroupDims(weiDims, zeroPointsMem->getStaticDims()); + auto mask = getMask(weiDims, groupDims); + + attr.set_zero_points(DNNL_ARG_WEIGHTS, mask, groupDims, DnnlExtensionUtils::ElementTypeToDataType(dstPrecision)); + cpuArgs[DNNL_ARG_ATTR_ZERO_POINTS | DNNL_ARG_WEIGHTS] = zeroPointsMem; + dnnlArgs[DNNL_ARG_ATTR_ZERO_POINTS | DNNL_ARG_WEIGHTS] = zeroPointsMem->getPrimitive(); +} + +void DnnlPostOpsComposer::appendDecompressionScalesLegacy(const MemoryCPtr& scales_ptr, + bool needTranspose, + ov::element::Type dstPrecision) { if (scales_ptr == nullptr) return; @@ -647,9 +705,9 @@ void DnnlPostOpsComposer::appendDecompressionScales(const MemoryCPtr& scales_ptr cpuArgs[DNNL_ARG_ATTR_SCALES | DNNL_ARG_WEIGHTS]->getPrimitive(); } -void DnnlPostOpsComposer::appendDecompressionZeroPoints(const MemoryCPtr& zero_points_ptr, - bool needTranspose, - ov::element::Type dstPrecision) { +void DnnlPostOpsComposer::appendDecompressionZeroPointsLegacy(const MemoryCPtr& zero_points_ptr, + bool needTranspose, + ov::element::Type dstPrecision) { if (zero_points_ptr == nullptr) return; diff --git a/src/plugins/intel_cpu/src/dnnl_postops_composer.h b/src/plugins/intel_cpu/src/dnnl_postops_composer.h index 7ae634658b005f..81fd1aaeed194d 100644 --- a/src/plugins/intel_cpu/src/dnnl_postops_composer.h +++ b/src/plugins/intel_cpu/src/dnnl_postops_composer.h @@ -30,10 +30,21 @@ class DnnlPostOpsComposer { const MemoryArgs& memory, const dnnl::memory::data_type outDataType); DnnlPrimitiveAttrs compose(); - void appendDecompressionScales(const MemoryCPtr& scales_ptr, bool needTranspose, ov::element::Type dstPrecision); + + void appendDecompressionScales(const MemoryCPtr& scales_ptr, + bool needTranspose, + ov::element::Type dstPrecision, + const VectorDims& weiDims); void appendDecompressionZeroPoints(const MemoryCPtr& zero_points_ptr, bool needTranspose, - ov::element::Type dstPrecision); + ov::element::Type dstPrecision, + const VectorDims& weiDims); + void appendDecompressionScalesLegacy(const MemoryCPtr& scales_ptr, + bool needTranspose, + ov::element::Type dstPrecision); + void appendDecompressionZeroPointsLegacy(const MemoryCPtr& zero_points_ptr, + bool needTranspose, + ov::element::Type dstPrecision); void setDynamicQuantizationParams(uint64_t groupSize); private: diff --git a/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp b/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp index a0590827006eb4..0c8cddd905dc2e 100644 --- a/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp +++ b/src/plugins/intel_cpu/src/nodes/common/cpu_convert.cpp @@ -570,12 +570,13 @@ struct ConvertFromBinPrecision> { } }; -#define INTEL_CPU_CVT_FROM_4BIT_LIST \ - INTEL_CPU_CVT(u4, f32), INTEL_CPU_CVT(u4, bf16), INTEL_CPU_CVT(u4, f16), INTEL_CPU_CVT(u4, i8), \ - INTEL_CPU_CVT(u4, u8), INTEL_CPU_CVT(i4, f32), INTEL_CPU_CVT(i4, bf16), INTEL_CPU_CVT(i4, f16), \ - INTEL_CPU_CVT(i4, i8), INTEL_CPU_CVT(i4, u8), INTEL_CPU_CVT(nf4, f32), INTEL_CPU_CVT(nf4, bf16), \ - INTEL_CPU_CVT(nf4, f16), INTEL_CPU_CVT(nf4, i8), INTEL_CPU_CVT(nf4, u8), INTEL_CPU_CVT(f4e2m1, f32), \ - INTEL_CPU_CVT(f4e2m1, bf16), INTEL_CPU_CVT(f4e2m1, f16), INTEL_CPU_CVT(f4e2m1, i8), INTEL_CPU_CVT(f4e2m1, u8) +#define INTEL_CPU_CVT_FROM_4BIT_LIST \ + INTEL_CPU_CVT(u4, f32), INTEL_CPU_CVT(u4, i32), INTEL_CPU_CVT(u4, bf16), INTEL_CPU_CVT(u4, f16), \ + INTEL_CPU_CVT(u4, i8), INTEL_CPU_CVT(u4, u8), INTEL_CPU_CVT(i4, f32), INTEL_CPU_CVT(i4, i32), \ + INTEL_CPU_CVT(i4, bf16), INTEL_CPU_CVT(i4, f16), INTEL_CPU_CVT(i4, i8), INTEL_CPU_CVT(i4, u8), \ + INTEL_CPU_CVT(nf4, f32), INTEL_CPU_CVT(nf4, bf16), INTEL_CPU_CVT(nf4, f16), INTEL_CPU_CVT(nf4, i8), \ + INTEL_CPU_CVT(nf4, u8), INTEL_CPU_CVT(f4e2m1, f32), INTEL_CPU_CVT(f4e2m1, bf16), INTEL_CPU_CVT(f4e2m1, f16), \ + INTEL_CPU_CVT(f4e2m1, i8), INTEL_CPU_CVT(f4e2m1, u8) struct ConvertFrom4BitContext { ov::element::Type_t inType; diff --git a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp index 52434a1eeb8461..8ae2d2784193af 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp @@ -228,14 +228,16 @@ static DnnlPrimitiveAttrs createPrimitiveAttrs(const FCAttrs& attrs, if (dstPrc != f8e8m0 || useDynamicQuantization) dstPrc = ov::element::f32; - dnnlpoc.appendDecompressionScales(memory.at(ARG_WEI | ARG_ATTR_SCALES), !attrs.weightsNonTransposed, dstPrc); + dnnlpoc.appendDecompressionScalesLegacy(memory.at(ARG_WEI | ARG_ATTR_SCALES), + !attrs.weightsNonTransposed, + dstPrc); } if (memory.count(ARG_WEI | ARG_ATTR_ZERO_POINTS)) { auto dstPrc = useDynamicQuantization ? ov::element::u8 : ov::element::f32; - dnnlpoc.appendDecompressionZeroPoints(memory.at(ARG_WEI | ARG_ATTR_ZERO_POINTS), - !attrs.weightsNonTransposed, - dstPrc); + dnnlpoc.appendDecompressionZeroPointsLegacy(memory.at(ARG_WEI | ARG_ATTR_ZERO_POINTS), + !attrs.weightsNonTransposed, + dstPrc); } if (useDynamicQuantization) { @@ -247,9 +249,9 @@ static DnnlPrimitiveAttrs createPrimitiveAttrs(const FCAttrs& attrs, uint8_t zp_value = (wei_precision == ov::element::i8) ? 128 : 8; DnnlBlockedMemoryDesc zpMemoryDesc(ov::element::u8, Shape({1})); auto decompressionSubtractPtr = std::make_shared(context->getEngine(), zpMemoryDesc, &zp_value); - dnnlpoc.appendDecompressionZeroPoints(decompressionSubtractPtr, - !attrs.weightsNonTransposed, - ov::element::u8); + dnnlpoc.appendDecompressionZeroPointsLegacy(decompressionSubtractPtr, + !attrs.weightsNonTransposed, + ov::element::u8); } dnnlpoc.setDynamicQuantizationParams(attrs.dynamicQuantizationGroupSize); } diff --git a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.cpp b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.cpp index 86b22607111833..9ffe4731689d43 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,23 @@ bool DnnlMatMulPrimitive::Key::operator==(const Key& rhs) const { return result; } +template +static dimsType normalizeToRank(const dimsType& vec, size_t rank) { + if (vec.size() == rank || vec.empty()) + return vec; + + dimsType result; + result.reserve(rank); + + for (size_t i = vec.size(); i < rank; ++i) { + result.push_back(1); + } + + result.insert(result.end(), vec.begin(), vec.end()); + + return result; +} + std::shared_ptr DnnlMatMulPrimitive::create(const MemoryArgs& memory, const MatMulAttrs& attrs, const ExecutorContext::CPtr context, @@ -105,19 +123,22 @@ DnnlMemoryDescPtr DnnlMatMulPrimitive::makeTransposedWeightDescriptor(const Dnnl const auto& weiDesc = srcDesc->getDnnlDesc(); auto wDims = weiDesc.get_dims(); auto wDataType = weiDesc.get_data_type(); + std::swap(wDims[wDims.size() - 1], wDims[wDims.size() - 2]); dnnl::memory::dims wDims2D = reshapeDownToRank<2>(wDims); const auto format = weightsNonTransposed ? dnnl::memory::format_tag::ab : dnnl::memory::format_tag::ba; const auto transposedWeiDesc = dnnl::memory::desc{wDims2D, wDataType, format}; + const auto reshapedWeiDesc = transposedWeiDesc.reshape(dstDesc->getDnnlDesc().get_dims()); - return DnnlExtensionUtils::makeDescriptor(transposedWeiDesc); + return DnnlExtensionUtils::makeDescriptor(reshapedWeiDesc); } static DnnlPrimitiveAttrs createPrimitiveAttrs(const MatMulAttrs& attrs, const PostOps& postOps, const MemoryArgs& memory, ExecutorContext::CPtr context, - bool useDynamicQuantization) { + bool useWeightsDecompression, + bool weightsNonTransposed) { const auto& srcDesc = memory.at(ARG_SRC)->getDescPtr(); const auto& weiDesc = memory.at(ARG_WEI)->getDescPtr(); const auto& dstDesc = memory.at(ARG_DST)->getDescPtr(); @@ -132,7 +153,30 @@ static DnnlPrimitiveAttrs createPrimitiveAttrs(const MatMulAttrs& attrs, DnnlPostOpsComposer dnnlpoc(postOps, context->getEngine(), dims, dims.size() - 1, isINT8, 1 << 0, memory, outputDataType); - return dnnlpoc.compose(); + const auto maxRank = + std::max({srcDesc->getShape().getRank(), weiDesc->getShape().getRank(), dstDesc->getShape().getRank()}); + const auto normWeiDims = normalizeToRank(weiDesc->getShape().getStaticDims(), maxRank); + if (memory.count(ARG_WEI | ARG_ATTR_SCALES)) { + auto dstPrc = ov::element::f32; + dnnlpoc.appendDecompressionScales(memory.at(ARG_WEI | ARG_ATTR_SCALES), + !weightsNonTransposed, + dstPrc, + normWeiDims); + } + if (memory.count(ARG_WEI | ARG_ATTR_ZERO_POINTS)) { + // TODO: clarify oneDNN requirements on ZP precision + auto zp = memory.at(ARG_WEI | ARG_ATTR_ZERO_POINTS); + auto zpPrc = zp->getPrecision(); + auto dstPrc = one_of(zpPrc, i32, i8, u8, i4, u4) ? zpPrc : i32; + dnnlpoc.appendDecompressionZeroPoints(zp, !weightsNonTransposed, dstPrc, normWeiDims); + } + + auto primAttrs = dnnlpoc.compose(); + if (useWeightsDecompression) { + primAttrs.attr.set_fpmath_mode(fpmath_mode::any, true); + } + + return primAttrs; } static dnnl::matmul::primitive_desc createDescriptorInternal(const dnnl::memory::desc& inputDesc, @@ -143,22 +187,6 @@ static dnnl::matmul::primitive_desc createDescriptorInternal(const dnnl::memory: const dnnl::engine& engine, const bool useSparseWeights, const bool useWeightsDecompression) { - auto normalizeToRank = [](const dnnl::memory::dims& vec, size_t rank) -> dnnl::memory::dims { - if (vec.size() == rank || vec.empty()) - return vec; - - dnnl::memory::dims result; - result.reserve(rank); - - for (size_t i = vec.size(); i < rank; ++i) { - result.push_back(1); - } - - result.insert(result.end(), vec.begin(), vec.end()); - - return result; - }; - auto weiDims = weightDesc.get_dims(); std::swap(weiDims[weiDims.size() - 1], weiDims[weiDims.size() - 2]); @@ -175,7 +203,9 @@ static dnnl::matmul::primitive_desc createDescriptorInternal(const dnnl::memory: auto idt = inputDesc.get_data_type(); auto wdt = idt; - if (idt == dnnl::memory::data_type::u8 || idt == dnnl::memory::data_type::s8) { + if (useWeightsDecompression) { + wdt = weightDesc.get_data_type(); + } else if (idt == dnnl::memory::data_type::u8 || idt == dnnl::memory::data_type::s8) { wdt = memory::data_type::s8; } @@ -245,6 +275,16 @@ static VectorDims makeDummyOutputDims(const VectorDims& inShape, const VectorDim return outputShape; } +bool DnnlMatMulPrimitive::useWeightsDecompressionImpl(const ov::element::Type inputType, + const ov::element::Type weightsType) { +#if defined(OPENVINO_ARCH_X86_64) + if (!dnnl::impl::cpu::x64::mayiuse(dnnl::impl::cpu::x64::avx2)) + return false; +#endif + + return (one_of(inputType, f32, bf16, f16) && one_of(weightsType, u8, i8, u4, i4)); +} + DnnlShapeAgnosticDataPtr DnnlMatMulPrimitive::createShapeAgnosticData(const FCAttrs& attrs, const PostOps& postOps, const MemoryArgs& memory, @@ -257,7 +297,9 @@ DnnlShapeAgnosticDataPtr DnnlMatMulPrimitive::createShapeAgnosticData(const FCAt auto dstDesc = memory.at(ARG_DST)->getDescPtr(); MatMulAttrs mmAttrs{false, false}; - const auto postOpData = createPrimitiveAttrs(mmAttrs, postOps, memory, context, false); + const auto useWeightsDecompression = useWeightsDecompressionImpl(srcDesc->getPrecision(), weiDesc->getPrecision()); + const auto postOpData = + createPrimitiveAttrs(mmAttrs, postOps, memory, context, useWeightsDecompression, attrs.weightsNonTransposed); if (!cacheWeights) return std::make_shared(postOpData); @@ -285,7 +327,7 @@ DnnlShapeAgnosticDataPtr DnnlMatMulPrimitive::createShapeAgnosticData(const FCAt context->getEngine(), context->getImplPriorities(), false, - false); + useWeightsDecompression); const auto weightsDesc = DnnlExtensionUtils::makeDescriptor(primDesc.weights_desc()); auto originalWeightsDesc = MemoryDescUtils::convertToDnnlMemoryDesc(weiDesc); @@ -319,7 +361,7 @@ DnnlMatMulPrimitive::DnnlMatMulPrimitive(const Key& key, engine, implPriorities, false, - false)), + useWeightsDecompressionImpl(key.src->getPrecision(), key.wei->getPrecision()))), m_implType(implTypeFromPrimDesc(m_primDesc)), m_srcDesc(DnnlExtensionUtils::makeDescriptor(m_primDesc.src_desc())), m_weiDesc(DnnlExtensionUtils::makeDescriptor(m_primDesc.weights_desc())), @@ -328,8 +370,6 @@ DnnlMatMulPrimitive::DnnlMatMulPrimitive(const Key& key, m_prim(primitive(m_primDesc)) {} void DnnlMatMulPrimitive::execute(const dnnl_primitive_args& primArgs) const { - std::cout << "Executing MM primitive" - << "\n"; m_prim.execute(m_stream, primArgs); } diff --git a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.hpp b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.hpp index 618d3abdf8b3de..5491b62a154687 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.hpp +++ b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_matmul_primitive.hpp @@ -53,6 +53,8 @@ class DnnlMatMulPrimitive { return m_implType; } + static bool useWeightsDecompressionImpl(const ov::element::Type inputType, const ov::element::Type weightsType); + static DnnlShapeAgnosticDataPtr createShapeAgnosticData(const FCAttrs& attrs, const PostOps& postOps, const MemoryArgs& memory, 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 bc55af8cfbb0e2..f2cf5a7c9102b7 100644 --- a/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp +++ b/src/plugins/intel_cpu/src/nodes/executors/fullyconnected_implementations.cpp @@ -133,6 +133,8 @@ static const TypeMapping dnnlMatMulTypeMapping { // quantization configuration {{_u8 | _i8, _i8, _u8|_i8|_i32|_bf16|_f16|_f32|_undefined, _u8|_i8|_i32|_bf16|_f16|_f32}, pt(bypass(), bypass(), bypass(), bypass())}, {{_u8 | _i8, _i8, _any, _any}, pt(bypass(), bypass(), just(), just())}, + // compresses int weights + {{_f32 | _bf16 | _f16, _u8 | _i8, _any, _any}, pt(bypass(), bypass(), use<0>(), use<0>())}, // @todo should we fallback to FPXX instead of _f32? {{_any, _any, _any, _any}, pt(just(), just(), just(), just())}, // @todo explicitly cover configuration limitations for oneDNN on ARM @@ -443,7 +445,7 @@ const std::vector>& getImplementations() { return std::make_shared(attrs, postOps, memory, context); } ) - OV_CPU_INSTANCE_X64( + OV_CPU_INSTANCE_DNNL( "matmul_dnnl", ExecutorType::Dnnl, OperationType::MatMul, @@ -454,7 +456,6 @@ const std::vector>& getImplementations() { CPU_DEBUG_CAP_ENABLE( if (getEnvBool("OV_CPU_ENABLE_DNNL_MAMTUL_FOR_FC")) { VERIFY(noSparseDecompression(config), UNSUPPORTED_SPARSE_WEIGHTS); - VERIFY(noWeightsDecompression(config), UNSUPPORTED_WEIGHTS_DECOMPRESSION); return true; }) return false; diff --git a/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp b/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp index 2df6c0ae7522cc..4a2e3728887087 100644 --- a/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp +++ b/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp @@ -41,6 +41,42 @@ namespace ov { namespace intel_cpu { namespace node { +ov::element::TypeVector FullyConnected::getSupportedCompressedWeightsTypes() { + using ov::element::Type_t; + + bool useMatmulPrim = false; + CPU_DEBUG_CAP_ENABLE(useMatmulPrim = getEnvBool("OV_CPU_ENABLE_DNNL_MAMTUL_FOR_FC");) + + if (useMatmulPrim) { + return {Type_t::u8, Type_t::i8}; + } else { +#if defined(OPENVINO_ARCH_X86_64) + return {Type_t::u8, Type_t::i8, Type_t::u4, Type_t::i4, Type_t::nf4, Type_t::f4e2m1}; +#else + return {}; +#endif + } +} + +ov::element::TypeVector FullyConnected::getSupportedCompressedActivationsTypes() { + using ov::element::Type_t; + + bool useMatmulPrim = false; + CPU_DEBUG_CAP_ENABLE(useMatmulPrim = getEnvBool("OV_CPU_ENABLE_DNNL_MAMTUL_FOR_FC");) + + if (useMatmulPrim) { + return {Type_t::f32, Type_t::f16}; + } else { +#if defined(OPENVINO_ARCH_X86_64) + // @todo enable for bf16 as well + // after EnforceInferencePrecision is replaced with ConvertPrecision + return {Type_t::f32}; +#else + return {}; +#endif + } +} + bool FullyConnected::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { try { @@ -113,7 +149,9 @@ bool FullyConnected::isSupportedCompressedOperation(const std::shared_ptr& model, const C CPU_REGISTER_PASS_COMMON(manager, ConvertMatMulToFC); CPU_REGISTER_PASS_COMMON(manager, FullyConnectedBiasFusion); - std::vector supported_activation_types{ - // @todo enable for bf16 as well - // after EnforceInferencePrecision is replaced with ConvertPrecision - ov::element::f32, - }; - - std::vector supported_compressed_weights_types{ - ov::element::u8, - ov::element::i8, - ov::element::u4, - ov::element::i4, - ov::element::nf4, - ov::element::f4e2m1, - }; - - CPU_REGISTER_PASS_X64( + CPU_REGISTER_PASS_COMMON( manager, pass::ConvertFullyConnectedToFullyConnectedCompressed, - supported_activation_types, - supported_compressed_weights_types, + ov::intel_cpu::node::FullyConnected::getSupportedCompressedActivationsTypes(), + ov::intel_cpu::node::FullyConnected::getSupportedCompressedWeightsTypes(), [&config](const std::shared_ptr& fc, size_t IC, size_t OC, size_t G) { return ov::intel_cpu::node::FullyConnected::isSupportedCompressedOperation(fc, IC, @@ -65,8 +50,8 @@ inline void ConvertToCPUSpecificOpset(std::shared_ptr& model, const C }); CPU_REGISTER_PASS_X64(manager, pass::ConvertFCToFCQuantizedLegacy); - CPU_REGISTER_PASS_X64(manager, MoveFCReshapeToWeights); - CPU_REGISTER_PASS_X64(manager, ov::pass::Validate); + CPU_REGISTER_PASS_COMMON(manager, MoveFCReshapeToWeights); + CPU_REGISTER_PASS_COMMON(manager, ov::pass::Validate); CPU_REGISTER_PASS_COMMON(manager, AlignMatMulInputRanks); CPU_REGISTER_PASS_COMMON(manager, ConvertTileToSeqTiles); CPU_REGISTER_PASS_COMMON(manager, ConvertToPowerStatic); diff --git a/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.cpp b/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.cpp index 25b10d55ca8165..c567e7c38c2ef1 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.cpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.cpp @@ -212,6 +212,13 @@ auto is_skipped_op(const std::shared_ptr& op) -> bool { return ov::is_type(op) || ov::is_type(op) || ov::is_type(op); } + +bool isSuitableMatMulWithConstantPath(const std::shared_ptr& node) { + return ov::is_type(node) && + !ov::is_type(node->get_input_node_shared_ptr(1)) && + ov::op::util::is_on_constant_path(node->input_value(1)); +} + } // namespace bool SnippetsMarkSkipped::run_on_model(const std::shared_ptr& m) { @@ -220,6 +227,15 @@ bool SnippetsMarkSkipped::run_on_model(const std::shared_ptr& m) { for (auto& node : m->get_ordered_ops()) { if (is_skipped_op(node)) continue; + // We perform this check separately because we mark here only weights path + // Matmul itself will be checked further + if (isSuitableMatMulWithConstantPath(node)) { + auto markup_func = [](Node* node) { + SetSnippetsNodeType(node->shared_from_this(), snippets::pass::SnippetsNodeType::SkippedByPlugin); + }; + std::unordered_set visited; + ov::op::util::visit_constant_path(node->get_input_node_ptr(1), visited, markup_func); + } if (isSuitableConvolutionParent(node)) { // Initiate fusing chain SetNodeFusingType(node, NodeFusingType::FusedWithConvolution); diff --git a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp index 469abbd99eb149..13e890f6339e81 100644 --- a/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp +++ b/src/plugins/intel_cpu/src/transformations/transformation_pipeline.cpp @@ -337,19 +337,14 @@ void Transformations::PreLpt(const std::vector& defaultPrecis CPU_REGISTER_PASS_COMMON(decompression_handling_manager, ov::pass::MarkShapeOfSubgraphs); // We need to fuse Transpose to MatMul to have a simpler callback for the next transformation CPU_REGISTER_PASS_X64(decompression_handling_manager, ov::pass::TransposeMatMul); - ov::element::TypeVector decompression_precisions{ov::element::u8, - ov::element::i8, - ov::element::u4, - ov::element::i4, - ov::element::nf4, - ov::element::f4e2m1}; - - CPU_REGISTER_PASS_X64(decompression_handling_manager, - ov::pass::MarkDequantization, - decompression_precisions, - false, - true); - CPU_SET_CALLBACK_X64( + CPU_REGISTER_PASS_ARM(decompression_handling_manager, ov::pass::TransposeMatMul); + const auto& decompression_precisions = ov::intel_cpu::node::FullyConnected::getSupportedCompressedWeightsTypes(); + CPU_REGISTER_PASS_COMMON(decompression_handling_manager, + ov::pass::MarkDequantization, + decompression_precisions, + false, + true); + CPU_SET_CALLBACK_COMMON( decompression_handling_manager, [&](const_node_ptr& node) -> bool { return !is_decompression_multiply(node); diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/arm/matmul_weights_decompression.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/arm/matmul_weights_decompression.cpp new file mode 100644 index 00000000000000..408dd40b4c658f --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/arm/matmul_weights_decompression.cpp @@ -0,0 +1,86 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp" + +#include "openvino/util/env_util.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { + +namespace { + +std::vector filter_additional_config_basic() { + return {{}, {ov::hint::inference_precision(ov::element::f16)}}; +} + +const std::vector decompression_precisions = {ov::element::f32}; +const std::vector weights_precisions = {ov::element::u8, ov::element::i8}; + +bool should_use_decompression_impl() { +#ifdef CPU_DEBUG_CAPS + return ov::util::getenv_bool("OV_CPU_ENABLE_DNNL_MAMTUL_FOR_FC"); +#else + return false; +#endif +} + +const std::vector input_shapes = { + {{{-1, -1, -1}, {{1, 4, 16}, {10, 16, 16}}}, {16, 32}}, + {{{}, {{1, 8, 16}}}, {16, 32}, 4ul}, + {{{}, {{1, 4, 16}}}, {1, 16, 32}}, + {{{}, {{5, 40, 96}}}, {1, 96, 240}}, + {{{}, {{1, 4, 48}}}, {48, 256}}, + {{{}, {{1, 11, 104}}}, {104, 77}, 104ul}, + {{{-1, -1, -1}, {{10, 40, 110}, {11, 40, 110}}}, {1, 110, 256}}, +}; +const std::vector fusing_params{emptyFusingSpec, fusingBias}; + +INSTANTIATE_TEST_SUITE_P(smoke_MatMulCompressedWeights, + MatmulWeightsDecompression, + ::testing::Combine(::testing::ValuesIn(input_shapes), + ::testing::ValuesIn(weights_precisions), + ::testing::ValuesIn(decompression_precisions), + ::testing::Values(ov::element::undefined), + ::testing::Values(true), + ::testing::Values(DecompressionSubtractType::full), + ::testing::Values(false), + ::testing::ValuesIn(filter_additional_config_basic()), + ::testing::ValuesIn(fusing_params), + ::testing::Values(should_use_decompression_impl())), + MatmulWeightsDecompression::getTestCaseName); + +const std::vector input_shapes_corner_cases = { + {{{-1, -1, -1}, {{1, 4, 16}}}, {1, 16, 32}}, + {{{-1, -1, -1}, {{1, 4, 16}}}, {16, 32}}, + {{{-1, -1, -1}, {{1, 5, 16}}}, {16, 32}, 4ul}, + {{{-1, -1, -1}, {{1, 1, 128}}}, {128, 128}, 16ul}, +}; + +const std::vector transpose_weights = {true, false}; +const std::vector decompression_subtract_type = {DecompressionSubtractType::full, + DecompressionSubtractType::scalar, + DecompressionSubtractType::empty}; +const std::vector reshape_on_decompression = {true, false}; +const std::vector decompression_precisions_corner_cases = {ov::element::f16, ov::element::f32}; + +INSTANTIATE_TEST_SUITE_P(smoke_MatMulCompressedWeights_corner_cases, + MatmulWeightsDecompression, + ::testing::Combine(::testing::ValuesIn(input_shapes_corner_cases), + ::testing::ValuesIn(weights_precisions), + ::testing::ValuesIn(decompression_precisions_corner_cases), + ::testing::Values(ov::element::undefined), + ::testing::ValuesIn(transpose_weights), + ::testing::ValuesIn(decompression_subtract_type), + ::testing::ValuesIn(reshape_on_decompression), + ::testing::ValuesIn(filter_additional_config_basic()), + ::testing::Values(emptyFusingSpec), + ::testing::Values(should_use_decompression_impl())), + MatmulWeightsDecompression::getTestCaseName); + +} // namespace +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.cpp new file mode 100644 index 00000000000000..e14245f2906e16 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.cpp @@ -0,0 +1,167 @@ +// Copyright (C) 2023-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "matmul_weights_decompression.hpp" +#include "openvino/runtime/intel_cpu/properties.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { + +std::string MatmulWeightsDecompression::getTestCaseName(testing::TestParamInfo obj) { + MatMulDecompressionShapeParams shape_params; + ov::test::ElementType weights_precision; + ov::test::ElementType decompression_precision; + ov::test::ElementType scale_precision; + bool transpose; + DecompressionSubtractType decompression_subtract_type; + bool reshape_on_decompression; + ov::AnyMap additional_config; + fusingSpecificParams fusing_params; + bool should_fuse; + + std::tie(shape_params, + weights_precision, + decompression_precision, + scale_precision, + transpose, + decompression_subtract_type, + reshape_on_decompression, + additional_config, + fusing_params, + should_fuse) = obj.param; + + std::ostringstream result; + result << shape_params << "_"; + result << "weights_precision=" << weights_precision << "_"; + result << "decompression_precision=" << decompression_precision << "_"; + result << "scale_precision=" << scale_precision << "_"; + result << "transpose_weights=" << transpose << "_"; + result << "decompression_subtract=" << decompression_subtract_type << "_"; + result << "reshape_on_decompression=" << reshape_on_decompression << "_"; + + result << "config=("; + for (const auto& configEntry : additional_config) { + result << configEntry.first << ", " << configEntry.second.as() << "_"; + } + result << ")"; + result << CpuTestWithFusing::getTestCaseName(fusing_params); + + return result.str(); +} + +std::shared_ptr MatmulWeightsDecompression::initSubgraph(const ov::PartialShape& data_shape, + const ov::Shape& weights_shape, + const int group_size, + const ov::element::Type data_precision, + const ov::element::Type weights_precision, + const ov::element::Type decompression_precision, + const ov::element::Type scale_precision, + const bool transpose_weights, + const DecompressionSubtractType decompression_subtract_type, + const bool reshape_on_decompression) { + ov::ParameterVector params{std::make_shared(data_precision, data_shape)}; + const auto weights_subgraph = initMatMulDecompressionSubgraph(weights_shape, + group_size, + data_precision, + weights_precision, + decompression_precision, + scale_precision, + transpose_weights, + decompression_subtract_type, + reshape_on_decompression); + auto matMul = std::make_shared(params[0], weights_subgraph); + return makeNgraphFunction(data_precision, params, matMul, "MatmulWeightsDecompression"); +} + +void MatmulWeightsDecompression::SetUp() { + targetDevice = ov::test::utils::DEVICE_CPU; + + MatMulDecompressionShapeParams shape_params; + ov::test::ElementType weights_precision; + ov::test::ElementType decompression_precision; + ov::test::ElementType scale_precision; + bool transpose_weights; + DecompressionSubtractType decompression_subtract_type; + bool reshape_on_decompression; + ov::AnyMap additional_config; + fusingSpecificParams fusing_params; + bool should_fuse; + + std::tie(shape_params, + weights_precision, + decompression_precision, + scale_precision, + transpose_weights, + decompression_subtract_type, + reshape_on_decompression, + additional_config, + fusing_params, + should_fuse) = GetParam(); + + configuration.insert(additional_config.begin(), additional_config.end()); + std::tie(postOpMgrPtr, fusedOps) = fusing_params; + init_input_shapes({shape_params.data_shape}); + + if (!configuration.count(ov::hint::dynamic_quantization_group_size.name())) { + abs_threshold = 5e-3; + } + + // if dynamic quantization is enabled + if (configuration.count(ov::hint::dynamic_quantization_group_size.name()) && + configuration.at(ov::hint::dynamic_quantization_group_size.name()) != 0) { + abs_threshold = 0.1; + } + + if (configuration.count(ov::hint::inference_precision.name()) && + configuration.at(ov::hint::inference_precision.name()) == ov::element::f16) { + abs_threshold = 0.2; + } + + ElementType netType = ov::element::f32; + inType = outType = netType; + + function = initSubgraph(inputDynamicShapes[0], + shape_params.weights_shape, + shape_params.decompression_group_size, + netType, + weights_precision, + decompression_precision, + scale_precision, + transpose_weights, + decompression_subtract_type, + reshape_on_decompression); +} + +void MatmulWeightsDecompression::check_results() { + const auto& test_param = GetParam(); + const ov::element::Type compressed_weights_precision = std::get<1>(test_param); + const bool use_matmul_decompression_impl = std::get<9>(test_param); + + const auto runtime_model = compiledModel.get_runtime_model(); + const auto result = runtime_model->get_result(); + auto fc = result->get_input_node_shared_ptr(0); + // Handle precision conversion before output + auto type = fc->get_rt_info().at(ov::exec_model_info::LAYER_TYPE).as(); + if (type == "Reorder" || type == "Convert" || type == "Subgraph") + fc = fc->get_input_node_shared_ptr(0); + + type = fc->get_rt_info().at(ov::exec_model_info::LAYER_TYPE).as(); + EXPECT_EQ(type, "FullyConnected"); + + const auto& expected_weights_precision = use_matmul_decompression_impl + ? compressed_weights_precision + : fc->get_input_element_type(0); + EXPECT_EQ(fc->get_input_element_type(1), expected_weights_precision); +} + +TEST_P(MatmulWeightsDecompression, CompareWithRefs) { + SKIP_IF_CURRENT_TEST_IS_DISABLED() + run(); + check_results(); +} + +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp new file mode 100644 index 00000000000000..266aab8e445928 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp @@ -0,0 +1,79 @@ +// Copyright (C) 2018-2024 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "common_test_utils/ov_tensor_utils.hpp" +#include "shared_test_classes/base/ov_subgraph.hpp" +#include "shared_test_classes/subgraph/weights_decompression_builders.hpp" +#include "utils/cpu_test_utils.hpp" +#include "utils/fusing_test_utils.hpp" + +using namespace CPUTestUtils; + +namespace ov { +namespace test { + +/* + * WP - weights precision + * DP - decompression precision + * IP - input precision + * SP - scale precision + * Opt - optional + * Subtract_const(WP) + * / + * Weights(WP) Convert(DP) + * | / Multiply_const(SP) + * Convert(DP) Reshape (Opt) / + * \ / Convert(if SP != DP) + * Subtract(Opt) / + * \ Reshape (Opt) + * \ / + * Multiply + * | + * Reshape (in case of group decompression) + * | + * Convert (if IP != DP) + * | + * Data(IP) Transpose(Opt) + * \ / + * Matmul + * | + * Bias + */ +typedef std::tuple // should use decompression implementation + MatmulWeightsDecompressionParams; + +class MatmulWeightsDecompression : public testing::WithParamInterface, + virtual public SubgraphBaseTest, + public CpuTestWithFusing { +public: + static std::string getTestCaseName(testing::TestParamInfo obj); + +protected: + std::shared_ptr initSubgraph(const ov::PartialShape& data_shape, + const ov::Shape& weights_shape, + const int group_size, + const ov::element::Type data_precision, + const ov::element::Type weights_precision, + const ov::element::Type decompression_precision, + const ov::element::Type scale_precision, + const bool transpose_weights, + const DecompressionSubtractType decompression_subtract_type, + const bool reshape_on_decompression); + + void SetUp() override; + + void check_results(); +}; + +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/matmul_weights_decompression.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/matmul_weights_decompression.cpp index 9a434943893eed..5a5a375566b955 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/matmul_weights_decompression.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/x64/matmul_weights_decompression.cpp @@ -1,200 +1,13 @@ -// Copyright (C) 2023-2024 Intel Corporation +// Copyright (C) 2018-2024 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // -#include "shared_test_classes/base/ov_subgraph.hpp" -#include "utils/fusing_test_utils.hpp" -#include "openvino/runtime/intel_cpu/properties.hpp" -#include "shared_test_classes/subgraph/weights_decompression_builders.hpp" +#include "custom/subgraph_tests/src/classes/matmul_weights_decompression.hpp" using namespace CPUTestUtils; namespace ov { namespace test { -/* - * WP - weights precision - * DP - decompression precision - * IP - input precision - * SP - scale precision - * Opt - optional - * Subtract_const(WP) - * / - * Weights(WP) Convert(DP) - * | / Multiply_const(SP) - * Convert(DP) Reshape (Opt) / - * \ / Convert(if SP != DP) - * Subtract(Opt) / - * \ Reshape (Opt) - * \ / - * Multiply - * | - * Reshape (in case of group decompression) - * | - * Convert (if IP != DP) - * | - * Data(IP) Transpose(Opt) - * \ / - * Matmul - * | - * Bias - */ -using MatmulWeightsDecompressionParams = std::tuple; // should use decompression implementation - -class MatmulWeightsDecompression : public testing::WithParamInterface, - virtual public SubgraphBaseTest, - public CpuTestWithFusing { -public: - static std::string getTestCaseName(testing::TestParamInfo obj) { - MatMulDecompressionShapeParams shape_params; - ov::test::ElementType weights_precision; - ov::test::ElementType decompression_precision; - ov::test::ElementType scale_precision; - bool transpose; - DecompressionSubtractType decompression_subtract_type; - bool reshape_on_decompression; - ov::AnyMap additional_config; - fusingSpecificParams fusing_params; - bool should_fuse; - - std::tie(shape_params, - weights_precision, - decompression_precision, - scale_precision, - transpose, - decompression_subtract_type, - reshape_on_decompression, - additional_config, - fusing_params, - should_fuse) = obj.param; - - std::ostringstream result; - result << shape_params << "_"; - result << "weights_precision=" << weights_precision << "_"; - result << "decompression_precision=" << decompression_precision << "_"; - result << "scale_precision=" << scale_precision << "_"; - result << "transpose_weights=" << transpose << "_"; - result << "decompression_subtract=" << decompression_subtract_type << "_"; - result << "reshape_on_decompression=" << reshape_on_decompression << "_"; - - result << "config=("; - for (const auto& configEntry : additional_config) { - result << configEntry.first << ", " << configEntry.second.as() << "_"; - } - result << ")"; - result << CpuTestWithFusing::getTestCaseName(fusing_params); - - return result.str(); - } - -protected: - std::shared_ptr initSubgraph(const ov::PartialShape& data_shape, - const ov::Shape& weights_shape, - const int group_size, - const ov::element::Type data_precision, - const ov::element::Type weights_precision, - const ov::element::Type decompression_precision, - const ov::element::Type scale_precision, - const bool transpose_weights, - const DecompressionSubtractType decompression_subtract_type, - const bool reshape_on_decompression) { - ov::ParameterVector params{std::make_shared(data_precision, data_shape)}; - const auto weights_subgraph = initMatMulDecompressionSubgraph(weights_shape, - group_size, - data_precision, - weights_precision, - decompression_precision, - scale_precision, - transpose_weights, - decompression_subtract_type, - reshape_on_decompression); - auto matMul = std::make_shared(params[0], weights_subgraph); - return makeNgraphFunction(data_precision, params, matMul, "MatmulWeightsDecompression"); - } - - void SetUp() override { - targetDevice = ov::test::utils::DEVICE_CPU; - - MatMulDecompressionShapeParams shape_params; - ov::test::ElementType weights_precision; - ov::test::ElementType decompression_precision; - ov::test::ElementType scale_precision; - bool transpose_weights; - DecompressionSubtractType decompression_subtract_type; - bool reshape_on_decompression; - ov::AnyMap additional_config; - fusingSpecificParams fusing_params; - bool should_fuse; - - std::tie(shape_params, - weights_precision, - decompression_precision, - scale_precision, - transpose_weights, - decompression_subtract_type, - reshape_on_decompression, - additional_config, - fusing_params, - should_fuse) = GetParam(); - - configuration.insert(additional_config.begin(), additional_config.end()); - std::tie(postOpMgrPtr, fusedOps) = fusing_params; - init_input_shapes({shape_params.data_shape}); - - // if dynamic quantization is enabled - if (configuration.count(ov::hint::dynamic_quantization_group_size.name()) && - configuration.at(ov::hint::dynamic_quantization_group_size.name()) != 0) { - abs_threshold = 0.1; - } else if (!configuration.count(ov::hint::dynamic_quantization_group_size.name())) { - abs_threshold = 5e-3; - } - - ElementType netType = ov::element::f32; - inType = outType = netType; - - function = initSubgraph(inputDynamicShapes[0], - shape_params.weights_shape, - shape_params.decompression_group_size, - netType, - weights_precision, - decompression_precision, - scale_precision, - transpose_weights, - decompression_subtract_type, - reshape_on_decompression); - } - - void check_results() { - const auto& test_param = GetParam(); - const ov::element::Type compressed_weights_precision = std::get<1>(test_param); - const bool use_matmul_decompression_impl = std::get<9>(test_param); - - const auto runtime_model = compiledModel.get_runtime_model(); - const auto result = runtime_model->get_result(); - const auto fc = result->get_input_node_shared_ptr(0); - const auto type = fc->get_rt_info().at(ov::exec_model_info::LAYER_TYPE).as(); - EXPECT_EQ(type, "FullyConnected"); - - const auto& expected_weights_precision = use_matmul_decompression_impl - ? compressed_weights_precision - : fc->get_input_element_type(0); - EXPECT_EQ(fc->get_input_element_type(1), expected_weights_precision); - } -}; - -TEST_P(MatmulWeightsDecompression, CompareWithRefs) { - SKIP_IF_CURRENT_TEST_IS_DISABLED() - run(); - check_results(); -} namespace { @@ -205,7 +18,8 @@ std::vector filter_additional_config_basic() { std::vector filter_additional_config_amx() { std::vector additional_config = {}; if (ov::with_cpu_x86_avx512_core_amx()) - additional_config.push_back({{ov::hint::dynamic_quantization_group_size(0), ov::hint::inference_precision(ov::element::bf16)}}); + additional_config.push_back( + {{ov::hint::dynamic_quantization_group_size(0), ov::hint::inference_precision(ov::element::bf16)}}); return additional_config; } @@ -310,8 +124,9 @@ const std::vector input_shapes_corner_cases_amx }; const std::vector transpose_weights = {true, false}; -const std::vector decompression_subtract_type = { - DecompressionSubtractType::full, DecompressionSubtractType::scalar, DecompressionSubtractType::empty}; +const std::vector decompression_subtract_type = {DecompressionSubtractType::full, + DecompressionSubtractType::scalar, + DecompressionSubtractType::empty}; const std::vector reshape_on_decompression = {true, false}; const std::vector decompression_precisions_corner_cases = {ov::element::f16, ov::element::f32}; @@ -387,12 +202,11 @@ const std::vector input_shapes_basic_dyn_quant = {{{}, {{1, 1, 1728}}}, {1728, 128}, 64lu}, }; -const std::vector weights_precisions_dyn_quant = {ov::element::u8, - ov::element::u4}; +const std::vector weights_precisions_dyn_quant = {ov::element::u8, ov::element::u4}; std::vector filter_additional_config_dyn_quant() { std::vector additional_config = { - {{ov::hint::dynamic_quantization_group_size(0)}}, // dynamic quantization is disabled + {{ov::hint::dynamic_quantization_group_size(0)}}, // dynamic quantization is disabled {{ov::hint::dynamic_quantization_group_size(16)}}, {{ov::hint::dynamic_quantization_group_size(128)}}, }; 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 4c21c06c491179..7af707df602bfc 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 @@ -481,7 +481,6 @@ std::vector disabledTestPatterns() { // Issue 88764, 91647, 108802: accuracy issue retVector.emplace_back(R"(MultipleLSTMCellTest/MultipleLSTMCellTest.CompareWithRefs.*)"); // Compressed weights are not supported - retVector.emplace_back(R"(smoke_MatMulCompressedWeights.*)"); retVector.emplace_back(R"(smoke_MatMulSharedCompressedWeights.*)"); retVector.emplace_back(R"(smoke_MatmulAndGatherSharedWeightsDecompression.*)"); // smoke_Snippets test cases are not supported on arm32 platforms From 83a55dfb79e6410af835cbca6685283037c254bc Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Thu, 19 Dec 2024 17:46:58 +0100 Subject: [PATCH 4/5] [RTTI] Apply OPENVINO_MATCHER_PASS_RTTI in Plugins (#28124) ### Details: - Applied OPENVINO_MATCHER_PASS_RTTI helper macro in Plugins. ### Tickets: - CVS-159567 --------- Signed-off-by: Tomasz Jankowski Co-authored-by: Michal Lukaszewski --- .../cpu_opset/arm/pass/convert_group_conv.hpp | 2 +- .../arm/pass/convert_group_conv1d.hpp | 4 ++-- .../arm/pass/convert_reduce_multi_axis.hpp | 2 +- .../arm/pass/convert_reduce_no_keep_dims.hpp | 2 +- .../cpu_opset/arm/pass/mish_decomposition.hpp | 2 +- .../common/pass/align_matmul_input_ranks.hpp | 2 +- .../pass/causal_mask_preprocess_fusion.cpp | 2 +- .../pass/convert_broadcast_to_tiles.hpp | 2 +- .../pass/convert_fq_rnn_to_quantized_rnn.hpp | 2 +- .../common/pass/convert_matmul_to_fc.hpp | 2 +- .../common/pass/convert_tile_to_seq_tiles.hpp | 2 +- .../common/pass/convert_to_leaky_relu.hpp | 2 +- .../common/pass/convert_to_power_static.hpp | 2 +- .../common/pass/convert_to_swish_cpu.hpp | 2 +- .../common/pass/decompose_integer_divide.hpp | 2 +- .../common/pass/decompose_rms_norm.hpp | 2 +- .../cpu_opset/common/pass/fc_bias_fusion.hpp | 2 +- .../pass/insert_convert_after_extension.hpp | 2 +- .../pass/move_fc_reshape_to_weights.hpp | 2 +- .../cpu_opset/common/pass/ngram_fusion.hpp | 2 +- .../pass/permute_slice_n_interpolation.hpp | 2 +- .../pass/rnn_sequences_optimization.hpp | 6 +++--- .../common/pass/stateful_sdpa_fusion.hpp | 2 +- .../common/pass/swap_convert_transpose.hpp | 1 + .../x64/pass/convert_to_interaction.hpp | 6 +++--- .../cpu_opset/x64/pass/mha_fusion.hpp | 3 +++ .../cpu_opset/x64/pass/mlp_fusion.hpp | 4 ++-- .../cpu_opset/x64/pass/qkv_proj_fusion.hpp | 6 +++--- .../x64/pass/sdpa_fuse_transpose_reshape.hpp | 2 +- .../snippets/common/pass/mul_add_to_fma.hpp | 1 + .../x64/pass/brgemm_to_brgemm_cpu.hpp | 2 +- .../x64/pass/eliminate_brgemm_copy_b.hpp | 2 +- .../snippets/x64/pass/remove_converts.hpp | 2 +- .../tpp/x64/pass/brgemm_to_brgemm_tpp.hpp | 2 +- .../tpp/x64/pass/eltwise_to_eltwise_tpp.hpp | 2 +- .../tpp/x64/pass/scalar_to_scalar_tpp.hpp | 2 +- .../bcast_and_pad_zp_buffers.hpp | 2 +- .../transformations/binary_conv_to_conv.hpp | 2 +- .../transformations/clamp_fp16_output.hpp | 2 +- .../transformations/convert_convolution.cpp | 4 ++-- .../convert_fc_to_compressed.hpp | 2 +- .../transformations/convert_matmul_to_fc.hpp | 2 +- .../convert_pooling_to_reduce.hpp | 2 +- .../transformations/convert_shapeof.hpp | 2 +- ...convert_stridedslices_to_variadicsplit.hpp | 2 +- .../decompose_reduce_for_false_keepdims.hpp | 2 ++ .../decompose_reduce_scalar_output.hpp | 2 +- .../dynamic_quantize_fully_connected.hpp | 2 +- .../transformations/einsum_decomposition.hpp | 1 + .../transformations/fc_convert_fusion.hpp | 2 +- .../transformations/fc_horizontal_fusion.hpp | 2 +- .../transformations/fc_per_layer_scaling.hpp | 2 +- .../group_norm_composition.hpp | 2 +- .../increase_position_ids_precision.hpp | 2 +- .../transformations/indirect_kv_cache.hpp | 4 ++-- .../transformations/kv_cache_compression.cpp | 2 +- .../transformations/kv_cache_fusion.cpp | 2 +- .../move_fc_reshape_to_weights.hpp | 2 +- .../optimize_subsequent_reshapes.hpp | 2 +- .../transformations/transpose_fusion.hpp | 6 +++--- ...queeze_broadcast_reshape_matmul_fusion.hpp | 2 +- ...nsqueeze_broadcast_reshape_sdpa_fusion.hpp | 2 +- .../npuw/partitioning/patterns/avoid.hpp | 1 + .../npuw/partitioning/patterns/compute.hpp | 8 +++++++ .../npuw/partitioning/patterns/dcoff.hpp | 16 ++++++++++++++ .../plugin/npuw/partitioning/patterns/opt.hpp | 21 +++++++++++++++++++ 66 files changed, 123 insertions(+), 69 deletions(-) diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv.hpp index 55c1ecde2aae10..3e9540f35f3273 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv.hpp @@ -61,7 +61,7 @@ namespace intel_cpu { class ConvertGroupConvolution : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertGroupConvolution", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertGroupConvolution"); ConvertGroupConvolution(); }; } // namespace intel_cpu diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv1d.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv1d.hpp index 5674514eeb8e64..7898833529294b 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv1d.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_group_conv1d.hpp @@ -54,7 +54,7 @@ namespace ov { namespace intel_cpu { class ConvertConv1DBase : public ov::pass::MatcherPass { protected: - OPENVINO_RTTI("ConvertConv1DBase", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertConv1DBase"); template ov::matcher_pass_callback convert_conv1d_to_conv2d(); }; @@ -71,4 +71,4 @@ class ConvertGroupConv1D : public ConvertConv1DBase { ConvertGroupConv1D(); }; } // namespace intel_cpu -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_multi_axis.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_multi_axis.hpp index 8e5fd1e38b605a..947d7ee476bc81 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_multi_axis.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_multi_axis.hpp @@ -51,7 +51,7 @@ namespace intel_cpu { class ConvertReduceMultiAxisBase : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertReduceMultiAxisBase", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertReduceMultiAxisBase"); template ov::matcher_pass_callback convert_reduce(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_no_keep_dims.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_no_keep_dims.hpp index ea4128ea265e42..6cc683154cc175 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_no_keep_dims.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/convert_reduce_no_keep_dims.hpp @@ -45,7 +45,7 @@ namespace intel_cpu { class ConvertReduceNoKeepDimsBase : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertReduceNoKeepDims", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertReduceNoKeepDimsBase"); template ov::matcher_pass_callback convert_reduce(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/mish_decomposition.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/mish_decomposition.hpp index 75b45dca468dc7..07384a8f1e24ca 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/mish_decomposition.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/arm/pass/mish_decomposition.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class MishDecomposition : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("MishDecomposition", "0"); + OPENVINO_MATCHER_PASS_RTTI("MishDecomposition"); MishDecomposition(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/align_matmul_input_ranks.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/align_matmul_input_ranks.hpp index f9ab862b19f4dd..9b9762ee5e525b 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/align_matmul_input_ranks.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/align_matmul_input_ranks.hpp @@ -19,7 +19,7 @@ namespace intel_cpu { class AlignMatMulInputRanks : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("AlignMatMulInputRanks", "0"); + OPENVINO_MATCHER_PASS_RTTI("AlignMatMulInputRanks"); AlignMatMulInputRanks(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/causal_mask_preprocess_fusion.cpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/causal_mask_preprocess_fusion.cpp index 5801dbb8ae74a9..5f3058429a8497 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/causal_mask_preprocess_fusion.cpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/causal_mask_preprocess_fusion.cpp @@ -24,7 +24,7 @@ using namespace ov::gen_pattern; class CausalMaskPreprocess : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("CausalMaskPreprocess", "0"); + OPENVINO_MATCHER_PASS_RTTI("CausalMaskPreprocess"); CausalMaskPreprocess(); private: diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_broadcast_to_tiles.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_broadcast_to_tiles.hpp index b0b1e5632f908a..e1b3307a13bdc4 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_broadcast_to_tiles.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_broadcast_to_tiles.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertBroadcastToTiles : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertBroadcastToTiles", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertBroadcastToTiles"); ConvertBroadcastToTiles(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_fq_rnn_to_quantized_rnn.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_fq_rnn_to_quantized_rnn.hpp index ee3692f2ea4ca6..a51a357197ef26 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_fq_rnn_to_quantized_rnn.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_fq_rnn_to_quantized_rnn.hpp @@ -76,7 +76,7 @@ namespace intel_cpu { class ConvertFqRnnToQuantizedRnn : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertFqRnnToQuantizedRnn", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertFqRnnToQuantizedRnn"); ConvertFqRnnToQuantizedRnn(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_matmul_to_fc.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_matmul_to_fc.hpp index 03366161f8c904..cf628a3497f3a5 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_matmul_to_fc.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_matmul_to_fc.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertMatMulToFC : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertMatMulToFC", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertMatMulToFC"); ConvertMatMulToFC(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_tile_to_seq_tiles.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_tile_to_seq_tiles.hpp index 5a4928477abec9..3760f2e000aee2 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_tile_to_seq_tiles.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_tile_to_seq_tiles.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertTileToSeqTiles : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertTileToSeqTiles", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertTileToSeqTiles"); ConvertTileToSeqTiles(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_leaky_relu.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_leaky_relu.hpp index b09f14de5793c5..40d4ed2907dbba 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_leaky_relu.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_leaky_relu.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertToLeakyRelu : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertToLeakyRelu", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertToLeakyRelu"); ConvertToLeakyRelu(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_power_static.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_power_static.hpp index d34a4c3667b5aa..3797eb780b3d13 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_power_static.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_power_static.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertToPowerStatic : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertToPowerStatic", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertToPowerStatic"); ConvertToPowerStatic(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_swish_cpu.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_swish_cpu.hpp index 3fe3569a13e745..3a640410db472b 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_swish_cpu.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/convert_to_swish_cpu.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class ConvertToSwishCPU : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertToSwishCPU", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertToSwishCPU"); ConvertToSwishCPU(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_integer_divide.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_integer_divide.hpp index 329febfcd21e92..ac7e2c2e72f68a 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_integer_divide.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_integer_divide.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class DecomposeIntegerDivide : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("DecomposeIntegerDivide", "0"); + OPENVINO_MATCHER_PASS_RTTI("DecomposeIntegerDivide"); DecomposeIntegerDivide(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_rms_norm.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_rms_norm.hpp index f11a3afa23d20c..4cc58841a77bb7 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_rms_norm.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/decompose_rms_norm.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class DecomposeRMSNorm : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("DecomposeRMSNorm", "0"); + OPENVINO_MATCHER_PASS_RTTI("DecomposeRMSNorm"); DecomposeRMSNorm(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/fc_bias_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/fc_bias_fusion.hpp index d1e64969fbcf4e..5fadd183dfd694 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/fc_bias_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/fc_bias_fusion.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class FullyConnectedBiasFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("FullyConnectedBiasFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("FullyConnectedBiasFusion"); FullyConnectedBiasFusion(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_after_extension.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_after_extension.hpp index 49cfab68bc6911..7c52d3614407fd 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_after_extension.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/insert_convert_after_extension.hpp @@ -14,7 +14,7 @@ namespace pass { class InsertConvertAfterExtension : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("InsertConvertAfterExtension", "0"); + OPENVINO_MATCHER_PASS_RTTI("InsertConvertAfterExtension"); InsertConvertAfterExtension(bool convert_output_precision = true); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/move_fc_reshape_to_weights.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/move_fc_reshape_to_weights.hpp index 0af0469ce0135e..d3869ff7509fae 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/move_fc_reshape_to_weights.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/move_fc_reshape_to_weights.hpp @@ -25,7 +25,7 @@ namespace intel_cpu { */ class MoveFCReshapeToWeights : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("MoveFCReshapeToWeights", "0"); + OPENVINO_MATCHER_PASS_RTTI("MoveFCReshapeToWeights"); MoveFCReshapeToWeights(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/ngram_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/ngram_fusion.hpp index a90487391b32ac..7a3aa4b3432318 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/ngram_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/ngram_fusion.hpp @@ -11,7 +11,7 @@ namespace intel_cpu { class NgramFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("NgramFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("NgramFusion"); NgramFusion(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/permute_slice_n_interpolation.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/permute_slice_n_interpolation.hpp index bbca2449a473af..369ef8ccab92e3 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/permute_slice_n_interpolation.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/permute_slice_n_interpolation.hpp @@ -14,7 +14,7 @@ namespace intel_cpu { class PermuteSliceAndInterpolation : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("PermuteSliceAndInterpolation", "0"); + OPENVINO_MATCHER_PASS_RTTI("PermuteSliceAndInterpolation"); PermuteSliceAndInterpolation(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.hpp index d7bfd28f0db80d..a63a3dce8219c2 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/rnn_sequences_optimization.hpp @@ -11,19 +11,19 @@ namespace intel_cpu { class OptimizeGRUSequenceTransposes : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("OptimizeGRUSequenceTransposes", "0"); + OPENVINO_MATCHER_PASS_RTTI("OptimizeGRUSequenceTransposes"); OptimizeGRUSequenceTransposes(); }; class OptimizeLSTMSequenceTransposes : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("OptimizeLSTMSequenceTransposes", "0"); + OPENVINO_MATCHER_PASS_RTTI("OptimizeLSTMSequenceTransposes"); OptimizeLSTMSequenceTransposes(); }; class OptimizeRNNSequenceTransposes : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("OptimizeRNNSequenceTransposes", "0"); + OPENVINO_MATCHER_PASS_RTTI("OptimizeRNNSequenceTransposes"); OptimizeRNNSequenceTransposes(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.hpp index bc000eb0485cd2..96028402aa9f92 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/stateful_sdpa_fusion.hpp @@ -10,7 +10,7 @@ namespace ov { namespace intel_cpu { class StatefulSDPAFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("StatefulSDPAFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("StatefulSDPAFusion"); StatefulSDPAFusion(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/swap_convert_transpose.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/swap_convert_transpose.hpp index 747ca3482eaf0c..7c53d73104fc1d 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/swap_convert_transpose.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/common/pass/swap_convert_transpose.hpp @@ -11,6 +11,7 @@ namespace intel_cpu { class SwapConvertTranspose : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("SwapConvertTranspose"); SwapConvertTranspose(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/convert_to_interaction.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/convert_to_interaction.hpp index 9fee162128f3ab..d9ed8e298d18fe 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/convert_to_interaction.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/convert_to_interaction.hpp @@ -11,19 +11,19 @@ namespace intel_cpu { class ConvertToInteraction : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertToInteraction", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertToInteraction"); ConvertToInteraction(); }; class FuseFQtoInteraction : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("FuseFQtoInteraction", "0"); + OPENVINO_MATCHER_PASS_RTTI("FuseFQtoInteraction"); FuseFQtoInteraction(); }; class ConvertInteractionInt8 : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertInteractionInt8", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertInteractionInt8"); ConvertInteractionInt8(); }; diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mha_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mha_fusion.hpp index 9273220c4a0a0c..fe4f4ccae04f1c 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mha_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mha_fusion.hpp @@ -11,6 +11,9 @@ namespace ov { namespace intel_cpu { class MHAFusionBase : public ov::pass::MatcherPass { +public: + OPENVINO_MATCHER_PASS_RTTI("MHAFusionBase"); + protected: bool valid_transpose_order(const std::shared_ptr& node, const std::vector& expected_order) { if (auto transpose_pattern = ov::as_type_ptr(node)) { diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mlp_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mlp_fusion.hpp index 5754d0fa9b622f..139aaaa488a1cb 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mlp_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/mlp_fusion.hpp @@ -11,9 +11,9 @@ namespace intel_cpu { class MLPFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("MLPFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("MLPFusion"); MLPFusion(); }; } // namespace intel_cpu -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/qkv_proj_fusion.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/qkv_proj_fusion.hpp index bfaf42f1f0acd3..e5b1743a68f7e6 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/qkv_proj_fusion.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/qkv_proj_fusion.hpp @@ -11,15 +11,15 @@ namespace intel_cpu { class QKVProjFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("QKVProjFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("QKVProjFusion"); QKVProjFusion(); }; class QKVProjFusion2 : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("QKVProjFusion2", "0"); + OPENVINO_MATCHER_PASS_RTTI("QKVProjFusion2"); QKVProjFusion2(); }; } // namespace intel_cpu -} // namespace ov \ No newline at end of file +} // namespace ov diff --git a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/sdpa_fuse_transpose_reshape.hpp b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/sdpa_fuse_transpose_reshape.hpp index d2bb84893c0728..ebba0a3ec9e185 100644 --- a/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/sdpa_fuse_transpose_reshape.hpp +++ b/src/plugins/intel_cpu/src/transformations/cpu_opset/x64/pass/sdpa_fuse_transpose_reshape.hpp @@ -10,7 +10,7 @@ namespace ov { namespace intel_cpu { class SDPAFuseTransposeReshape : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("SDPAFuseTransposeReshape", "0"); + OPENVINO_MATCHER_PASS_RTTI("SDPAFuseTransposeReshape"); SDPAFuseTransposeReshape(); }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/common/pass/mul_add_to_fma.hpp b/src/plugins/intel_cpu/src/transformations/snippets/common/pass/mul_add_to_fma.hpp index 57cf48283e4552..b171e861b23cba 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/common/pass/mul_add_to_fma.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/common/pass/mul_add_to_fma.hpp @@ -17,6 +17,7 @@ namespace pass { */ class MulAddToFMA : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("MulAddToFMA"); MulAddToFMA(); }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/brgemm_to_brgemm_cpu.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/brgemm_to_brgemm_cpu.hpp index 9475171b24f65d..245f83c13c3466 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/brgemm_to_brgemm_cpu.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/brgemm_to_brgemm_cpu.hpp @@ -34,7 +34,7 @@ namespace pass { */ class BrgemmToBrgemmCPU : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("BrgemmToBrgemmCPU", "0"); + OPENVINO_MATCHER_PASS_RTTI("BrgemmToBrgemmCPU"); BrgemmToBrgemmCPU(); }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/eliminate_brgemm_copy_b.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/eliminate_brgemm_copy_b.hpp index 89815eb1d6ffbf..c330bc9c922381 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/eliminate_brgemm_copy_b.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/eliminate_brgemm_copy_b.hpp @@ -20,7 +20,7 @@ namespace pass { */ class EliminateBrgemmCopyB : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("EliminateBrgemmCopyB", "0"); + OPENVINO_MATCHER_PASS_RTTI("EliminateBrgemmCopyB"); EliminateBrgemmCopyB(); }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/remove_converts.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/remove_converts.hpp index 000321a8918ccd..2c965871840572 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/remove_converts.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/remove_converts.hpp @@ -17,7 +17,7 @@ namespace pass { */ class RemoveConverts : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("RemoveConverts", "0"); + OPENVINO_MATCHER_PASS_RTTI("RemoveConverts"); RemoveConverts(); }; diff --git a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/brgemm_to_brgemm_tpp.hpp b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/brgemm_to_brgemm_tpp.hpp index 0fb26f6df1d6b2..2b73104d1e1335 100644 --- a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/brgemm_to_brgemm_tpp.hpp +++ b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/brgemm_to_brgemm_tpp.hpp @@ -18,7 +18,7 @@ namespace pass { */ class BrgemmToBrgemmTPP: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("BrgemmToBrgemmTPP", "0"); + OPENVINO_MATCHER_PASS_RTTI("BrgemmToBrgemmTPP"); BrgemmToBrgemmTPP(); static bool is_supported_brgemm_configuration(const std::vector>& layouts, diff --git a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/eltwise_to_eltwise_tpp.hpp b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/eltwise_to_eltwise_tpp.hpp index 189d048e86ffd7..f0bdab120c3498 100644 --- a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/eltwise_to_eltwise_tpp.hpp +++ b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/eltwise_to_eltwise_tpp.hpp @@ -18,7 +18,7 @@ namespace pass { */ class EltwiseToEltwiseTPP: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("EltwiseToEltwiseTPP", "0"); + OPENVINO_MATCHER_PASS_RTTI("EltwiseToEltwiseTPP"); EltwiseToEltwiseTPP(); }; diff --git a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/scalar_to_scalar_tpp.hpp b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/scalar_to_scalar_tpp.hpp index 8bbfcf80c751ac..a56e23363067e2 100644 --- a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/scalar_to_scalar_tpp.hpp +++ b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/scalar_to_scalar_tpp.hpp @@ -18,7 +18,7 @@ namespace pass { */ class ScalarToScalarTPP: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ScalarToScalarTPP", "0"); + OPENVINO_MATCHER_PASS_RTTI("ScalarToScalarTPP"); ScalarToScalarTPP(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/bcast_and_pad_zp_buffers.hpp b/src/plugins/intel_gpu/src/plugin/transformations/bcast_and_pad_zp_buffers.hpp index 1a869b8afbddf2..1fab1692d97cbe 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/bcast_and_pad_zp_buffers.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/bcast_and_pad_zp_buffers.hpp @@ -13,7 +13,7 @@ namespace intel_gpu { // and adds optional padding to align elements count to `alignment` value class BroadcastAndPadZeroPointBuffers : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("BroadcastAndPadZeroPointBuffers", "0"); + OPENVINO_MATCHER_PASS_RTTI("BroadcastAndPadZeroPointBuffers"); BroadcastAndPadZeroPointBuffers(size_t alignment = 1, bool supports_immad = false); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/binary_conv_to_conv.hpp b/src/plugins/intel_gpu/src/plugin/transformations/binary_conv_to_conv.hpp index 90d62a8e7a1fa5..bf372ae19c1553 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/binary_conv_to_conv.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/binary_conv_to_conv.hpp @@ -11,7 +11,7 @@ namespace intel_gpu { class ConvertBinaryConvolutionToConvolution: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ConvertBinaryConvolutionToConvolution", "0"); + OPENVINO_MATCHER_PASS_RTTI("ConvertBinaryConvolutionToConvolution"); ConvertBinaryConvolutionToConvolution(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/clamp_fp16_output.hpp b/src/plugins/intel_gpu/src/plugin/transformations/clamp_fp16_output.hpp index ac93d446ee749d..bea51c2e768576 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/clamp_fp16_output.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/clamp_fp16_output.hpp @@ -18,7 +18,7 @@ namespace intel_gpu { */ class ClampFP16Output: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("ov::intel_gpu::ClampFP16Output"); + OPENVINO_MATCHER_PASS_RTTI("ov::intel_gpu::ClampFP16Output"); ClampFP16Output(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.cpp b/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.cpp index 656b4c6fd99c20..0d23eb49829217 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.cpp @@ -102,13 +102,13 @@ ov::Tensor get_compensation(std::shared_ptr w, std::shared_ptr class KVCacheCompressionMatcher : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("KVCacheCompressionMatcher", "0"); + OPENVINO_MATCHER_PASS_RTTI("KVCacheCompressionMatcher"); KVCacheCompressionMatcher(ov::element::Type compression_dt); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/kv_cache_fusion.cpp b/src/plugins/intel_gpu/src/plugin/transformations/kv_cache_fusion.cpp index 8be42a1311094b..f22b32b23ea407 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/kv_cache_fusion.cpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/kv_cache_fusion.cpp @@ -30,7 +30,7 @@ namespace intel_gpu { class KVCacheFusionMatcher : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("KVCacheFusionMatcher", "0"); + OPENVINO_MATCHER_PASS_RTTI("KVCacheFusionMatcher"); KVCacheFusionMatcher(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/move_fc_reshape_to_weights.hpp b/src/plugins/intel_gpu/src/plugin/transformations/move_fc_reshape_to_weights.hpp index f573abd4589e8f..7237e5c97ace70 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/move_fc_reshape_to_weights.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/move_fc_reshape_to_weights.hpp @@ -30,7 +30,7 @@ namespace intel_gpu { */ class MoveFCReshapeToWeights: public ov::pass::MatcherPass { public: - OPENVINO_RTTI("MoveFCReshapeToWeights", "0"); + OPENVINO_MATCHER_PASS_RTTI("MoveFCReshapeToWeights"); MoveFCReshapeToWeights(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/optimize_subsequent_reshapes.hpp b/src/plugins/intel_gpu/src/plugin/transformations/optimize_subsequent_reshapes.hpp index 3a38bb92ad5167..702b18e7fc5dc9 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/optimize_subsequent_reshapes.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/optimize_subsequent_reshapes.hpp @@ -15,7 +15,7 @@ namespace intel_gpu { */ class OptimizeSubsequentReshapes : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("OptimizeSubsequentReshapes", "0"); + OPENVINO_MATCHER_PASS_RTTI("OptimizeSubsequentReshapes"); OptimizeSubsequentReshapes(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/transpose_fusion.hpp b/src/plugins/intel_gpu/src/plugin/transformations/transpose_fusion.hpp index 4869100054b819..a845c7a7aa86b0 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/transpose_fusion.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/transpose_fusion.hpp @@ -17,19 +17,19 @@ class TransposeFusion: public ov::pass::GraphRewrite { class TransposeMatMulMatcher : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("TransposeMatMulMatcher", "0"); + OPENVINO_MATCHER_PASS_RTTI("TransposeMatMulMatcher"); TransposeMatMulMatcher(bool supports_immad); }; class TransposeMatMulTransposeMatcher : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("TransposeMatMulTransposeMatcher", "0"); + OPENVINO_MATCHER_PASS_RTTI("TransposeMatMulTransposeMatcher"); TransposeMatMulTransposeMatcher(bool supports_immad); }; class TransposeSDPAMatcher : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("TransposeSDPAMatcher", "0"); + OPENVINO_MATCHER_PASS_RTTI("TransposeSDPAMatcher"); TransposeSDPAMatcher(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_matmul_fusion.hpp b/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_matmul_fusion.hpp index 35ed30cdc9726e..3e5926561820b8 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_matmul_fusion.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_matmul_fusion.hpp @@ -11,7 +11,7 @@ namespace intel_gpu { class UnsqueezeBroadcastReshapeMatmulFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("UnsqueezeBroadcastReshapeMatmulFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("UnsqueezeBroadcastReshapeMatmulFusion"); UnsqueezeBroadcastReshapeMatmulFusion(); }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_sdpa_fusion.hpp b/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_sdpa_fusion.hpp index ede3ac16fb51b5..e740e846409ea9 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_sdpa_fusion.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/unsqueeze_broadcast_reshape_sdpa_fusion.hpp @@ -11,7 +11,7 @@ namespace intel_gpu { class UnsqueezeBroadcastReshapeSDPAFusion : public ov::pass::MatcherPass { public: - OPENVINO_RTTI("UnsqueezeBroadcastReshapeSDPAFusion", "0"); + OPENVINO_MATCHER_PASS_RTTI("UnsqueezeBroadcastReshapeSDPAFusion"); UnsqueezeBroadcastReshapeSDPAFusion(); }; diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/avoid.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/avoid.hpp index e77a02a4439018..24d682c603a799 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/avoid.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/avoid.hpp @@ -23,6 +23,7 @@ namespace avoid { // Note: this pattern is only utilized by the online partitioner class RMSNorm : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::avoid::RMSNorm"); RMSNorm(const std::shared_ptr& snapshot, const std::string& avoid_device); }; diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/compute.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/compute.hpp index 77bc9fb3f90418..8a70290dfabe4e 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/compute.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/compute.hpp @@ -23,41 +23,49 @@ namespace compute { class DQMatMulGQu4 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::DQMatMulGQu4"); DQMatMulGQu4(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class DQMatMulCWu4 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::DQMatMulCWu4"); DQMatMulCWu4(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class DQMatMulGQi4 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::DQMatMulGQi4"); DQMatMulGQi4(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class DQMatMulCWi4 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::DQMatMulCWi4"); DQMatMulCWi4(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class DQMatMulConv : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::DQMatMulConv"); DQMatMulConv(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class VocabMatMul : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::VocabMatMul"); VocabMatMul(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class RMSNorm : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::RMSNorm"); RMSNorm(const std::shared_ptr& snapshot, const std::string& isol_tag); }; class RMSNorm2 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::compute::RMSNorm2"); RMSNorm2(const std::shared_ptr& snapshot, const std::string& isol_tag); }; diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/dcoff.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/dcoff.hpp index da06a5304c8bd7..4b4cbdd823dfb2 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/dcoff.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/dcoff.hpp @@ -54,6 +54,9 @@ void finalize_remap(Function& fbody, Subgraph& fsg, const ClosureRemap& m); namespace SymmNoZP { class DCOFFPassBase : public ov::pass::MatcherPass { +public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmNoZP::DCOFFPassBase"); + protected: DCOffMode m_dcoff_mode = DCOffMode::CAST_ONLY; ov::element::Type m_dcoff_type; @@ -94,6 +97,9 @@ class DCOFFPassGather final : public DCOFFPassBase { namespace SymmZP { // TODO: Not sure if it is actually Symm.. class DCOFFPassBase : public ov::pass::MatcherPass { +public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::DCOFFPassBase"); + protected: DCOffMode m_dcoff_mode = DCOffMode::CAST_ONLY; ov::element::Type m_dcoff_type; @@ -129,21 +135,26 @@ class DCOFFPassConvert1 final : public DCOFFPassBase { class DCOFFPassReshape2 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::DCOFFPassReshape2"); DCOFFPassReshape2(DCOffMode dcoff_mode, ov::element::Type dcoff_type, DCOFFParamRef pref); }; class DCOFFPassReshape3 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::DCOFFPassReshape3"); DCOFFPassReshape3(DCOffMode dcoff_mode, ov::element::Type dcoff_type, DCOFFParamRef pref); }; class DCOFFPassReshape4 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::DCOFFPassReshape4"); DCOFFPassReshape4(DCOffMode dcoff_mode, ov::element::Type dcoff_type, DCOFFParamRef pref); }; class CWAI1 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::CWAI1"); + using CPtr = std::shared_ptr; using Results = std::reference_wrapper>; @@ -152,6 +163,8 @@ class CWAI1 : public ov::pass::MatcherPass { class CWAI2 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::CWAI2"); + using CPtr = std::shared_ptr; using Results = std::reference_wrapper>; @@ -160,6 +173,8 @@ class CWAI2 : public ov::pass::MatcherPass { class CWAI3 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::SymmZP::CWAI3"); + using CPtr = std::shared_ptr; using Results = std::reference_wrapper>; @@ -171,6 +186,7 @@ class CWAI3 : public ov::pass::MatcherPass { namespace AsymmZP { class DCOFFPassReshape : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::AsymmZP::DCOFFPassReshape"); DCOFFPassReshape(DCOffMode dcoff_mode, ov::element::Type dcoff_type, DCOFFParamRef pref); }; diff --git a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.hpp b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.hpp index 904ce88039d2eb..f2cdee0f436d57 100644 --- a/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.hpp +++ b/src/plugins/intel_npu/src/plugin/npuw/partitioning/patterns/opt.hpp @@ -64,31 +64,37 @@ struct Context { class DQMatMulCWi : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQMatMulCWi"); explicit DQMatMulCWi(Context::Ref ctx); }; class DQMatMulGQi : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQMatMulGQi"); explicit DQMatMulGQi(Context::Ref ctx); }; class DQMatMulGQ2i : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQMatMulGQ2i"); explicit DQMatMulGQ2i(Context::Ref ctx); }; class DQMatMulGQiP : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQMatMulGQiP"); explicit DQMatMulGQiP(Context::Ref ctx); }; class DQMatMulGQ2iP : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQMatMulGQ2iP"); explicit DQMatMulGQ2iP(Context::Ref ctx); }; class DQParMMGQ : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQParMMGQ"); explicit DQParMMGQ(Context::Ref ctx); }; @@ -98,16 +104,19 @@ void mergeParallelMatMuls(const std::shared_ptr& m, Context& ctx); class DQLiftGatherAsymCW : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQLiftGatherAsymCW"); DQLiftGatherAsymCW(); }; class DQLiftGatherSymCW : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQLiftGatherSymCW"); DQLiftGatherSymCW(); }; class DQLiftGatherSymGQ : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQLiftGatherSymGQ"); DQLiftGatherSymGQ(); }; @@ -115,21 +124,25 @@ class DQLiftGatherSymGQ : public ov::pass::MatcherPass { class DQUnpackDictGatheru : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQUnpackDictGatheru"); DQUnpackDictGatheru(Context::Ref ctx); }; class DQUnpackDictGatherGQi : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQUnpackDictGatherGQi"); DQUnpackDictGatherGQi(Context::Ref ctx); }; class HostGather : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::HostGather"); HostGather(Context::Ref ctx); }; class HostGatherDQ : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::HostGatherDQ"); HostGatherDQ(Context::Ref ctx); }; @@ -137,43 +150,51 @@ class HostGatherDQ : public ov::pass::MatcherPass { class DQUnpackDictMatMulCWu : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQUnpackDictMatMulCWu"); DQUnpackDictMatMulCWu(Context::Ref ctx); }; class DQUnpackDictMatMulGQi : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::DQUnpackDictMatMulGQi"); DQUnpackDictMatMulGQi(Context::Ref ctx); }; class CompressDictMatMulf32 : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::CompressDictMatMulf32"); CompressDictMatMulf32(Context::Ref ctx); }; // Slice last Matmul class SliceLastMatmul : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::SliceLastMatmul"); SliceLastMatmul(); }; class SliceLastMatmulAdd : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::SliceLastMatmulAdd"); SliceLastMatmulAdd(); }; class SliceLastMatmulTranspose : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::SliceLastMatmulTranspose"); SliceLastMatmulTranspose(); }; class SliceLastMatmulMultiply : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::SliceLastMatmulMultiply"); SliceLastMatmulMultiply(); }; // Convolution to MatMul class ConvToMatmul : public ov::pass::MatcherPass { public: + OPENVINO_MATCHER_PASS_RTTI("npuw::patterns::opt::ConvToMatmul"); ConvToMatmul(Context::Ref ctx); }; From e8f906e165a09b5eb707d8857edc96c051887f57 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Thu, 19 Dec 2024 18:48:47 +0100 Subject: [PATCH 5/5] [RTTI] Add OPENVINO_MODEL_PASS_RTTI definition (#28123) ### Details: - Adds RTTI definition for passes derived from ov::pass::ModelPass. - Applies the macro where applicable. ### Tickets: - CVS-159568 --------- Signed-off-by: Tomasz Jankowski Co-authored-by: Michal Lukaszewski --- .../low_precision/align_quantization_intervals.hpp | 2 +- .../align_quantization_parameters.hpp | 2 +- .../include/low_precision/low_precision.hpp | 4 ++-- .../markup_avg_pool_precision_preserved.hpp | 2 +- .../low_precision/markup_can_be_quantized.hpp | 2 +- .../include/low_precision/markup_precisions.hpp | 2 +- .../markup_quantization_granularity.hpp | 3 ++- .../include/low_precision/propagate_precisions.hpp | 2 +- .../low_precision/propagate_shared_value.hpp | 1 + .../tests/simple_low_precision_transformer.hpp | 1 + .../offline_transformations/include/pruning.hpp | 4 ++-- .../include/snippets/pass/align_element_types.hpp | 2 +- .../snippets/pass/analyze_broadcastable_inputs.hpp | 2 +- .../include/snippets/pass/canonicalization.hpp | 2 +- .../include/snippets/pass/fq_decomposition.hpp | 2 ++ src/common/snippets/include/snippets/pass/hash.hpp | 2 +- .../include/snippets/pass/propagate_precision.hpp | 2 +- .../include/snippets/pass/tokenization.hpp | 5 +++-- .../snippets/include/snippets/pass/validate.hpp | 2 +- .../change_placeholder_types.hpp | 2 +- .../common_optimizations/common_optimizations.hpp | 2 +- .../common_optimizations/dimension_tracking.hpp | 2 +- .../common_optimizations/fused_names_cleanup.hpp | 2 +- .../mark_precision_sensitive_shapeof_subgraphs.hpp | 2 +- .../moc_legacy_transformations.hpp | 2 +- .../common_optimizations/moc_transformations.hpp | 10 ++++++---- .../optimize_strided_slice.hpp | 8 ++++---- .../push_constant_to_subgraph.hpp | 2 +- .../remove_multi_subgraph_op_dangling_params.hpp | 2 +- .../reverse_shape_and_type_infer.hpp | 2 +- .../common_optimizations/ric_fusion.hpp | 2 +- .../shared_ops_optimization.hpp | 2 +- .../simplify_shape_of_sub_graph.hpp | 2 +- .../transformations/control_flow/unroll_if.hpp | 2 +- .../control_flow/unroll_tensor_iterator.hpp | 2 +- .../include/transformations/convert_precision.hpp | 2 +- .../align_mixed_fp32_fp16_types.hpp | 2 +- .../convert_compression_only_to_legacy.hpp | 2 +- .../mark_subgraphs_to_keep_in_mixed_precision.hpp | 2 +- .../include/transformations/hash.hpp | 2 +- .../include/transformations/init_node_info.hpp | 2 +- .../opset_conversions/convert_opset2_to_opset1.hpp | 2 +- .../opset_conversions/convert_opset3_to_opset2.hpp | 2 +- .../transformations/resolve_names_collisions.hpp | 2 +- .../smart_reshape/lstm_states_broadcast.hpp | 2 +- .../smart_reshape/smart_reshape.hpp | 2 +- .../symbol_optimization.hpp | 4 ++-- .../symbolic_optimizations.hpp | 6 +++--- .../transpose_sinking/ts_general.hpp | 2 +- .../include/transformations/utils/print_model.hpp | 2 +- .../common_optimizations/ric_fusion.cpp | 2 +- .../include/openvino/pass/constant_folding.hpp | 2 +- .../include/openvino/pass/convert_fp32_to_fp16.hpp | 2 +- src/core/include/openvino/pass/graph_rewrite.hpp | 2 +- src/core/include/openvino/pass/low_latency.hpp | 2 +- src/core/include/openvino/pass/make_stateful.hpp | 2 +- src/core/include/openvino/pass/pass.hpp | 14 ++++++++++++-- .../openvino/pass/sdpa_to_paged_attention.hpp | 2 +- src/core/include/openvino/pass/serialize.hpp | 4 ++-- .../openvino/pass/stateful_to_stateless.hpp | 2 +- src/core/include/openvino/pass/validate.hpp | 2 +- src/core/include/openvino/pass/visualize_tree.hpp | 2 +- .../frontend/decoder_transformation_extension.cpp | 2 +- src/core/tests/pass_config.cpp | 2 +- .../src/extension/decoder_transformation.cpp | 1 + .../pytorch/src/transforms/dict_resolver.hpp | 4 ++-- .../prim_list_tuple_construct_replacer.hpp | 2 +- .../transforms/prim_unpack_parameter_replacer.hpp | 2 +- .../src/transforms/tuple_unpack_replacer.hpp | 2 +- .../src/transformations/switch_merge_resolve.hpp | 2 +- .../helper_transforms/const_to_result_remover.hpp | 2 +- .../saved_model_unused_remover.hpp | 2 +- .../tflite_quantize_resolver.hpp | 2 +- .../aarch64/pass/snippets_mark_skipped.hpp | 2 +- .../snippets/x64/pass/enforce_precision.hpp | 2 +- .../snippets/x64/pass/snippets_mark_skipped.hpp | 2 +- .../tpp/x64/pass/fuse_tpp_to_equations.hpp | 2 +- .../plugin/transformations/convert_convolution.hpp | 2 +- .../transformations/print_model_statistics.hpp | 2 +- .../include/common_test_utils/graph_comparator.hpp | 3 +++ .../common_test_utils/src/ov_test_utils.cpp | 1 + 81 files changed, 113 insertions(+), 90 deletions(-) diff --git a/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp b/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp index 2caf346bfc5da6..5d82af51847081 100644 --- a/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp +++ b/src/common/low_precision_transformations/include/low_precision/align_quantization_intervals.hpp @@ -30,7 +30,7 @@ class LP_TRANSFORMATIONS_API AlignQuantizationIntervals; */ class ov::pass::low_precision::AlignQuantizationIntervals : public ov::pass::ModelPass { public: - OPENVINO_RTTI("AlignQuantizationIntervals", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::AlignQuantizationIntervals"); AlignQuantizationIntervals(const std::vector& defaultPrecisions = ov::pass::low_precision::precision_set::get_int8_support()); bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/common/low_precision_transformations/include/low_precision/align_quantization_parameters.hpp b/src/common/low_precision_transformations/include/low_precision/align_quantization_parameters.hpp index 89c9bf59747860..ce6db1c397522f 100644 --- a/src/common/low_precision_transformations/include/low_precision/align_quantization_parameters.hpp +++ b/src/common/low_precision_transformations/include/low_precision/align_quantization_parameters.hpp @@ -31,7 +31,7 @@ class LP_TRANSFORMATIONS_API AlignQuantizationParameters; */ class ov::pass::low_precision::AlignQuantizationParameters : public ov::pass::ModelPass { public: - OPENVINO_RTTI("AlignQuantizationParameters", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::AlignQuantizationParameters"); AlignQuantizationParameters(const std::vector defaultPrecisions = ov::pass::low_precision::precision_set::get_int8_support()); bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/common/low_precision_transformations/include/low_precision/low_precision.hpp b/src/common/low_precision_transformations/include/low_precision/low_precision.hpp index d6bddd3643a4f6..b3b92340303ced 100644 --- a/src/common/low_precision_transformations/include/low_precision/low_precision.hpp +++ b/src/common/low_precision_transformations/include/low_precision/low_precision.hpp @@ -42,7 +42,7 @@ class LP_TRANSFORMATIONS_API LowPrecision; class ov::pass::low_precision::MarkupOptimizations : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MarkupOptimizations", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::MarkupOptimizations"); MarkupOptimizations( const std::vector& precisionRestrictions, const std::vector& quantizationRestrictions, @@ -62,7 +62,7 @@ class ov::pass::low_precision::TypeRelaxedReplacer : public ov::pass::GraphRewri class LP_TRANSFORMATIONS_API ov::pass::low_precision::LowPrecision : public ov::pass::ModelPass { public: - OPENVINO_RTTI("LowPrecision", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::LowPrecision"); LowPrecision( const std::vector& precisionRestrictions = {}, const std::vector& quantizationRestrictions = {}, diff --git a/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp b/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp index da3605b4ee4ba5..4e65b9f414f9fc 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_avg_pool_precision_preserved.hpp @@ -29,7 +29,7 @@ class LP_TRANSFORMATIONS_API MarkupAvgPoolPrecisionPreserved; */ class ov::pass::low_precision::MarkupAvgPoolPrecisionPreserved : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MarkupAvgPoolPrecisionPreserved", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::MarkupAvgPoolPrecisionPreserved"); MarkupAvgPoolPrecisionPreserved(const std::vector defaultPrecisions = ov::pass::low_precision::precision_set::get_int8_support()); bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/common/low_precision_transformations/include/low_precision/markup_can_be_quantized.hpp b/src/common/low_precision_transformations/include/low_precision/markup_can_be_quantized.hpp index f886e69f2088c7..7359a6617c96b6 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_can_be_quantized.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_can_be_quantized.hpp @@ -30,7 +30,7 @@ class LP_TRANSFORMATIONS_API MarkupCanBeQuantized; */ class ov::pass::low_precision::MarkupCanBeQuantized : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MarkupCanBeQuantized", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::MarkupCanBeQuantized"); MarkupCanBeQuantized(const std::vector defaultPrecisions = { ov::element::u8, ov::element::i8 }); bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp b/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp index 92ea93b2c3e5b1..56e926101581bf 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_precisions.hpp @@ -36,6 +36,7 @@ class LP_TRANSFORMATIONS_API MarkupPrecisions; */ class ov::pass::low_precision::MarkupPrecisions : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("low_precision::MarkupPrecisions"); class Restriction { public: class RestrictionByVersion { @@ -65,7 +66,6 @@ class ov::pass::low_precision::MarkupPrecisions : public ov::pass::ModelPass { std::unordered_map precisionsByVersion; }; - OPENVINO_RTTI("MarkupPrecisions", "0"); explicit MarkupPrecisions(const std::vector& restrictions = {}, const std::vector& defaultPrecisions = { ov::element::u8, ov::element::i8 }); bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/low_precision_transformations/include/low_precision/markup_quantization_granularity.hpp b/src/common/low_precision_transformations/include/low_precision/markup_quantization_granularity.hpp index a61473cf263963..aa0ee4b4191de0 100644 --- a/src/common/low_precision_transformations/include/low_precision/markup_quantization_granularity.hpp +++ b/src/common/low_precision_transformations/include/low_precision/markup_quantization_granularity.hpp @@ -34,6 +34,8 @@ class LP_TRANSFORMATIONS_API MarkupQuantizationGranularity; */ class ov::pass::low_precision::MarkupQuantizationGranularity : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("low_precision::MarkupQuantizationGranularity"); + class PerTensorQuantization { public: explicit PerTensorQuantization(const bool versionIsRequired) : versionIsRequired(versionIsRequired) {} @@ -45,7 +47,6 @@ class ov::pass::low_precision::MarkupQuantizationGranularity : public ov::pass:: std::unordered_map> portsByVersion; }; - OPENVINO_RTTI("MarkupPerTensorQuantization", "0"); explicit MarkupQuantizationGranularity(const std::vector& restrictions = {}); bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp b/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp index c17fa2faded476..98f91bc5155d7b 100644 --- a/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp +++ b/src/common/low_precision_transformations/include/low_precision/propagate_precisions.hpp @@ -31,7 +31,7 @@ class LP_TRANSFORMATIONS_API PropagatePrecisions; */ class ov::pass::low_precision::PropagatePrecisions : public ov::pass::ModelPass { public: - OPENVINO_RTTI("PropagatePrecisions", "0"); + OPENVINO_MODEL_PASS_RTTI("low_precision::PropagatePrecisions"); PropagatePrecisions(const AttributeParameters& params = AttributeParameters()); bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp b/src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp index 16a014cda6ec04..9254e2fc007dab 100644 --- a/src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp +++ b/src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp @@ -38,6 +38,7 @@ class LP_TRANSFORMATIONS_API PropagateSharedValue; template class ov::pass::low_precision::PropagateSharedValue : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("low_precision::PropagateSharedValue"); bool run_on_model(const std::shared_ptr& f) override { OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::LPT_LT, "PropagateSharedValue"); diff --git a/src/common/low_precision_transformations/tests/simple_low_precision_transformer.hpp b/src/common/low_precision_transformations/tests/simple_low_precision_transformer.hpp index 7593361f8dd71a..36cf9747f6d76b 100644 --- a/src/common/low_precision_transformations/tests/simple_low_precision_transformer.hpp +++ b/src/common/low_precision_transformations/tests/simple_low_precision_transformer.hpp @@ -16,6 +16,7 @@ class SimpleLowPrecisionTransformer : public ov::pass::ModelPass{ public: + OPENVINO_MODEL_PASS_RTTI("SimpleLowPrecisionTransformer"); SimpleLowPrecisionTransformer( const std::vector& precisionRestrictions = {}, const std::vector& quantizationRestrictions = {}, diff --git a/src/common/offline_transformations/include/pruning.hpp b/src/common/offline_transformations/include/pruning.hpp index dd5374d7477ded..e573108a89eb86 100644 --- a/src/common/offline_transformations/include/pruning.hpp +++ b/src/common/offline_transformations/include/pruning.hpp @@ -67,7 +67,7 @@ class ov::pass::PropagateMasks : public ov::pass::GraphRewrite { */ class ov::pass::ShrinkWeights : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ShrinkWeights", "0"); + OPENVINO_MODEL_PASS_RTTI("ShrinkWeights"); bool run_on_model(const std::shared_ptr&) override; }; @@ -77,6 +77,6 @@ class ov::pass::ShrinkWeights : public ov::pass::ModelPass { */ class ov::pass::Pruning : public ov::pass::ModelPass { public: - OPENVINO_RTTI("Pruning", "0"); + OPENVINO_MODEL_PASS_RTTI("Pruning"); bool run_on_model(const std::shared_ptr&) override; }; diff --git a/src/common/snippets/include/snippets/pass/align_element_types.hpp b/src/common/snippets/include/snippets/pass/align_element_types.hpp index 1d5a1fa9256c88..6261b2b87b2a65 100644 --- a/src/common/snippets/include/snippets/pass/align_element_types.hpp +++ b/src/common/snippets/include/snippets/pass/align_element_types.hpp @@ -19,7 +19,7 @@ namespace pass { */ class AlignElementTypes: public ov::pass::ModelPass { public: - OPENVINO_RTTI("AlignElementTypes"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::AlignElementTypes"); AlignElementTypes(std::vector input_precisions, std::vector output_precisions); bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp b/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp index 4367567c9df1c7..9d23e462ddff94 100644 --- a/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp +++ b/src/common/snippets/include/snippets/pass/analyze_broadcastable_inputs.hpp @@ -21,7 +21,7 @@ namespace pass { */ class AnalyzeBroadcastableInputs : public ov::pass::ModelPass { public: - OPENVINO_RTTI("AnalyzeBroadcastableInputs"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::AnalyzeBroadcastableInputs"); // [Index of Parameter -> Index of broadcastable dimension from end] using BroadcastableInputsMap = std::map; AnalyzeBroadcastableInputs(BroadcastableInputsMap& map); diff --git a/src/common/snippets/include/snippets/pass/canonicalization.hpp b/src/common/snippets/include/snippets/pass/canonicalization.hpp index 5c7acaa781d2b8..645184a55609ba 100644 --- a/src/common/snippets/include/snippets/pass/canonicalization.hpp +++ b/src/common/snippets/include/snippets/pass/canonicalization.hpp @@ -22,7 +22,7 @@ namespace pass { */ class Canonicalization: public ov::pass::ModelPass { public: - OPENVINO_RTTI("Canonicalization"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::Canonicalization"); using BlockedShapeVector = op::Subgraph::BlockedShapeVector; using Layout = std::vector; explicit Canonicalization(const BlockedShapeVector& blocked_input_shapes); diff --git a/src/common/snippets/include/snippets/pass/fq_decomposition.hpp b/src/common/snippets/include/snippets/pass/fq_decomposition.hpp index 1e4af6c04e22fa..9f2b0ab7cc4bf9 100644 --- a/src/common/snippets/include/snippets/pass/fq_decomposition.hpp +++ b/src/common/snippets/include/snippets/pass/fq_decomposition.hpp @@ -80,6 +80,8 @@ class FakeQuantizeDecomposition : public ov::pass::MatcherPass { */ class CommonFakeQuantizeDecomposition: public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("snippets::pass::CommonFakeQuantizeDecomposition"); + bool run_on_model(const std::shared_ptr& m) override; static bool is_supported_fq(const std::shared_ptr& fq); diff --git a/src/common/snippets/include/snippets/pass/hash.hpp b/src/common/snippets/include/snippets/pass/hash.hpp index 66126cd21bbe6d..fc3bd9a64d0bdc 100644 --- a/src/common/snippets/include/snippets/pass/hash.hpp +++ b/src/common/snippets/include/snippets/pass/hash.hpp @@ -18,7 +18,7 @@ namespace pass { */ class Hash : public ov::pass::ModelPass { public: - OPENVINO_RTTI("HashPass", "0"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::Hash"); bool run_on_model(const std::shared_ptr& f) override; diff --git a/src/common/snippets/include/snippets/pass/propagate_precision.hpp b/src/common/snippets/include/snippets/pass/propagate_precision.hpp index 6f805cb1b68808..66d0b28430dd5f 100644 --- a/src/common/snippets/include/snippets/pass/propagate_precision.hpp +++ b/src/common/snippets/include/snippets/pass/propagate_precision.hpp @@ -19,7 +19,7 @@ namespace pass { */ class PropagatePrecision: public ov::pass::ModelPass { public: - OPENVINO_RTTI("PropagatePrecision", "0"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::PropagatePrecision"); PropagatePrecision(const std::shared_ptr& target_machine); bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/snippets/include/snippets/pass/tokenization.hpp b/src/common/snippets/include/snippets/pass/tokenization.hpp index 24efcceec71a24..fc7ed8aace6d64 100644 --- a/src/common/snippets/include/snippets/pass/tokenization.hpp +++ b/src/common/snippets/include/snippets/pass/tokenization.hpp @@ -37,7 +37,7 @@ int64_t GetTopologicalOrder(const std::shared_ptr&); */ class EnumerateNodes : public ov::pass::ModelPass { public: - OPENVINO_RTTI("EnumerateNodes", "0"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::EnumerateNodes"); EnumerateNodes() : ModelPass() {} bool run_on_model(const std::shared_ptr&) override; }; @@ -59,6 +59,8 @@ class EnumerateNodes : public ov::pass::ModelPass { */ class SnippetsTokenization : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("snippets::pass::SnippetsTokenization"); + /** * @interface Config * @brief Allow to adjust tokenization passes @@ -123,7 +125,6 @@ class SnippetsTokenization : public ov::pass::ModelPass { std::set m_mha_supported_transpose_ranks = { 3, 4 }; }; - OPENVINO_RTTI("SnippetsTokenization", "0"); SnippetsTokenization(const Config& config) : m_config(config) {} bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/snippets/include/snippets/pass/validate.hpp b/src/common/snippets/include/snippets/pass/validate.hpp index 1fedf8a2ce08d5..21d748eaa3afbb 100644 --- a/src/common/snippets/include/snippets/pass/validate.hpp +++ b/src/common/snippets/include/snippets/pass/validate.hpp @@ -17,7 +17,7 @@ namespace pass { */ class Validate: public ov::pass::ModelPass { public: - OPENVINO_RTTI("Validate", "0"); + OPENVINO_MODEL_PASS_RTTI("snippets::pass::Validate"); Validate(const std::shared_ptr& pass_config) : m_pass_config(pass_config) {} bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/transformations/include/transformations/common_optimizations/change_placeholder_types.hpp b/src/common/transformations/include/transformations/common_optimizations/change_placeholder_types.hpp index d2ff059d5974ef..023937b79df48a 100644 --- a/src/common/transformations/include/transformations/common_optimizations/change_placeholder_types.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/change_placeholder_types.hpp @@ -20,7 +20,7 @@ class TRANSFORMATIONS_API ChangePlaceholderTypes; */ class ChangePlaceholderTypes : public ModelPass { public: - OPENVINO_RTTI("ChangePlaceholderTypes", "0"); + OPENVINO_MODEL_PASS_RTTI("ChangePlaceholderTypes"); explicit ChangePlaceholderTypes(const std::vector& params_with_custom_types) : m_params_with_custom_types(params_with_custom_types) {} bool run_on_model(const std::shared_ptr& model) override; diff --git a/src/common/transformations/include/transformations/common_optimizations/common_optimizations.hpp b/src/common/transformations/include/transformations/common_optimizations/common_optimizations.hpp index 7540275ce74d0f..35017f5984f9a1 100644 --- a/src/common/transformations/include/transformations/common_optimizations/common_optimizations.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/common_optimizations.hpp @@ -20,6 +20,6 @@ class TRANSFORMATIONS_API CommonOptimizations; class ov::pass::CommonOptimizations : public ov::pass::ModelPass { public: - OPENVINO_RTTI("CommonOptimizations", "0"); + OPENVINO_MODEL_PASS_RTTI("CommonOptimizations"); bool run_on_model(const std::shared_ptr& f) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/dimension_tracking.hpp b/src/common/transformations/include/transformations/common_optimizations/dimension_tracking.hpp index d1ec2069b3f621..ca176057972eaa 100644 --- a/src/common/transformations/include/transformations/common_optimizations/dimension_tracking.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/dimension_tracking.hpp @@ -22,7 +22,7 @@ class TRANSFORMATIONS_API FindBatch; class ov::pass::FindBatch : public ov::pass::ModelPass { public: - OPENVINO_RTTI("FindBatch"); + OPENVINO_MODEL_PASS_RTTI("FindBatch"); FindBatch(bool detach_detection_output = false, bool track = true) : track(track), detach_do(detach_detection_output) {} diff --git a/src/common/transformations/include/transformations/common_optimizations/fused_names_cleanup.hpp b/src/common/transformations/include/transformations/common_optimizations/fused_names_cleanup.hpp index 8058a01811d9bc..fd7ce8defba920 100644 --- a/src/common/transformations/include/transformations/common_optimizations/fused_names_cleanup.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/fused_names_cleanup.hpp @@ -21,6 +21,6 @@ class TRANSFORMATIONS_API FusedNamesCleanup; */ class ov::pass::FusedNamesCleanup : public ov::pass::ModelPass { public: - OPENVINO_RTTI("FusedNamesCleanup", "0"); + OPENVINO_MODEL_PASS_RTTI("FusedNamesCleanup"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/mark_precision_sensitive_shapeof_subgraphs.hpp b/src/common/transformations/include/transformations/common_optimizations/mark_precision_sensitive_shapeof_subgraphs.hpp index 05e73456d46ee0..3e20e7535f8fed 100644 --- a/src/common/transformations/include/transformations/common_optimizations/mark_precision_sensitive_shapeof_subgraphs.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/mark_precision_sensitive_shapeof_subgraphs.hpp @@ -26,7 +26,7 @@ class TRANSFORMATIONS_API MarkShapeOfSubgraphs; */ class ov::pass::MarkPrecisionSensitiveShapeOfSubgraphs : public ModelPass { public: - OPENVINO_RTTI("MarkPrecisionSensitiveShapeOfSubgraphs", "0"); + OPENVINO_MODEL_PASS_RTTI("MarkPrecisionSensitiveShapeOfSubgraphs"); MarkPrecisionSensitiveShapeOfSubgraphs(); bool run_on_model(const std::shared_ptr& f) override; diff --git a/src/common/transformations/include/transformations/common_optimizations/moc_legacy_transformations.hpp b/src/common/transformations/include/transformations/common_optimizations/moc_legacy_transformations.hpp index 833ce83e6cf065..0f40a4d81a1bde 100644 --- a/src/common/transformations/include/transformations/common_optimizations/moc_legacy_transformations.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/moc_legacy_transformations.hpp @@ -32,7 +32,7 @@ namespace pass { class MOCLegacyTransformations : public ModelPass { public: - OPENVINO_RTTI("MOCLegacyTransformations", "0"); + OPENVINO_MODEL_PASS_RTTI("MOCLegacyTransformations"); explicit MOCLegacyTransformations(const std::vector& params_with_custom_types) : m_params_with_custom_types(params_with_custom_types) {} bool run_on_model(const std::shared_ptr& f) override; diff --git a/src/common/transformations/include/transformations/common_optimizations/moc_transformations.hpp b/src/common/transformations/include/transformations/common_optimizations/moc_transformations.hpp index 49893dfb220de6..b65c9b84456ff8 100644 --- a/src/common/transformations/include/transformations/common_optimizations/moc_transformations.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/moc_transformations.hpp @@ -24,11 +24,9 @@ class TRANSFORMATIONS_API MOCTransformations; */ class ov::pass::MOCTransformations : public ov::pass::ModelPass { - bool m_use_shapes; - bool m_low_precision_enabled; - public: - OPENVINO_RTTI("MOCTransformations", "0"); + OPENVINO_MODEL_PASS_RTTI("MOCTransformations"); + /** * use_shapes = True enables transformations which are depends on shapes and also it * enables ConstantFolding for all ShapeOf operations. @@ -41,4 +39,8 @@ class ov::pass::MOCTransformations : public ov::pass::ModelPass { m_low_precision_enabled(low_precision_enabled) {} bool run_on_model(const std::shared_ptr& m) override; + +private: + bool m_use_shapes; + bool m_low_precision_enabled; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/optimize_strided_slice.hpp b/src/common/transformations/include/transformations/common_optimizations/optimize_strided_slice.hpp index 454378a0e9bbd1..cb642795254791 100644 --- a/src/common/transformations/include/transformations/common_optimizations/optimize_strided_slice.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/optimize_strided_slice.hpp @@ -29,7 +29,7 @@ class TRANSFORMATIONS_API SliceSequenceToSingleSlice; */ class ov::pass::UselessSliceEraser : public ov::pass::ModelPass { public: - OPENVINO_RTTI("UselessSliceEraser", "0"); + OPENVINO_MODEL_PASS_RTTI("UselessSliceEraser"); bool run_on_model(const std::shared_ptr& m) override; }; @@ -41,7 +41,7 @@ class ov::pass::UselessSliceEraser : public ov::pass::ModelPass { */ class ov::pass::GroupedStridedSliceOptimizer : public ov::pass::ModelPass { public: - OPENVINO_RTTI("GroupedStridedSliceOptimizer", "0"); + OPENVINO_MODEL_PASS_RTTI("GroupedStridedSliceOptimizer"); bool run_on_model(const std::shared_ptr& m) override; }; @@ -53,7 +53,7 @@ class ov::pass::GroupedStridedSliceOptimizer : public ov::pass::ModelPass { */ class ov::pass::GroupedSliceToVSplitOptimization : public ov::pass::ModelPass { public: - OPENVINO_RTTI("GroupedSliceToVSplitOptimization", "0"); + OPENVINO_MODEL_PASS_RTTI("GroupedSliceToVSplitOptimization"); bool run_on_model(const std::shared_ptr& m) override; }; @@ -82,9 +82,9 @@ class ov::pass::SliceSequenceToSingleSlice : public ov::pass::MatcherPass { */ class ov::pass::StridedSliceOptimization : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("StridedSliceOptimization"); StridedSliceOptimization(bool use_shapes = true); - OPENVINO_RTTI("StridedSliceOptimization", "0"); bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/common/transformations/include/transformations/common_optimizations/push_constant_to_subgraph.hpp b/src/common/transformations/include/transformations/common_optimizations/push_constant_to_subgraph.hpp index e571b9a41869f2..085da725a64233 100644 --- a/src/common/transformations/include/transformations/common_optimizations/push_constant_to_subgraph.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/push_constant_to_subgraph.hpp @@ -17,7 +17,7 @@ namespace pass { */ class TRANSFORMATIONS_API PushConstantToSubgraph : public ov::pass::ModelPass { public: - OPENVINO_RTTI("PushConstantToSubgraph", "0"); + OPENVINO_MODEL_PASS_RTTI("PushConstantToSubgraph"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp b/src/common/transformations/include/transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp index 359d68f7c980c2..b5b35e44364e46 100644 --- a/src/common/transformations/include/transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp @@ -23,6 +23,6 @@ class TRANSFORMATIONS_API RemoveMultiSubGraphOpDanglingParamsResults; class ov::pass::RemoveMultiSubGraphOpDanglingParamsResults : public ov::pass::ModelPass { public: - OPENVINO_RTTI("RemoveMultiSubGraphOpDanglingParamsResults", "0"); + OPENVINO_MODEL_PASS_RTTI("RemoveMultiSubGraphOpDanglingParamsResults"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/reverse_shape_and_type_infer.hpp b/src/common/transformations/include/transformations/common_optimizations/reverse_shape_and_type_infer.hpp index cfc5d789d9c07e..f0f9fe269e6206 100644 --- a/src/common/transformations/include/transformations/common_optimizations/reverse_shape_and_type_infer.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/reverse_shape_and_type_infer.hpp @@ -20,7 +20,7 @@ class TRANSFORMATIONS_API ReverseShapeAndTypeInfer; */ class ov::pass::ReverseShapeAndTypeInfer : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ReverseShapeAndTypeInfer", "0"); + OPENVINO_MODEL_PASS_RTTI("ReverseShapeAndTypeInfer"); bool run_on_model(const std::shared_ptr& f) override; private: diff --git a/src/common/transformations/include/transformations/common_optimizations/ric_fusion.hpp b/src/common/transformations/include/transformations/common_optimizations/ric_fusion.hpp index c91c27a464cada..1c56d61bb615c9 100644 --- a/src/common/transformations/include/transformations/common_optimizations/ric_fusion.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/ric_fusion.hpp @@ -23,6 +23,6 @@ class TRANSFORMATIONS_API ReverseInputChannelsFusion; class ov::pass::ReverseInputChannelsFusion : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ReverseInputChannelsFusion", "0"); + OPENVINO_MODEL_PASS_RTTI("ReverseInputChannelsFusion"); bool run_on_model(const std::shared_ptr&) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/shared_ops_optimization.hpp b/src/common/transformations/include/transformations/common_optimizations/shared_ops_optimization.hpp index 8e2a87502ebcc9..6ff8f611564db2 100644 --- a/src/common/transformations/include/transformations/common_optimizations/shared_ops_optimization.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/shared_ops_optimization.hpp @@ -22,6 +22,6 @@ class TRANSFORMATIONS_API SharedOpOptimization; */ class ov::pass::SharedOpOptimization : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SharedOpOptimization", "0"); + OPENVINO_MODEL_PASS_RTTI("SharedOpOptimization"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/common_optimizations/simplify_shape_of_sub_graph.hpp b/src/common/transformations/include/transformations/common_optimizations/simplify_shape_of_sub_graph.hpp index 509047578bd489..79e0ffd789bf7c 100644 --- a/src/common/transformations/include/transformations/common_optimizations/simplify_shape_of_sub_graph.hpp +++ b/src/common/transformations/include/transformations/common_optimizations/simplify_shape_of_sub_graph.hpp @@ -41,7 +41,7 @@ class ov::pass::GroupedGatherElimination : public ov::pass::MatcherPass { */ class ov::pass::SimplifyShapeOfSubGraph : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SimplifyShapeOfSubGraph", "0"); + OPENVINO_MODEL_PASS_RTTI("SimplifyShapeOfSubGraph"); explicit SimplifyShapeOfSubGraph(bool use_shapes = true) : m_use_shapes(use_shapes){}; bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/common/transformations/include/transformations/control_flow/unroll_if.hpp b/src/common/transformations/include/transformations/control_flow/unroll_if.hpp index e59b60106e2536..5dc95ee3eeb85a 100644 --- a/src/common/transformations/include/transformations/control_flow/unroll_if.hpp +++ b/src/common/transformations/include/transformations/control_flow/unroll_if.hpp @@ -26,6 +26,6 @@ class TRANSFORMATIONS_API UnrollIf; class ov::pass::UnrollIf : public ov::pass::ModelPass { public: - OPENVINO_RTTI("UnrollIf", "0"); + OPENVINO_MODEL_PASS_RTTI("UnrollIf"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/control_flow/unroll_tensor_iterator.hpp b/src/common/transformations/include/transformations/control_flow/unroll_tensor_iterator.hpp index 282aecab5c7f05..ce8b6419e6734e 100644 --- a/src/common/transformations/include/transformations/control_flow/unroll_tensor_iterator.hpp +++ b/src/common/transformations/include/transformations/control_flow/unroll_tensor_iterator.hpp @@ -28,6 +28,6 @@ class TRANSFORMATIONS_API UnrollTensorIterator; class ov::pass::UnrollTensorIterator : public ov::pass::ModelPass { public: - OPENVINO_RTTI("UnrollTensorIterator", "0"); + OPENVINO_MODEL_PASS_RTTI("UnrollTensorIterator"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/convert_precision.hpp b/src/common/transformations/include/transformations/convert_precision.hpp index 30f773da9e3be4..b411629ccbce77 100644 --- a/src/common/transformations/include/transformations/convert_precision.hpp +++ b/src/common/transformations/include/transformations/convert_precision.hpp @@ -79,7 +79,7 @@ using type_to_fuse_map = class ov::pass::ConvertPrecision : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ConvertPrecision", "0"); + OPENVINO_MODEL_PASS_RTTI("ConvertPrecision"); ConvertPrecision(ov::element::Type_t from, ov::element::Type_t to, type_to_fuse_map additional_type_to_fuse_map = {}, diff --git a/src/common/transformations/include/transformations/fp16_compression/align_mixed_fp32_fp16_types.hpp b/src/common/transformations/include/transformations/fp16_compression/align_mixed_fp32_fp16_types.hpp index 4fd93d7742ab67..e890b89794d862 100644 --- a/src/common/transformations/include/transformations/fp16_compression/align_mixed_fp32_fp16_types.hpp +++ b/src/common/transformations/include/transformations/fp16_compression/align_mixed_fp32_fp16_types.hpp @@ -21,6 +21,6 @@ class TRANSFORMATIONS_API AlignMixedFP32FP16Types; */ class ov::pass::AlignMixedFP32FP16Types : public ov::pass::ModelPass { public: - OPENVINO_RTTI("AlignMixedFP32FP16Types", "0"); + OPENVINO_MODEL_PASS_RTTI("AlignMixedFP32FP16Types"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/fp16_compression/convert_compression_only_to_legacy.hpp b/src/common/transformations/include/transformations/fp16_compression/convert_compression_only_to_legacy.hpp index fbac44f637a2a2..c7c8e408da2209 100644 --- a/src/common/transformations/include/transformations/fp16_compression/convert_compression_only_to_legacy.hpp +++ b/src/common/transformations/include/transformations/fp16_compression/convert_compression_only_to_legacy.hpp @@ -21,6 +21,6 @@ class TRANSFORMATIONS_API ConvertCompressedOnlyToLegacy; */ class ov::pass::ConvertCompressedOnlyToLegacy : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ConvertCompressedOnlyToLegacy", "0"); + OPENVINO_MODEL_PASS_RTTI("ConvertCompressedOnlyToLegacy"); bool run_on_model(const std::shared_ptr& f) override; }; diff --git a/src/common/transformations/include/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.hpp b/src/common/transformations/include/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.hpp index 0ffce989f0d83c..d7f4e2991a3d07 100644 --- a/src/common/transformations/include/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.hpp +++ b/src/common/transformations/include/transformations/fp16_compression/mark_subgraphs_to_keep_in_mixed_precision.hpp @@ -25,6 +25,6 @@ constexpr auto float16_min_normalized = float16::from_bits(0x0400); */ class ov::pass::MarkSugraphsToKeepInMixedPrecision : public ov::pass::ModelPass { public: - OPENVINO_RTTI("MarkSugraphsToKeepInMixedPrecision", "0"); + OPENVINO_MODEL_PASS_RTTI("MarkSugraphsToKeepInMixedPrecision"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/hash.hpp b/src/common/transformations/include/transformations/hash.hpp index 73668c7e53548e..3d6cf8f46076dc 100644 --- a/src/common/transformations/include/transformations/hash.hpp +++ b/src/common/transformations/include/transformations/hash.hpp @@ -18,7 +18,7 @@ namespace pass { */ class TRANSFORMATIONS_API Hash : public ov::pass::ModelPass { public: - OPENVINO_RTTI("HashPass"); + OPENVINO_MODEL_PASS_RTTI("HashPass"); bool run_on_model(const std::shared_ptr& f) override; diff --git a/src/common/transformations/include/transformations/init_node_info.hpp b/src/common/transformations/include/transformations/init_node_info.hpp index e458bcfdcd4bd4..9474edc00cf9e0 100644 --- a/src/common/transformations/include/transformations/init_node_info.hpp +++ b/src/common/transformations/include/transformations/init_node_info.hpp @@ -35,6 +35,6 @@ class TRANSFORMATIONS_API InitNodeInfo; */ class ov::pass::InitNodeInfo : public ov::pass::ModelPass { public: - OPENVINO_RTTI("InitNodeInfo", "0"); + OPENVINO_MODEL_PASS_RTTI("InitNodeInfo"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/opset_conversions/convert_opset2_to_opset1.hpp b/src/common/transformations/include/transformations/opset_conversions/convert_opset2_to_opset1.hpp index 8b523bc663912d..e3d511d396c510 100644 --- a/src/common/transformations/include/transformations/opset_conversions/convert_opset2_to_opset1.hpp +++ b/src/common/transformations/include/transformations/opset_conversions/convert_opset2_to_opset1.hpp @@ -19,6 +19,6 @@ class TRANSFORMATIONS_API ConvertOpSet2ToOpSet1; class ov::pass::ConvertOpSet2ToOpSet1 : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ConvertOpSet2ToOpSet1", "0"); + OPENVINO_MODEL_PASS_RTTI("ConvertOpSet2ToOpSet1"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/opset_conversions/convert_opset3_to_opset2.hpp b/src/common/transformations/include/transformations/opset_conversions/convert_opset3_to_opset2.hpp index 8a44b0d24ad6e4..f5e4faeeca93f8 100644 --- a/src/common/transformations/include/transformations/opset_conversions/convert_opset3_to_opset2.hpp +++ b/src/common/transformations/include/transformations/opset_conversions/convert_opset3_to_opset2.hpp @@ -19,6 +19,6 @@ class TRANSFORMATIONS_API ConvertOpSet3ToOpSet2; class ov::pass::ConvertOpSet3ToOpSet2 : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ConvertOpSet3ToOpSet2", "0"); + OPENVINO_MODEL_PASS_RTTI("ConvertOpSet3ToOpSet2"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/resolve_names_collisions.hpp b/src/common/transformations/include/transformations/resolve_names_collisions.hpp index f1d1f18a505441..8af93bd055043f 100644 --- a/src/common/transformations/include/transformations/resolve_names_collisions.hpp +++ b/src/common/transformations/include/transformations/resolve_names_collisions.hpp @@ -24,7 +24,7 @@ namespace pass { */ class TRANSFORMATIONS_API ResolveNameCollisions : public ModelPass { public: - OPENVINO_RTTI("ResolveNameCollisions", "0"); + OPENVINO_MODEL_PASS_RTTI("ResolveNameCollisions"); ResolveNameCollisions() = default; explicit ResolveNameCollisions(bool resolve_all_names) : m_resolve_all_names(resolve_all_names) {} bool run_on_model(const std::shared_ptr& model) override; diff --git a/src/common/transformations/include/transformations/smart_reshape/lstm_states_broadcast.hpp b/src/common/transformations/include/transformations/smart_reshape/lstm_states_broadcast.hpp index 55f80ace7812e3..6b93dd465c3ecd 100644 --- a/src/common/transformations/include/transformations/smart_reshape/lstm_states_broadcast.hpp +++ b/src/common/transformations/include/transformations/smart_reshape/lstm_states_broadcast.hpp @@ -26,6 +26,6 @@ class TRANSFORMATIONS_API LSTMStatesBroadcast; class ov::pass::LSTMStatesBroadcast : public ov::pass::ModelPass { public: - OPENVINO_RTTI("LSTMStatesBroadcast", "0"); + OPENVINO_MODEL_PASS_RTTI("LSTMStatesBroadcast"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/smart_reshape/smart_reshape.hpp b/src/common/transformations/include/transformations/smart_reshape/smart_reshape.hpp index 55bdf523762d91..970d64447c798a 100644 --- a/src/common/transformations/include/transformations/smart_reshape/smart_reshape.hpp +++ b/src/common/transformations/include/transformations/smart_reshape/smart_reshape.hpp @@ -20,6 +20,6 @@ class TRANSFORMATIONS_API SmartReshape; class ov::pass::SmartReshape : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SmartReshape", "0"); + OPENVINO_MODEL_PASS_RTTI("SmartReshape"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/symbolic_transformations/symbol_optimization.hpp b/src/common/transformations/include/transformations/symbolic_transformations/symbol_optimization.hpp index 179bc7d6cfcf52..323a1218bfdf4a 100644 --- a/src/common/transformations/include/transformations/symbolic_transformations/symbol_optimization.hpp +++ b/src/common/transformations/include/transformations/symbolic_transformations/symbol_optimization.hpp @@ -21,7 +21,7 @@ class TRANSFORMATIONS_API OptimizeSymbolsUsedAsValues; */ class ov::pass::ApplySymbolEquivalence : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ApplySymbolEquivalence", "0"); + OPENVINO_MODEL_PASS_RTTI("ApplySymbolEquivalence"); bool run_on_model(const std::shared_ptr& m) override; }; @@ -32,6 +32,6 @@ class ov::pass::ApplySymbolEquivalence : public ov::pass::ModelPass { */ class ov::pass::OptimizeSymbolsUsedAsValues : public ov::pass::ModelPass { public: - OPENVINO_RTTI("OptimizeSymbolsUsedAsValues", "0"); + OPENVINO_MODEL_PASS_RTTI("OptimizeSymbolsUsedAsValues"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/symbolic_transformations/symbolic_optimizations.hpp b/src/common/transformations/include/transformations/symbolic_transformations/symbolic_optimizations.hpp index 17a5d8503cbcb9..c6a99c90122544 100644 --- a/src/common/transformations/include/transformations/symbolic_transformations/symbolic_optimizations.hpp +++ b/src/common/transformations/include/transformations/symbolic_transformations/symbolic_optimizations.hpp @@ -24,7 +24,7 @@ class TRANSFORMATIONS_API LabelResolvingThroughSelect; */ class ov::pass::SymbolicOptimizations : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SymbolicOptimizations", "0"); + OPENVINO_MODEL_PASS_RTTI("SymbolicOptimizations"); explicit SymbolicOptimizations(bool full_run = true); bool run_on_model(const std::shared_ptr& m) override; std::shared_ptr get_manager() { @@ -42,7 +42,7 @@ class ov::pass::SymbolicOptimizations : public ov::pass::ModelPass { */ class ov::pass::SymbolicPropagation : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SymbolicPropagation"); + OPENVINO_MODEL_PASS_RTTI("SymbolicPropagation"); bool run_on_model(const std::shared_ptr& m) override; }; @@ -60,4 +60,4 @@ class ov::pass::LabelResolvingThroughSelect : public ov::pass::MatcherPass { public: OPENVINO_RTTI("LabelResolvingThroughSelect", "0"); LabelResolvingThroughSelect(); -}; \ No newline at end of file +}; diff --git a/src/common/transformations/include/transformations/transpose_sinking/ts_general.hpp b/src/common/transformations/include/transformations/transpose_sinking/ts_general.hpp index c794608798a4a4..09d4d5819322a9 100644 --- a/src/common/transformations/include/transformations/transpose_sinking/ts_general.hpp +++ b/src/common/transformations/include/transformations/transpose_sinking/ts_general.hpp @@ -52,6 +52,6 @@ class ov::pass::transpose_sinking::TSGeneralBackward : public ov::pass::GraphRew */ class ov::pass::transpose_sinking::TSGeneral : public ov::pass::ModelPass { public: - OPENVINO_RTTI("TSGeneral", "0"); + OPENVINO_MODEL_PASS_RTTI("TSGeneral"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/common/transformations/include/transformations/utils/print_model.hpp b/src/common/transformations/include/transformations/utils/print_model.hpp index 29340d60727c82..0829cd7e320e88 100644 --- a/src/common/transformations/include/transformations/utils/print_model.hpp +++ b/src/common/transformations/include/transformations/utils/print_model.hpp @@ -390,7 +390,7 @@ void dump_cpp_style(std::ostream& os, const std::shared_ptr& model) { class OPENVINO_API PrintModel : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::pass::PrintModel"); + OPENVINO_MODEL_PASS_RTTI("ov::pass::PrintModel"); PrintModel(std::string file_name) { static int dump_index = 0; 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 53f26e00136ee9..4e9715883ec9f8 100644 --- a/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/ric_fusion.cpp @@ -804,7 +804,7 @@ class ConvertPassThrough : public ov::pass::MatcherPass { class Constant : public ov::pass::ModelPass { public: - OPENVINO_RTTI("Constant", "0"); + OPENVINO_MODEL_PASS_RTTI("Constant"); Constant() = default; bool run_on_model(const std::shared_ptr& model) override { RUN_ON_FUNCTION_SCOPE(Constant); diff --git a/src/core/include/openvino/pass/constant_folding.hpp b/src/core/include/openvino/pass/constant_folding.hpp index 134f02c590974f..6b2e763e49cb1a 100644 --- a/src/core/include/openvino/pass/constant_folding.hpp +++ b/src/core/include/openvino/pass/constant_folding.hpp @@ -18,7 +18,7 @@ namespace pass { */ class OPENVINO_API ConstantFolding : public ModelPass { public: - OPENVINO_RTTI("ConstantFolding"); + OPENVINO_MODEL_PASS_RTTI("ConstantFolding"); bool run_on_model(const std::shared_ptr& model) override; protected: diff --git a/src/core/include/openvino/pass/convert_fp32_to_fp16.hpp b/src/core/include/openvino/pass/convert_fp32_to_fp16.hpp index ae9bb25efb4a87..ebae49b7a1fa05 100644 --- a/src/core/include/openvino/pass/convert_fp32_to_fp16.hpp +++ b/src/core/include/openvino/pass/convert_fp32_to_fp16.hpp @@ -14,7 +14,7 @@ namespace pass { */ class OPENVINO_API ConvertFP32ToFP16 : public ModelPass { public: - OPENVINO_RTTI("ConvertFP32ToFP16"); + OPENVINO_MODEL_PASS_RTTI("ConvertFP32ToFP16"); bool run_on_model(const std::shared_ptr&) override; }; } // namespace pass diff --git a/src/core/include/openvino/pass/graph_rewrite.hpp b/src/core/include/openvino/pass/graph_rewrite.hpp index 3fd801235c31a2..ec8e1339912513 100644 --- a/src/core/include/openvino/pass/graph_rewrite.hpp +++ b/src/core/include/openvino/pass/graph_rewrite.hpp @@ -34,7 +34,7 @@ namespace pass { /// \ingroup ov_pass_cpp_api class OPENVINO_API GraphRewrite : public ModelPass { public: - OPENVINO_RTTI("ov::pass::GraphRewrite"); + OPENVINO_MODEL_PASS_RTTI("ov::pass::GraphRewrite"); GraphRewrite() = default; diff --git a/src/core/include/openvino/pass/low_latency.hpp b/src/core/include/openvino/pass/low_latency.hpp index b3a8d38f755d42..d7bead4972c39b 100644 --- a/src/core/include/openvino/pass/low_latency.hpp +++ b/src/core/include/openvino/pass/low_latency.hpp @@ -36,7 +36,7 @@ namespace pass { */ class OPENVINO_API LowLatency2 : public ModelPass { public: - OPENVINO_RTTI("LowLatency2"); + OPENVINO_MODEL_PASS_RTTI("LowLatency2"); explicit LowLatency2(bool use_const_initializer = true) : m_use_const_initializer(use_const_initializer) {} diff --git a/src/core/include/openvino/pass/make_stateful.hpp b/src/core/include/openvino/pass/make_stateful.hpp index a4132589fe6a41..064f3fdea6aad1 100644 --- a/src/core/include/openvino/pass/make_stateful.hpp +++ b/src/core/include/openvino/pass/make_stateful.hpp @@ -18,7 +18,7 @@ namespace pass { */ class OPENVINO_API MakeStateful : public ModelPass { public: - OPENVINO_RTTI("MakeStateful"); + OPENVINO_MODEL_PASS_RTTI("MakeStateful"); using ParamResPairs = std::vector, std::shared_ptr>>; diff --git a/src/core/include/openvino/pass/pass.hpp b/src/core/include/openvino/pass/pass.hpp index 5c27df8aed4a0d..3927e7542aa886 100644 --- a/src/core/include/openvino/pass/pass.hpp +++ b/src/core/include/openvino/pass/pass.hpp @@ -4,16 +4,26 @@ #pragma once -#include #include -#include +#include #include "openvino/core/core_visibility.hpp" #include "openvino/core/enum_mask.hpp" #include "openvino/core/model.hpp" #include "openvino/core/node.hpp" +#include "openvino/core/rtti.hpp" #include "openvino/pass/pass_config.hpp" +#define _OPENVINO_MODEL_PASS_RTTI_WITH_TYPE(TYPE_NAME) _OPENVINO_MODEL_PASS_RTTI_WITH_TYPE_VERSION(TYPE_NAME, "0") + +#define _OPENVINO_MODEL_PASS_RTTI_WITH_TYPE_VERSION(TYPE_NAME, VERSION_NAME) \ + _OPENVINO_RTTI_WITH_TYPE_VERSION_PARENT(TYPE_NAME, VERSION_NAME, ::ov::pass::ModelPass) + +#define OPENVINO_MODEL_PASS_RTTI(...) \ + _OPENVINO_RTTI_EXPAND(_OPENVINO_RTTI_DEFINITION_SELECTOR_2(__VA_ARGS__, \ + _OPENVINO_MODEL_PASS_RTTI_WITH_TYPE_VERSION, \ + _OPENVINO_MODEL_PASS_RTTI_WITH_TYPE)(__VA_ARGS__)) + namespace ov { namespace pass { enum class PassProperty : uint32_t { diff --git a/src/core/include/openvino/pass/sdpa_to_paged_attention.hpp b/src/core/include/openvino/pass/sdpa_to_paged_attention.hpp index a0dd403818b462..74aeacb0719cee 100644 --- a/src/core/include/openvino/pass/sdpa_to_paged_attention.hpp +++ b/src/core/include/openvino/pass/sdpa_to_paged_attention.hpp @@ -17,7 +17,7 @@ namespace pass { */ class OPENVINO_API SDPAToPagedAttention : public ModelPass { public: - OPENVINO_RTTI("SDPAToPagedAttention"); + OPENVINO_MODEL_PASS_RTTI("SDPAToPagedAttention"); SDPAToPagedAttention(bool use_block_indices_inputs = false, bool use_score_outputs = false); bool run_on_model(const std::shared_ptr& model) override; diff --git a/src/core/include/openvino/pass/serialize.hpp b/src/core/include/openvino/pass/serialize.hpp index d0eaadde346bf6..ff99a59c70b556 100644 --- a/src/core/include/openvino/pass/serialize.hpp +++ b/src/core/include/openvino/pass/serialize.hpp @@ -26,7 +26,7 @@ namespace pass { */ class OPENVINO_API Serialize : public ov::pass::ModelPass { public: - OPENVINO_RTTI("Serialize"); + OPENVINO_MODEL_PASS_RTTI("Serialize"); enum class Version : uint8_t { UNSPECIFIED = 0, // Use the latest or function version @@ -63,7 +63,7 @@ class OPENVINO_API Serialize : public ov::pass::ModelPass { */ class OPENVINO_API StreamSerialize : public ov::pass::ModelPass { public: - OPENVINO_RTTI("StreamSerialize"); + OPENVINO_MODEL_PASS_RTTI("StreamSerialize"); struct DataHeader { size_t custom_data_offset; diff --git a/src/core/include/openvino/pass/stateful_to_stateless.hpp b/src/core/include/openvino/pass/stateful_to_stateless.hpp index 90fd6b9e6e7901..551c9315c20f72 100644 --- a/src/core/include/openvino/pass/stateful_to_stateless.hpp +++ b/src/core/include/openvino/pass/stateful_to_stateless.hpp @@ -14,7 +14,7 @@ namespace pass { */ class OPENVINO_API StatefulToStateless : public ModelPass { public: - OPENVINO_RTTI("StatefulToStateless"); + OPENVINO_MODEL_PASS_RTTI("StatefulToStateless"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/core/include/openvino/pass/validate.hpp b/src/core/include/openvino/pass/validate.hpp index 23cfe9909f707b..dce6967131d33d 100644 --- a/src/core/include/openvino/pass/validate.hpp +++ b/src/core/include/openvino/pass/validate.hpp @@ -24,7 +24,7 @@ namespace pass { /// \ingroup ov_pass_cpp_api class OPENVINO_API Validate : public ModelPass { public: - OPENVINO_RTTI("ov::pass::Validate"); + OPENVINO_MODEL_PASS_RTTI("ov::pass::Validate"); Validate() : ModelPass() {} bool run_on_model(const std::shared_ptr& f) override; diff --git a/src/core/include/openvino/pass/visualize_tree.hpp b/src/core/include/openvino/pass/visualize_tree.hpp index 065cec96e27220..2207270cd57d3d 100644 --- a/src/core/include/openvino/pass/visualize_tree.hpp +++ b/src/core/include/openvino/pass/visualize_tree.hpp @@ -28,7 +28,7 @@ namespace pass { */ class OPENVINO_API VisualizeTree : public ModelPass { public: - OPENVINO_RTTI("ov::pass::VisualizeTree"); + OPENVINO_MODEL_PASS_RTTI("ov::pass::VisualizeTree"); using node_modifiers_t = std::function& attributes)>; VisualizeTree(const std::string& file_name, node_modifiers_t nm = nullptr, bool dot_only = false); diff --git a/src/core/tests/frontend/decoder_transformation_extension.cpp b/src/core/tests/frontend/decoder_transformation_extension.cpp index 714dd4b9fafb18..d1110041392bf7 100644 --- a/src/core/tests/frontend/decoder_transformation_extension.cpp +++ b/src/core/tests/frontend/decoder_transformation_extension.cpp @@ -37,7 +37,7 @@ TEST(DecoderTransformation, FunctionPass) { namespace _decoder_transformation_test { class TestPass : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::pass::TestPass"); + OPENVINO_MODEL_PASS_RTTI("ov::pass::TestPass"); TestPass() = default; TestPass(const TestPass& tp) = default; bool run_on_model(const std::shared_ptr&) override { diff --git a/src/core/tests/pass_config.cpp b/src/core/tests/pass_config.cpp index 15ebc71eef10a6..053cb2b62aff32 100644 --- a/src/core/tests/pass_config.cpp +++ b/src/core/tests/pass_config.cpp @@ -51,7 +51,7 @@ class RenameSigmoid : public ov::pass::MatcherPass { class TestModelPass : public pass::ModelPass { public: - OPENVINO_RTTI("TestModelPass"); + OPENVINO_MODEL_PASS_RTTI("TestModelPass"); bool run_on_model(const std::shared_ptr& f) override { pass::Manager manager(get_pass_config()); diff --git a/src/frontends/common/src/extension/decoder_transformation.cpp b/src/frontends/common/src/extension/decoder_transformation.cpp index 4533fb89d85651..940131479ca9e0 100644 --- a/src/frontends/common/src/extension/decoder_transformation.cpp +++ b/src/frontends/common/src/extension/decoder_transformation.cpp @@ -12,6 +12,7 @@ using namespace ov::frontend; /// \brief Helper class to register user function as a FunctionPass class CustomModelPass : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("frontend::CustomModelPass"); explicit CustomModelPass(std::function)> pass) : m_pass(std::move(pass)) {} bool run_on_model(const std::shared_ptr& f) override { diff --git a/src/frontends/pytorch/src/transforms/dict_resolver.hpp b/src/frontends/pytorch/src/transforms/dict_resolver.hpp index 150b1361dab57d..b2830cecb51bdc 100644 --- a/src/frontends/pytorch/src/transforms/dict_resolver.hpp +++ b/src/frontends/pytorch/src/transforms/dict_resolver.hpp @@ -15,13 +15,13 @@ namespace pass { // This transformation replaces pattern Parameter(Dict)->aten::__getitem__ class DictParameterResolver : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::pytorch::pass::DictParameterResolver"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::pytorch::pass::DictParameterResolver"); bool run_on_model(const std::shared_ptr& model) override; }; // This transformation replaces pattern prim::DictConstruct->Result class DictResultResolver : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::pytorch::pass::DictResultResolver"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::pytorch::pass::DictResultResolver"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/frontends/pytorch/src/transforms/prim_list_tuple_construct_replacer.hpp b/src/frontends/pytorch/src/transforms/prim_list_tuple_construct_replacer.hpp index 31a025d6d90493..cbe8e1eb0b62c9 100644 --- a/src/frontends/pytorch/src/transforms/prim_list_tuple_construct_replacer.hpp +++ b/src/frontends/pytorch/src/transforms/prim_list_tuple_construct_replacer.hpp @@ -14,7 +14,7 @@ namespace pass { class DecomposeListTupleResults : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::pytorch::pass::DecomposeListTupleResults"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::pytorch::pass::DecomposeListTupleResults"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/frontends/pytorch/src/transforms/prim_unpack_parameter_replacer.hpp b/src/frontends/pytorch/src/transforms/prim_unpack_parameter_replacer.hpp index 2616b66fb58ab6..5d339a307033ef 100644 --- a/src/frontends/pytorch/src/transforms/prim_unpack_parameter_replacer.hpp +++ b/src/frontends/pytorch/src/transforms/prim_unpack_parameter_replacer.hpp @@ -27,7 +27,7 @@ namespace pass { // tuples only and the most nested objects in those tuples are tensors. class DecomposeUnpackParameters : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::pytorch::pass::DecomposeUnpackParameters"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::pytorch::pass::DecomposeUnpackParameters"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/frontends/pytorch/src/transforms/tuple_unpack_replacer.hpp b/src/frontends/pytorch/src/transforms/tuple_unpack_replacer.hpp index 625b986f3b64b7..2aec2824bbddd3 100644 --- a/src/frontends/pytorch/src/transforms/tuple_unpack_replacer.hpp +++ b/src/frontends/pytorch/src/transforms/tuple_unpack_replacer.hpp @@ -20,7 +20,7 @@ class PrimTupleUnpackReplacer : public ov::pass::MatcherPass { class TupleUnpackInBodyReplacer : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::pytorch::pass::TupleUnpackInBodyReplacer"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::pytorch::pass::TupleUnpackInBodyReplacer"); bool run_on_model(const std::shared_ptr& model) override; }; diff --git a/src/frontends/tensorflow/src/transformations/switch_merge_resolve.hpp b/src/frontends/tensorflow/src/transformations/switch_merge_resolve.hpp index 6038005e2eb4c4..d9eb34fb58d81b 100644 --- a/src/frontends/tensorflow/src/transformations/switch_merge_resolve.hpp +++ b/src/frontends/tensorflow/src/transformations/switch_merge_resolve.hpp @@ -20,7 +20,7 @@ namespace pass { // Merge nodes can have the same eliminated markers that means the fused If will have several outputs. class SwitchMergeResolver : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::tensorflow::SwitchMergeResolver"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::tensorflow::SwitchMergeResolver"); SwitchMergeResolver() = default; bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/frontends/tensorflow_common/include/helper_transforms/const_to_result_remover.hpp b/src/frontends/tensorflow_common/include/helper_transforms/const_to_result_remover.hpp index fc4d1c36fac3af..016f7b994dacb3 100644 --- a/src/frontends/tensorflow_common/include/helper_transforms/const_to_result_remover.hpp +++ b/src/frontends/tensorflow_common/include/helper_transforms/const_to_result_remover.hpp @@ -17,7 +17,7 @@ namespace pass { // We need to remove them because separate sub-graphs can solidly affect performance class ConstToResultRemover : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::tensorflow::pass::UnsupportedConstToResultRemover"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::tensorflow::pass::UnsupportedConstToResultRemover"); ConstToResultRemover() {} bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/frontends/tensorflow_common/include/helper_transforms/saved_model_unused_remover.hpp b/src/frontends/tensorflow_common/include/helper_transforms/saved_model_unused_remover.hpp index c7d457d8d6a361..fcc493458ccbba 100644 --- a/src/frontends/tensorflow_common/include/helper_transforms/saved_model_unused_remover.hpp +++ b/src/frontends/tensorflow_common/include/helper_transforms/saved_model_unused_remover.hpp @@ -15,7 +15,7 @@ namespace pass { // Results marked as unused by Saved Model settings class SavedModelUnusedRemover : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::tensorflow::pass::SavedModelUnusedRemover"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::tensorflow::pass::SavedModelUnusedRemover"); SavedModelUnusedRemover() {} bool run_on_model(const std::shared_ptr& m) override; diff --git a/src/frontends/tensorflow_lite/src/tflite_transformations/tflite_quantize_resolver.hpp b/src/frontends/tensorflow_lite/src/tflite_transformations/tflite_quantize_resolver.hpp index 584e8c55b6a9ea..84cdf44cbf5b02 100644 --- a/src/frontends/tensorflow_lite/src/tflite_transformations/tflite_quantize_resolver.hpp +++ b/src/frontends/tensorflow_lite/src/tflite_transformations/tflite_quantize_resolver.hpp @@ -32,7 +32,7 @@ class TFLQuantizeReplacer : public ov::pass::MatcherPass { // This transformation simplifies type manipulations in the graph class TFLQuantizeResolver : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ov::frontend::tensorflow_lite::pass::TFLQuantizeResolver"); + OPENVINO_MODEL_PASS_RTTI("ov::frontend::tensorflow_lite::pass::TFLQuantizeResolver"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.hpp b/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.hpp index 2b17039d198bf3..8ca0424ccda030 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/aarch64/pass/snippets_mark_skipped.hpp @@ -16,7 +16,7 @@ namespace intel_cpu { */ class SnippetsMarkSkipped : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SnippetsMarkSkipped", "0"); + OPENVINO_MODEL_PASS_RTTI("SnippetsMarkSkipped"); SnippetsMarkSkipped() : ModelPass() {} bool run_on_model(const std::shared_ptr&) override; }; diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/enforce_precision.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/enforce_precision.hpp index 05f8d1206715f0..24e848cf157e0e 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/enforce_precision.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/enforce_precision.hpp @@ -15,7 +15,7 @@ namespace pass { class EnforcePrecision : public ov::pass::ModelPass { public: - OPENVINO_RTTI("EnforcePrecision", "0"); + OPENVINO_MODEL_PASS_RTTI("EnforcePrecision"); EnforcePrecision(const element::Type source, const element::Type target, diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.hpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.hpp index fc5250defac8cb..f71a376ee1f038 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.hpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/snippets_mark_skipped.hpp @@ -16,7 +16,7 @@ namespace intel_cpu { */ class SnippetsMarkSkipped : public ov::pass::ModelPass { public: - OPENVINO_RTTI("SnippetsMarkSkipped", "0"); + OPENVINO_MODEL_PASS_RTTI("SnippetsMarkSkipped"); SnippetsMarkSkipped(bool enableBF16 = false) : ModelPass(), enableBF16(enableBF16) {} bool run_on_model(const std::shared_ptr&) override; diff --git a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/fuse_tpp_to_equations.hpp b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/fuse_tpp_to_equations.hpp index 9a00f97d9c464d..a99330845d443d 100644 --- a/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/fuse_tpp_to_equations.hpp +++ b/src/plugins/intel_cpu/src/transformations/tpp/x64/pass/fuse_tpp_to_equations.hpp @@ -18,7 +18,7 @@ namespace pass { */ class FuseTPPToEquations: public ov::pass::ModelPass { public: - OPENVINO_RTTI("FuseTPPToEquations", "0"); + OPENVINO_MODEL_PASS_RTTI("FuseTPPToEquations"); FuseTPPToEquations() = default; bool run_on_model(const std::shared_ptr& m) override; private: diff --git a/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.hpp b/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.hpp index 004bd4fad561a8..1cc30180db7142 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/convert_convolution.hpp @@ -11,7 +11,7 @@ namespace intel_gpu { class ConvertConvolutionToInternal : public ov::pass::ModelPass { public: - OPENVINO_RTTI("ConvertConvolutionToInternal", "0"); + OPENVINO_MODEL_PASS_RTTI("ConvertConvolutionToInternal"); bool run_on_model(const std::shared_ptr& m) override; }; diff --git a/src/plugins/intel_gpu/src/plugin/transformations/print_model_statistics.hpp b/src/plugins/intel_gpu/src/plugin/transformations/print_model_statistics.hpp index 079028f0154848..77922903c287bd 100644 --- a/src/plugins/intel_gpu/src/plugin/transformations/print_model_statistics.hpp +++ b/src/plugins/intel_gpu/src/plugin/transformations/print_model_statistics.hpp @@ -11,7 +11,7 @@ namespace intel_gpu { class PrintModelStatistics : public ov::pass::ModelPass { public: - OPENVINO_RTTI("PrintModelStatistics", "0"); + OPENVINO_MODEL_PASS_RTTI("PrintModelStatistics"); PrintModelStatistics() = default; bool run_on_model(const std::shared_ptr& m) override; 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 dbd945bc80a45b..461136bc08aaa8 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 @@ -127,6 +127,7 @@ namespace ov { namespace pass { class InjectionPass : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("InjectionPass"); using injection_callback = std::function)>; explicit InjectionPass(injection_callback callback) : ModelPass(), m_callback(std::move(callback)) {} @@ -268,6 +269,7 @@ class InitUniqueNames : public ov::pass::ModelPass { UniqueNamesHolder::Ptr m_unh; public: + OPENVINO_MODEL_PASS_RTTI("InitUniqueNames"); InitUniqueNames(UniqueNamesHolder::Ptr unh) : m_unh(unh) {} bool run_on_model(const std::shared_ptr& f) override { m_unh->init_names(f); @@ -279,6 +281,7 @@ class CheckUniqueNames : public ov::pass::ModelPass { UniqueNamesHolder::Ptr m_unh; public: + OPENVINO_MODEL_PASS_RTTI("CheckUniqueNames"); CheckUniqueNames(UniqueNamesHolder::Ptr unh, bool soft_names_comparison = false, bool result_friendly_names_check = true) diff --git a/src/tests/test_utils/common_test_utils/src/ov_test_utils.cpp b/src/tests/test_utils/common_test_utils/src/ov_test_utils.cpp index d781d92b57052a..91ef3fd6a7ebe1 100644 --- a/src/tests/test_utils/common_test_utils/src/ov_test_utils.cpp +++ b/src/tests/test_utils/common_test_utils/src/ov_test_utils.cpp @@ -17,6 +17,7 @@ namespace pass { class CopyTensorNamesToRefModel : public ov::pass::ModelPass { public: + OPENVINO_MODEL_PASS_RTTI("CopyTensorNamesToRefModel"); CopyTensorNamesToRefModel(const std::shared_ptr& ref_model) : m_ref_model(ref_model) {} bool run_on_model(const std::shared_ptr& f) override { const auto& orig_results = f->get_results();