Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
33ee5cad
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
33ee5cad
编写于
12月 13, 2018
作者:
D
dongdaxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format code style of executor_thread_worker.cc
上级
06930531
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
38 addition
and
39 deletion
+38
-39
paddle/fluid/framework/executor_thread_worker.cc
paddle/fluid/framework/executor_thread_worker.cc
+38
-39
未找到文件。
paddle/fluid/framework/executor_thread_worker.cc
浏览文件 @
33ee5cad
...
@@ -417,18 +417,20 @@ void AsyncExecutorThreadWorker::PrepareParams() {
...
@@ -417,18 +417,20 @@ void AsyncExecutorThreadWorker::PrepareParams() {
}
}
void
AsyncExecutorThreadWorker
::
UpdateParams
()
{
void
AsyncExecutorThreadWorker
::
UpdateParams
()
{
for
(
auto
i
:
_param_config
->
sparse_table_id
)
{
//TODO
for
(
auto
i
:
_param_config
->
sparse_table_id
)
{
//for (int i = 0; i < 1; ++i) {
PushSparse
(
i
);
PushSparse
(
i
);
}
}
//for (auto i = 0u; i < GlobalConfig::instance().dense_table_id.size(); ++i) {//TODO
for
(
auto
i
:
_param_config
->
dense_table_id
)
{
for
(
auto
i
:
_param_config
->
dense_table_id
)
{
PushDense
(
i
);
PushDense
(
i
);
}
}
int32_t
tmp_push_dense_wait_times
=
-
1
;
//_param_config->tmp_push_dense_wait_times; //TODO
// _param_config->tmp_push_dense_wait_times
int32_t
tmp_push_sparse_wait_times
=
-
1
;
//_param_config->tmp_push_sparse_wait_times; //TODO
int32_t
tmp_push_dense_wait_times
=
-
1
;
static
uint32_t
push_dense_wait_times
=
static_cast
<
uint32_t
>
(
tmp_push_dense_wait_times
);
// _param_config->tmp_push_sparse_wait_times
static
uint32_t
push_sparse_wait_times
=
static_cast
<
uint32_t
>
(
tmp_push_sparse_wait_times
);
int32_t
tmp_push_sparse_wait_times
=
-
1
;
static
uint32_t
push_dense_wait_times
=
static_cast
<
uint32_t
>
(
tmp_push_dense_wait_times
);
static
uint32_t
push_sparse_wait_times
=
static_cast
<
uint32_t
>
(
tmp_push_sparse_wait_times
);
if
(
_push_dense_status
.
size
()
>=
push_dense_wait_times
)
{
if
(
_push_dense_status
.
size
()
>=
push_dense_wait_times
)
{
for
(
auto
&
t
:
_push_dense_status
)
{
for
(
auto
&
t
:
_push_dense_status
)
{
...
@@ -448,17 +450,13 @@ void AsyncExecutorThreadWorker::UpdateParams() {
...
@@ -448,17 +450,13 @@ void AsyncExecutorThreadWorker::UpdateParams() {
if
(
tmp_push_sparse_wait_times
==
-
1
)
{
if
(
tmp_push_sparse_wait_times
==
-
1
)
{
_push_sparse_status
.
resize
(
0
);
_push_sparse_status
.
resize
(
0
);
}
}
//for (auto dense_table_id : GlobalConfig::instance().dense_table_id) {//TODO
for
(
auto
dense_table_id
:
_param_config
->
dense_table_id
)
{
for
(
auto
dense_table_id
:
_param_config
->
dense_table_id
)
{
_pull_dense_thread
->
increase_thread_version
(
thread_id_
,
dense_table_id
);
_pull_dense_thread
->
increase_thread_version
(
thread_id_
,
dense_table_id
);
}
}
//}
}
}
void
AsyncExecutorThreadWorker
::
PushDense
(
int
table_id
)
{
void
AsyncExecutorThreadWorker
::
PushDense
(
int
table_id
)
{
std
::
vector
<
paddle
::
ps
::
Region
>
regions
;
std
::
vector
<
paddle
::
ps
::
Region
>
regions
;
//auto& variables = GlobalConfig::instance().dense_gradient_variable_name[table_id];
//std::vector<std::string> variables;
for
(
auto
&
t
:
_param_config
->
dense_gradient_variable_name
[
table_id
])
{
for
(
auto
&
t
:
_param_config
->
dense_gradient_variable_name
[
table_id
])
{
Variable
*
var
=
thread_scope_
->
FindVar
(
t
);
Variable
*
var
=
thread_scope_
->
FindVar
(
t
);
CHECK
(
var
!=
nullptr
)
<<
"var["
<<
t
<<
"] not found"
;
CHECK
(
var
!=
nullptr
)
<<
"var["
<<
t
<<
"] not found"
;
...
@@ -469,7 +467,8 @@ void AsyncExecutorThreadWorker::PushDense(int table_id) {
...
@@ -469,7 +467,8 @@ void AsyncExecutorThreadWorker::PushDense(int table_id) {
regions
.
emplace_back
(
std
::
move
(
reg
));
regions
.
emplace_back
(
std
::
move
(
reg
));
}
}
auto
status
=
_pslib_ptr
->
_worker_ptr
->
push_dense
(
regions
.
data
(),
regions
.
size
(),
table_id
);
auto
status
=
_pslib_ptr
->
_worker_ptr
->
push_dense
(
regions
.
data
(),
regions
.
size
(),
table_id
);
_push_dense_status
.
push_back
(
std
::
move
(
status
));
_push_dense_status
.
push_back
(
std
::
move
(
status
));
}
}
...
@@ -478,7 +477,7 @@ void AsyncExecutorThreadWorker::PullSparse(int table_id) {
...
@@ -478,7 +477,7 @@ void AsyncExecutorThreadWorker::PullSparse(int table_id) {
auto
&
features
=
_features
[
table_id
];
auto
&
features
=
_features
[
table_id
];
auto
&
feature_value
=
_feature_value
[
table_id
];
auto
&
feature_value
=
_feature_value
[
table_id
];
auto
fea_dim
=
_param_config
->
fea_dim
;
//TODO
auto
fea_dim
=
_param_config
->
fea_dim
;
// slot id starts from 1
// slot id starts from 1
features
.
clear
();
features
.
clear
();
features
.
resize
(
0
);
features
.
resize
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录