[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:
parent
5291ecc11c
commit
29a4239707
|
|
@ -1314,19 +1314,20 @@ event::ptr primitive_inst::execute(const std::vector<event::ptr>& events) {
|
||||||
_mem_changed = false;
|
_mem_changed = false;
|
||||||
const auto orig_outputs = _outputs;
|
const auto orig_outputs = _outputs;
|
||||||
std::vector<event::ptr> dependencies;
|
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();
|
do_runtime_in_place_concat();
|
||||||
OPENVINO_ASSERT(_node != nullptr, "[GPU] Invalid primitive_inst object for dynamic shapes case: program_node can't be null");
|
OPENVINO_ASSERT(_node != nullptr, "[GPU] Invalid primitive_inst object for dynamic shapes case: program_node can't be null");
|
||||||
update_shape();
|
update_shape();
|
||||||
|
|
||||||
|
|
||||||
bool can_skip_execution = false;
|
bool can_skip_execution = false;
|
||||||
if (_impl_params->output_layouts[0].count() == 0) {
|
if (_impl_params->output_layouts[0].count() == 0) {
|
||||||
GPU_DEBUG_TRACE_DETAIL << id() << " : Skipping because output data is empty " << std::endl;
|
GPU_DEBUG_TRACE_DETAIL << id() << " : Skipping because output data is empty " << std::endl;
|
||||||
can_skip_execution = true;
|
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;
|
bool subgraph_input_changed = false;
|
||||||
for (size_t i = 0; i < dependant_shape_of_insts.size(); i++) {
|
for (size_t i = 0; i < dependant_shape_of_insts.size(); i++) {
|
||||||
if (dependant_shape_of_insts[i]->shape_changed()) {
|
if (dependant_shape_of_insts[i]->shape_changed()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue