Skip to content

Commit

Permalink
Merge pull request #34 from chao9527/chao9527/PaddleBox
Browse files Browse the repository at this point in the history
optimize for async
  • Loading branch information
qingshui authored Apr 1, 2022
2 parents 08d66d9 + 1588bcd commit 3860903
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 124 deletions.
8 changes: 5 additions & 3 deletions paddle/fluid/framework/boxps_trainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,20 @@ void BoxPSTrainer::InitTrainerEnv(const ProgramDesc& main_program,
}
}

std::set<std::string> async_param_name;
if (async_mode_) {
dense_table_->Init(*root_scope_, *param_need_sync_.get(),
async_param_name = dense_table_->Init(*root_scope_, *param_need_sync_.get(),
persistable_vars_);
}
for (int i = 0; i < thread_num_; ++i) {
auto this_worker =
std::dynamic_pointer_cast<paddle::framework::BoxPSWorker>(workers_[i]);
this_worker->SetRootScope(root_scope_);
this_worker->CreateDeviceResource(main_program);
if (async_mode_) {
this_worker->SetDenseTable(dense_table_.get());
this_worker->SetDenseTable(dense_table_.get());
this_worker->SetAsyncParamName(async_param_name);
}
this_worker->CreateDeviceResource(main_program);
// CopyParameters(*root_scope_, i);
}
}
Expand Down
Loading

0 comments on commit 3860903

Please sign in to comment.