Skip to content

Commit ac8ddbb

Browse files
[GPU] Conv doens't extend strides and dilations for 3d output
1 parent 4655dd0 commit ac8ddbb

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/plugins/intel_gpu/src/graph/layout_optimizer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ bool should_use_winograd_2x3_s1(const convolution_node& node,
536536

537537
auto prim = node.get_primitive();
538538
if (input_layout.data_type != data_types::f16
539-
|| input_layout.feature() % 64 != 0 // current algorithm is effective for ifm to be multiply of 64
539+
|| (input_layout.is_static() && input_layout.feature() % 64 != 0) // current algorithm is effective for ifm to be multiply of 64
540540
|| weights_layout.spatial(0) != 3 // weights have to be 3x3 by definiton
541541
|| weights_layout.spatial(1) != 3 // weights have to be 3x3 by definition
542542
|| weights_layout.batch() % 64 != 0 // current algorithm is effective for ofm to be multiply of 64
@@ -616,7 +616,7 @@ bool layout_optimizer::convolution_byxf_opt(const layout& input_layout,
616616
all_ones(conv->dilation) &&
617617
!node.get_transposed() &&
618618
node.get_groups() == 1 &&
619-
input_layout.feature() % 32 == 0 &&
619+
(input_layout.is_static() && input_layout.feature() % 32 == 0) &&
620620
weights_layout.spatial(1) == 1 && output_layout.feature() % 64 == 0 &&
621621
weights_layout.batch() % 64 == 0 &&
622622
all_ones(conv->stride) &&

src/plugins/intel_gpu/src/plugin/ops/convolution.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static void CreateConvolutionOp(ProgramBuilder& p, const std::shared_ptr<ov::int
4444
auto pads_end = op->get_pads_end();
4545
auto auto_pad = op->get_auto_pad();
4646

47-
if (!op->is_dynamic()) {
47+
if (!op->is_dynamic() && outDims.size() >= 4) {
4848
// Extend 1d vectors to 2d as 1d can't be handled properly by the graph optimizer for now
4949
strides.resize(std::max<size_t>(2, strides.size()), 1);
5050
dilations.resize(std::max<size_t>(2, strides.size()), 1);

src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/convolution.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ const std::vector<ov::element::Type> netPrecisions = {
1414
ov::element::f16
1515
};
1616

17+
/* ============= 1D Convolution ============= */
18+
const auto conv1DParams = ::testing::Combine(
19+
::testing::Values(std::vector<size_t>({1})),
20+
::testing::Values(std::vector<size_t>({1})),
21+
::testing::Values(std::vector<ptrdiff_t>({0})),
22+
::testing::Values(std::vector<ptrdiff_t>({0})),
23+
::testing::Values(std::vector<size_t>({1})),
24+
::testing::Values(192),
25+
::testing::Values(ov::op::PadType::EXPLICIT)
26+
);
27+
28+
INSTANTIATE_TEST_SUITE_P(smoke_Convolution1D, ConvolutionLayerTest,
29+
::testing::Combine(
30+
conv1DParams,
31+
::testing::Values(ov::element::f32),
32+
::testing::Values(ov::test::static_partial_shapes_to_test_representation(std::vector<ov::PartialShape>({{1, 256, 1}}))),
33+
::testing::Values(ov::test::utils::DEVICE_GPU)),
34+
ConvolutionLayerTest::getTestCaseName);
35+
1736
/* ============= 2D Convolution ============= */
1837
const std::vector<std::vector<size_t >> kernels = {{3, 3},
1938
{3, 5}};

0 commit comments

Comments
 (0)