[IE CLDNN] Fix i8 regression on single-image-super-resolution-1032 (#1990)
authorJedrzej Hajduczenia <jedrzej.hajduczenia@intel.com>
Fri, 4 Sep 2020 06:20:16 +0000 (08:20 +0200)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 06:20:16 +0000 (09:20 +0300)
inference-engine/thirdparty/clDNN/src/layout_optimizer.cpp

index c6725d2..5765c08 100644 (file)
@@ -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<reorder>() || node.is_type<input_layout>()) {
         expected = node.get_output_layout().format;
     } else if (node.is_type<reshape>()) {