diff --git a/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc b/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc index 0c094917f6f33eef767bd7073fb2fe97a8e074d3..49e675a473042bd57b7688a2847bc7e0f4b7fc53 100644 --- a/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc +++ b/paddle/fluid/framework/new_executor/interpreter/dependency_builder.cc @@ -70,15 +70,15 @@ const std::map>& DependencyBuilder::Build( BuildOpHappensBefore(); ShrinkDownstreamMap(); + if (is_sequential_run) { + AddDependencyForSequentialRun(); + } + AddDependencyForCoalesceTensorOp(); AddDependencyForCommunicationOp(); AddDependencyForRandomOp(); AddDependencyForReadOp(); - if (is_sequential_run) { - AddDependencyForSequentialRun(); - } - is_build_ = true; VLOG(8) << "Finish build dependency"; @@ -335,6 +335,10 @@ void DependencyBuilder::AddDownstreamOp(int prior_op_idx, if (op_happens_before_.size() != 0) { for (size_t op_idx = 0; op_idx < op_num_; ++op_idx) { + if (op_happens_before_[op_idx][prior_op_idx]) { + op_happens_before_[op_idx][posterior_op_idx] = true; + } + if (op_happens_before_[posterior_op_idx][op_idx]) { op_happens_before_[prior_op_idx][op_idx] = true; } @@ -461,10 +465,6 @@ void DependencyBuilder::BuildDownstreamMap() { AddDownstreamOp(dep_op, op); } } - - VLOG(6) << "downstream count: " << CountDownstreamMap(op_downstream_map_); - VLOG(6) << "downstream_map: " << std::endl - << StringizeDownstreamMap(op_downstream_map_); } void DependencyBuilder::BuildOpHappensBefore() { @@ -542,8 +542,9 @@ void DependencyBuilder::ShrinkDownstreamMap() { } op_downstream_map_.at(i) = minumum_nexts; } - VLOG(6) << "downstream count: " << CountDownstreamMap(op_downstream_map_); - VLOG(6) << "downstream_map: " << std::endl + VLOG(8) << "Finish shrink downstream map"; + VLOG(8) << "downstream count: " << CountDownstreamMap(op_downstream_map_); + VLOG(8) << "downstream_map: " << std::endl << StringizeDownstreamMap(op_downstream_map_); } diff --git a/paddle/fluid/framework/new_executor/interpretercore_util.cc b/paddle/fluid/framework/new_executor/interpretercore_util.cc index 934d29591d3efa108b7c695ef09e6f1d60b4c3d6..e5bd3c97b1f53b7b3846ab4bac166d91d20c61a4 100644 --- a/paddle/fluid/framework/new_executor/interpretercore_util.cc +++ b/paddle/fluid/framework/new_executor/interpretercore_util.cc @@ -268,7 +268,7 @@ void create_all_ops(const framework::BlockDesc& block, std::vector>* ops) { for (auto& op : block.AllOps()) { auto op_type = op->Type(); - VLOG(1) << "CreateOp from : " << op_type; + VLOG(8) << "CreateOp from : " << op_type; auto& info = OpInfoMap::Instance().Get(op_type);