Skip to content

Commit e0895e4

Browse files
committed
remove some seems unused codes.
1 parent ea408d5 commit e0895e4

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

paddle/fluid/operators/detail/request_handler.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class RequestHandler {
8080
}
8181
framework::ProgramDesc* program() { return program_; }
8282
framework::Executor* executor() { return executor_; }
83-
std::vector<framework::Variable*>& sparse_vars() { return sparse_vars_; }
8483

8584
// This function processes user's rpc request.
8685
// The implemention is in request_handler_impl.
@@ -113,13 +112,7 @@ class RequestHandler {
113112
std::unordered_map<std::string,
114113
std::shared_ptr<framework::ExecutorPrepareContext>>*
115114
grad_to_prepared_ctx_;
116-
117-
// Record received sparse variables, so that
118-
// we could reset those after execute optimize program
119-
std::vector<framework::Variable*> sparse_vars_;
120115
RPCServer* rpc_server_;
121-
122-
std::mutex sparse_var_mutex_;
123116
};
124117

125118
} // namespace detail

paddle/fluid/operators/detail/request_handler_impl.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ bool RequestSendHandler::Handle(const std::string& varname,
6363
PADDLE_THROW("sync: Can not find server side var");
6464
return false;
6565
}
66-
67-
if (invar->IsType<framework::SelectedRows>()) {
68-
std::unique_lock<std::mutex> lock(sparse_var_mutex_);
69-
sparse_vars_.push_back(invar);
70-
}
7166
}
7267

7368
return true;

paddle/fluid/operators/listen_and_serv_op.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor,
108108
std::shared_ptr<framework::ExecutorPrepareContext>(nullptr));
109109

110110
rpc_service_->ResetBarrierCounter();
111-
// Record received sparse variables, so that
112-
// we could reset those after execute optimize program
113-
std::vector<framework::Variable *> sparse_vars;
114111
while (true) {
115112
// Get from multiple trainers, we don't care about the order in which
116113
// the gradients arrives, just add suffix 0~n and merge the gradient.
@@ -146,15 +143,6 @@ void ListenAndServOp::RunSyncLoop(framework::Executor *executor,
146143
recv_scope);
147144
VLOG(2) << "run all blocks spent " << detail::GetTimestamp() - ts << "(ms)";
148145

149-
// Reset the received sparse variables, the sum operator would not
150-
// sum the input sparse variables which rows is empty at the next
151-
// mini-batch.
152-
// TODO(Yancey1989): move the reset action into an operator, we couldn't
153-
// have any hide logic in the operator.
154-
for (framework::Variable *var : sparse_vars) {
155-
var->GetMutable<framework::SelectedRows>()->mutable_rows()->clear();
156-
}
157-
158146
rpc_service_->SetCond(detail::kRequestGet);
159147
rpc_service_->WaitBarrier(detail::kRequestGet);
160148
rpc_service_->ResetBarrierCounter();

0 commit comments

Comments
 (0)