提交 c9b79989 编写于 作者: D dongdaxiang

fix tag in async_executor

上级 95b887c4
...@@ -103,16 +103,16 @@ void AsyncExecutor::GatherServers( ...@@ -103,16 +103,16 @@ void AsyncExecutor::GatherServers(
void AsyncExecutor::InitParamConfig() { void AsyncExecutor::InitParamConfig() {
for (int i = 0; i < for (int i = 0; i <
_pslib_ptr->get_param()->server_param().\ _pslib_ptr->get_param()->server_param(). \
downpour_server_param().\ downpour_server_param(). \
downpour_table_param_size(); downpour_table_param_size();
++i) { ++i) {
if (_pslib_ptr->get_param()->server_param().\ if (_pslib_ptr->get_param()->server_param(). \
downpour_server_param().downpour_table_param(i).\ downpour_server_param().downpour_table_param(i). \
table_class().find("SparseTable") != -1) { table_class().find("SparseTable") != -1) {
_param_config.fea_dim = _pslib_ptr->get_param()->server_param().\ _param_config.fea_dim = _pslib_ptr->get_param()->server_param(). \
downpour_server_param().\ downpour_server_param(). \
downpour_table_param(i).\ downpour_table_param(i). \
accessor().fea_dim(); accessor().fea_dim();
break; break;
} }
......
...@@ -45,7 +45,8 @@ inline std::default_random_engine& local_random_engine() { ...@@ -45,7 +45,8 @@ inline std::default_random_engine& local_random_engine() {
engine_wrapper_t() { engine_wrapper_t() {
static std::atomic<uint64_t> x(0); static std::atomic<uint64_t> x(0);
std::seed_seq sseq = {x++, x++, x++, std::seed_seq sseq = {x++, x++, x++,
static_cast<uint64_t>(current_realtime() * 1000)}; static_cast<uint64_t>(
current_realtime() * 1000)};
engine.seed(sseq); engine.seed(sseq);
} }
}; };
...@@ -77,6 +78,7 @@ class AsyncExecutor { ...@@ -77,6 +78,7 @@ class AsyncExecutor {
void SaveModel(const std::string& path); void SaveModel(const std::string& path);
void InitParamConfig(); void InitParamConfig();
#endif #endif
private: private:
void CreateThreads(ExecutorThreadWorker* worker, void CreateThreads(ExecutorThreadWorker* worker,
const ProgramDesc& main_program, const ProgramDesc& main_program,
...@@ -87,6 +89,7 @@ class AsyncExecutor { ...@@ -87,6 +89,7 @@ class AsyncExecutor {
#ifdef PADDLE_WITH_PSLIB #ifdef PADDLE_WITH_PSLIB
void PrepareDenseThread(const std::string& mode); void PrepareDenseThread(const std::string& mode);
#endif #endif
public: public:
#ifdef PADDLE_WITH_PSLIB #ifdef PADDLE_WITH_PSLIB
std::shared_ptr<paddle::distributed::PSlib> _pslib_ptr; std::shared_ptr<paddle::distributed::PSlib> _pslib_ptr;
......
...@@ -440,7 +440,6 @@ void AsyncExecutorThreadWorker::PushDense(int table_id) { ...@@ -440,7 +440,6 @@ void AsyncExecutorThreadWorker::PushDense(int table_id) {
auto status = _pslib_ptr->_worker_ptr->push_dense( auto status = _pslib_ptr->_worker_ptr->push_dense(
regions.data(), regions.size(), table_id); regions.data(), regions.size(), table_id);
_push_dense_status.push_back(std::move(status)); _push_dense_status.push_back(std::move(status));
} }
void AsyncExecutorThreadWorker::PullSparse(int table_id) { void AsyncExecutorThreadWorker::PullSparse(int table_id) {
......
...@@ -136,7 +136,7 @@ class DensePullThread { ...@@ -136,7 +136,7 @@ class DensePullThread {
class ExecutorThreadWorker { class ExecutorThreadWorker {
public: public:
ExecutorThreadWorker() ExecutorThreadWorker()
: thread_id_(-1), root_scope_(NULL), thread_scope_(NULL), debug_(false) {} : thread_id_(-1), root_scope_(NULL), thread_scope_(NULL), debug_(false) {}
virtual ~ExecutorThreadWorker() {} virtual ~ExecutorThreadWorker() {}
...@@ -160,7 +160,7 @@ class ExecutorThreadWorker { ...@@ -160,7 +160,7 @@ class ExecutorThreadWorker {
void SetFetchVarNames(const std::vector<std::string>& fetch_var_names); void SetFetchVarNames(const std::vector<std::string>& fetch_var_names);
#ifdef PADDLE_WITH_PSLIB #ifdef PADDLE_WITH_PSLIB
virtual void SetPSlibPtr( virtual void SetPSlibPtr(
std::shared_ptr<paddle::distributed::PSlib> pslib_ptr) {}; std::shared_ptr<paddle::distributed::PSlib> pslib_ptr) {}
virtual void SetPullDenseThread( virtual void SetPullDenseThread(
std::shared_ptr<DensePullThread> dpt) {} std::shared_ptr<DensePullThread> dpt) {}
virtual void SetParamConfig( virtual void SetParamConfig(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册