Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
TonyTonyFun
Paddle
提交
fb6cc3a1
P
Paddle
项目概览
TonyTonyFun
/
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,发现更多精彩内容 >>
提交
fb6cc3a1
编写于
4月 01, 2019
作者:
Q
Qiao Longfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
follow commnet, optimize code and add comment test=develop
上级
adf272bc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
paddle/fluid/framework/details/multi_devices_graph_pass.h
paddle/fluid/framework/details/multi_devices_graph_pass.h
+3
-0
paddle/fluid/framework/scope.h
paddle/fluid/framework/scope.h
+4
-0
paddle/fluid/operators/distributed/parameter_send.cc
paddle/fluid/operators/distributed/parameter_send.cc
+6
-7
paddle/fluid/operators/distributed_ops/send_op.cc
paddle/fluid/operators/distributed_ops/send_op.cc
+1
-1
未找到文件。
paddle/fluid/framework/details/multi_devices_graph_pass.h
浏览文件 @
fb6cc3a1
...
@@ -132,8 +132,11 @@ class AsyncSSAGraphBuilder : public MultiDevSSAGraphBuilderBase {
...
@@ -132,8 +132,11 @@ class AsyncSSAGraphBuilder : public MultiDevSSAGraphBuilderBase {
node
->
Op
()
->
Flush
();
node
->
Op
()
->
Flush
();
}
else
if
(
node
->
Name
()
==
"lookup_table"
||
node
->
Name
()
==
"nce"
||
}
else
if
(
node
->
Name
()
==
"lookup_table"
||
node
->
Name
()
==
"nce"
||
node
->
Name
()
==
"hierarchical_sigmoid"
)
{
node
->
Name
()
==
"hierarchical_sigmoid"
)
{
// in async_mode, we do not need remote prefetch, because communicator
// will do async parameter recv.
VLOG
(
1
)
<<
"set "
<<
node
->
Name
()
<<
" op remote_prefetch to false"
;
VLOG
(
1
)
<<
"set "
<<
node
->
Name
()
<<
" op remote_prefetch to false"
;
node
->
Op
()
->
SetAttr
(
"remote_prefetch"
,
false
);
node
->
Op
()
->
SetAttr
(
"remote_prefetch"
,
false
);
node
->
Op
()
->
Flush
();
}
}
return
false
;
return
false
;
}
}
...
...
paddle/fluid/framework/scope.h
浏览文件 @
fb6cc3a1
...
@@ -52,6 +52,10 @@ class Scope {
...
@@ -52,6 +52,10 @@ class Scope {
/// Mark it to const because that new kid scope cannot change parent scope.
/// Mark it to const because that new kid scope cannot change parent scope.
Scope
&
NewScope
()
const
;
Scope
&
NewScope
()
const
;
/// Create a sub-scope for current scope but do not record it in the kids to
/// avoid performance problems.
/// Note!!! You should delete the result pointer yourself to avoid memory
/// leak!
Scope
*
NewTmpScope
()
const
;
Scope
*
NewTmpScope
()
const
;
/// Create a variable with given name if it doesn't exist.
/// Create a variable with given name if it doesn't exist.
...
...
paddle/fluid/operators/distributed/parameter_send.cc
浏览文件 @
fb6cc3a1
...
@@ -81,8 +81,8 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
...
@@ -81,8 +81,8 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
auto
abs_sections
=
ToAbsoluteSection
(
rpc_ctx
.
height_sections
);
auto
abs_sections
=
ToAbsoluteSection
(
rpc_ctx
.
height_sections
);
auto
&
send_rows
=
send_slr
.
rows
();
auto
&
send_rows
=
send_slr
.
rows
();
std
::
vector
<
std
::
vector
<
in
t
>>
outs_rows_idx
;
std
::
vector
<
std
::
vector
<
size_
t
>>
outs_rows_idx
;
std
::
vector
<
std
::
vector
<
in
t
>>
outs_dense_idx
;
std
::
vector
<
std
::
vector
<
size_
t
>>
outs_dense_idx
;
outs_rows_idx
.
resize
(
out_num
);
outs_rows_idx
.
resize
(
out_num
);
outs_dense_idx
.
resize
(
out_num
);
outs_dense_idx
.
resize
(
out_num
);
...
@@ -99,7 +99,7 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
...
@@ -99,7 +99,7 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
// split rows index into output sparse vars
// split rows index into output sparse vars
for
(
size_t
i
=
0
;
i
<
send_rows
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
send_rows
.
size
();
++
i
)
{
in
t
out_idx
=
GetSectionIndex
(
send_rows
[
i
],
abs_sections
);
size_
t
out_idx
=
GetSectionIndex
(
send_rows
[
i
],
abs_sections
);
outs_rows_idx
[
out_idx
].
push_back
(
send_rows
[
i
]);
outs_rows_idx
[
out_idx
].
push_back
(
send_rows
[
i
]);
outs_dense_idx
[
out_idx
].
push_back
(
i
);
outs_dense_idx
[
out_idx
].
push_back
(
i
);
}
}
...
@@ -160,10 +160,9 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
...
@@ -160,10 +160,9 @@ void ParameterSend<T>::operator()(const RpcContext &rpc_ctx,
}
}
}
}
// note!! only support sync send now
if
(
sync
)
{
if
(
true
||
sync
)
{
for
(
auto
&
handle
:
rets
)
{
for
(
size_t
i
=
0
;
i
<
rets
.
size
();
i
++
)
{
PADDLE_ENFORCE
(
handle
->
Wait
(),
"internal error in RPCClient"
);
PADDLE_ENFORCE
(
rets
[
i
]
->
Wait
(),
"internal error in RPCClient"
);
}
}
}
}
...
...
paddle/fluid/operators/distributed_ops/send_op.cc
浏览文件 @
fb6cc3a1
...
@@ -52,7 +52,7 @@ class SendOp : public framework::OperatorBase {
...
@@ -52,7 +52,7 @@ class SendOp : public framework::OperatorBase {
auto
send_functor
=
distributed
::
ParameterSend
<
float
>
();
auto
send_functor
=
distributed
::
ParameterSend
<
float
>
();
auto
rpc_ctx
=
distributed
::
RpcContext
(
ins
[
0
],
send_varnames
,
epmap
,
auto
rpc_ctx
=
distributed
::
RpcContext
(
ins
[
0
],
send_varnames
,
epmap
,
height_sections
);
height_sections
);
send_functor
(
rpc_ctx
,
scope
,
static_cast
<
bool
>
(
sync_send
)
);
send_functor
(
rpc_ctx
,
scope
,
true
);
}
else
{
}
else
{
distributed
::
Communicator
::
GetInstance
()
->
Send
(
ins
[
0
],
scope
);
distributed
::
Communicator
::
GetInstance
()
->
Send
(
ins
[
0
],
scope
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录