[CPU] Fixed fusing Convolution with Sum (#4617)
This commit is contained in:
parent
3eac187e2e
commit
54f60ee761
@ -301,6 +301,7 @@ void MKLDNNConvolutionNode::getSupportedDescriptors() {
|
||||
// bofore the fused convolution. This behaviour might be more correct regarding expected markup
|
||||
// of the graph but performance of first and second approaches might be different. Need to verify
|
||||
outputDataType = eltwisePrecision == Precision::BF16 ? memory::data_type::bf16 : memory::data_type::f32;
|
||||
eltwisePrecision = MKLDNNExtensionUtils::DataTypeToIEPrecision(outputDataType);
|
||||
}
|
||||
}
|
||||
// correction for cases of FP32 input - we do not have FP32 convolution supported BF16 output
|
||||
|
@ -68,8 +68,10 @@ protected:
|
||||
|
||||
if (inPrc == Precision::UNSPECIFIED) {
|
||||
selectedType += std::string("_") + Precision(Precision::FP32).name();
|
||||
} else {
|
||||
} else if (inPrc == Precision::BF16) {
|
||||
selectedType += std::string("_") + inPrc.name();
|
||||
} else {
|
||||
selectedType += std::string("_") + Precision(netPrecision).name();
|
||||
}
|
||||
|
||||
ngraph::op::PadType padType;
|
||||
@ -202,6 +204,22 @@ INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_Planar_BF16, ConvolutionLayerCPUTest,
|
||||
::testing::Values(cpuBF16PluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_Planar_I8, ConvolutionLayerCPUTest,
|
||||
::testing::Combine(
|
||||
::testing::Combine(
|
||||
convParams_ExplicitPadding_Planar_2D,
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::Values(Precision::I8),
|
||||
::testing::Values(Precision::UNSPECIFIED),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(std::vector<size_t >({ 2, 12, 7, 7 })),
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU)),
|
||||
::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_Planar_2D)),
|
||||
::testing::Values(fusingSum),
|
||||
::testing::Values(cpuEmptyPluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
/* ============= GroupConvolution (Planar 3D) ============= */
|
||||
const auto convParams_ExplicitPadding_Planar_3D = ::testing::Combine(
|
||||
::testing::ValuesIn(kernels3d),
|
||||
@ -249,6 +267,22 @@ INSTANTIATE_TEST_CASE_P(smoke_Conv_3D_Planar_BF16, ConvolutionLayerCPUTest,
|
||||
::testing::Values(cpuBF16PluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_Conv_3D_Planar_I8, ConvolutionLayerCPUTest,
|
||||
::testing::Combine(
|
||||
::testing::Combine(
|
||||
convParams_ExplicitPadding_Planar_3D,
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::Values(Precision::I8),
|
||||
::testing::Values(Precision::UNSPECIFIED),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(std::vector<size_t >({ 2, 12, 7, 7, 7 })),
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU)),
|
||||
::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_Planar_3D)),
|
||||
::testing::Values(fusingSum),
|
||||
::testing::Values(cpuEmptyPluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
/* ============= GroupConvolution (Blocked 2D) ============= */
|
||||
const auto convParams_ExplicitPadding_Blocked_2D = ::testing::Combine(
|
||||
::testing::ValuesIn(kernels2d),
|
||||
@ -298,6 +332,22 @@ INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_Blocked_BF16, ConvolutionLayerCPUTest,
|
||||
::testing::Values(cpuBF16PluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_Blocked_I8, ConvolutionLayerCPUTest,
|
||||
::testing::Combine(
|
||||
::testing::Combine(
|
||||
convParams_ExplicitPadding_Blocked_2D,
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::Values(Precision::I8),
|
||||
::testing::Values(Precision::UNSPECIFIED),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(std::vector<size_t >({ 2, 64, 7, 7 })),
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU)),
|
||||
::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_Blocked_2D)),
|
||||
::testing::Values(fusingSum),
|
||||
::testing::Values(cpuEmptyPluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
/* ============= GroupConvolution (Blocked 3D) ============= */
|
||||
const auto convParams_ExplicitPadding_Blocked_3D = ::testing::Combine(
|
||||
::testing::ValuesIn(kernels3d),
|
||||
@ -347,6 +397,22 @@ INSTANTIATE_TEST_CASE_P(smoke_Conv_3D_Blocked_BF16, ConvolutionLayerCPUTest,
|
||||
::testing::Values(cpuBF16PluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_Conv_3D_Blocked_I8, ConvolutionLayerCPUTest,
|
||||
::testing::Combine(
|
||||
::testing::Combine(
|
||||
convParams_ExplicitPadding_Blocked_3D,
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::Values(Precision::I8),
|
||||
::testing::Values(Precision::UNSPECIFIED),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(std::vector<size_t >({ 2, 64, 7, 7, 7 })),
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU)),
|
||||
::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_Blocked_3D)),
|
||||
::testing::Values(fusingSum),
|
||||
::testing::Values(cpuEmptyPluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
/* ============= Kernel_1x1 (2D) ============= */
|
||||
|
||||
const auto convParams_ExplicitPadding_1x1_2D = ::testing::Combine(
|
||||
@ -397,6 +463,22 @@ INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_1x1_BF16, ConvolutionLayerCPUTest,
|
||||
::testing::Values(cpuBF16PluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(smoke_Conv_2D_1x1_I8, ConvolutionLayerCPUTest,
|
||||
::testing::Combine(
|
||||
::testing::Combine(
|
||||
convParams_ExplicitPadding_1x1_2D,
|
||||
::testing::Values(Precision::FP32),
|
||||
::testing::Values(Precision::I8),
|
||||
::testing::Values(Precision::UNSPECIFIED),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(Layout::ANY),
|
||||
::testing::Values(std::vector<size_t >({ 2, 64, 7, 7 })),
|
||||
::testing::Values(CommonTestUtils::DEVICE_CPU)),
|
||||
::testing::ValuesIn(filterCPUInfoForDevice(CPUParams_1x1_2D)),
|
||||
::testing::Values(fusingSum),
|
||||
::testing::Values(cpuEmptyPluginConfig)),
|
||||
ConvolutionLayerCPUTest::getTestCaseName);
|
||||
|
||||
/* ========= */
|
||||
|
||||
} // namespace
|
||||
|
Loading…
Reference in New Issue
Block a user