Skip to content

Commit b47c607

Browse files
authored
[GPU] fix possible memory corruption with skippable nodes (#29042)
### Details: - we have some nodes which is target to be optimized during runtime, the memory status can be corrupted among iterations for these nodes ### Tickets: - CVS-161830 --------- Signed-off-by: fishbell <bell.song@intel.com>
1 parent 888cc14 commit b47c607

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plugins/intel_gpu/src/graph/primitive_inst.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,11 @@ void primitive_inst::do_runtime_skip_gather() {
14601460
GPU_DEBUG_TRACE_DETAIL << "--- Cannot optimize because idx_data [" << i << "] (" << idx_data[i] << ") != " << i << std::endl;
14611461
if (_impl_params->output_layouts[0].data_padding.is_dynamic())
14621462
_impl_params->output_layouts[0].data_padding = padding();
1463+
// for runtime skippable nodes, if previous iter is skipped while this iter not, its output memory needs to be revalidate
1464+
// as memory opt/release may be applied for these nodes to reduce memory footprint in previous iters
1465+
if (can_be_optimized()) {
1466+
set_flag(ExecutionFlags::SHAPE_CHANGED);
1467+
}
14631468
set_can_be_optimized(false);
14641469
return;
14651470
}

0 commit comments

Comments
 (0)