Skip to content

Commit

Permalink
[GPU] Set fc format to bfyx when its spatial pitches are one
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-y committed Nov 26, 2024
1 parent 833c034 commit 82fe15f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/intel_gpu/src/graph/fully_connected.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ format::type get_preferred_format(fully_connected_node const& node, const kernel
// "is_batch_after_spatial" should return true)
if (data_type_traits::is_floating_point(input_layout.data_type) &&
input_layout.format == format::bfyx &&
input_layout.batch() > 1)
input_layout.batch() > 1 &&
input_pitches[2] == 1 &&
input_pitches[3] == 1)
return format::yxfb;

return format::bfyx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,19 @@ INSTANTIATE_TEST_SUITE_P(smoke_MatMul_fc_fb_io_block_f16, GPUMatMulLayerTest,
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
MatMulLayerTest::getTestCaseName);

std::vector<std::vector<ov::Shape>> fc4d_shapeRelatedParams = {
{ {16, 16, 16, 576}, {576, 1728} },
};

INSTANTIATE_TEST_SUITE_P(smoke_MatMul_fc4d, GPUMatMulLayerTest,
::testing::Combine(
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(fc4d_shapeRelatedParams)),
::testing::Values(std::make_pair(false, false)),
::testing::ValuesIn(inputPrecisions),
::testing::ValuesIn(fc_f16_secondaryInputTypes),
::testing::Values(ov::test::utils::DEVICE_GPU),
::testing::Values(additional_config)),
MatMulLayerTest::getTestCaseName);

} // namespace

0 comments on commit 82fe15f

Please sign in to comment.