Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
b8484161
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b8484161
编写于
12月 21, 2017
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
follow comments
上级
175a4f52
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
5 deletion
+7
-5
paddle/framework/block_desc.cc
paddle/framework/block_desc.cc
+1
-1
paddle/operators/detail/recv_impl.cc
paddle/operators/detail/recv_impl.cc
+1
-1
paddle/operators/detail/send_recv_impl.h
paddle/operators/detail/send_recv_impl.h
+1
-1
paddle/operators/recv_op.cc
paddle/operators/recv_op.cc
+4
-2
未找到文件。
paddle/framework/block_desc.cc
浏览文件 @
b8484161
...
@@ -90,7 +90,7 @@ OpDesc *BlockDesc::PrependOp() {
...
@@ -90,7 +90,7 @@ OpDesc *BlockDesc::PrependOp() {
return
ops_
.
front
().
get
();
return
ops_
.
front
().
get
();
}
}
void
BlockDesc
Bind
::
RemoveOp
(
size_t
s
,
size_t
e
)
{
void
BlockDesc
::
RemoveOp
(
size_t
s
,
size_t
e
)
{
if
(
ops_
.
begin
()
+
s
==
ops_
.
end
()
||
ops_
.
begin
()
+
e
==
ops_
.
end
())
{
if
(
ops_
.
begin
()
+
s
==
ops_
.
end
()
||
ops_
.
begin
()
+
e
==
ops_
.
end
())
{
return
;
return
;
}
}
...
...
paddle/operators/detail/recv_impl.cc
浏览文件 @
b8484161
...
@@ -58,7 +58,7 @@ Status SendRecvServerImpl::Wait(ServerContext *context,
...
@@ -58,7 +58,7 @@ Status SendRecvServerImpl::Wait(ServerContext *context,
return
Status
::
OK
;
return
Status
::
OK
;
}
}
void
SendRecvServerImpl
::
Star
t
()
{
void
SendRecvServerImpl
::
Rese
t
()
{
std
::
lock_guard
<
std
::
mutex
>
lock
(
this
->
mutex_
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
this
->
mutex_
);
done_
=
false
;
done_
=
false
;
}
}
...
...
paddle/operators/detail/send_recv_impl.h
浏览文件 @
b8484161
...
@@ -56,7 +56,7 @@ class SendRecvServerImpl final : public SendRecvService::Service {
...
@@ -56,7 +56,7 @@ class SendRecvServerImpl final : public SendRecvService::Service {
VariableMessage
*
out_var
)
override
;
VariableMessage
*
out_var
)
override
;
Status
Wait
(
ServerContext
*
context
,
const
VoidMessage
*
in_var
,
Status
Wait
(
ServerContext
*
context
,
const
VoidMessage
*
in_var
,
VoidMessage
*
out_var
)
override
;
VoidMessage
*
out_var
)
override
;
void
Star
t
();
void
Rese
t
();
void
Done
();
void
Done
();
void
SetScope
(
framework
::
Scope
*
scope
)
{
scope_
=
scope
;
};
void
SetScope
(
framework
::
Scope
*
scope
)
{
scope_
=
scope
;
};
...
...
paddle/operators/recv_op.cc
浏览文件 @
b8484161
...
@@ -80,7 +80,7 @@ class RecvOp : public framework::OperatorBase {
...
@@ -80,7 +80,7 @@ class RecvOp : public framework::OperatorBase {
auto
grad_list
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"GradList"
);
auto
grad_list
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"GradList"
);
auto
trainer_count
=
Attr
<
int
>
(
"Trainers"
);
auto
trainer_count
=
Attr
<
int
>
(
"Trainers"
);
size_t
param_count
=
param_list
.
size
();
size_t
param_count
=
param_list
.
size
();
rpc_service_
->
Star
t
();
rpc_service_
->
Rese
t
();
// TODO(typhoonzero): change this to a while_op for every cluster-batch.
// TODO(typhoonzero): change this to a while_op for every cluster-batch.
while
(
true
)
{
while
(
true
)
{
// Get from multiple trainers, we don't care about order in which
// Get from multiple trainers, we don't care about order in which
...
@@ -93,6 +93,8 @@ class RecvOp : public framework::OperatorBase {
...
@@ -93,6 +93,8 @@ class RecvOp : public framework::OperatorBase {
std
::
string
param_var_name
;
std
::
string
param_var_name
;
if
(
it
!=
grad_list
.
end
())
{
if
(
it
!=
grad_list
.
end
())
{
param_var_name
=
param_list
[
it
-
grad_list
.
begin
()];
param_var_name
=
param_list
[
it
-
grad_list
.
begin
()];
}
else
{
LOG
(
ERROR
)
<<
"grad have no paired param found!"
;
}
}
VLOG
(
3
)
<<
"recved grad: "
<<
grad_var_name
VLOG
(
3
)
<<
"recved grad: "
<<
grad_var_name
<<
" updating param: "
<<
param_var_name
;
<<
" updating param: "
<<
param_var_name
;
...
@@ -112,7 +114,7 @@ class RecvOp : public framework::OperatorBase {
...
@@ -112,7 +114,7 @@ class RecvOp : public framework::OperatorBase {
// FIXME(typhoonzero): do not copy
// FIXME(typhoonzero): do not copy
framework
::
CopyFrom
(
v
.
second
,
dev_ctx
.
GetPlace
(),
dev_ctx
,
tensor
);
framework
::
CopyFrom
(
v
.
second
,
dev_ctx
.
GetPlace
(),
dev_ctx
,
tensor
);
}
}
rpc_service_
->
Star
t
();
rpc_service_
->
Rese
t
();
std
::
string
program_str
=
Attr
<
std
::
string
>
(
"OptimizeProgram"
);
std
::
string
program_str
=
Attr
<
std
::
string
>
(
"OptimizeProgram"
);
framework
::
ProgramDesc
program_desc
;
framework
::
ProgramDesc
program_desc
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录