Skip to content

Commit

Permalink
fix inpalce case
Browse files Browse the repository at this point in the history
  • Loading branch information
GGBond8488 authored and Your Name committed Jan 9, 2024
1 parent 60ecf98 commit d2b0df4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,10 @@ void BuildOpFuncList(const platform::Place& place,
std::rethrow_exception(std::current_exception());
}

if (FLAGS_save_static_runtime_data) {
// inplace case: If you save the input and output of share_buff, it will
// cause the saved input of the op corresponding to share_buff to be
// overwritten by the output.
if (FLAGS_save_static_runtime_data && (op->Type() != "share_buffer")) {
VLOG(6) << "start to save paddle variable";
auto root_path = FLAGS_static_runtime_data_save_path;
for (auto& vname : op->InputVars()) {
Expand Down
5 changes: 4 additions & 1 deletion paddle/fluid/framework/new_executor/program_interpreter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,10 @@ void ProgramInterpreter::RunOperator(const Instruction& instr_node) {
}

// for debug
if (FLAGS_save_static_runtime_data) {
// inplace case: If you save the input and output of share_buff, it will cause
// the saved input of the op corresponding to share_buff to be overwritten by
// the output.
if (FLAGS_save_static_runtime_data && (op->Type() != "share_buffer")) {
VLOG(6) << "start to save paddle variable";
auto root_path = FLAGS_static_runtime_data_save_path;
for (auto& vname : op->InputVars()) {
Expand Down

0 comments on commit d2b0df4

Please sign in to comment.