From fab1a02960cfe81923164a19092f17ce4f56ee15 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Tue, 21 Sep 2021 22:13:30 -0500 Subject: [PATCH] refine gc for new_executor (#35764) * refine gc for new_executor, test=develop * refine, test=develop * refine, test=develop * merge, test=develop --- paddle/fluid/framework/new_executor/interpretercore.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paddle/fluid/framework/new_executor/interpretercore.cc b/paddle/fluid/framework/new_executor/interpretercore.cc index dad39f1471..25f71dee2a 100644 --- a/paddle/fluid/framework/new_executor/interpretercore.cc +++ b/paddle/fluid/framework/new_executor/interpretercore.cc @@ -385,6 +385,10 @@ void InterpreterCore::CheckGC(size_t instr_id, !var_scope.vec_meta_info_[var_id].vardesc_->Persistable()) { gc_.Add(var_scope.var_list[var_id], gc_event_[instr_id], vec_instruction_[instr_id].dev_ctx_); + } else if (is_ready && + var_scope.vec_meta_info_[var_id].vardesc_ == nullptr) { + gc_.Add(var_scope.var_list[var_id], gc_event_[instr_id], + vec_instruction_[instr_id].dev_ctx_); } } } -- GitLab