From 5aba10b5851d8a777a37c2f6fc95912f3f59cdf2 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Mon, 11 Jun 2018 18:52:35 +0800 Subject: [PATCH] set the thread pool of prefetch to 1 to fix a bug --- paddle/fluid/operators/detail/grpc_server.cc | 1 - paddle/fluid/operators/listen_and_serv_op.cc | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/detail/grpc_server.cc b/paddle/fluid/operators/detail/grpc_server.cc index 82d422d110e..487abffefe6 100644 --- a/paddle/fluid/operators/detail/grpc_server.cc +++ b/paddle/fluid/operators/detail/grpc_server.cc @@ -158,7 +158,6 @@ class RequestPrefetch final : public RequestBase { std::string in_var_name = request_->Varname(); std::string out_var_name = request_->OutVarname(); VLOG(3) << "in_var_name: " << in_var_name - << "out_var_name: " << out_var_name << " RequestPrefetch: " << out_var_name; auto scope = request_->GetMutableLocalScope(); diff --git a/paddle/fluid/operators/listen_and_serv_op.cc b/paddle/fluid/operators/listen_and_serv_op.cc index 4d35caff2c7..5cd95f8efe9 100644 --- a/paddle/fluid/operators/listen_and_serv_op.cc +++ b/paddle/fluid/operators/listen_and_serv_op.cc @@ -247,7 +247,7 @@ void ListenAndServOp::RunImpl(const framework::Scope &scope, rpc_service_->RegisterRPC(detail::kRequestSend, request_send_handler_.get()); rpc_service_->RegisterRPC(detail::kRequestGet, request_get_handler_.get()); rpc_service_->RegisterRPC(detail::kRequestPrefetch, - request_prefetch_handler_.get()); + request_prefetch_handler_.get(), 1); auto *optimize_block = Attr(kOptimizeBlock); auto *program = optimize_block->Program(); @@ -263,7 +263,8 @@ void ListenAndServOp::RunImpl(const framework::Scope &scope, prefetch_var_name_to_block_id_str) { std::vector pieces; split(prefetch_var_name_and_id, ':', &pieces); - VLOG(3) << "after split, grad = " << pieces[0] << ", id=" << pieces[1]; + VLOG(3) << "after split, prefetch_var = " << pieces[0] + << ", id=" << pieces[1]; PADDLE_ENFORCE_EQ(pieces.size(), 2); int block_id = std::stoi(pieces[1]); -- GitLab