diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 3997294f172be5ecdf25876866365f01c31c9e42..f0bc3acccc22e6b74ac87ff98357cfe157c675c8 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -365,6 +365,7 @@ ParallelExecutor::ParallelExecutor( void ParallelExecutor::BCastParamsToDevices( const std::unordered_set &vars) const { + VLOG(3) << "BCastParamsToDevices"; // the initializing bcast, all vars would be bcast from device(0). for (auto &var : vars) { framework::Variable *main_var = member_->local_scopes_[0]->FindVar(var); diff --git a/paddle/fluid/framework/scope.cc b/paddle/fluid/framework/scope.cc index 953618560913229cd1e47659ad61e621efc10ed1..884ad3b34b363dacdcc373e3011e3b9191c8b80c 100644 --- a/paddle/fluid/framework/scope.cc +++ b/paddle/fluid/framework/scope.cc @@ -259,5 +259,34 @@ std::string GenScopeTreeDebugInfo(Scope* root) { return os.str(); } +std::string GenParentScopeTreeDebugInfo(Scope* leaf) { + std::stringstream os; + + if (!leaf) return ""; + + // level traversal + std::vector scopes; + const Scope* current_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"; + + for (auto* q : scopes) { + os << "====\n"; + os << q << ":\n"; + for (auto& var : q->LocalVarNames()) { + os << " - " << var << "\n"; + } + } + + return os.str(); +} + } // namespace framework } // namespace paddle diff --git a/paddle/fluid/framework/scope.h b/paddle/fluid/framework/scope.h index f0915d2eee072b0bcd53f37dad5ef9d801c87172..eb5c12def6a2f9e19d08f8aeaf5489f84d86ec94 100644 --- a/paddle/fluid/framework/scope.h +++ b/paddle/fluid/framework/scope.h @@ -144,6 +144,7 @@ class Scope { // Generate some debug string about the inherience structure of scope, quite // naive. std::string GenScopeTreeDebugInfo(Scope*); +std::string GenParentScopeTreeDebugInfo(Scope*); } // namespace framework } // namespace paddle