提交 f816e116 编写于 作者: Y Yang Yang

clean up

上级 e443d034
...@@ -174,7 +174,6 @@ class ParallelDoOp : public framework::OperatorBase { ...@@ -174,7 +174,6 @@ class ParallelDoOp : public framework::OperatorBase {
lod_tensor_to_be_merged->MergeLoDTensor(lod_tensors, dev_ctx.GetPlace()); lod_tensor_to_be_merged->MergeLoDTensor(lod_tensors, dev_ctx.GetPlace());
} }
WaitOnPlaces(places); WaitOnPlaces(places);
LOG(INFO) << "End of ParallelGradDo";
} }
}; };
...@@ -237,7 +236,6 @@ class ParallelDoGradOp : public framework::OperatorBase { ...@@ -237,7 +236,6 @@ class ParallelDoGradOp : public framework::OperatorBase {
WaitOnPlaces(places); WaitOnPlaces(places);
AccumulateGrad(scope, place, sub_scopes, places); AccumulateGrad(scope, place, sub_scopes, places);
LOG(INFO) << "End of ParallelDoGrad";
} }
void AccumulateGrad(const framework::Scope &scope, void AccumulateGrad(const framework::Scope &scope,
...@@ -248,15 +246,12 @@ class ParallelDoGradOp : public framework::OperatorBase { ...@@ -248,15 +246,12 @@ class ParallelDoGradOp : public framework::OperatorBase {
std::__cxx11::string tmp_name; std::__cxx11::string tmp_name;
auto *tmp = sub_scopes[0]->Var(&tmp_name); auto *tmp = sub_scopes[0]->Var(&tmp_name);
LOG(INFO) << "---" << s;
for (size_t i = 1; i < sub_scopes.size(); ++i) { for (size_t i = 1; i < sub_scopes.size(); ++i) {
if (!(places[i] == places[0])) { if (!(places[i] == places[0])) {
LOG(INFO) << "---";
CopyOrShare(*sub_scopes[i]->FindVar(s), places[0], tmp); CopyOrShare(*sub_scopes[i]->FindVar(s), places[0], tmp);
WaitOnPlace(places[0]); WaitOnPlace(places[0]);
} }
LOG(INFO) << "---";
auto sum_op = framework::OpRegistry::CreateOp( auto sum_op = framework::OpRegistry::CreateOp(
"sum", {{"X", {s, tmp_name}}}, {{"Out", {s}}}, "sum", {{"X", {s, tmp_name}}}, {{"Out", {s}}},
framework::AttributeMap{}); framework::AttributeMap{});
...@@ -264,7 +259,6 @@ class ParallelDoGradOp : public framework::OperatorBase { ...@@ -264,7 +259,6 @@ class ParallelDoGradOp : public framework::OperatorBase {
WaitOnPlace(places[0]); WaitOnPlace(places[0]);
} }
LOG(INFO) << "---";
CopyOrShare(*sub_scopes[0]->FindVar(s), place, scope.FindVar(s)); CopyOrShare(*sub_scopes[0]->FindVar(s), place, scope.FindVar(s));
} }
WaitOnPlaces(places); WaitOnPlaces(places);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册