Skip to content

Commit

Permalink
[GPU] Reverse kernel shape when autopadding (openvinotoolkit#23033)
Browse files Browse the repository at this point in the history
### Details:
 - *Reverse the weight spatial kernel shape when autopadding*

### Tickets:
 - *130861*
  • Loading branch information
steve-y authored Mar 28, 2024
1 parent 1904f2c commit 8913c1f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct convolution_impl : typed_primitive_impl_ocl<convolution> {
const auto spatial_rank = input_layout.get_spatial_rank();

ov::PartialShape kernel;
for (size_t i = 0; i < spatial_rank; i++) {
for (int32_t i = static_cast<int32_t>(spatial_rank) - 1; i >= 0; i--) {
kernel.emplace_back(weights_layout.spatial(i));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ const auto groupConv2DParams_AutoPadValid = ::testing::Combine(
::testing::ValuesIn(numGroups),
::testing::Values(ov::op::PadType::VALID)
);
const auto groupConv2DParams_AutoPadSameUpper = ::testing::Combine(
::testing::Values(std::vector<size_t >({1, 5})),
::testing::ValuesIn(strides),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::Values(std::vector<ptrdiff_t>({0, 0})),
::testing::ValuesIn(dilations),
::testing::Values(80),
::testing::Values(80),
::testing::Values(ov::op::PadType::SAME_UPPER)
);

INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution2D_ExplicitPadding, GroupConvolutionLayerTest,
::testing::Combine(
Expand All @@ -113,6 +123,15 @@ INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution2D_AutoPadValid, GroupConvolution
::testing::Values(ov::test::utils::DEVICE_GPU)),
GroupConvolutionLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_GroupConvolution2D_AutoPadSameUpper, GroupConvolutionLayerTest,
::testing::Combine(
groupConv2DParams_AutoPadSameUpper,
::testing::ValuesIn(netPrecisions),
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(
std::vector<std::vector<ov::Shape>>({{{1, 80, 1, 1008}}}))),
::testing::Values(ov::test::utils::DEVICE_GPU)),
GroupConvolutionLayerTest::getTestCaseName);

/* ============= 3D GroupConvolution ============= */
const std::vector<std::vector<size_t >> kernels3d = {{3, 3, 3}};
const std::vector<std::vector<ptrdiff_t>> paddings3d = {{0, 0, 0}};
Expand Down

0 comments on commit 8913c1f

Please sign in to comment.