diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/reorder_inputs.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/reorder_inputs.cpp index 88dcb8865d937a..cdc56673f8c6a9 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/reorder_inputs.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/reorder_inputs.cpp @@ -545,6 +545,15 @@ const char *dir_msg(direction_e dir) { return "backward"; } +static bool is_weights_dependency(program_node* predecessor, program_node* successor) { + bool is_weights_dep = false; + if (successor->is_type() || successor->is_type() || successor->is_type()) { + size_t dep_idx = successor->get_dependency_index(*predecessor); + is_weights_dep = dep_idx == successor->get_primitive()->input_size(); + } + return is_weights_dep; +} + // If there is layout mismatch between two layers, add reorder template void insert_reorders_in_dir(program& p, const std::map& fmt_map, reorder_factory& rf, layout_optimizer& lo, program_node* node) { @@ -558,6 +567,9 @@ void insert_reorders_in_dir(program& p, const std::map 0 && fmt_map.at(next) == fmt) continue; + if (is_weights_dependency(node, next)) + continue; + // We have three (potentially) conflicting information here for format // node->get_output_layout().format : It is not up-to-date at this moment. It is just the default format (bfyx) // fmt_map.at(node).format : It is queried with get_preferred_layout. However, it has only output format. @@ -609,6 +621,9 @@ void insert_reorders_in_dir(program& p, const std::map

0 && fmt_map.at(next.first) == fmt) continue; + if (is_weights_dependency(next.first, node)) + continue; + // We have three (potentially) conflicting information here for format // node->get_output_layout().format : It is not up-to-date at this moment. It is just the default format (bfyx) // fmt_map.at(node).format : It is queried with get_preferred_layout. However, it has only output format.