From 1fd12aceb82c8fc7aada3dabfb139700e3a2931c Mon Sep 17 00:00:00 2001 From: "yuan.xiong" Date: Fri, 13 Dec 2024 13:31:24 +0800 Subject: [PATCH] Check broadcast node in can_mark_node Signed-off-by: yuan.xiong --- .../graph_optimizer/mark_shape_of_subgraphs.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp index 2d7a6ea8183cd4..a40c7dfebb9de6 100644 --- a/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp +++ b/src/plugins/intel_gpu/src/graph/graph_optimizer/mark_shape_of_subgraphs.cpp @@ -22,13 +22,6 @@ void mark_shape_of_subgraphs::look_for_shape_of_subgraph(program_node& node) { return; } - // skip mark_node for broadcast node if dependency nodes are data and shape_of - auto& dependencies = node.get_dependencies(); - if (node.is_type() && dependencies.size() == 2) { - if (dependencies[0].first->is_type() && dependencies[1].first->is_type()) - return; - } - // Check if all dependencies are constant or marked as a part of shape_of subgraph bool can_execute_in_subgraph = true; bool has_shape_of_subgraph_dep = false; @@ -94,6 +87,13 @@ bool mark_shape_of_subgraphs::can_mark_node(const program_node& node) { return false; } + // skip mark_node for broadcast node if dependency nodes are data and shape_of + auto& dependencies = node.get_dependencies(); + if (node.is_type() && dependencies.size() == 2) { + if (dependencies[0].first->is_type() && dependencies[1].first->is_type()) + return false; + } + return true; }