diff --git a/paddle/fluid/framework/executor.cc b/paddle/fluid/framework/executor.cc index 7b73b330375ec8c6ab936cac7af34205fec457b9..fb456fcb680c0c0fdaff8ccf5115bd176464b68b 100644 --- a/paddle/fluid/framework/executor.cc +++ b/paddle/fluid/framework/executor.cc @@ -183,6 +183,7 @@ void Executor::Run(const ProgramDesc& pdesc, const std::vector& skip_ref_cnt_vars, bool force_disable_gc, bool keep_kid_scopes) { + LOG_FIRST_N(INFO, 1) << "Old Executor is Running."; platform::RecordEvent record_run( "Executor::Run", platform::TracerEventType::UserDefined, 1); platform::RecordBlock b(block_id); diff --git a/paddle/fluid/framework/new_executor/interpretercore.cc b/paddle/fluid/framework/new_executor/interpretercore.cc index 39746f073408bee56eabb75a4b2819233b200597..59285dd6e61ea1a1d91671a1ef5c856c68897e6a 100644 --- a/paddle/fluid/framework/new_executor/interpretercore.cc +++ b/paddle/fluid/framework/new_executor/interpretercore.cc @@ -193,6 +193,7 @@ paddle::framework::FetchList InterpreterCore::Run( #endif if (!is_build_) { + LOG_FIRST_N(INFO, 1) << "New Executor is Running."; paddle::framework::interpreter::build_variable_scope( block_, &var_scope_, create_local_scope_); diff --git a/paddle/fluid/framework/new_executor/interpretercore_util.cc b/paddle/fluid/framework/new_executor/interpretercore_util.cc index a11ac6ff981c976e0ff38eebc1195771c82ee671..6fbb14287ed1c8f8443285fcb7c8182a60595bd0 100644 --- a/paddle/fluid/framework/new_executor/interpretercore_util.cc +++ b/paddle/fluid/framework/new_executor/interpretercore_util.cc @@ -418,7 +418,6 @@ 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); @@ -443,6 +442,7 @@ void build_op_func_list(const platform::Place& place, } auto unused_var_map = get_unused_vars(block, ops); + bool flag_log_is_printed = false; for (size_t i = 0; i < ops.size(); ++i) { auto op = ops[i].get(); const std::string& op_type = op->Type(); @@ -452,7 +452,7 @@ void build_op_func_list(const platform::Place& place, // 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."; + LOG_FIRST_N(INFO, 1) << "Standalone Executor is Used."; flag_log_is_printed = true; } diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 26150b2d04b04359c43e9b3d1d0f90faf87ab137..cfb92bb178b1eff74417bcf7590e2ae843a1194a 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -983,6 +983,7 @@ void ParallelExecutor::BCastParamsToDevices( FetchUnmergedList ParallelExecutor::Run( const std::vector &fetch_tensors) { + LOG_FIRST_N(INFO, 1) << "ParallelExecutor is Running (Run)."; PreludeToRun(fetch_tensors); platform::RecordBlock b(0); @@ -1000,6 +1001,7 @@ FetchUnmergedList ParallelExecutor::Run( FetchList ParallelExecutor::RunAndMerge( const std::vector &fetch_tensors) { + LOG_FIRST_N(INFO, 1) << "ParallelExecutor is Running (RunAndMerge)."; PreludeToRun(fetch_tensors); platform::RecordBlock b(0); diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index 39c3468d5fbd24c2e2a3eba2c1cd4692c73e1db0..3b21262cc4b144de111f9df57224c634850f3753 100755 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -771,9 +771,6 @@ class _ExecutorCache(object): inner_program = converted_program # print(f"Program after convert:\n {inner_program}", flush=True) - 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: build_strategy = None from paddle.incubate.autograd import prim_enabled, prim2orig @@ -789,9 +786,16 @@ class _ExecutorCache(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.") + if os.environ.get('FLAGS_CONVERT_GRAPH_TO_PROGRAM', None) in [ + 1, '1', True, 'True', 'true' + ] and not program._is_start_up_program_: + if program.num_blocks > 1: + # If there are multiple blocks in the program, subblock will not be executed with the new executor in temporary + logging.warning("There are more than 1 block in program.") + elif program.num_blocks == 1: + logging.warning("There are 1 block in program.") + else: + logging.warning("There are no block in program.") # standalone executor will apply buffer_shared_inplace_pass and # inplace_addto_op_pass to program according to build_strategy @@ -1667,10 +1671,6 @@ class Executor(object): else: tensor._copy_from(cpu_tensor, self.place) - warnings.warn( - "FLAGS_USE_STANDALONE_EXECUTOR is set to 1. New executor is used to execute Program." - ) - return new_exe.run(scope, list(feed.keys()), fetch_list, return_numpy)