Skip to content

Commit

Permalink
[GPU] update layout.compatible() to check false conditions first (ope…
Browse files Browse the repository at this point in the history
…nvinotoolkit#23101)

### Details:
- Update layout.compatible() to check properly for the case where o(or
b) axis is blocked
 - Add unit test case

### Tickets:
 - 132367
  • Loading branch information
wilson-seok authored and alvoron committed Apr 29, 2024
1 parent 1fa986e commit df8d769
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/runtime/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ ov::PartialShape layout::transform(const ov::PartialShape& pshape, cldnn::format
// Check a reorder is 1d along feature axis. Or feature size fits to inner block size of feature axis
static inline bool check_redundant_1d_along_feature(layout const& l1, layout const& l2) {
// No padding, double blocked format and different data_type
if (!l1.data_padding && !l2.data_padding && !format::is_multi_blocked(l1.format) && !format::is_multi_blocked(l2.format) &&
if ((l1.get_linear_size() == l2.get_linear_size()) && !l1.data_padding && !l2.data_padding &&
!format::is_multi_blocked(l1.format) && !format::is_multi_blocked(l2.format) &&
l2.data_type == l1.data_type && l2.count() == l1.count()) {
auto l1_inner_blk = format::is_single_blocked(l1.format) ? l1.format.traits().block_sizes.at(0).second : 1;
auto l2_inner_blk = format::is_single_blocked(l2.format) ? l2.format.traits().block_sizes.at(0).second : 1;
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/intel_gpu/tests/unit/module_tests/layout_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ INSTANTIATE_TEST_SUITE_P(smoke, layout_cmp_test,
layout{ov::PartialShape{1, 32, 4, 4}, data_types::f32, format::b_fs_yx_fsv32, padding({0, 0, 1, 1}, 0)}, true, true},
{layout{ov::PartialShape{10, 20}, data_types::f16, format::bfyx},
layout{ov::PartialShape{10, 20}, data_types::f16, format::os_iyx_osv16}, false, false},
{layout{ov::PartialShape{1, 16, 1, 1}, data_types::f16, format::bfyx},
layout{ov::PartialShape{1, 16, 1, 1}, data_types::f16, format::os_iyx_osv16}, false, false},
{layout{ov::PartialShape{1, 2, 3, 4}, data_types::f16, format::bfyx},
layout{ov::PartialShape{1, 2, 3, 4}, data_types::f16, format::oiyx}, false, true},
{layout{ov::PartialShape{128, 10}, data_types::f16, format::bfyx},
Expand Down

0 comments on commit df8d769

Please sign in to comment.