Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[BUGFIX] Free up executor memory when reassigning new executor #19214

Merged
merged 1 commit into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/executor/graph_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2006,6 +2006,7 @@ Executor *Executor::SimpleBind(nnvm::Symbol symbol,
default_ctx, group2ctx, &tmp_in_arg_ctxes, &tmp_arg_grad_ctxes,
&tmp_grad_req_types, &tmp_aux_state_ctxes, verbose);
// Subgraph cannot be recreated from unoptimized symbol
delete exec;
exec = new exec::GraphExecutor(symbol);
exec->Init(symbol.Copy(), default_ctx, group2ctx, tmp_in_arg_ctxes, tmp_arg_grad_ctxes,
tmp_aux_state_ctxes, arg_shape_map, arg_dtype_map, arg_stype_map,
Expand Down Expand Up @@ -2077,6 +2078,7 @@ Executor *Executor::Bind(nnvm::Symbol symbol,
&tmp_arg_grad_store, &tmp_grad_req_type, &tmp_aux_states,
verbose);
// Subgraph cannot be recreated from unoptimized symbol
delete exec;
exec = new exec::GraphExecutor(symbol);
}
}
Expand Down