From ba177e81bc84859720d3b6ad60f7451497bdbc90 Mon Sep 17 00:00:00 2001 From: Steve Yoo Date: Thu, 12 Dec 2024 12:41:46 +0000 Subject: [PATCH] [GPU] Confine reorder skipping opt condition to different i/o rank --- .../src/graph/graph_optimizer/remove_redundant_reorders.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/remove_redundant_reorders.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/remove_redundant_reorders.cpp index f771300a160167..ac7810c6e9154c 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/remove_redundant_reorders.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/remove_redundant_reorders.cpp @@ -295,8 +295,10 @@ void remove_redundant_reorders::run(program& p) { auto o_layout = r_node.get_output_layout(); const auto& i_layout = r_node.get_input_layout(0); - if ((!update_implementations && r_node.get_dependency(0).is_type()) || - (r_node.get_dependency(0).is_type() && r_node.get_dependency(0).can_be_optimized())) + auto is_r_node_rank_changed = r_node.get_output_layout().get_rank() != r_node.get_dependency(0).get_output_layout().get_rank(); + if (is_r_node_rank_changed && + ((!update_implementations && r_node.get_dependency(0).is_type()) || + (r_node.get_dependency(0).is_type() && r_node.get_dependency(0).can_be_optimized()))) continue; // Optimize reorder b_fs_yx_fsv16 -> bfyx when spatials are equal to 1. In this case we can reinterpret buffer,