diff --git a/paddle/fluid/framework/device_worker.h b/paddle/fluid/framework/device_worker.h index f663fa89f99f8984832df652fb0139a1d16228a9..c9997b5ee3b1f27fca380c53db27ab6576305271 100644 --- a/paddle/fluid/framework/device_worker.h +++ b/paddle/fluid/framework/device_worker.h @@ -66,11 +66,11 @@ class PullDenseWorker { Scope* root_scope_; bool running_; - std::map last_versions_; - std::map current_version_; - std::mutex mutex_for_version_; - std::map> training_versions_; - std::map> dense_value_names_; + static std::map last_versions_; + static std::map current_version_; + static std::mutex mutex_for_version_; + static std::map> training_versions_; + static std::map> dense_value_names_; std::thread t_; int thread_num_; diff --git a/paddle/fluid/framework/downpour_worker.cc b/paddle/fluid/framework/downpour_worker.cc index 62126072c81ba4497a65e0ea02c2526fd76abbcb..238bf03815343d7935c3c35237d3a40c2fee8560 100644 --- a/paddle/fluid/framework/downpour_worker.cc +++ b/paddle/fluid/framework/downpour_worker.cc @@ -213,12 +213,10 @@ void DownpourWorker::TrainFiles() { push_sparse_status_.resize(0); } - /* for (size_t i = 0; i < param_.dense_table_size(); ++i) { uint64_t tid = static_cast(param_.dense_table(i).table_id()); pull_dense_worker_->IncreaseThreadVersion(thread_id_, tid); } - */ thread_scope_->DropKids(); ++batch_cnt; diff --git a/paddle/fluid/framework/pull_dense_worker.cc b/paddle/fluid/framework/pull_dense_worker.cc index 556424311a2034fce0aeffecd7e805d238318012..5108621985060f2d5882ff590f28460acc33d089 100644 --- a/paddle/fluid/framework/pull_dense_worker.cc +++ b/paddle/fluid/framework/pull_dense_worker.cc @@ -18,6 +18,12 @@ namespace paddle { namespace framework { std::shared_ptr PullDenseWorker::s_instance_ = NULL; +std::mutex PullDenseWorker::mutex_for_version_; +std::map PullDenseWorker::last_versions_; +std::map PullDenseWorker::current_version_; +std::map> PullDenseWorker::training_versions_; +std::map> + PullDenseWorker::dense_value_names_; void PullDenseWorker::Initialize(const TrainerDesc& param) { running_ = false;