From be738a646e2f760a53c36a658c7d07c4f75cd814 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Sun, 27 Jan 2019 21:56:25 +0800 Subject: [PATCH] add some debug infor --- .../details/async_ssa_graph_executor.cc | 17 ++++++++++------- .../details/multi_devices_graph_pass.cc | 2 ++ paddle/fluid/framework/scope.cc | 12 +++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/paddle/fluid/framework/details/async_ssa_graph_executor.cc b/paddle/fluid/framework/details/async_ssa_graph_executor.cc index 7dc269242f..c259ff4f74 100644 --- a/paddle/fluid/framework/details/async_ssa_graph_executor.cc +++ b/paddle/fluid/framework/details/async_ssa_graph_executor.cc @@ -68,18 +68,21 @@ FeedFetchList AsyncSSAGraphExecutor::Run( if (pool_) { run_futures.emplace_back(pool_->enqueue(std::move(call))); - for (auto &f : run_futures) { - if (exception_holder_.IsCaught()) { - f.wait(); - } else { - fetch_data.emplace_back(std::move(f.get())); - } - } } else { fetch_data.emplace_back(std::move(call())); } } + if (pool_) { + for (auto &f : run_futures) { + if (exception_holder_.IsCaught()) { + f.wait(); + } else { + fetch_data.emplace_back(std::move(f.get())); + } + } + } + if (exception_holder_.IsCaught()) { exception_holder_.ReThrow(); } diff --git a/paddle/fluid/framework/details/multi_devices_graph_pass.cc b/paddle/fluid/framework/details/multi_devices_graph_pass.cc index d7a4b5692b..f1347e2b0d 100644 --- a/paddle/fluid/framework/details/multi_devices_graph_pass.cc +++ b/paddle/fluid/framework/details/multi_devices_graph_pass.cc @@ -249,6 +249,8 @@ void MultiDevSSAGraphBuilderBase::InsertScaleLossGradOp( break; } + VLOG(3) << "loss_scale: " << loss_scale; + if (loss_scale) { // TODO(paddle-dev): Why is there no input for this op_handle? auto loss_grad_name = node->Op()->OutputArgumentNames()[0]; diff --git a/paddle/fluid/framework/scope.cc b/paddle/fluid/framework/scope.cc index 884ad3b34b..2c76ab22f6 100644 --- a/paddle/fluid/framework/scope.cc +++ b/paddle/fluid/framework/scope.cc @@ -271,16 +271,14 @@ std::string GenParentScopeTreeDebugInfo(Scope* leaf) { while (current_scope != nullptr) { scopes.push_back(current_scope); current_scope = current_scope->parent(); - // end of a level - os << "\n------------------------------------------\n"; } - os << "\nDetails:\n\n"; + os << "\n--------------GenParentScopeTreeDebugInfo--------------\n"; - for (auto* q : scopes) { - os << "====\n"; - os << q << ":\n"; - for (auto& var : q->LocalVarNames()) { + for (int i = scopes.size() - 1; i >= 0; --i) { + os << "=======level [" << i << "]=======\n"; + os << scopes[i] << ":\n"; + for (auto& var : scopes[i]->LocalVarNames()) { os << " - " << var << "\n"; } } -- GitLab