From 10705c50d86dad80f06b89f2e35a65f8c57a77fd Mon Sep 17 00:00:00 2001 From: Yuan Hu Date: Fri, 8 Mar 2024 18:04:02 +0800 Subject: [PATCH] [CPU] fix bug in PR 23179 (#23314) ### Details: - *fix bug in https://github.com/openvinotoolkit/openvino/pull/23179 , the flat condition is not right* - *add test case for ic < 4 with layout nchw8c->nchw8c on sse42* - the onednn PR https://github.com/openvinotoolkit/oneDNN/pull/235 ### Tickets: - *[CVS-125793](https://jira.devtools.intel.com/browse/CVS-125793)* --------- Signed-off-by: HU Yuan2 --- .../single_layer_tests/convolution.cpp | 44 ++++++++++++++----- src/plugins/intel_cpu/thirdparty/onednn | 2 +- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/plugins/intel_cpu/tests/functional/single_layer_tests/convolution.cpp b/src/plugins/intel_cpu/tests/functional/single_layer_tests/convolution.cpp index 5f93642e72d..22c4a8229b4 100755 --- a/src/plugins/intel_cpu/tests/functional/single_layer_tests/convolution.cpp +++ b/src/plugins/intel_cpu/tests/functional/single_layer_tests/convolution.cpp @@ -352,6 +352,14 @@ std::vector inputShapesPlain2Blocked1d = { } }, { + //dynamic shapes + {-1, 2, {1, 200}}, + { //target static shapes + {2, 2, 7}, + {1, 2, 9} + } + }, + { //dynamic shapes {-1, 3, {1, 200}}, { //target static shapes @@ -361,6 +369,8 @@ std::vector inputShapesPlain2Blocked1d = { } }; +std::vector inputShapesSmallIC1d = inputShapesPlain2Blocked1d; + /* ============= Convolution params (2D) ============= */ const std::vector kernels2d = { {3, 3}, {1, 1} }; const std::vector strides2d = { {1, 1}, {2, 2} }; @@ -401,6 +411,14 @@ std::vector inputShapesPlain2Blocked2d = { { 1, 1, 9, 9} } }, + { + //dynamic shape + { -1, 2, -1, {1, 200} }, + { //target static shapes + { 2, 2, 7, 7 }, + { 1, 2, 9, 9} + } + }, { //dynamic shape { -1, 3, -1, {1, 200} }, @@ -411,6 +429,8 @@ std::vector inputShapesPlain2Blocked2d = { } }; +std::vector inputShapesSmallIC2d = inputShapesPlain2Blocked2d; + /* ============= Convolution params (3D) ============= */ const std::vector kernels3d = { {3, 3, 3}, {1, 1, 1} }; const std::vector strides3d = { {1, 1, 1}, {2, 2, 2} }; @@ -852,22 +872,23 @@ INSTANTIATE_TEST_SUITE_P(smoke_Conv_1D_I8, ConvolutionLayerCPUTest, ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); -const std::vector CPUParams_1D_plain_to_blocked = { +const std::vector CPUParams_1D_small_IC = { + conv_sse42_1D, conv_sse42_plain_to_blocked_1D, conv_avx2_plain_to_blocked_1D, conv_avx512_plain_to_blocked_1D, }; -INSTANTIATE_TEST_SUITE_P(smoke_Conv_1D_PlainToBlocked_FP32, ConvolutionLayerCPUTest, +INSTANTIATE_TEST_SUITE_P(smoke_Conv_1D_SmallIC_FP32, ConvolutionLayerCPUTest, ::testing::Combine( ::testing::Combine( convParams_ExplicitPadding_1D, ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), ::testing::Values(ElementType::undefined), - ::testing::ValuesIn(inputShapesPlain2Blocked1d), + ::testing::ValuesIn(inputShapesSmallIC1d), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_1D_plain_to_blocked)), + ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_1D_small_IC)), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); @@ -1057,22 +1078,23 @@ INSTANTIATE_TEST_SUITE_P(Conv_2D_I8_dilated, ConvolutionLayerCPUTest, ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); -const std::vector CPUParams_2D_plain_to_blocked = { +const std::vector CPUParams_2D_small_IC = { + conv_sse42_2D, conv_sse42_plain_to_blocked_2D, conv_avx2_plain_to_blocked_2D, conv_avx512_plain_to_blocked_2D, }; -INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_PlainToBlocked_FP32, ConvolutionLayerCPUTest, +INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_SmallIC_FP32, ConvolutionLayerCPUTest, ::testing::Combine( ::testing::Combine( convParams_ExplicitPadding_2D, ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), ::testing::Values(ElementType::undefined), - ::testing::ValuesIn(inputShapesPlain2Blocked2d), + ::testing::ValuesIn(inputShapesSmallIC2d), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_2D_plain_to_blocked)), + ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_2D_small_IC)), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); @@ -1091,16 +1113,16 @@ INSTANTIATE_TEST_SUITE_P(smoke_Conv_2D_PlainToBlocked_BF16, ConvolutionLayerCPUT ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); -INSTANTIATE_TEST_SUITE_P(Conv_PlainToBlocked_2D_FP32_dilated, ConvolutionLayerCPUTest, +INSTANTIATE_TEST_SUITE_P(smoke_Conv_SmallIC_2D_FP32_dilated, ConvolutionLayerCPUTest, ::testing::Combine( ::testing::Combine( convParams_ExplicitPadding_2D_dilated, ::testing::Values(ElementType::f32), ::testing::Values(ElementType::undefined), ::testing::Values(ElementType::undefined), - ::testing::ValuesIn(inputShapesPlain2Blocked2d), + ::testing::ValuesIn(inputShapesSmallIC2d), ::testing::Values(CommonTestUtils::DEVICE_CPU)), - ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_2D_plain_to_blocked)), + ::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_2D_small_IC)), ::testing::Values(emptyFusingSpec), ::testing::Values(cpuEmptyPluginConfig)), ConvolutionLayerCPUTest::getTestCaseName); diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index a3a2be6cf6d..790944d87b7 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit a3a2be6cf6d9ce466cc1a7c2597e01843d8bb551 +Subproject commit 790944d87b7185c0f5ba8f47825b86203ecff955