Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
极客李华
Paddle
提交
33ee5cad
P
Paddle
项目概览
极客李华
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
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,48 +417,46 @@ void AsyncExecutorThreadWorker::PrepareParams() {
}
void
AsyncExecutorThreadWorker
::
UpdateParams
()
{
for
(
auto
i
:
_param_config
->
sparse_table_id
)
{
//TODO
//for (int i = 0; i < 1; ++i) {
PushSparse
(
i
);
}
//for (auto i = 0u; i < GlobalConfig::instance().dense_table_id.size(); ++i) {//TODO
for
(
auto
i
:
_param_config
->
dense_table_id
)
{
PushDense
(
i
);
}
int32_t
tmp_push_dense_wait_times
=
-
1
;
//_param_config->tmp_push_dense_wait_times; //TODO
int32_t
tmp_push_sparse_wait_times
=
-
1
;
//_param_config->tmp_push_sparse_wait_times; //TODO
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
)
{
for
(
auto
&
t
:
_push_dense_status
)
{
t
.
wait
();
}
_push_dense_status
.
resize
(
0
);
}
if
(
tmp_push_dense_wait_times
==
-
1
)
{
_push_dense_status
.
resize
(
0
);
}
if
(
_push_sparse_status
.
size
()
>=
push_sparse_wait_times
)
{
for
(
auto
&
t
:
_push_sparse_status
)
{
t
.
wait
();
}
_push_sparse_status
.
resize
(
0
);
}
if
(
tmp_push_sparse_wait_times
==
-
1
)
{
_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
)
{
_pull_dense_thread
->
increase_thread_version
(
thread_id_
,
dense_table_id
);
for
(
auto
i
:
_param_config
->
sparse_table_id
)
{
PushSparse
(
i
);
}
for
(
auto
i
:
_param_config
->
dense_table_id
)
{
PushDense
(
i
);
}
// _param_config->tmp_push_dense_wait_times
int32_t
tmp_push_dense_wait_times
=
-
1
;
// _param_config->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
)
{
for
(
auto
&
t
:
_push_dense_status
)
{
t
.
wait
();
}
_push_dense_status
.
resize
(
0
);
}
if
(
tmp_push_dense_wait_times
==
-
1
)
{
_push_dense_status
.
resize
(
0
);
}
if
(
_push_sparse_status
.
size
()
>=
push_sparse_wait_times
)
{
for
(
auto
&
t
:
_push_sparse_status
)
{
t
.
wait
();
}
//}
_push_sparse_status
.
resize
(
0
);
}
if
(
tmp_push_sparse_wait_times
==
-
1
)
{
_push_sparse_status
.
resize
(
0
);
}
for
(
auto
dense_table_id
:
_param_config
->
dense_table_id
)
{
_pull_dense_thread
->
increase_thread_version
(
thread_id_
,
dense_table_id
);
}
}
void
AsyncExecutorThreadWorker
::
PushDense
(
int
table_id
)
{
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
])
{
Variable
*
var
=
thread_scope_
->
FindVar
(
t
);
CHECK
(
var
!=
nullptr
)
<<
"var["
<<
t
<<
"] not found"
;
...
...
@@ -469,7 +467,8 @@ void AsyncExecutorThreadWorker::PushDense(int table_id) {
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
));
}
...
...
@@ -478,7 +477,7 @@ void AsyncExecutorThreadWorker::PullSparse(int table_id) {
auto
&
features
=
_features
[
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
features
.
clear
();
features
.
resize
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录