@@ -48,6 +48,13 @@ static void ParallelExecuteBlocks(
48
48
for (size_t i = 0 ; i < fs.size (); ++i) fs[i].wait ();
49
49
}
50
50
51
+ static void SavePort (std::shared_ptr<detail::AsyncGRPCServer> rpc_service) {
52
+ std::ofstream port_file;
53
+ port_file.open (" /tmp/paddle.selected_port" );
54
+ port_file << rpc_service->GetSelectedPort ();
55
+ port_file.close ();
56
+ }
57
+
51
58
ListenAndServOp::ListenAndServOp (const std::string &type,
52
59
const framework::VariableNameMap &inputs,
53
60
const framework::VariableNameMap &outputs,
@@ -66,9 +73,8 @@ void ListenAndServOp::Stop() {
66
73
void ListenAndServOp::PreparePrefetchCtx (
67
74
framework::Executor *executor, framework::BlockDesc *prefetch_block,
68
75
framework::ProgramDesc *program) const {
69
- // TODO(qiao) set proper fields for table lookup and update
70
- rpc_service_->SetExecutor (executor);
71
76
VLOG (3 ) << " prefetch block id is " << prefetch_block->ID ();
77
+ rpc_service_->SetExecutor (executor);
72
78
auto prefetch_prepared = executor->Prepare (*program, prefetch_block->ID ());
73
79
rpc_service_->SetPrefetchBlkdId (prefetch_block->ID ());
74
80
rpc_service_->SetPrefetchPreparedCtx (prefetch_prepared.get ());
@@ -134,7 +140,7 @@ void ListenAndServOp::RunSyncUpdate(
134
140
break ;
135
141
}
136
142
137
- // NOTE: if is_gpu_place, CUDA kernels are launch by multiple threads
143
+ // NOTE: if is_gpu_place, CUDA kernels are launched by multiple threads
138
144
// and this will still work.
139
145
140
146
// The optimize blocks which have the same parent ID would run parallel
@@ -173,13 +179,6 @@ void ListenAndServOp::RunSyncUpdate(
173
179
} // while(true)
174
180
}
175
181
176
- static void SavePort (std::shared_ptr<detail::AsyncGRPCServer> rpc_service) {
177
- std::ofstream port_file;
178
- port_file.open (" /tmp/paddle.selected_port" );
179
- port_file << rpc_service->GetSelectedPort ();
180
- port_file.close ();
181
- }
182
-
183
182
void ListenAndServOp::RunImpl (const framework::Scope &scope,
184
183
const platform::Place &dev_place) const {
185
184
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance ();
0 commit comments