From 021941bf035e780fecc98451cf1d9e24ba23d6f6 Mon Sep 17 00:00:00 2001 From: Jedrzej Hajduczenia Date: Fri, 4 Sep 2020 08:20:16 +0200 Subject: [PATCH] [IE CLDNN] Fix i8 regression on single-image-super-resolution-1032 (#1990) --- .../thirdparty/clDNN/src/layout_optimizer.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/inference-engine/thirdparty/clDNN/src/layout_optimizer.cpp b/inference-engine/thirdparty/clDNN/src/layout_optimizer.cpp index c6725d23cf2..5765c08face 100644 --- a/inference-engine/thirdparty/clDNN/src/layout_optimizer.cpp +++ b/inference-engine/thirdparty/clDNN/src/layout_optimizer.cpp @@ -393,7 +393,7 @@ bool layout_optimizer::convolution_b_fs_yx_fsv16_opt(layout const &input_layout, // Check for fsv16 imad kernel else if ((input_layout.format.dimension() == 4) && (conv->activations_zero_points.empty() && conv->weights_zero_points.empty()) && - (!((conv->groups > 1) && (in_features_per_group == 1) && (out_features_per_group == 1)))) + ((in_features_per_group > 8) || (out_features_per_group >= 4))) return true; return false; } @@ -462,7 +462,7 @@ bool layout_optimizer::convolution_b_fs_zyx_fsv16_opt(layout const &input_layout (conv->activations_zero_points.empty() && conv->weights_zero_points.empty()) && (input_layout.data_type == data_types::i8 || input_layout.data_type == data_types::u8) && (weights_layout.data_type == data_types::i8 || weights_layout.data_type == data_types::u8) && - (!((conv->groups > 1) && (in_features_per_group == 1) && (out_features_per_group == 1)))) + ((in_features_per_group > 8) || (out_features_per_group >= 4))) return true; bool format_ver = (input_layout.format == format::bfzyx || input_layout.format == format::b_fs_zyx_fsv16 || @@ -810,8 +810,13 @@ format layout_optimizer::get_preferred_format(program_node& node) { auto layout = node.get_output_layout(); if (layout.format.spatial_num() == 2 && (layout.data_type == data_types::i8 || layout.data_type == data_types::u8) && - layout.size.batch[0] % 16 == 0) + layout.size.batch[0] % 16 == 0) { + if (layout.size.feature[0] > 8) { + expected = format::b_fs_yx_fsv16; + } else { expected = format::b_fs_yx_fsv4; + } + } } else if (node.is_type() || node.is_type()) { expected = node.get_output_layout().format; } else if (node.is_type()) {