Commit 2de35b04 authored by Sergey Shalnov's avatar Sergey Shalnov Committed by Robert Kimball

IntelGPU backend: Cconvolutions operations corner cases fix (#2749)

parent 5490bae5
......@@ -1600,8 +1600,8 @@ shared_ptr<runtime::Executable>
// clDNN has quite limited support for Convolution operation
// following are the checks to go with workaround
if ((win_stride.size() > 2) || (pad_below.size() > 2) || (pad_above.size() > 2) ||
(win_dilation.size() > 2) || (data_dilation.size() > 2) ||
if ((win_stride.size() != 2) || (pad_below.size() != 2) || (pad_above.size() != 2) ||
(win_dilation.size() != 2) || (data_dilation.size() != 2) ||
(data_dilation.at(0) != 1) || (data_dilation.at(1) != 1) ||
(op->get_output_element_type(0) != element::f32))
{
......@@ -1676,10 +1676,20 @@ shared_ptr<runtime::Executable>
const Strides& win_dilation = conv_op->get_window_movement_strides_forward();
const Strides& data_dilation = conv_op->get_data_dilation_strides_forward();
if ((win_stride.size() > 2) || (win_stride.at(0) != 1) || (win_stride.at(1) != 1) ||
(pad_below.size() > 2) || (pad_above.size() > 2) || (data_dilation.size() > 2) ||
// workaround to use custom kernel in case of filter output NxCx1x1
bool proceed_with_custom_kernel = false;
const Shape& output_shape = op->get_output_shape(0);
if ((output_shape.size() == 4) && (output_shape.at(2) == 1) &&
(output_shape.at(3) == 1))
{
proceed_with_custom_kernel = true;
}
if ((win_stride.size() != 2) || (win_stride.at(0) != 1) || (win_stride.at(1) != 1) ||
(pad_below.size() != 2) || (pad_above.size() != 2) || (data_dilation.size() != 2) ||
(data_dilation.at(0) != 1) || (data_dilation.at(1) != 1) ||
(win_dilation.size() > 2) || (op->get_output_element_type(0) != element::f32))
(win_dilation.size() != 2) || (op->get_output_element_type(0) != element::f32) ||
proceed_with_custom_kernel)
{
do_convolution_operation(topology,
op->get_input_tensor_name(0),
......@@ -1776,10 +1786,10 @@ shared_ptr<runtime::Executable>
const Strides& win_dilation = conv_op->get_window_dilation_strides_forward();
const Strides& data_dilation = conv_op->get_window_movement_strides_forward();
if ((win_stride.size() > 2) || (win_stride.at(0) != 1) || (win_stride.at(1) != 1) ||
(pad_below.size() > 2) || (pad_above.size() > 2) || (data_dilation.size() > 2) ||
if ((win_stride.size() != 2) || (win_stride.at(0) != 1) || (win_stride.at(1) != 1) ||
(pad_below.size() != 2) || (pad_above.size() != 2) || (data_dilation.size() != 2) ||
(data_dilation.at(0) != 1) || (data_dilation.at(1) != 1) ||
(win_dilation.size() > 2) || (win_dilation.at(0) != 1) ||
(win_dilation.size() != 2) || (win_dilation.at(0) != 1) ||
(win_dilation.at(1) != 1) || (op->get_output_element_type(0) != element::f32) ||
((pad_below.at(0) == pad_above.at(0)) && (pad_below.at(1) == pad_above.at(1))))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment