diff --git a/src/plugins/intel_gpu/src/graph/include/layout_optimizer.h b/src/plugins/intel_gpu/src/graph/include/layout_optimizer.h index 45e16d48b0c..17710b3a412 100644 --- a/src/plugins/intel_gpu/src/graph/include/layout_optimizer.h +++ b/src/plugins/intel_gpu/src/graph/include/layout_optimizer.h @@ -191,6 +191,7 @@ public: bool are_layouts_suitable_for_onednn(program_node& node); static bool onednn_check_data_types_for_pooling(data_types in_dt, data_types out_dt); static bool onednn_check_data_types_for_convolution(data_types in_dt, data_types wei_dt, data_types out_dt); + static bool onednn_check_data_types_for_deconvolution(data_types in_dt, data_types wei_dt, data_types out_dt); static bool onednn_check_data_types_for_fc_gemm(data_types in_dt, data_types wei_dt, data_types out_dt); static bool onednn_check_preferred_impl_type_of_users(program_node& node); bool is_primitive_implemented_for_onednn(program_node& node); diff --git a/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp b/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp index 1ffac0d5c37..f54fe8d46f0 100644 --- a/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp +++ b/src/plugins/intel_gpu/src/graph/layout_optimizer.cpp @@ -106,6 +106,22 @@ bool layout_optimizer::onednn_check_data_types_for_convolution(data_types in_dt, return false; } +// almost same with onednn_check_data_types_for_convolution. +// removed case +// - in_dt(f16) wei_dt(f16) out_dt(f32) +bool layout_optimizer::onednn_check_data_types_for_deconvolution(data_types in_dt, data_types wei_dt, data_types out_dt) { + if ((in_dt == data_types::f16 && wei_dt == data_types::f16) && + (out_dt == data_types::f16 || out_dt == data_types::i8 || out_dt == data_types::u8)) + return true; + if ((in_dt == data_types::i8 || in_dt == data_types::u8) && wei_dt == data_types::i8 && + (out_dt == data_types::f32 || out_dt == data_types::i32 || out_dt == data_types::f16 || out_dt == data_types::i8 || out_dt == data_types::u8)) + return true; + if ((in_dt == data_types::f32 && wei_dt == data_types::f32) && + (out_dt == data_types::i8 || out_dt == data_types::u8)) + return true; + return false; +} + bool layout_optimizer::onednn_check_data_types_for_fc_gemm(data_types in_dt, data_types wei_dt, data_types out_dt) { if ((in_dt == data_types::f16 && wei_dt == data_types::f16) && (out_dt == data_types::f16 || out_dt == data_types::f32 || out_dt == data_types::i8)) @@ -1231,11 +1247,12 @@ bool layout_optimizer::are_data_types_suitable_for_onednn(program_node& node) { if (node.is_type()) { return onednn_check_data_types_for_pooling(in_dt, out_dt); - } else if (node.is_type() || node.is_type()) { - bool is_conv = node.is_type(); - auto wei_dt = is_conv ? node.as().weights().get_output_layout().data_type : - node.as().weights().get_output_layout().data_type; + } else if (node.is_type()) { + auto wei_dt = node.as().weights().get_output_layout().data_type; return onednn_check_data_types_for_convolution(in_dt, wei_dt, out_dt); + } else if (node.is_type()) { + auto wei_dt = node.as().weights().get_output_layout().data_type; + return onednn_check_data_types_for_deconvolution(in_dt, wei_dt, out_dt); } else if (node.is_type() || node.is_type()) { bool is_fc = node.is_type(); auto wei_dt = is_fc ? node.as().weights().get_output_layout().data_type :