From 5350d22745b0b425a644f23c6f76c621e1f18252 Mon Sep 17 00:00:00 2001 From: Pawel Raasz Date: Tue, 4 Feb 2025 06:32:43 +0000 Subject: [PATCH] Minor fixed and enable shared test eltwise, convolution for undefined type Signed-off-by: Pawel Raasz --- .../low_precision/layer_transformation.hpp | 2 +- .../instances/common/convolution.cpp | 54 ++++++++++--------- .../instances/common/eltwise.cpp | 12 ++--- .../shared_tests_instances/core_config.cpp | 4 +- .../src/base/ov_subgraph.cpp | 11 ++-- 5 files changed, 46 insertions(+), 37 deletions(-) diff --git a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp index df423516bd8984..b40170e54bc766 100644 --- a/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp +++ b/src/common/low_precision_transformations/include/low_precision/layer_transformation.hpp @@ -49,7 +49,7 @@ class LP_TRANSFORMATIONS_API DataPrecision { bool empty() const noexcept { OPENVINO_SUPPRESS_DEPRECATED_START - assert(((precision == element::dynamic || precisoin == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint)) || + assert(((precision == element::dynamic || precision == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint)) || ((precision != element::dynamic && precision != element::undefined) && (max != 0.f))); return (precision == element::dynamic || precision == element::undefined) && (min == 0.f) && (max == 0.f) && (!hasZeroPoint); OPENVINO_SUPPRESS_DEPRECATED_END diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/convolution.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/convolution.cpp index 1e50d14e5de685..0140811ade25ba 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/convolution.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/convolution.cpp @@ -11,20 +11,21 @@ using namespace CPUTestUtils; namespace ov { namespace test { namespace Convolution { +OPENVINO_SUPPRESS_DEPRECATED_START /* ============= Convolution (Gemm 1D) ============= */ -INSTANTIATE_TEST_SUITE_P(smoke_Conv_1D_GEMM_FP32, ConvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - convParams_ExplicitPadding_GEMM_1D(), - ::testing::Values(ElementType::f32), - ::testing::Values(ElementType::dynamic), - ::testing::Values(ElementType::dynamic), - ::testing::ValuesIn(inShapesGemm1D()), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_1D())), - ::testing::ValuesIn(fusingParamsSetWithEmpty()), - ::testing::Values(empty_plugin_config)), - ConvolutionLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P( + smoke_Conv_1D_GEMM_FP32, + ConvolutionLayerCPUTest, + ::testing::Combine(::testing::Combine(convParams_ExplicitPadding_GEMM_1D(), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::dynamic, ElementType::undefined), + ::testing::Values(ElementType::dynamic, ElementType::undefined), + ::testing::ValuesIn(inShapesGemm1D()), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_1D())), + ::testing::ValuesIn(fusingParamsSetWithEmpty()), + ::testing::Values(empty_plugin_config)), + ConvolutionLayerCPUTest::getTestCaseName); std::vector inputShapesPlain2Blocked3d = { {{}, {{ 1, 1, 7, 7, 7 }}}, @@ -62,19 +63,20 @@ INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_GEMM_FP32, ConvolutionLayerCPUTest, ::testing::Values(empty_plugin_config)), ConvolutionLayerCPUTest::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(Conv_2D_GEMM_FP32_dilated_empty_fusing, ConvolutionLayerCPUTest, - ::testing::Combine( - ::testing::Combine( - convParams_ExplicitPadding_GEMM_2D_dilated(), - ::testing::Values(ElementType::f32), - ::testing::Values(ElementType::dynamic), - ::testing::Values(ElementType::dynamic), - ::testing::ValuesIn(inShapesGemm2D()), - ::testing::Values(ov::test::utils::DEVICE_CPU)), - ::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_2D())), - ::testing::Values(emptyFusingSpec), - ::testing::Values(empty_plugin_config)), - ConvolutionLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P( + Conv_2D_GEMM_FP32_dilated_empty_fusing, + ConvolutionLayerCPUTest, + ::testing::Combine(::testing::Combine(convParams_ExplicitPadding_GEMM_2D_dilated(), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined, element::dynamic), + ::testing::Values(ElementType::undefined, element::dynamic), + ::testing::ValuesIn(inShapesGemm2D()), + ::testing::Values(ov::test::utils::DEVICE_CPU)), + ::testing::ValuesIn(filterCPUInfo(CPUParams_GEMM_2D())), + ::testing::Values(emptyFusingSpec), + ::testing::Values(empty_plugin_config)), + ConvolutionLayerCPUTest::getTestCaseName); +OPENVINO_SUPPRESS_DEPRECATED_END /* ============= Convolution (2D) ============= */ INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_FP32_empty_fusing, ConvolutionLayerCPUTest, diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/eltwise.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/eltwise.cpp index c208192521a63d..adff5b6348ed03 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/eltwise.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/common/eltwise.cpp @@ -12,15 +12,15 @@ using namespace CPUTestUtils; namespace ov { namespace test { namespace Eltwise { - +OPENVINO_SUPPRESS_DEPRECATED_START const auto params_4D = ::testing::Combine(::testing::Combine(::testing::ValuesIn(static_shapes_to_test_representation(inShapes_4D())), ::testing::ValuesIn(eltwiseOpTypesBinInp()), ::testing::ValuesIn(secondaryInputTypes()), ::testing::ValuesIn(opTypes()), ::testing::ValuesIn(netType()), - ::testing::Values(ov::element::dynamic), - ::testing::Values(ov::element::dynamic), + ::testing::Values(ov::element::dynamic, ElementType::undefined), + ::testing::Values(ov::element::dynamic, ElementType::undefined), ::testing::Values(ov::test::utils::DEVICE_CPU), ::testing::ValuesIn(additional_config())), ::testing::ValuesIn(filterCPUSpecificParams(cpuParams_4D())), @@ -35,14 +35,14 @@ const auto params_4D_Snippets = ::testing::ValuesIn(secondaryInputTypes()), ::testing::ValuesIn(opTypes()), ::testing::ValuesIn(netType()), - ::testing::Values(ov::element::dynamic), - ::testing::Values(ov::element::dynamic), + ::testing::Values(ov::element::dynamic, ElementType::undefined), + ::testing::Values(ov::element::dynamic, ElementType::undefined), ::testing::Values(ov::test::utils::DEVICE_CPU), ::testing::Values(additional_config()[0])), ::testing::ValuesIn(filterCPUSpecificParams(cpuParams_4D())), ::testing::Values(emptyFusingSpec), ::testing::Values(true)); - +OPENVINO_SUPPRESS_DEPRECATED_END INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_4D_MemOrder_Snippets, EltwiseLayerCPUTest, params_4D_Snippets, EltwiseLayerCPUTest::getTestCaseName); const auto params_4D_emptyCPUSpec = diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/core_config.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/core_config.cpp index c33fe27ed549a1..dbe5c6f993dce7 100644 --- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/core_config.cpp +++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/core_config.cpp @@ -19,9 +19,11 @@ void core_configuration(ov::test::SubgraphBaseTest* test) { } // todo: issue: 123320 - if (!((inf_prc != config.end() && inf_prc->second == element::dynamic) || + OPENVINO_SUPPRESS_DEPRECATED_START + if (!((inf_prc != config.end() && (inf_prc->second == element::dynamic || inf_prc->second == element::undefined)) || (inf_prc == config.end() && exec_mode != config.end() && exec_mode->second == hint::ExecutionMode::ACCURACY))) { + OPENVINO_SUPPRESS_DEPRECATED_END test->convert_precisions.insert({ov::element::bf16, ov::element::f32}); test->convert_precisions.insert({ov::element::f16, ov::element::f32}); } diff --git a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp index 5dd5029f27976c..4dc15eb72d4cbb 100644 --- a/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp +++ b/src/tests/functional/shared_test_classes/src/base/ov_subgraph.cpp @@ -273,7 +273,8 @@ void SubgraphBaseTest::configure_model() { { auto& params = function->get_parameters(); for (size_t i = 0; i < params.size(); i++) { - if (inType != ov::element::Type_t::dynamic) { + OPENVINO_SUPPRESS_DEPRECATED_START + if (inType != ov::element::Type_t::dynamic && inType != ov::element::undefined) { p.input(i).tensor().set_element_type(inType); } } @@ -283,11 +284,12 @@ void SubgraphBaseTest::configure_model() { { auto results = function->get_results(); for (size_t i = 0; i < results.size(); i++) { - if (outType != ov::element::Type_t::dynamic) { + if (outType != ov::element::Type_t::dynamic && outType != ov::element::undefined) { p.output(i).tensor().set_element_type(outType); } } } + OPENVINO_SUPPRESS_DEPRECATED_END function = p.build(); } @@ -377,7 +379,10 @@ void SubgraphBaseTest::update_ref_model() { } const auto& outputs = functionRefs->outputs(); for (size_t i = 0; i < outputs.size(); ++i) { - if (outType != ElementType::dynamic && outType != outputs[i].get_element_type()) { + OPENVINO_SUPPRESS_DEPRECATED_START + if (outType != ElementType::dynamic && outType != element::undefined && + outType != outputs[i].get_element_type()) { + OPENVINO_SUPPRESS_DEPRECATED_END p.output(i).tensor().set_element_type(outType); } }