From e59a8a2744d3b1ad420a69f5bc652b876ff48cc2 Mon Sep 17 00:00:00 2001 From: Yuan Hu Date: Mon, 1 Jul 2024 18:46:47 +0800 Subject: [PATCH 01/15] [CPU] Add test case for precision fp16 (#19721) ### Details: - *https://github.com/openvinotoolkit/openvino/pull/16500#issuecomment-1602581987* - *add test case for conv dconv fullconnect matmul mvn pad pooling subgraph softmax* ### Tickets: - *CVS-110112* --------- Signed-off-by: HU Yuan2 --- .../dev_api/openvino/runtime/system_conf.hpp | 7 + src/inference/src/system_conf.cpp | 7 + src/plugins/intel_cpu/src/graph.cpp | 4 +- .../classes/convolution.cpp | 7 +- .../classes/convolution_backprop_data.cpp | 8 +- .../single_layer_tests/classes/matmul.cpp | 9 +- .../single_layer_tests/classes/pooling.cpp | 30 +- .../single_layer_tests/classes/pooling.hpp | 7 +- .../single_layer_tests/classes/softmax.cpp | 17 +- .../single_layer_tests/classes/softmax.hpp | 3 +- .../instances/common/pooling.cpp | 39 ++- .../instances/common/softmax.cpp | 12 +- .../instances/x64/convolution.cpp | 108 ++++++- .../x64/convolution_backprop_data.cpp | 57 ++++ .../instances/x64/matmul.cpp | 273 +++++++++++++++++- .../instances/x64/pooling.cpp | 127 +++++++- .../instances/x64/softmax.cpp | 94 ++++++ .../custom/single_layer_tests/pad.cpp | 124 +++++--- .../src/concat_const_inplace.cpp | 14 +- .../subgraph_tests/src/conv_sum_broadcast.cpp | 35 ++- .../fullyconnected_strided_inputs_outputs.cpp | 16 + .../subgraph_tests/src/inplace_edge.cpp | 2 +- .../src/input_noreorder_eltwise_bf16.cpp | 31 +- .../custom/subgraph_tests/src/interaction.cpp | 16 + .../src/matmul_strided_inputs_outputs.cpp | 15 + .../subgraph_tests/src/remove_convert.cpp | 51 +++- .../skip_tests_config.cpp | 7 + .../functional/utils/arm/filter_cpu_info.cpp | 4 + .../tests/functional/utils/cpu_test_utils.cpp | 71 +++++ .../tests/functional/utils/cpu_test_utils.hpp | 6 +- .../functional/utils/filter_cpu_info.hpp | 1 + .../functional/utils/x64/filter_cpu_info.cpp | 18 ++ 32 files changed, 1110 insertions(+), 110 deletions(-) create mode 100644 src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/softmax.cpp diff --git a/src/inference/dev_api/openvino/runtime/system_conf.hpp b/src/inference/dev_api/openvino/runtime/system_conf.hpp index c3d3364c550f1a..b6f22ad4f8daa7 100644 --- a/src/inference/dev_api/openvino/runtime/system_conf.hpp +++ b/src/inference/dev_api/openvino/runtime/system_conf.hpp @@ -146,6 +146,13 @@ OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_amx_int8(); */ OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_amx_bf16(); +/** + * @brief Checks whether CPU supports AMX fp16 capability + * @ingroup ov_dev_api_system_conf + * @return `True` is tAMX_FP16 instructions are available, `false` otherwise + */ +OPENVINO_RUNTIME_API bool with_cpu_x86_avx512_core_amx_fp16(); + /** * @brief Checks whether CPU supports AMX capability * @ingroup ov_dev_api_system_conf diff --git a/src/inference/src/system_conf.cpp b/src/inference/src/system_conf.cpp index 4987e72355a5a6..fd8f97d93addd5 100644 --- a/src/inference/src/system_conf.cpp +++ b/src/inference/src/system_conf.cpp @@ -92,6 +92,10 @@ bool with_cpu_x86_avx512_core_amx_bf16() { return get_cpu_info().has(Xbyak::util::Cpu::tAMX_BF16); } +bool with_cpu_x86_avx512_core_amx_fp16() { + return get_cpu_info().has(Xbyak::util::Cpu::tAMX_FP16); +} + bool with_cpu_x86_avx512_core_amx() { return with_cpu_x86_avx512_core_amx_int8() || with_cpu_x86_avx512_core_amx_bf16(); } @@ -131,6 +135,9 @@ bool with_cpu_x86_avx512_core_amx_int8() { bool with_cpu_x86_avx512_core_amx_bf16() { return false; } +bool with_cpu_x86_avx512_core_amx_fp16() { + return false; +} bool with_cpu_x86_avx512_core_amx() { return false; } diff --git a/src/plugins/intel_cpu/src/graph.cpp b/src/plugins/intel_cpu/src/graph.cpp index e17d4d7ae029ef..2ff2ee2636ec02 100644 --- a/src/plugins/intel_cpu/src/graph.cpp +++ b/src/plugins/intel_cpu/src/graph.cpp @@ -1832,7 +1832,7 @@ void Graph::EnforceInferencePrecision() { for (size_t i = 0; i < node->getOriginalInputsNumber(); i++) { auto keepOriginalInputPrecisionAtPort = [](const NodePtr& node, const size_t inPort) { - // keep non-float precisions + // keep non-float32 precisions if (node->getOriginalInputPrecisionAtPort(inPort) != ov::element::f32) return true; @@ -1876,7 +1876,7 @@ void Graph::EnforceInferencePrecision() { } for (size_t i = 0; i < node->getOriginalOutputsNumber(); i++) { - // keep non-float precisions + // keep non-float32 precisions if (node->getOriginalOutputPrecisionAtPort(i) != ov::element::f32) continue; diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.cpp index 7f294b3fc7fc75..207e522c32f823 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution.cpp @@ -160,11 +160,16 @@ void ConvolutionLayerCPUTest::SetUp() { init_input_shapes({inputShape}); auto it = configuration.find(ov::hint::inference_precision.name()); - if (it != configuration.end() && it->second.as() == ov::element::bf16) { + ov::element::Type inference_precision = (it != configuration.end()) ? + it->second.as() : ov::element::undefined; + if (inference_precision == ov::element::bf16) { selectedType += "_BF16"; rel_threshold = 1e-2f; if (selectedType == "jit_gemm_BF16") rel_threshold = 0.05f; + } else if (inference_precision == ov::element::f16) { + selectedType += "_FP16"; + rel_threshold = 0.00125f; } else { selectedType = makeSelectedTypeStr(selectedType, netType); } diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution_backprop_data.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution_backprop_data.cpp index 93f1b11cf117a2..415515ef7f40a2 100755 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution_backprop_data.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/convolution_backprop_data.cpp @@ -196,9 +196,15 @@ void DeconvolutionLayerCPUTest::SetUp() { std::tie(kernel, stride, padBegin, padEnd, dilation, convOutChannels, padType, outPadding) = basicParamsSet; - if (additionalConfig[ov::hint::inference_precision.name()] == ov::element::bf16) { + auto it = configuration.find(ov::hint::inference_precision.name()); + ov::element::Type inference_precision = (it != configuration.end()) ? + it->second.as() : ov::element::undefined; + if (inference_precision == ov::element::bf16) { inType = outType = prec = ElementType::bf16; rel_threshold = 1e-2f; + } else if (inference_precision == ov::element::f16) { + inType = outType = prec = ElementType::f16; + rel_threshold = 0.00125f; } else { inType = outType = prec; } diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/matmul.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/matmul.cpp index 3e55d3368cefb3..dd58da28c8ad05 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/matmul.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/matmul.cpp @@ -118,9 +118,14 @@ void MatMulLayerCPUTest::SetUp() { configuration.insert(additionalConfig.begin(), additionalConfig.end()); auto it = additionalConfig.find(ov::hint::inference_precision.name()); - if (it != additionalConfig.end() && it->second.as() == ov::element::bf16) { + ov::element::Type inference_precision = (it != additionalConfig.end()) ? + it->second.as() : ov::element::undefined; + if (inference_precision == ov::element::bf16) { inType = outType = netType = ElementType::bf16; rel_threshold = abs_threshold = 1e-2f; + } else if (inference_precision == ov::element::f16) { + inType = outType = netType = ElementType::f16; + rel_threshold = abs_threshold = 1e-4f; } else { inType = outType = netType; rel_threshold = 1e-4f; @@ -128,7 +133,7 @@ void MatMulLayerCPUTest::SetUp() { } cpuNodeType = nodeType == MatMulNodeType::MatMul ? "MatMul" : "FullyConnected"; - selectedType = makeSelectedTypeStr(selectedType, outType); + selectedType = makeSelectedTypeStr(selectedType, deduce_expected_precision(outType, configuration)); ov::ParameterVector params{std::make_shared(netType, inShapeA)}; diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.cpp index 22bf0994deb37e..65f48713185f59 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.cpp @@ -19,7 +19,8 @@ std::string PoolingLayerCPUTest::getTestCaseName(const testing::TestParamInfo kernel, stride; @@ -53,6 +54,12 @@ std::string PoolingLayerCPUTest::getTestCaseName(const testing::TestParamInfo kernel, stride, dilation; std::vector padBegin, padEnd; @@ -146,6 +156,12 @@ std::string MaxPoolingV8LayerCPUTest::getTestCaseName( results << "PE" << ov::test::utils::vec2str(padEnd) << "_"; results << "Rounding=" << roundingType << "_"; results << "AutoPad=" << padType << "_"; + if (!additionalConfig.empty()) { + results << "_PluginConf"; + for (auto& item : additionalConfig) { + results << "_" << item.first << "=" << item.second.as(); + } + } results << CPUTestsBase::getTestCaseName(cpuParams); return results.str(); @@ -158,7 +174,9 @@ void MaxPoolingV8LayerCPUTest::SetUp() { InputShape inputShapes; ElementType inPrc; CPUSpecificParams cpuParams; - std::tie(basicParamsSet, inputShapes, inPrc, cpuParams) = this->GetParam(); + ov::AnyMap additionalConfig; + std::tie(basicParamsSet, inputShapes, inPrc, cpuParams, additionalConfig) = this->GetParam(); + configuration.insert(additionalConfig.begin(), additionalConfig.end()); std::vector kernel, stride, dilation; std::vector padBegin, padEnd; @@ -172,7 +190,7 @@ void MaxPoolingV8LayerCPUTest::SetUp() { if (selectedType.empty()) { selectedType = getPrimitiveType(); } - selectedType = makeSelectedTypeStr(selectedType, inPrc); + selectedType = makeSelectedTypeStr(selectedType, deduce_expected_precision(inPrc, configuration)); init_input_shapes({inputShapes}); diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.hpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.hpp index a2add35826accd..a1d04c633e94f1 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.hpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/pooling.hpp @@ -19,12 +19,15 @@ using poolLayerCpuTestParamsSet = std::tuple; + fusingSpecificParams, + ov::AnyMap>; + using maxPoolV8LayerCpuTestParamsSet = std::tuple; + CPUSpecificParams, + ov::AnyMap>; class PoolingLayerCPUTest : public testing::WithParamInterface, virtual public SubgraphBaseTest, public CpuTestWithFusing { diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/softmax.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/softmax.cpp index fe95030df307ae..bf2cc9617d8835 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/softmax.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/softmax.cpp @@ -16,7 +16,8 @@ std::string SoftMaxLayerCPUTest::getTestCaseName(const testing::TestParamInfo specificParams_FP16_AMX { + CPUSpecificParams{{}, {}, {"brgemm_avx512_amx"}, "brgemm_avx512_amx"} +}; + const std::vector IS_x64 = { {static_shapes_to_test_representation({{7, 32, 120}, {3, 7, 120, 50}}), {false, false}}, {static_shapes_to_test_representation({{7, 32, 120}, {3, 7, 120, 50}}), {true, false}}, @@ -47,6 +56,7 @@ std::vector fusingParamsSet2DBF16 { fusingPReluPerTensor, }; +std::vector fusingParamsSet2DFP16 = fusingParamsSet2DBF16; const std::vector matmulFusingParamsNightly { emptyFusingSpec, fusingElu, @@ -71,6 +81,21 @@ const auto testParams_Static_IS_x64 = ::testing::Combine(matMulParams_x64, INSTANTIATE_TEST_SUITE_P(smoke_MM_Static_IS_x64, MatMulLayerCPUTest, testParams_Static_IS_x64, MatMulLayerCPUTest::getTestCaseName); +const auto matMulParams_x64_FP16 = ::testing::Combine(::testing::ValuesIn(IS_x64), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParams_Static_IS_x64_FP16 = ::testing::Combine(matMulParams_x64_FP16, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulFusingParams()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Static_IS_x64_FP16, MatMulLayerCPUTest, testParams_Static_IS_x64_FP16, MatMulLayerCPUTest::getTestCaseName); + const auto testParams2D_smoke = ::testing::Combine(::testing::Combine(::testing::ValuesIn(IS2D_smoke()), ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), @@ -93,8 +118,20 @@ const auto testParams2DBF16_smoke = ::testing::Combine(::testing::Combine(::test ::testing::ValuesIn(fusingParamsSet2DBF16), ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); +const auto testParams2DFP16_smoke = ::testing::Combine(::testing::Combine(::testing::ValuesIn(IS2D_smoke()), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)), + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2DFP16), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + INSTANTIATE_TEST_SUITE_P(smoke_FC_2D, MatMulLayerCPUTest, testParams2D_smoke, MatMulLayerCPUTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_BF16, MatMulLayerCPUTest, testParams2DBF16_smoke, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_FP16, MatMulLayerCPUTest, testParams2DFP16_smoke, MatMulLayerCPUTest::getTestCaseName); const auto testParams2D_nightly = ::testing::Combine(::testing::Combine(::testing::ValuesIn(IS2D_nightly()), ::testing::Values(ElementType::f32), @@ -212,12 +249,26 @@ const auto fullyConnectedParams2D_Brgemm_smoke = ::testing::Combine(::testing::V ::testing::Values(ov::test::utils::DEVICE_CPU), ::testing::ValuesIn(filterAdditionalConfig_Brgemm())); +const auto fullyConnectedParams2D_Brgemm_FP16_smoke = ::testing::Combine(::testing::ValuesIn(IS2D_Brgemm_smoke), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + const auto testParams2D_Brgemm_smoke = ::testing::Combine(fullyConnectedParams2D_Brgemm_smoke, ::testing::Values(MatMulNodeType::FullyConnected), ::testing::ValuesIn(fusingParamsSet2D_Brgemm_smoke), ::testing::ValuesIn(filterSpecificParams_Brgemm(true))); +const auto testParams2D_Brgemm_FP16_smoke = ::testing::Combine(fullyConnectedParams2D_Brgemm_FP16_smoke, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2D_Brgemm_smoke), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_Brgemm, MatMulLayerCPUTest, testParams2D_Brgemm_smoke, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_Brgemm_FP16, MatMulLayerCPUTest, testParams2D_Brgemm_FP16_smoke, MatMulLayerCPUTest::getTestCaseName); const std::vector IS_brgemm_smoke = { {static_shapes_to_test_representation({{1, 2, 32, 120}, {120, 5}}), {false, false}}, @@ -248,6 +299,21 @@ const auto testBrgemmParams_smoke = ::testing::Combine(matMulBrgemmParams_smoke, INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Static, MatMulLayerCPUTest, testBrgemmParams_smoke, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmParams_FP16_smoke = ::testing::Combine(::testing::ValuesIn(IS_brgemm_smoke), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmParams_FP16_smoke = ::testing::Combine(matMulBrgemmParams_FP16_smoke, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulFusingParams()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Static_FP16, MatMulLayerCPUTest, testBrgemmParams_FP16_smoke, MatMulLayerCPUTest::getTestCaseName); + const std::vector IS_brgemm_nightly = { {static_shapes_to_test_representation({{1, 2, 32, 120}, {120, 5}}), {false, true}}, {static_shapes_to_test_representation({{1, 2, 32, 120}, {120, 5}}), {true, true}}, @@ -277,6 +343,21 @@ const auto testBrgemmParams_nightly = ::testing::Combine(matMulBrgemmParams_nigh INSTANTIATE_TEST_SUITE_P(nightly_MM_Brgemm_Static, MatMulLayerCPUTest, testBrgemmParams_nightly, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmParams_FP16_nightly = ::testing::Combine(::testing::ValuesIn(IS_brgemm_nightly), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmParams_FP16_nightly = ::testing::Combine(matMulBrgemmParams_FP16_nightly, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulFusingParams()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(nightly_MM_Brgemm_Static_FP16, MatMulLayerCPUTest, testBrgemmParams_FP16_nightly, MatMulLayerCPUTest::getTestCaseName); + const std::vector IS_Brgemm_Dynamic = { { { @@ -351,6 +432,21 @@ const auto testBrgemmParamsDynamic = ::testing::Combine(matMulBrgemmParamsDynami INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Dynamic, MatMulLayerCPUTest, testBrgemmParamsDynamic, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmParamsDynamic_FP16 = ::testing::Combine(::testing::ValuesIn(IS_Brgemm_Dynamic), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmParamsDynamic_FP16 = ::testing::Combine(matMulBrgemmParamsDynamic_FP16, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Dynamic_FP16, MatMulLayerCPUTest, testBrgemmParamsDynamic_FP16, MatMulLayerCPUTest::getTestCaseName); + const std::vector IS_Dynamic_Fusing = { { { //dynamic case description each pair per each input has {{dynamic shape}, {{static shape case1}, {static shape case2}, ...} @@ -415,6 +511,21 @@ const auto testParamsDynamicFusing = ::testing::Combine(matMulParamsDynamicFusin INSTANTIATE_TEST_SUITE_P(smoke_MM_Dynamic_Fusing, MatMulLayerCPUTest, testParamsDynamicFusing, MatMulLayerCPUTest::getTestCaseName); +const auto matMulParamsDynamicFusing_FP16 = ::testing::Combine(::testing::ValuesIn(IS_Dynamic_Fusing), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParamsDynamicFusing_FP16 = ::testing::Combine(matMulParamsDynamicFusing_FP16, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulFusingParams()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Dynamic_Fusing_FP16, MatMulLayerCPUTest, testParamsDynamicFusing_FP16, MatMulLayerCPUTest::getTestCaseName); + const auto matMulParamsBrgemmDynamicFusing = ::testing::Combine(::testing::ValuesIn(IS_Dynamic_Fusing), ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), @@ -430,6 +541,21 @@ const auto testParamsBrgemmDynamicFusing = ::testing::Combine(matMulParamsBrgemm INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Dynamic_Fusing, MatMulLayerCPUTest, testParamsBrgemmDynamicFusing, MatMulLayerCPUTest::getTestCaseName); +const auto matMulParamsBrgemmDynamicFusing_FP16 = ::testing::Combine(::testing::ValuesIn(IS_Dynamic_Fusing), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParamsBrgemmDynamicFusing_FP16 = ::testing::Combine(matMulParamsBrgemmDynamicFusing_FP16, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulFusingParams()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Dynamic_Fusing_FP16, MatMulLayerCPUTest, testParamsBrgemmDynamicFusing_FP16, MatMulLayerCPUTest::getTestCaseName); + std::vector filterAdditionalConfig_BrgemmAmx() { std::vector additionalConfig; if (with_cpu_x86_bfloat16()) { @@ -485,6 +611,21 @@ const auto testBrgemmAmxParams_smoke = ::testing::Combine(matMulBrgemmAmxParams_ INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Amx_Static, MatMulLayerCPUTest, testBrgemmAmxParams_smoke, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmAmxParams_FP16_smoke = ::testing::Combine(::testing::ValuesIn(IS_brgemm_Amx_smoke), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmAmxParams_FP16_smoke = ::testing::Combine(matMulBrgemmAmxParams_FP16_smoke, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulBrgemmAmxFusingParams), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16_AMX))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Amx_Static_FP16, MatMulLayerCPUTest, testBrgemmAmxParams_FP16_smoke, MatMulLayerCPUTest::getTestCaseName); + const auto matMulBrgemmAmxParams_nightly = ::testing::Combine(::testing::ValuesIn(IS_brgemm_Amx_smoke), ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), @@ -500,6 +641,21 @@ const auto testBrgemmAmxParams_nightly = ::testing::Combine(matMulBrgemmAmxParam INSTANTIATE_TEST_SUITE_P(nightly_MM_Brgemm_Amx_Static, MatMulLayerCPUTest, testBrgemmAmxParams_nightly, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmAmxParams_FP16_nightly = ::testing::Combine(::testing::ValuesIn(IS_brgemm_Amx_smoke), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmAmxParams_FP16_nightly = ::testing::Combine(matMulBrgemmAmxParams_FP16_nightly, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::ValuesIn(matmulBrgemmAmxFusingParams), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16_AMX))); + +INSTANTIATE_TEST_SUITE_P(nightly_MM_Brgemm_Amx_Static_FP16, MatMulLayerCPUTest, testBrgemmAmxParams_FP16_nightly, MatMulLayerCPUTest::getTestCaseName); + const auto matMulBrgemmAmxParamsDynamic = ::testing::Combine(::testing::ValuesIn(IS_Brgemm_Dynamic), ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), @@ -515,6 +671,21 @@ const auto testBrgemmAmxParamsDynamic = ::testing::Combine(matMulBrgemmAmxParams INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Amx_Dynamic, MatMulLayerCPUTest, testBrgemmAmxParamsDynamic, MatMulLayerCPUTest::getTestCaseName); +const auto matMulBrgemmAmxParamsDynamic_FP16 = ::testing::Combine(::testing::ValuesIn(IS_Brgemm_Dynamic), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::PARAMETER), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testBrgemmAmxParamsDynamic_FP16 = ::testing::Combine(matMulBrgemmAmxParamsDynamic_FP16, + ::testing::Values(MatMulNodeType::MatMul), + ::testing::Values(emptyFusingSpec), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16_AMX))); + +INSTANTIATE_TEST_SUITE_P(smoke_MM_Brgemm_Amx_Dynamic_FP16, MatMulLayerCPUTest, testBrgemmAmxParamsDynamic_FP16, MatMulLayerCPUTest::getTestCaseName); + const std::vector IS2D_Brgemm_Amx_smoke = { {static_shapes_to_test_representation({{59, 16}, {16, 120}}), {true, false}}, {static_shapes_to_test_representation({{59, 16}, {16, 120}}), {true, true}}, @@ -630,6 +801,21 @@ const auto testParams2D_Brgemm_Amx_smoke = ::testing::Combine(fullyConnectedPara INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_Brgemm_Amx, MatMulLayerCPUTest, testParams2D_Brgemm_Amx_smoke, MatMulLayerCPUTest::getTestCaseName); +const auto fullyConnectedParams2D_FP16_Brgemm_Amx_smoke = ::testing::Combine(::testing::ValuesIn(IS2D_Brgemm_Amx_smoke), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParams2D_FP16_Brgemm_Amx_smoke = ::testing::Combine(fullyConnectedParams2D_FP16_Brgemm_Amx_smoke, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2D_Brgemm_smoke), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16_AMX))); + +INSTANTIATE_TEST_SUITE_P(smoke_FC_2D_Brgemm_Amx_FP16, MatMulLayerCPUTest, testParams2D_FP16_Brgemm_Amx_smoke, MatMulLayerCPUTest::getTestCaseName); + const std::vector IS2D_Brgemm_nightly = { {static_shapes_to_test_representation({{59, 16}, {16, 120}}), {false, false}}, {static_shapes_to_test_representation({{59, 16}, {16, 120}}), {false, true}}, @@ -668,6 +854,21 @@ const auto testParams2D_Brgemm_nightly = ::testing::Combine(fullyConnectedParams INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_Brgemm, MatMulLayerCPUTest, testParams2D_Brgemm_nightly, MatMulLayerCPUTest::getTestCaseName); +const auto fullyConnectedParams2D_FP16_Brgemm_nightly = ::testing::Combine(::testing::ValuesIn(IS2D_Brgemm_nightly), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParams2D_FP16_Brgemm_nightly = ::testing::Combine(fullyConnectedParams2D_FP16_Brgemm_nightly, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2D_nightly), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + +INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_Brgemm_FP16, MatMulLayerCPUTest, testParams2D_FP16_Brgemm_nightly, MatMulLayerCPUTest::getTestCaseName); + const auto fullyConnectedParams2D_Brgemm_Amx_nightly = ::testing::Combine(::testing::ValuesIn(IS2D_Brgemm_nightly), ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), @@ -683,6 +884,21 @@ const auto testParams2D_Brgemm_Amx_nightly = ::testing::Combine(fullyConnectedPa INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_Brgemm_Amx, MatMulLayerCPUTest, testParams2D_Brgemm_Amx_nightly, MatMulLayerCPUTest::getTestCaseName); +const auto fullyConnectedParams2D_FP16_Brgemm_Amx_nightly = ::testing::Combine(::testing::ValuesIn(IS2D_Brgemm_nightly), + ::testing::Values(ElementType::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + +const auto testParams2D_FP16_Brgemm_Amx_nightly = ::testing::Combine(fullyConnectedParams2D_FP16_Brgemm_Amx_nightly, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2D_nightly), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16_AMX))); + +INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_Brgemm_Amx_FP16, MatMulLayerCPUTest, testParams2D_FP16_Brgemm_Amx_nightly, MatMulLayerCPUTest::getTestCaseName); + const auto testParams2DBF16_nightly = ::testing::Combine(::testing::Combine(::testing::ValuesIn(IS2D_nightly()), ::testing::ValuesIn(netPRCs()), ::testing::Values(ElementType::undefined), @@ -694,8 +910,20 @@ const auto testParams2DBF16_nightly = ::testing::Combine(::testing::Combine(::te ::testing::ValuesIn(fusingParamsSet2DBF16), ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); +const auto testParams2DFP16_nightly = ::testing::Combine(::testing::Combine(::testing::ValuesIn(IS2D_nightly()), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)), + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet2DFP16), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + INSTANTIATE_TEST_SUITE_P(nightly_FC_2D, MatMulLayerCPUTest, testParams2D_nightly, MatMulLayerCPUTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_BF16, MatMulLayerCPUTest, testParams2DBF16_nightly, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(nightly_FC_2D_FP16, MatMulLayerCPUTest, testParams2DFP16_nightly, MatMulLayerCPUTest::getTestCaseName); std::vector fusingParamsSet3D_smoke { // The following three patterns are convered by MLAS test @@ -714,6 +942,12 @@ std::vector fusingParamsSet3DBF16 { fusingMultiplyPerChannel, }; +std::vector fusingParamsSet3DFP16 { + emptyFusingSpec, + fusingBias, + fusingMultiplyPerChannel, +}; + const auto fullyConnectedParams3DBF16_smoke = ::testing::Combine(::testing::ValuesIn(IS3D_smoke()), ::testing::ValuesIn(netPRCs()), ::testing::Values(ElementType::undefined), @@ -722,12 +956,26 @@ const auto fullyConnectedParams3DBF16_smoke = ::testing::Combine(::testing::Valu ::testing::Values(ov::test::utils::DEVICE_CPU), ::testing::ValuesIn(additionalConfig())); +const auto fullyConnectedParams3DFP16_smoke = ::testing::Combine(::testing::ValuesIn(IS3D_smoke()), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); + const auto testParams3DBF16_smoke = ::testing::Combine(fullyConnectedParams3DBF16_smoke, ::testing::Values(MatMulNodeType::FullyConnected), ::testing::ValuesIn(fusingParamsSet3DBF16), ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); +const auto testParams3DFP16_smoke = ::testing::Combine(fullyConnectedParams3DFP16_smoke, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet3DFP16), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + INSTANTIATE_TEST_SUITE_P(smoke_FC_3D_BF16, MatMulLayerCPUTest, testParams3DBF16_smoke, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_FC_3D_FP16, MatMulLayerCPUTest, testParams3DFP16_smoke, MatMulLayerCPUTest::getTestCaseName); const auto fullyConnectedParams3D_smoke = ::testing::Combine(::testing::ValuesIn(IS3D_smoke()), ::testing::Values(ElementType::f32), @@ -794,19 +1042,32 @@ const auto fullyConnectedParams3DBF16_nightly = ::testing::Combine(::testing::Va ::testing::Values(ov::test::utils::DEVICE_CPU), ::testing::ValuesIn(additionalConfig())); -const auto testParams3DBF16_nightly = ::testing::Combine(fullyConnectedParams3DBF16_nightly, - ::testing::Values(MatMulNodeType::FullyConnected), - ::testing::ValuesIn(fusingParamsSet3DBF16), - ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); - -INSTANTIATE_TEST_SUITE_P(nightly_FC_3D_BF16, MatMulLayerCPUTest, testParams3DBF16_nightly, MatMulLayerCPUTest::getTestCaseName); +const auto fullyConnectedParams3DFP16_nightly = ::testing::Combine(::testing::ValuesIn(IS3D_nightly), + ::testing::Values(ov::element::f32), + ::testing::Values(ElementType::undefined), + ::testing::Values(ElementType::undefined), + ::testing::Values(utils::InputLayerType::CONSTANT), + ::testing::Values(ov::test::utils::DEVICE_CPU), + ::testing::Values(cpu_f16_plugin_config)); const auto testParams3D_nightly = ::testing::Combine(fullyConnectedParams3D_nightly, ::testing::Values(MatMulNodeType::FullyConnected), ::testing::ValuesIn(fusingParamsSet3D_nightly), ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); +const auto testParams3DBF16_nightly = ::testing::Combine(fullyConnectedParams3DBF16_nightly, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet3DBF16), + ::testing::ValuesIn(filterCPUInfo(filterSpecificParams()))); + +const auto testParams3DFP16_nightly = ::testing::Combine(fullyConnectedParams3DFP16_nightly, + ::testing::Values(MatMulNodeType::FullyConnected), + ::testing::ValuesIn(fusingParamsSet3DFP16), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(specificParams_FP16))); + INSTANTIATE_TEST_SUITE_P(nightly_FC_3D, MatMulLayerCPUTest, testParams3D_nightly, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(nightly_FC_3D_BF16, MatMulLayerCPUTest, testParams3DBF16_nightly, MatMulLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(nightly_FC_3D_FP16, MatMulLayerCPUTest, testParams3DFP16_nightly, MatMulLayerCPUTest::getTestCaseName); class MatMulLayerCPUTestUndefShapes : public MatMulLayerCPUTest { }; diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/pooling.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/pooling.cpp index 753b671dd7bace..4127d0c9deddd8 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/pooling.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/pooling.cpp @@ -38,7 +38,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_4D_ref, MaxPoolingV8LayerCPUTest, ::testing::ValuesIn(paramsMaxV84D_ref), ::testing::ValuesIn(inputShapes4D()), ::testing::ValuesIn((inpOutPrecision())), - ::testing::Values(ref)), + ::testing::Values(ref), + ::testing::Values(CPUTestUtils::empty_plugin_config)), MaxPoolingV8LayerCPUTest::getTestCaseName); const auto avx512_nwc = CPUSpecificParams{{nwc}, {nwc}, {"jit_avx512"}, "jit_avx512"}; @@ -100,7 +101,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_4D_I8, PoolingLayerCPUTest, ::testing::Values(ElementType::f32), ::testing::Values(true), ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_4D)), - ::testing::ValuesIn(fusingParamsSet)), + ::testing::ValuesIn(fusingParamsSet), + ::testing::Values(CPUTestUtils::empty_plugin_config)), PoolingLayerCPUTest::getTestCaseName); const std::vector inputShapes5D_int8 = { @@ -140,9 +142,116 @@ INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_5D_I8, PoolingLayerCPUTest, ::testing::Values(ElementType::f32), ::testing::Values(true), ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_5D)), - ::testing::ValuesIn(fusingParamsSet)), + ::testing::ValuesIn(fusingParamsSet), + ::testing::Values(CPUTestUtils::empty_plugin_config)), PoolingLayerCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_4D_I8_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsAvg4D()), + ::testing::ValuesIn(inputShapes4D_int8), + ::testing::Values(ElementType::f32), + ::testing::Values(true), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigsFusing_4D)), + ::testing::ValuesIn(fusingParamsSet), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_5D_I8_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsAvg5D()), + ::testing::ValuesIn(inputShapes5D_int8), + ::testing::Values(ElementType::f32), + ::testing::Values(true), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigsFusing_5D)), + ::testing::ValuesIn(fusingParamsSet), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_3D_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsMax3D()), + ::testing::ValuesIn(inputShapes3D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_3D_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsAvg3D()), + ::testing::ValuesIn(inputShapes3D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_4D_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsMax4D()), + ::testing::ValuesIn(inputShapes4D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_4D_FP16, MaxPoolingV8LayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsMaxV84D()), + ::testing::ValuesIn(inputShapes4D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(cpu_f16_plugin_config)), + MaxPoolingV8LayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_4D_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsAvg4D()), + ::testing::ValuesIn(inputShapes4D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_AvgPool_CPU_Large_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsAvg4D_Large()), + ::testing::ValuesIn(inputShapes4D_Large()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_5D_FP16, PoolingLayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsMax5D()), + ::testing::ValuesIn(inputShapes5D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::Values(false), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(cpu_f16_plugin_config)), + PoolingLayerCPUTest::getTestCaseName); + +INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_5D_FP16, MaxPoolingV8LayerCPUTest, + ::testing::Combine( + ::testing::ValuesIn(paramsMaxV85D()), + ::testing::ValuesIn(inputShapes5D()), + ::testing::ValuesIn(inpOutPrecision()), + ::testing::ValuesIn(filterCPUInfoForDeviceWithFP16(vecCpuConfigs)), + ::testing::Values(cpu_f16_plugin_config)), + MaxPoolingV8LayerCPUTest::getTestCaseName); + INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_3D, PoolingLayerCPUTest, ::testing::Combine( ::testing::ValuesIn(paramsMax3D()), @@ -150,7 +259,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_3D, PoolingLayerCPUTest, ::testing::ValuesIn((inpOutPrecision())), ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_3D)), - ::testing::Values(emptyFusingSpec)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(CPUTestUtils::empty_plugin_config)), PoolingLayerCPUTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_3D, MaxPoolingV8LayerCPUTest, @@ -158,7 +268,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_3D, MaxPoolingV8LayerCPUTest, ::testing::ValuesIn(paramsMaxV83D()), ::testing::ValuesIn(inputShapes3D()), ::testing::ValuesIn((inpOutPrecision())), - ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_3D))), + ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_3D)), + ::testing::Values(CPUTestUtils::empty_plugin_config)), MaxPoolingV8LayerCPUTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_5D, PoolingLayerCPUTest, @@ -168,7 +279,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_MaxPool_CPU_5D, PoolingLayerCPUTest, ::testing::ValuesIn((inpOutPrecision())), ::testing::Values(false), ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_5D)), - ::testing::Values(emptyFusingSpec)), + ::testing::Values(emptyFusingSpec), + ::testing::Values(CPUTestUtils::empty_plugin_config)), PoolingLayerCPUTest::getTestCaseName); INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_5D, MaxPoolingV8LayerCPUTest, @@ -176,7 +288,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_MaxPoolV8_CPU_5D, MaxPoolingV8LayerCPUTest, ::testing::ValuesIn(paramsMaxV85D()), ::testing::ValuesIn(inputShapes5D()), ::testing::ValuesIn((inpOutPrecision())), - ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_5D))), + ::testing::ValuesIn(filterCPUInfoForDevice(vecCpuConfigsFusing_5D)), + ::testing::Values(CPUTestUtils::empty_plugin_config)), MaxPoolingV8LayerCPUTest::getTestCaseName); } // namespace } // namespace Pooling diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/softmax.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/softmax.cpp new file mode 100644 index 00000000000000..2a22f629c29661 --- /dev/null +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/instances/x64/softmax.cpp @@ -0,0 +1,94 @@ +// Copyright (C) 2023 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "custom/single_layer_tests/classes/softmax.hpp" +#include +#include "utils/cpu_test_utils.hpp" +#include "utils/filter_cpu_info.hpp" +#include + +using namespace CPUTestUtils; + +namespace ov { +namespace test { +namespace SoftMax { +namespace { +const auto optimizedCPUSpec = []()-> std::vector{ + const auto avx512 = CPUSpecificParams{{}, {}, {"jit"}, "jit_avx512"}; + const auto avx2 = CPUSpecificParams{{}, {}, {"jit"}, "jit_avx2"}; + const auto sse42 = CPUSpecificParams{{}, {}, {"jit"}, "jit_sse42"}; + const std::vector vecCpuConfigs = {avx512, avx2, sse42}; + auto supportConfigure = CPUTestUtils::filterCPUInfoForDevice(vecCpuConfigs); + // only the MAX ISA of vecCpuConfigs will be tested + if (supportConfigure.size() > 0) { + return std::vector{supportConfigure[0]}; + } else { + return std::vector{}; + } +}; + +const std::vector optimizedConfigsFP32 = { + // Static shapes + {ov::test::InputShape{ov::PartialShape{1, 100}, {ov::Shape{1, 100}}}, 1}, + {ov::test::InputShape{ov::PartialShape{10, 10}, {ov::Shape{10, 10}}}, 1}, + {ov::test::InputShape{ov::PartialShape{100, 1}, {ov::Shape{100, 1}}}, 0}, + {ov::test::InputShape{ov::PartialShape{100, 1}, {ov::Shape{100, 1}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 1}, {ov::Shape{5, 5, 1}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5}, {ov::Shape{5, 5, 5}}}, 2}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5}}}, 0}, + {ov::test::InputShape{ov::PartialShape{5, 5, 1, 1}, {ov::Shape{5, 5, 1, 1}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 1}, {ov::Shape{5, 5, 5, 1}}}, 2}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5}}}, 2}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5}}}, 3}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5, 5}}}, 0}, + {ov::test::InputShape{ov::PartialShape{5, 5, 1, 1, 1}, {ov::Shape{5, 5, 1, 1, 1}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5, 5}}}, 1}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 1, 1}, {ov::Shape{5, 5, 5, 1, 1}}}, 2}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5, 5}}}, 2}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 1, 1}, {ov::Shape{5, 5, 5, 1, 1}}}, 3}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5, 5}}}, 3}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 1}, {ov::Shape{5, 5, 5, 5, 1}}}, 4}, + {ov::test::InputShape{ov::PartialShape{5, 5, 5, 5, 5}, {ov::Shape{5, 5, 5, 5, 5}}}, 4}, + // Dynamic shapes + {ov::test::InputShape{// dynamic shape + ov::PartialShape{-1, -1}, + {// target static shapes + ov::Shape{10, 10}, + ov::Shape{15, 15}, + ov::Shape{10, 10}, + ov::Shape{10, 5}}}, + 1}, + {ov::test::InputShape{// dynamic shape + ov::PartialShape{-1, -1, 1, 1, 1}, + {// target static shapes + ov::Shape{5, 5, 1, 1, 1}, + ov::Shape{10, 7, 1, 1, 1}, + ov::Shape{5, 5, 1, 1, 1}}}, + 1}, + {ov::test::InputShape{// dynamic shape + ov::PartialShape{{1, 10}, 10}, + {// target static shapes + ov::Shape{10, 10}, + ov::Shape{5, 10}}}, + 1}, +}; + +const auto OptimizedParams = testing::Combine(testing::Values(ElementType::f32, ElementType::bf16), + testing::ValuesIn(optimizedConfigsFP32), + testing::Values(ov::test::utils::DEVICE_CPU), + testing::ValuesIn(optimizedCPUSpec()), + testing::Values(CPUTestUtils::empty_plugin_config)); + +INSTANTIATE_TEST_SUITE_P(smoke_SoftMax_Optimized_CPU, + SoftMaxLayerCPUTest, + OptimizedParams, + SoftMaxLayerCPUTest::getTestCaseName); + +//TODO CVS-143812 + +} // namespace +} // namespace SoftMax +} // namespace test +} // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/pad.cpp b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/pad.cpp index f3b8a603f86e1b..7d35fe6b822cb2 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/pad.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/pad.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/runtime/system_conf.hpp" #include "common_test_utils/ov_tensor_utils.hpp" #include "common_test_utils/test_enums.hpp" @@ -23,7 +24,8 @@ using PadLayerCPUTestParamSet = std::tuple< std::vector, // padsEnd float, // argPadValue ov::op::PadMode, // padMode - CPUSpecificParams + CPUSpecificParams, + ov::AnyMap // cpu device config >; class PadLayerCPUTest : public testing::WithParamInterface, @@ -37,7 +39,8 @@ class PadLayerCPUTest : public testing::WithParamInterface inputPrecisions = { ElementType::i8 }; +const std::vector deviceConfig = { + CPUTestUtils::empty_plugin_config, + cpu_f16_plugin_config +}; + const std::vector inputLayerTypes = { ov::test::utils::InputLayerType::CONSTANT, ov::test::utils::InputLayerType::PARAMETER @@ -198,7 +214,7 @@ const std::vector> padsEnd4D_Full = {{0, 0, -2, 0}, {0, 0 const std::vector CPUParams4DBlocked = { cpuParams_nChw16c, - cpuParams_nChw8c, + cpuParams_nChw8c }; INSTANTIATE_TEST_SUITE_P( @@ -212,7 +228,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DConstBlocked_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -227,7 +244,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::Values(cpuParams_nhwc)), + ::testing::Values(cpuParams_nhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -242,7 +260,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -257,7 +276,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::Values(cpuParams_nhwc)), + ::testing::Values(cpuParams_nhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -272,7 +292,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DConstBlocked_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -287,7 +308,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::Values(cpuParams_nhwc)), + ::testing::Values(cpuParams_nhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -302,7 +324,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -317,7 +340,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::Values(cpuParams_nhwc)), + ::testing::Values(cpuParams_nhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -352,7 +376,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DDynamic)), + ::testing::ValuesIn(CPUParams4DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -367,7 +392,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DConstBlocked_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -382,7 +408,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DDynamic)), + ::testing::ValuesIn(CPUParams4DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -397,7 +424,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -412,7 +440,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DDynamic)), + ::testing::ValuesIn(CPUParams4DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -427,7 +456,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DConstBlocked_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -442,7 +472,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4D_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DDynamic)), + ::testing::ValuesIn(CPUParams4DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -457,7 +488,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd4DBlocked_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams4DBlocked)), + ::testing::ValuesIn(CPUParams4DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -499,7 +531,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DConstBlocked_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -514,7 +547,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::Values(cpuParams_ndhwc)), + ::testing::Values(cpuParams_ndhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -529,7 +563,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DBlocked_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -544,7 +579,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::Values(cpuParams_ndhwc)), + ::testing::Values(cpuParams_ndhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -559,7 +595,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DConstBlocked_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -574,7 +611,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::Values(cpuParams_ndhwc)), + ::testing::Values(cpuParams_ndhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -589,7 +627,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DBlocked_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -604,7 +643,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::Values(cpuParams_ndhwc)), + ::testing::Values(cpuParams_ndhwc), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -639,7 +679,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DDynamic)), + ::testing::ValuesIn(CPUParams5DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -654,7 +695,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DConstBlocked_Smoke), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -669,7 +711,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DDynamic)), + ::testing::ValuesIn(CPUParams5DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -684,7 +727,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DBlocked_Smoke), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -699,7 +743,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DDynamic)), + ::testing::ValuesIn(CPUParams5DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -714,7 +759,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DConstBlocked_Full), ::testing::ValuesIn(argPadValue), ::testing::Values(ov::op::PadMode::CONSTANT), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -729,7 +775,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5D_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DDynamic)), + ::testing::ValuesIn(CPUParams5DDynamic), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); @@ -744,7 +791,8 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(padsEnd5DBlocked_Full), ::testing::Values(0), ::testing::ValuesIn(padMode), - ::testing::ValuesIn(CPUParams5DBlocked)), + ::testing::ValuesIn(CPUParams5DBlocked), + ::testing::ValuesIn(deviceConfig)), PadLayerCPUTest::getTestCaseName ); diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp index ff3f0bad3f302a..1ae0d661746987 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/concat_const_inplace.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // +#include "openvino/runtime/system_conf.hpp" #include "shared_test_classes/base/ov_subgraph.hpp" #include "utils/cpu_test_utils.hpp" #include "common_test_utils/ov_tensor_utils.hpp" @@ -37,8 +38,13 @@ class ConcatConstantInPlaceTest : public testing::WithParamInterfaceGetParam())) - configuration.insert({ov::hint::inference_precision.name(), ov::element::bf16}); + if (ov::element::bf16 == (inType = outType = this->GetParam())) { + configuration.insert({ov::hint::inference_precision(ov::element::bf16)}); + } else if (ov::element::f16 == (inType = outType = this->GetParam())) { + configuration.insert({ov::hint::inference_precision(ov::element::f16)}); + } else { + configuration.insert({ov::hint::inference_precision(ov::element::f32)}); + } const ov::Shape inputShape = {1, 3, 3, 11}; ov::ParameterVector inputParams{std::make_shared(ov::element::f32, inputShape)}; @@ -79,11 +85,11 @@ TEST_P(ConcatConstantInPlaceTest, smoke_ConcatConstantInPlaceTest_CPU) { CheckNumberOfNodesWithType(compiledModel, "Reorder", 2); } + INSTANTIATE_TEST_SUITE_P(smoke_ConcatConstantInPlaceTest_CPU, ConcatConstantInPlaceTest, - testing::Values(ov::element::f32, ov::element::bf16), + testing::Values(ov::element::f32, ov::element::bf16, ov::element::f16), ConcatConstantInPlaceTest::getTestCaseName); - } // namespace } // namespace test } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/conv_sum_broadcast.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/conv_sum_broadcast.cpp index 4ac54dcd19b009..002ca921c2afcf 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/conv_sum_broadcast.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/conv_sum_broadcast.cpp @@ -118,8 +118,12 @@ class ConvSumInPlaceTest : public testing::WithParamInterfacesecond.as() == ov::element::bf16) { + ov::element::Type inference_precision = (it != configuration.end()) ? + it->second.as() : ov::element::undefined; + if (inference_precision == ov::element::bf16) { runtimeType = ov::element::Type_t::bf16; + } else if (inference_precision == ov::element::f16) { + runtimeType = ov::element::Type_t::f16; } if (inputParams.front()->get_element_type() == ov::element::i8 || inputParams.front()->get_element_type() == ov::element::u8) { @@ -138,12 +142,25 @@ class ConvSumInPlaceTest : public testing::WithParamInterface fusingParamsSetBF16{ fusingReluScaleShift }; +const std::vector fusingParamsSetFP16 = fusingParamsSetBF16; + InputShape convInpShape = { //dynamic shapes {-1, 32, -1, -1}, @@ -465,6 +484,16 @@ INSTANTIATE_TEST_SUITE_P(smoke_Conv_Sum_Broadcast_BF16, ::testing::Values(cpu_bf16_plugin_config)), ConvSumInPlaceTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Conv_Sum_Broadcast_FP16, + ConvSumInPlaceTest, + ::testing::Combine( + ::testing::Values(convInpShape), + ::testing::ValuesIn(secondInp), + ::testing::Values(true, false), + ::testing::ValuesIn(fusingParamsSetFP16), + ::testing::Values(cpu_f16_plugin_config)), + ConvSumInPlaceTest::getTestCaseName); + INSTANTIATE_TEST_SUITE_P(smoke_Conv_Sum_Broadcast_INT8, ConvSumInPlaceTestInt8, ::testing::Combine( ::testing::Values(convInpShape), diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fullyconnected_strided_inputs_outputs.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fullyconnected_strided_inputs_outputs.cpp index b0a5855fd4de5c..1a81e6019fc6c1 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fullyconnected_strided_inputs_outputs.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/fullyconnected_strided_inputs_outputs.cpp @@ -102,6 +102,16 @@ TEST_P(FullyConnectedStridedInputsOutputsTest, CompareWithRefs) { run(); } +using FullyConnectedStridedInputsOutputsTest_FP16 = FullyConnectedStridedInputsOutputsTest; +TEST_P(FullyConnectedStridedInputsOutputsTest_FP16, CompareWithRefs) { + if (!(ov::with_cpu_x86_avx512_core_fp16())) { + GTEST_SKIP() << "Skipping test, platform don't support precision f16"; + } + configuration.insert({ov::hint::inference_precision.name(), ov::element::f16}); + + run(); +} + namespace { INSTANTIATE_TEST_SUITE_P(smoke_Check, @@ -110,6 +120,12 @@ INSTANTIATE_TEST_SUITE_P(smoke_Check, ::testing::Values(2, 3)), FullyConnectedStridedInputsOutputsTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Check, + FullyConnectedStridedInputsOutputsTest_FP16, + ::testing::Combine(::testing::Values(ov::element::f32), + ::testing::Values(2, 3)), + FullyConnectedStridedInputsOutputsTest::getTestCaseName); + } // namespace } // namespace test diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/inplace_edge.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/inplace_edge.cpp index 8f7f6780048827..feae1769e0e439 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/inplace_edge.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/inplace_edge.cpp @@ -37,7 +37,7 @@ class NonInputInPlaceTest : public testing::WithParamInterface, vir void SetUp() override { targetDevice = utils::DEVICE_CPU; - configuration.insert({ov::hint::inference_precision.name(), ov::element::f16.to_string()}); + configuration.insert({ov::hint::inference_precision.name(), ov::element::f16}); const ov::Shape inputShape = {1, 11, 3, 3}; targetStaticShapes = {{inputShape, inputShape}}; ElementType prc = this->GetParam(); diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/input_noreorder_eltwise_bf16.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/input_noreorder_eltwise_bf16.cpp index 9cfa14baa8a277..a947c765b009bb 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/input_noreorder_eltwise_bf16.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/input_noreorder_eltwise_bf16.cpp @@ -14,12 +14,15 @@ namespace test { class InputNoReorderEltwiseBF16 : virtual public SubgraphBaseStaticTest, public CPUTestsBase { protected: - void SetUp() override { - auto netPrecision = inType = ov::element::f32; + virtual void set_output_type_and_config() { outType = ov::element::bf16; - targetDevice = ov::test::utils::DEVICE_CPU; ov::AnyMap additional_config{ov::hint::inference_precision(ov::element::bf16)}; configuration.insert(additional_config.begin(), additional_config.end()); + } + void SetUp() override { + auto netPrecision = inType = ov::element::f32; + set_output_type_and_config(); + targetDevice = ov::test::utils::DEVICE_CPU; ov::Shape inputShape{2, 4, 4, 1}; auto eltwiseType = ov::test::utils::EltwiseTypes::ADD; @@ -56,5 +59,27 @@ TEST_F(InputNoReorderEltwiseBF16, smoke_CompareWithRefs) { CheckNumberOfNodesWithType(compiledModel, "Convert", 0); CheckNumberOfNodesWithTypes(compiledModel, {"Eltwise", "Subgraph"}, 1); } + +class InputNoReorderEltwiseFP16 : public InputNoReorderEltwiseBF16 { +protected: + void set_output_type_and_config() override { + outType = ov::element::f16; + ov::AnyMap additional_config{ov::hint::inference_precision(ov::element::f16)}; + configuration.insert(additional_config.begin(), additional_config.end()); + } +}; + +TEST_F(InputNoReorderEltwiseFP16, smoke_CompareWithRefs) { + if (!(ov::with_cpu_x86_avx512_core_fp16() || ov::with_cpu_x86_avx512_core_amx_fp16())) { + GTEST_SKIP() << "Skipping test, platform don't support precision f16"; + } + + run(); + + CheckNumberOfNodesWithType(compiledModel, "Reorder", 0); + CheckNumberOfNodesWithType(compiledModel, "Convert", 0); + CheckNumberOfNodesWithTypes(compiledModel, {"Eltwise", "Subgraph"}, 1); +} + } // namespace test } // namespace ov diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/interaction.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/interaction.cpp index b670b565a3903a..1be7035c08285f 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/interaction.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/interaction.cpp @@ -171,8 +171,20 @@ TEST_P(IntertactionCPUTest, CompareWithRefs) { CheckNumberOfNodesWithType(compiledModel, "Interaction", 1); } +using IntertactionCPUTest_FP16 = IntertactionCPUTest; +TEST_P(IntertactionCPUTest_FP16, CompareWithRefs) { + if (!(ov::with_cpu_x86_avx512_core_fp16())) { + GTEST_SKIP() << "Skipping test, platform don't support precision f16"; + } + configuration.insert({ov::hint::inference_precision.name(), ov::element::f16}); + + run(); + CheckNumberOfNodesWithType(compiledModel, "Interaction", 1); +} + namespace { const std::vector inPrecisions = {ElementType::f32, ElementType::bf16, ElementType::i32, ElementType::i8}; +const std::vector inPrecisions_FP16 = {ElementType::f32, ElementType::i32}; // the model has 27 inputs with same shape const std::vector input_shapes = { // temporarily disable dynamic shape for performance issue @@ -194,4 +206,8 @@ INSTANTIATE_TEST_SUITE_P(smoke_Interaction, IntertactionCPUTest, ::testing::Combine(::testing::ValuesIn(inPrecisions), ::testing::ValuesIn(input_shapes)), IntertactionCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Interaction, + IntertactionCPUTest_FP16, + ::testing::Combine(::testing::ValuesIn(inPrecisions_FP16), ::testing::ValuesIn(input_shapes)), + IntertactionCPUTest::getTestCaseName); } // namespace diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/matmul_strided_inputs_outputs.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/matmul_strided_inputs_outputs.cpp index d30c4378921553..7ce57dbfe28ee6 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/matmul_strided_inputs_outputs.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/matmul_strided_inputs_outputs.cpp @@ -89,6 +89,16 @@ TEST_P(MatmulStridedInputsOutputsTest, CompareWithRefs) { run(); } +using MatmulStridedInputsOutputsTest_FP16 = MatmulStridedInputsOutputsTest; +TEST_P(MatmulStridedInputsOutputsTest_FP16, CompareWithRefs) { + if (!(ov::with_cpu_x86_avx512_core_fp16())) { + GTEST_SKIP() << "Skipping test, platform don't support precision f16"; + } + configuration.insert({ov::hint::inference_precision.name(), ov::element::f16}); + + run(); +} + namespace { INSTANTIATE_TEST_SUITE_P(smoke_Check, @@ -96,6 +106,11 @@ INSTANTIATE_TEST_SUITE_P(smoke_Check, ::testing::Values(ov::element::f32, ov::element::bf16), MatmulStridedInputsOutputsTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_Check, + MatmulStridedInputsOutputsTest_FP16, + ::testing::Values(ov::element::f32), + MatmulStridedInputsOutputsTest::getTestCaseName); + } // namespace } // namespace test diff --git a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/remove_convert.cpp b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/remove_convert.cpp index 1f62e678802328..b2d57bc64b138f 100644 --- a/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/remove_convert.cpp +++ b/src/plugins/intel_cpu/tests/functional/custom/subgraph_tests/src/remove_convert.cpp @@ -12,7 +12,7 @@ using namespace CPUTestUtils; namespace ov { namespace test { -using RemoveConvertCPUTestParams = std::tuple; +using RemoveConvertCPUTestParams = std::tuple; class RemoveUselessBF16ConvertCPUTest : public testing::WithParamInterface, virtual public SubgraphBaseTest, @@ -21,21 +21,27 @@ class RemoveUselessBF16ConvertCPUTest : public testing::WithParamInterface& obj) { ElementType inType; InputShape inputShape; - std::tie(inType, inputShape) = obj.param; + ov::AnyMap additionalConfig; + std::tie(inType, inputShape, additionalConfig) = obj.param; std::ostringstream result; result << "IS=" << inputShape << "_"; result << "Prc=" << inType; + if (!additionalConfig.empty()) { + result << "_PluginConf"; + for (auto& item : additionalConfig) { + result << "_" << item.first << "=" << item.second.as(); + } + } return result.str(); } void SetUp() override { ElementType inType; InputShape inputShape; - std::tie(inType, inputShape) = this->GetParam(); + ov::AnyMap additionalConfig; + std::tie(inType, inputShape, additionalConfig) = this->GetParam(); + configuration.insert(additionalConfig.begin(), additionalConfig.end()); targetDevice = ov::test::utils::DEVICE_CPU; - if (inType == ElementType::bf16) { - configuration.insert({ov::hint::inference_precision(ov::element::bf16)}); - } std::tie(inFmts, outFmts, priority, selectedType) = CPUSpecificParams{{}, {}, {}, makeSelectedTypeStr("ref", inType)}; init_input_shapes({inputShape}); @@ -65,17 +71,25 @@ class RemoveUselessConvertCPUTest : public testing::WithParamInterface& obj) { ElementType inType; InputShape inputShape; - std::tie(inType, inputShape) = obj.param; + ov::AnyMap additionalConfig; + std::tie(inType, inputShape, additionalConfig) = obj.param; std::ostringstream result; result << "IS=" << inputShape << "_"; result << "Prc=" << inType; + if (!additionalConfig.empty()) { + result << "_PluginConf"; + for (auto& item : additionalConfig) { + result << "_" << item.first << "=" << item.second.as(); + } + } return result.str(); } void SetUp() override { ElementType inType; InputShape inputShape; - std::tie(inType, inputShape) = this->GetParam(); + ov::AnyMap additionalConfig; + std::tie(inType, inputShape, additionalConfig) = this->GetParam(); targetDevice = ov::test::utils::DEVICE_CPU; init_input_shapes({inputShape}); @@ -110,6 +124,15 @@ TEST_P(RemoveUselessConvertCPUTest, CompareWithRefs) { CheckNumberOfNodesWithType(compiledModel, "Convert", 0); } +using RemoveUselessFP16ConvertCPUTest = RemoveUselessBF16ConvertCPUTest; +TEST_P(RemoveUselessFP16ConvertCPUTest, CompareWithRefs) { + auto implType = deduce_expected_precision(ov::element::f16, configuration); + selectedType = makeSelectedTypeStr("ref", implType); + run(); + CheckNumberOfNodesWithTypes(compiledModel, {"Convert", "Subgraph"}, 0); + CheckPluginRelatedResults(compiledModel, "StridedSlice"); +} + namespace { const std::vector inputShapes = { // dynamic batch @@ -121,12 +144,20 @@ const std::vector inputShapes = { INSTANTIATE_TEST_SUITE_P(smoke_RemoveConvert, RemoveUselessBF16ConvertCPUTest, - ::testing::Combine(::testing::Values(ElementType::bf16), ::testing::ValuesIn(inputShapes)), + ::testing::Combine(::testing::Values(ElementType::bf16), ::testing::ValuesIn(inputShapes), + ::testing::Values(cpu_bf16_plugin_config)), RemoveUselessBF16ConvertCPUTest::getTestCaseName); +INSTANTIATE_TEST_SUITE_P(smoke_RemoveConvert, + RemoveUselessFP16ConvertCPUTest, + ::testing::Combine(::testing::Values(ElementType::f16), ::testing::ValuesIn(inputShapes), + ::testing::Values(cpu_f16_plugin_config)), + RemoveUselessFP16ConvertCPUTest::getTestCaseName); + INSTANTIATE_TEST_SUITE_P(smoke_RemoveConvert, RemoveUselessConvertCPUTest, - ::testing::Combine(::testing::Values(ElementType::f32), ::testing::Values(inputShapes[0])), + ::testing::Combine(::testing::Values(ElementType::f32), ::testing::Values(inputShapes[0]), + ::testing::Values(empty_plugin_config)), RemoveUselessConvertCPUTest::getTestCaseName); } // namespace } // namespace test 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 017e97bfac874d..70dd06ecfb44d9 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 @@ -533,6 +533,13 @@ std::vector disabledTestPatterns() { // Issue: 142465 retVector.emplace_back(R"(smoke_Reduce_MultiAxis_4D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs.*INFERENCE_PRECISION_HINT=f16.*)"); retVector.emplace_back(R"(smoke_Reduce_MultiAxis_5D_fusing_CPU/ReduceCPULayerTest.CompareWithRefs.*INFERENCE_PRECISION_HINT=f16.*)"); + // Issue: 143852 + retVector.emplace_back(R"((smoke|nightly)_FC_3D_FP16/.*_Fused=Multiply\(PerChannel\).*)"); + retVector.emplace_back(R"((smoke|nightly)_MM_Brgemm_Static_FP16.*TS=\(\(55\.12\)\).*_Fused=Multiply\(PerChannel\).*)"); + retVector.emplace_back(R"(smoke_MM_Dynamic_Fusing_FP16/.*TS=\(\(16\.12\)_\(33\.7\)_\(16\.12\)\).*_Fused=Multiply\(PerChannel\).*)"); + retVector.emplace_back(R"(smoke_MM_Brgemm_Dynamic_Fusing_FP16/.*TS=\(\(16\.12\)_\(33\.7\)_\(16\.12\)\).*_Fused=Multiply\(PerChannel\).*)"); + retVector.emplace_back(R"(smoke_Conv_.*_FP16/.*_Fused=PRelu1D\.Multiply\(PerChannel\)\.Add\(PerChannel\).*)"); + retVector.emplace_back(R"(smoke_Conv_Sum_Broadcast_FP16/ConvSumInPlaceTest.*Relu\.Multiply\(PerChannel\)\.Add\(PerChannel\).*)"); } return retVector; diff --git a/src/plugins/intel_cpu/tests/functional/utils/arm/filter_cpu_info.cpp b/src/plugins/intel_cpu/tests/functional/utils/arm/filter_cpu_info.cpp index 3bb42fe47e0615..2d348b323219dd 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/arm/filter_cpu_info.cpp +++ b/src/plugins/intel_cpu/tests/functional/utils/arm/filter_cpu_info.cpp @@ -38,4 +38,8 @@ std::vector filterCPUInfoForDevice(const std::vector filterCPUInfoForDeviceWithFP16(const std::vector& allParams) { + std::vector resCPUParams; + return resCPUParams; +} } // namespace CPUTestUtils diff --git a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp index f3fde176331885..fab8365bc28e49 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp +++ b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.cpp @@ -8,6 +8,7 @@ #include "cpu_test_utils.hpp" #include "openvino/core/type/element_type.hpp" +#include "openvino/runtime/system_conf.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" #include "utils/general_utils.h" #include "utils/rt_info/memory_formats_attribute.hpp" @@ -471,4 +472,74 @@ void CheckNumberOfNodesWithType(const ov::CompiledModel& compiledModel, size_t expectedCount) { CheckNumberOfNodesWithTypes(compiledModel, {nodeType}, expectedCount); } + + +// deduce the actual precision of the operation given the ngraph level operation precision and the plugin config +ov::element::Type +CPUTestsBase::deduce_expected_precision(const ov::element::Type& opPrecision, + const ov::AnyMap& configuration) { +#if defined(OPENVINO_ARCH_ARM) || defined(OPENVINO_ARCH_ARM64) + return opPrecision; +#endif +#if defined(OPENVINO_ARCH_RISCV64) + return opPrecision; +#endif +#if defined(OPENVINO_ARCH_X86_64) + // if is not float + if (!opPrecision.is_real()) { + return opPrecision; + } + ov::element::Type inferencePrecision = ov::element::f32; + bool inferencePrecisionSetExplicitly = false; + const std::string precisionKey = ov::hint::inference_precision.name(); + const auto& it = configuration.find(precisionKey); + if (it != configuration.end()) { + auto inferencePrecisionConfig = it->second.as(); + inferencePrecisionSetExplicitly = true; + // TODO also need to check (dnnl::impl::cpu::x64::avx2_vnni_2) + if ((inferencePrecisionConfig == ov::element::bf16 && ov::with_cpu_x86_avx512_core()) + || (inferencePrecisionConfig == ov::element::f16 && ov::with_cpu_x86_avx512_core_fp16()) + || (inferencePrecisionConfig == ov::element::f32) + || (inferencePrecisionConfig == ov::element::undefined)) { + inferencePrecision = inferencePrecisionConfig; + } + } + if (!inferencePrecisionSetExplicitly) { + const std::string executionModeKey = ov::hint::execution_mode.name(); + const auto& configIt = configuration.find(executionModeKey); + if (configIt != configuration.end() && configIt->second.as() == ov::hint::ExecutionMode::PERFORMANCE) { + inferencePrecision = ov::element::f32; + if (ov::with_cpu_x86_bfloat16()) { + inferencePrecision = ov::element::bf16; + } + } else { + inferencePrecision = ov::element::undefined; + } + } + + ov::element::Type deducedType = opPrecision; + // enforceInferPrecision stage + if (inferencePrecision == ov::element::bf16) { + deducedType = ov::with_cpu_x86_avx512_core() ? ov::element::bf16 : ov::element::f32; + } + + // ngraph transform pipeline stage + if (inferencePrecision == ov::element::f16) { + if (deducedType == ov::element::f32) { + deducedType = ov::element::f16; + } + } + if (deducedType == ov::element::bf16) { + deducedType = ov::with_cpu_x86_avx512_core() ? ov::element::bf16 : ov::element::f32; + } else if (deducedType == ov::element::f16) { + if (inferencePrecision != ov::element::f16 && inferencePrecision != ov::element::undefined) { + deducedType = ov::element::f32; + } + } else { + deducedType = ov::element::f32; + } + + return deducedType; +#endif +} } // namespace CPUTestUtils diff --git a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp index 2a15f89c72ad85..792e84a050f095 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp +++ b/src/plugins/intel_cpu/tests/functional/utils/cpu_test_utils.hpp @@ -4,6 +4,7 @@ #pragma once +#include "openvino/core/any.hpp" #include "openvino/runtime/compiled_model.hpp" #include "openvino/runtime/exec_model_info.hpp" #include "openvino/runtime/system_conf.hpp" @@ -128,6 +129,8 @@ class CPUTestsBase { const std::vector& priority); // TODO: change to setter method static std::string makeSelectedTypeStr(std::string implString, ov::element::Type_t elType); + static ov::element::Type deduce_expected_precision(const ov::element::Type& opPrecision, + const ov::AnyMap& configuration); void updateSelectedType(const std::string& primitiveType, const ov::element::Type netType, const ov::AnyMap& config); @@ -171,8 +174,9 @@ class CPUTestsBase { // common parameters const auto emptyCPUSpec = CPUSpecificParams{{}, {}, {}, {}}; const ov::AnyMap empty_plugin_config{}; -const ov::AnyMap cpu_bf16_plugin_config = {{ov::hint::inference_precision(ov::element::bf16)}}; const ov::AnyMap cpu_f16_plugin_config = {{ov::hint::inference_precision(ov::element::f16)}}; +const ov::AnyMap cpu_bf16_plugin_config = {{ov::hint::inference_precision(ov::element::bf16)}}; +const ov::AnyMap cpu_f32_plugin_config = {{ov::hint::inference_precision(ov::element::f32)}}; // utility functions std::vector filterCPUSpecificParams(const std::vector& paramsVector); diff --git a/src/plugins/intel_cpu/tests/functional/utils/filter_cpu_info.hpp b/src/plugins/intel_cpu/tests/functional/utils/filter_cpu_info.hpp index 8a92dea80575ab..d8f9f6ea1b3470 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/filter_cpu_info.hpp +++ b/src/plugins/intel_cpu/tests/functional/utils/filter_cpu_info.hpp @@ -11,4 +11,5 @@ namespace CPUTestUtils { std::vector filterCPUInfo(const std::vector& CPUParams); std::vector filterCPUInfoForArch(const std::vector& CPUParams); std::vector filterCPUInfoForDevice(const std::vector& CPUParams); +std::vector filterCPUInfoForDeviceWithFP16(const std::vector& allParams); } // namespace CPUTestUtils diff --git a/src/plugins/intel_cpu/tests/functional/utils/x64/filter_cpu_info.cpp b/src/plugins/intel_cpu/tests/functional/utils/x64/filter_cpu_info.cpp index cd30f756db66db..f0c663375cee5b 100644 --- a/src/plugins/intel_cpu/tests/functional/utils/x64/filter_cpu_info.cpp +++ b/src/plugins/intel_cpu/tests/functional/utils/x64/filter_cpu_info.cpp @@ -63,4 +63,22 @@ std::vector filterCPUInfoForDevice(const std::vector filterCPUInfoForDeviceWithFP16(const std::vector& allParams) { + std::vector specificParams; + if (!ov::with_cpu_x86_avx512_core_fp16()) { + return specificParams; + } + std::copy_if(allParams.begin(), allParams.end(), std::back_inserter(specificParams), [](const CPUSpecificParams& item) { + const auto &selected = std::get<3>(item); + bool isValid = false; + if (selected.find("avx512") != std::string::npos) { + isValid = true; + } + if ((!ov::with_cpu_x86_avx512_core_amx_fp16()) && selected.find("amx") != std::string::npos) { + isValid = false; + } + return isValid; + }); + return specificParams; +} } // namespace CPUTestUtils From cc29db8ab590830132d78ed3c4cc576cf57b2326 Mon Sep 17 00:00:00 2001 From: Andrzej Kopytko Date: Mon, 1 Jul 2024 13:08:07 +0200 Subject: [PATCH 02/15] [DOCS] fixed footer file (#25306) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- docs/sphinx_setup/_static/html/footer.html | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/docs/sphinx_setup/_static/html/footer.html b/docs/sphinx_setup/_static/html/footer.html index 61278050b69173..2194cf3cec66b0 100644 --- a/docs/sphinx_setup/_static/html/footer.html +++ b/docs/sphinx_setup/_static/html/footer.html @@ -12,17 +12,13 @@ .footer-link-list a { float: left; + margin-right: 30px; text-decoration: none; background-color: transparent; } .footer-link-list a:nth-child(1) { - margin-right: 50px; - } - - .footer-link-list a:nth-child(0) { - clear: both; - margin-right: 150px; + margin-right: 20px; } .footer-contents { @@ -31,6 +27,8 @@ box-sizing: border-box; font-family: sans-serif; padding-top: 10px; + margin-top: 0; + margin-bottom: 0; line-height: 1.65; margin-left: 0px; margin-right: 0px; @@ -67,23 +65,9 @@ } ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; + margin-bottom: 0px; } - li { - float: left; - } - - li a { - display: block; - padding-left: 12px; - padding-right: 12px; - padding-top: 1px; - text-decoration: none !important; - } .no-bullets { list-style-type: none; } @@ -155,13 +139,13 @@ alt="glossary">Glossary
  • Case Studies
  • - -

    Intel technologies may require enabled hardware, software or service activation. // No product or component can be absolutely secure. // Your costs and results may vary. // Performance varies by use, configuration and other factors. // See our complete legal Notices and Disclaimers. // Intel is committed to respecting human rights and avoiding causing or contributing to adverse impacts on human rights. See Intel’s Global Human Rights Principles. Intel’s products and software are intended only to be used in applications that do not cause or contribute to adverse impacts on human rights.

    +

    Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or + its subsidiaries. Other names and brands may be claimed as the property of others.

    \ No newline at end of file From 5480d4148abf6d37f142a00992a4a4d0083bba94 Mon Sep 17 00:00:00 2001 From: Alicja Miloszewska Date: Mon, 1 Jul 2024 13:39:12 +0200 Subject: [PATCH 03/15] [OV JS] Fix hardcoded error msg (#25272) ### Details: - Each error msg concerned the 'compiledModelSync' method. - A new parameter with method name was added to `get_parameters_error_msg` --------- Co-authored-by: Vishniakov Nikolai --- src/bindings/js/node/src/core_wrap.cpp | 8 ++------ src/bindings/js/node/src/type_validation.cpp | 4 ++-- src/bindings/js/node/tests/basic.test.js | 4 ++-- src/bindings/js/node/tests/read_model.test.js | 7 +++++++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/bindings/js/node/src/core_wrap.cpp b/src/bindings/js/node/src/core_wrap.cpp index 8264bff0c1a103..33350056fc443c 100644 --- a/src/bindings/js/node/src/core_wrap.cpp +++ b/src/bindings/js/node/src/core_wrap.cpp @@ -86,9 +86,7 @@ Napi::Value CoreWrap::read_model_sync(const Napi::CallbackInfo& info) { } else if (ov::js::validate(info, allowed_signatures)) { model = _core.read_model(info[0].ToString()); } else { - const auto error_message = ov::js::get_parameters_error_msg(info, allowed_signatures); - - OPENVINO_THROW(error_message); + OPENVINO_THROW("'readModelSync'", ov::js::get_parameters_error_msg(info, allowed_signatures)); } return ModelWrap::wrap(info.Env(), model); @@ -168,10 +166,8 @@ Napi::Value CoreWrap::compile_model_sync_dispatch(const Napi::CallbackInfo& info return compile_model_sync(info, info[0].ToObject(), info[1].ToString(), config); } + OPENVINO_THROW("'compileModelSync'", ov::js::get_parameters_error_msg(info, allowed_signatures)); - const auto error_message = ov::js::get_parameters_error_msg(info, allowed_signatures); - - OPENVINO_THROW(error_message); } catch (std::exception& e) { reportError(info.Env(), e.what()); diff --git a/src/bindings/js/node/src/type_validation.cpp b/src/bindings/js/node/src/type_validation.cpp index 737aba21c14f27..4852e0e4051c2a 100644 --- a/src/bindings/js/node/src/type_validation.cpp +++ b/src/bindings/js/node/src/type_validation.cpp @@ -147,8 +147,8 @@ bool validate_value(const Napi::Env& env, const Napi::Value& value) } std::string get_parameters_error_msg(const Napi::CallbackInfo& info, std::vector& allowed_signatures) { - return "Method 'compileModelSync' called with incorrect parameters.\nProvided signature: " + - js::get_current_signature(info) + " \nAllowed signatures:\n- " + ov::util::join(allowed_signatures, "\n- "); + return " method called with incorrect parameters.\nProvided signature: " + js::get_current_signature(info) + + " \nAllowed signatures:\n- " + ov::util::join(allowed_signatures, "\n- "); } } // namespace js } // namespace ov diff --git a/src/bindings/js/node/tests/basic.test.js b/src/bindings/js/node/tests/basic.test.js index e95f76a6470609..ba3e585e40ce7d 100644 --- a/src/bindings/js/node/tests/basic.test.js +++ b/src/bindings/js/node/tests/basic.test.js @@ -75,7 +75,7 @@ describe('Core.compileModelSync()', () => { }); it('compileModelSync(model, device, config) throws when config is a string', () => { - const expectedMsg = ("Method 'compileModelSync' called with incorrect parameters.\n" + + const expectedMsg = ("'compileModelSync' method called with incorrect parameters.\n" + 'Provided signature: (object, string, string) \n' + 'Allowed signatures:\n' + '- (string, string)\n' + @@ -97,7 +97,7 @@ describe('Core.compileModelSync()', () => { }); it('compileModelSync(model) throws if the number of arguments is invalid', () => { - const expectedMsg = ("Method 'compileModelSync' called with incorrect parameters.\n" + + const expectedMsg = ("'compileModelSync' method called with incorrect parameters.\n" + 'Provided signature: (object) \n' + 'Allowed signatures:\n' + '- (string, string)\n' + diff --git a/src/bindings/js/node/tests/read_model.test.js b/src/bindings/js/node/tests/read_model.test.js index 407627c5ae9cb0..731001fbb861b7 100644 --- a/src/bindings/js/node/tests/read_model.test.js +++ b/src/bindings/js/node/tests/read_model.test.js @@ -27,6 +27,13 @@ describe('Core.readModeSync', () => { assert.equal(model.inputs.length, 1); }); + it('readModeSync throws', () => { + assert.throws( + () => core.readModelSync(core), + /'readModelSync' method called with incorrect parameters./, + ) + }); + it('readModeSync(modelUint8ArrayBuffer, weightsUint8ArrayBuffer) ', () => { const model = core.readModelSync( new Uint8Array(modelFile.buffer), From c31ecf4a5cc988266e0b10a583aebae8949943e9 Mon Sep 17 00:00:00 2001 From: Karol Blaszczak Date: Mon, 1 Jul 2024 14:32:51 +0200 Subject: [PATCH 04/15] [DOCS] tiny fix for benchmarks master (#25302) --- .../generative-ai-performance.rst | 13 ++++++++++--- .../openvino_sphinx_theme/templates/navbar-nav.html | 7 +++++++ .../_static/{ => download}/llm_models.csv | 3 +-- 3 files changed, 18 insertions(+), 5 deletions(-) rename docs/sphinx_setup/_static/{ => download}/llm_models.csv (92%) diff --git a/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst b/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst index 03588eeb441f38..73c9f255ff3dbb 100644 --- a/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst +++ b/docs/articles_en/about-openvino/performance-benchmarks/generative-ai-performance.rst @@ -1,8 +1,15 @@ Most Efficient Large Language Models for AI PC ============================================== -The table below lists key performance indicators for a selection of Large Language Models -running on an Intel® Core™ Ultra 7-165H based system. +This page is regularly updated to help you identify the best-performing LLMs on the +Intel® Core™ Ultra processor family and AI PCs. + +The table below lists the key performance indicators for a selection of Large Language Models, +running on an Intel® Core™ Ultra 7-165H based system, on built-in GPUs. + +For complete information on the system config, see: +`Hardware Platforms [PDF] `__ + .. raw:: html @@ -54,7 +61,7 @@ running on an Intel® Core™ Ultra 7-165H based system. :class: modeldata stripe :name: supportedModelsTable :header-rows: 1 - :file: ../../_static/llm_models.csv + :file: ../../_static/download/llm_models.csv This page is regularly updated to help you identify the best-performing LLMs on the diff --git a/docs/openvino_sphinx_theme/openvino_sphinx_theme/templates/navbar-nav.html b/docs/openvino_sphinx_theme/openvino_sphinx_theme/templates/navbar-nav.html index faba6fc1538a62..8d428571f18b12 100644 --- a/docs/openvino_sphinx_theme/openvino_sphinx_theme/templates/navbar-nav.html +++ b/docs/openvino_sphinx_theme/openvino_sphinx_theme/templates/navbar-nav.html @@ -31,6 +31,13 @@ + +