diff --git a/paddle/fluid/framework/new_executor/interpretercore_util.cc b/paddle/fluid/framework/new_executor/interpretercore_util.cc index 055a765af11a962636252f7cb640b5f11e9c6fc8..38ef5fd70ce873f79fe4e495b4192061c24dba3e 100644 --- a/paddle/fluid/framework/new_executor/interpretercore_util.cc +++ b/paddle/fluid/framework/new_executor/interpretercore_util.cc @@ -412,6 +412,7 @@ void build_op_func_list(const platform::Place& place, : var_scope->GetMutableScope(); std::vector> ops_unique; // its elements will be moved to vec_func_list + bool flag_log_is_printed = false; // Step 1: create all ops for current block. create_all_ops(block, &ops_unique); // If gc is enabled and block size > 1 @@ -438,6 +439,13 @@ void build_op_func_list(const platform::Place& place, auto op = ops[i].get(); VLOG(6) << "Build OpFuncNode from : " << op->Type(); + // Print new executor log if grad op is used. + // It's only for test and will be removed later. + if (!flag_log_is_printed && op->Type().find("_grad") != std::string::npos) { + VLOG(0) << "Standalone Executor is Used."; + flag_log_is_printed = true; + } + auto inputs_names = op->Inputs(); auto outputs_names = op->Outputs(); diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index f9a527ec94ef9f0543c3a16a98fa73aeb29e22cd..601c66f5b3007a8558c82c56c8ba1f7c601ec38f 100755 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1533,7 +1533,7 @@ class Executor(object): converted_program.lr_sheduler = inner_program.lr_sheduler inner_program = converted_program # print(f"Program after convert:\n {inner_program}", flush=True) - logging.warning( + warnings.warn( "FLAGS_USE_STANDALONE_EXECUTOR and FLAGS_CONVERT_GRAPH_TO_PROGRAM is set to 1. Graph will be converted to Program and executed using new executor." ) else: @@ -1550,6 +1550,11 @@ class Executor(object): fetch_var_name=fetch_var_name, use_fetch_v2=True) + # If there are multiple blocks in the program, subblock will not be + # executed with the new executor in temporary + if program.num_blocks > 1: + warnings.warn("There are more than 1 block in program.") + # standalone executor will apply buffer_shared_inplace_pass and # inplace_addto_op_pass to program according to build_strategy enable_inplace = True if build_strategy is None or build_strategy.enable_inplace else False