diff --git a/mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc b/mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc index 4120d57465a..d60aa7c21cb 100644 --- a/mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc +++ b/mindspore/ccsrc/backend/session/anf_runtime_algorithm.cc @@ -1477,7 +1477,7 @@ size_t AnfRuntimeAlgorithm::GetRealInputIndex(const mindspore::AnfNodePtr &anf_n auto find = spec_node_list.find(node_name); if (find != spec_node_list.end()) { ret = find->second[cur_index]; - MS_LOG(INFO) << "Real input index change to" << ret << ", node name:" << node_name; + MS_LOG(DEBUG) << "Real input index change to" << ret << ", node name:" << node_name; } } return ret; diff --git a/mindspore/ccsrc/backend/session/ascend_session.cc b/mindspore/ccsrc/backend/session/ascend_session.cc index 2354f36cc84..f0a5f485ffa 100644 --- a/mindspore/ccsrc/backend/session/ascend_session.cc +++ b/mindspore/ccsrc/backend/session/ascend_session.cc @@ -194,7 +194,7 @@ void GenOpOutputStubTensor(const KernelGraphPtr &single_op_graph, const CNodePtr size_t LoadCtrlInputTensor(const std::shared_ptr &graph, std::vector *inputs) { MS_EXCEPTION_IF_NULL(graph); - MS_LOG(INFO) << "Load kInputCtrlTensors"; + MS_LOG(DEBUG) << "Load kInputCtrlTensors"; auto inputs_params = graph->input_ctrl_tensors(); if (inputs_params == nullptr) { return 0; @@ -231,7 +231,7 @@ size_t LoadCtrlInputTensor(const std::shared_ptr &graph, std::vecto *epoch_val = graph->current_epoch(); epoch_tensor->set_sync_status(kNeedSyncHostToDevice); inputs->push_back(epoch_tensor); - MS_LOG(INFO) << "Load epoch_val:" << *epoch_val; + MS_LOG(DEBUG) << "Load epoch_val:" << *epoch_val; graph->set_current_epoch(graph->current_epoch() + 1); return inputs_params->size(); } @@ -629,9 +629,7 @@ bool AscendSession::GraphCacheExist(const GraphInfo &graph_info) const { void AscendSession::BuildOpImpl(const OpRunInfo &op_run_info, const GraphInfo &graph_info, const std::vector &input_tensors, const std::vector &tensors_mask) { - MS_LOG(INFO) << "Build op " << op_run_info.op_name << " start !"; if (GraphCacheExist(graph_info)) { - MS_LOG(INFO) << "Build op " << op_run_info.op_name << " graph cache has existed !"; return; } @@ -643,7 +641,6 @@ void AscendSession::BuildOpImpl(const OpRunInfo &op_run_info, const GraphInfo &g RunOpAdjustKernel(graph); BuildKernel(graph); run_op_graphs_[graph_info] = graph; - MS_LOG(INFO) << "Build op " << op_run_info.op_name << " finish !"; } void AscendSession::RunOpImpl(const GraphInfo &graph_info, OpRunInfo *op_run_info, @@ -663,7 +660,6 @@ void AscendSession::RunOpImpl(const GraphInfo &graph_info, OpRunInfo *op_run_inf // Run op auto graph = run_op_graphs_[graph_info]; MS_EXCEPTION_IF_NULL(graph); - MS_LOG(INFO) << "Run op " << op_run_info->op_name << " start!"; // malloc mem RunOpRemoveNopNode(graph); RunOpMemoryAlloc(*input_tensors, graph.get()); @@ -683,7 +679,6 @@ void AscendSession::RunOpImpl(const GraphInfo &graph_info, OpRunInfo *op_run_inf UpdateOutputAbstract(graph, op_run_info); } RunOpMemoryClear(graph.get()); - MS_LOG(INFO) << "Run op " << op_run_info->op_name << " finish!"; } KernelGraphPtr AscendSession::PreBuildOp(const OpRunInfo &op_run_info, @@ -931,7 +926,7 @@ void AscendSession::BuildKernel(const std::vector &kernels) const { } void AscendSession::BuildDynamicKernel(const std::shared_ptr &kernel_graph) const { - MS_LOG(INFO) << "Start!"; + MS_LOG(DEBUG) << "Start!"; MS_EXCEPTION_IF_NULL(kernel_graph); const auto &kernels = kernel_graph->execution_order(); auto iter = std::find_if(kernels.begin(), kernels.end(), [](const CNodePtr &kernel) { @@ -945,7 +940,7 @@ void AscendSession::BuildDynamicKernel(const std::shared_ptr &kerne if (!runtime_instance->GenDynamicKernel(kernel_graph.get())) { MS_LOG(DEBUG) << "Graph:" << kernel_graph->graph_id() << " failed to generate dynamic kernel!"; } - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; } static CNodePtr GetNextLabelSet(const std::vector &kernel_nodes, uint32_t index) { @@ -1089,12 +1084,10 @@ void AscendSession::MemoryAlloc(KernelGraph *kernel_graph) const { void AscendSession::RunOpMemoryAlloc(const std::vector &input_tensors, KernelGraph *kernel_graph) const { - MS_LOG(INFO) << "Start memory alloc!"; MS_EXCEPTION_IF_NULL(kernel_graph); auto runtime_instance = device::KernelRuntimeManager::Instance().GetKernelRuntime(kAscendDevice, device_id_); MS_EXCEPTION_IF_NULL(runtime_instance); runtime_instance->RunOpAssignMemory(input_tensors, kernel_graph); - MS_LOG(INFO) << "Finish!"; } void AscendSession::RunOpGenKernelEvent(const KernelGraph *graph) const { @@ -1127,7 +1120,7 @@ void AscendSession::Load(const std::shared_ptr &kernel_graph) const } void AscendSession::Execute(const std::shared_ptr &kernel_graph, bool is_task) const { - MS_LOG(INFO) << "Start!"; + MS_LOG(DEBUG) << "Start!"; bool is_task_sink = false; if (is_task) { auto context_ptr = MsContext::GetInstance(); @@ -1145,21 +1138,21 @@ void AscendSession::Execute(const std::shared_ptr &kernel_graph, bo #endif MS_LOG(EXCEPTION) << "run task error!"; } - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; } void AscendSession::DumpSetup(const std::shared_ptr &kernel_graph) const { - MS_LOG(INFO) << "Start!"; + MS_LOG(DEBUG) << "Start!"; MS_EXCEPTION_IF_NULL(kernel_graph); E2eDump::DumpSetup(kernel_graph.get(), rank_id_); - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; } void AscendSession::Dump(const std::shared_ptr &kernel_graph) const { - MS_LOG(INFO) << "Start!"; + MS_LOG(DEBUG) << "Start!"; MS_EXCEPTION_IF_NULL(kernel_graph); E2eDump::DumpData(kernel_graph.get(), rank_id_); - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; } void AscendSession::DumpAllGraphs(const std::vector &all_graphs) { diff --git a/mindspore/ccsrc/backend/session/cpu_session.cc b/mindspore/ccsrc/backend/session/cpu_session.cc index c79c9a34200..364bfde07e9 100644 --- a/mindspore/ccsrc/backend/session/cpu_session.cc +++ b/mindspore/ccsrc/backend/session/cpu_session.cc @@ -278,8 +278,6 @@ void CPUSession::RunOpImpl(const GraphInfo &graph_info, OpRunInfo *op_run_info, runtime_.CreateOutputTensors(kernel_graph.get(), *input_tensors, outputs, &tensor_to_node); runtime_.BindInputOutput(kernel_graph.get(), *input_tensors, outputs); - MS_LOG(INFO) << "Run Op start"; - bool ret = runtime_.Run(kernel_graph.get(), false); if (!ret) { MS_LOG(EXCEPTION) << "Run Op failed"; @@ -291,7 +289,6 @@ void CPUSession::RunOpImpl(const GraphInfo &graph_info, OpRunInfo *op_run_info, } SetOutputFlags(*outputs); runtime_.RunOpClearMemory(kernel_graph.get()); - MS_LOG(INFO) << "Run Op end"; } void CPUSession::SetKernelInfo(const KernelGraph *kernel_graph) { diff --git a/mindspore/ccsrc/backend/session/session_basic.cc b/mindspore/ccsrc/backend/session/session_basic.cc index 309660afa7e..1735ca6ebb7 100644 --- a/mindspore/ccsrc/backend/session/session_basic.cc +++ b/mindspore/ccsrc/backend/session/session_basic.cc @@ -185,7 +185,6 @@ BaseRef CreateNodeOutputTensor(const session::KernelWithIndex &node_output_pair, int output_index = SizeToInt(node_output_pair.second); MS_EXCEPTION_IF_NULL(node); MS_EXCEPTION_IF_NULL(graph); - MS_LOG(INFO) << "Create tensor for output[" << node->DebugString() << "] index[" << output_index << "]"; auto tensor_from_input = GetNodeOutputTensorFromInputs(node_output_pair, graph, input_tensors); if (tensor_from_input != nullptr) { return tensor_from_input; @@ -1220,7 +1219,6 @@ void SessionBasic::CreateOutputPlaceholder( size_t index = 0; for (auto &item : anf_outputs) { MS_EXCEPTION_IF_NULL(item); - MS_LOG(INFO) << "Create node output placeholder[" << item->DebugString() << "]"; std::vector indexes{index++}; outputs->emplace_back(CreateNodeOutputPlaceholder(item, kernel_graph, input_tensors, indexes, output_indexes)); } diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc index 670e2620f80..3fb4097bd71 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_device_address.cc @@ -277,12 +277,12 @@ nlohmann::json ConstructTransDataKernelJson(const std::vector &host_shap } void AscendDeviceAddress::SyncStream() const { - MS_LOG(INFO) << "Start!"; + MS_LOG(DEBUG) << "Start!"; auto ms_context = MsContext::GetInstance(); MS_EXCEPTION_IF_NULL(ms_context); if (ms_context->get_param(MS_CTX_EXECUTION_MODE) != kPynativeMode && !ms_context->get_param(MS_CTX_ENABLE_PYNATIVE_INFER)) { - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; return; } auto device_id = ms_context->get_param(MS_CTX_DEVICE_ID); @@ -292,7 +292,7 @@ void AscendDeviceAddress::SyncStream() const { if (!ret) { MS_LOG(EXCEPTION) << "Sync stream error!"; } - MS_LOG(INFO) << "Finish!"; + MS_LOG(DEBUG) << "Finish!"; } bool AscendDeviceAddress::SyncDeviceToHost(size_t size, void *host_ptr) const { diff --git a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc index 8e6c3a26a29..870dcfdd2e8 100644 --- a/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/ascend/ascend_kernel_runtime.cc @@ -588,28 +588,30 @@ bool AscendKernelRuntime::Run(session::KernelGraph *const graph, bool is_task_si SignalGuard sg; MS_EXCEPTION_IF_NULL(graph); bool ret = false; -#if defined(_WIN32) || defined(_WIN64) - auto start_time = std::chrono::steady_clock::now(); -#else - struct timeval start_time {}; - struct timeval end_time {}; - (void)gettimeofday(&start_time, nullptr); -#endif + if (is_task_sink) { +#if defined(_WIN32) || defined(_WIN64) + auto start_time = std::chrono::steady_clock::now(); +#else + struct timeval start_time {}; + struct timeval end_time {}; + (void)gettimeofday(&start_time, nullptr); +#endif ret = RunTask(graph); +#if defined(_WIN32) || defined(_WIN64) + auto end_time = std::chrono::steady_clock::now(); + std::chrono::duration> cost = end_time - start_time; + MS_LOG(INFO) << "Call MS Run Success in " << cost.count() << " us"; +#else + (void)gettimeofday(&end_time, nullptr); + uint64_t cost = kUSecondInSecond * static_cast(end_time.tv_sec - start_time.tv_sec); + cost += static_cast(end_time.tv_usec - start_time.tv_usec); + MS_LOG(INFO) << "Call MS Run Success in " << cost << " us"; +#endif } else { ret = LaunchKernel(graph); } -#if defined(_WIN32) || defined(_WIN64) - auto end_time = std::chrono::steady_clock::now(); - std::chrono::duration> cost = end_time - start_time; - MS_LOG(INFO) << "Call MS Run Success in " << cost.count() << " us"; -#else - (void)gettimeofday(&end_time, nullptr); - uint64_t cost = kUSecondInSecond * static_cast(end_time.tv_sec - start_time.tv_sec); - cost += static_cast(end_time.tv_usec - start_time.tv_usec); - MS_LOG(INFO) << "Call MS Run Success in " << cost << " us"; -#endif + return ret; } diff --git a/mindspore/ccsrc/runtime/device/ascend/signal_util.cc b/mindspore/ccsrc/runtime/device/ascend/signal_util.cc index 0bee199e683..23c002ad477 100644 --- a/mindspore/ccsrc/runtime/device/ascend/signal_util.cc +++ b/mindspore/ccsrc/runtime/device/ascend/signal_util.cc @@ -36,7 +36,7 @@ void SignalGuard::RegisterHandlers() { struct sigaction old_int_action; (void)sigaction(SIGINT, nullptr, &old_int_action); if (old_int_action.sa_sigaction != nullptr) { - MS_LOG(INFO) << "The signal has been registered"; + MS_LOG(DEBUG) << "The signal has been registered"; old_handler = old_int_action.sa_sigaction; } int_action.sa_sigaction = &IntHandler; diff --git a/mindspore/ccsrc/runtime/device/kernel_runtime.cc b/mindspore/ccsrc/runtime/device/kernel_runtime.cc index 700f71a260e..0d9db601c44 100644 --- a/mindspore/ccsrc/runtime/device/kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/kernel_runtime.cc @@ -413,7 +413,7 @@ void KernelRuntime::UpdateRefNodeOutputMem(const session::KernelGraph *graph) { auto output_sizes = kernel_mod->GetOutputSizeList(); if (output_sizes.empty()) { - MS_LOG(INFO) << "This kernel has no output size."; + MS_LOG(DEBUG) << "This kernel has no output size."; continue; } for (size_t i = 0; i < output_sizes.size(); ++i) { @@ -921,7 +921,7 @@ void KernelRuntime::GenAddrCleanLaunchArgs(const CNodePtr &cnode, AddressPtrList input->size = device_address->size_; kernel_inputs->emplace_back(input); } - MS_LOG(INFO) << "AtomicAddClean clean output size:" << clean_output_indexes.size(); + MS_LOG(DEBUG) << "AtomicAddClean clean output size:" << clean_output_indexes.size(); } // set clean workspace address if (AnfAlgo::HasNodeAttr(kAttrAtomicWorkspaceIndexs, pre_node)) {