[GPU] Fix to skip shape_of_subgraph when input shape is not changed. (#24795)

We only check whether shape of subgraph is changed or not in dynamic
node. But static node also need to be skipped. The node after shape_of
can be static.


### Tickets:
 - *142892*

---------

Signed-off-by: hyunback <hyunback.kim@intel.com>
This commit is contained in:
hyunback kim 2024-06-10 18:44:05 +09:00 committed by GitHub
parent 5291ecc11c
commit 29a4239707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -1314,19 +1314,20 @@ event::ptr primitive_inst::execute(const std::vector<event::ptr>& events) {
_mem_changed = false;
const auto orig_outputs = _outputs;
std::vector<event::ptr> dependencies;
if (is_dynamic() && !has_inner_networks()) {
if ((is_dynamic() || _node->is_in_shape_of_subgraph()) && !has_inner_networks()) {
do_runtime_in_place_concat();
OPENVINO_ASSERT(_node != nullptr, "[GPU] Invalid primitive_inst object for dynamic shapes case: program_node can't be null");
update_shape();
bool can_skip_execution = false;
if (_impl_params->output_layouts[0].count() == 0) {
GPU_DEBUG_TRACE_DETAIL << id() << " : Skipping because output data is empty " << std::endl;
can_skip_execution = true;
}
if (_node->is_in_shape_of_subgraph()) {
// subgraph_input_changed can be available only shape_of is dynamic.
// shape_of_subgraph for static shape_of could be run every inference if constant propagation does not work.
if (_node->is_in_shape_of_subgraph() && dependant_shape_of_insts.front()->is_dynamic()) {
bool subgraph_input_changed = false;
for (size_t i = 0; i < dependant_shape_of_insts.size(); i++) {
if (dependant_shape_of_insts[i]->shape_changed()) {