Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
e84f353e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
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看板
提交
e84f353e
编写于
4月 19, 2018
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimize
上级
1a438287
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
2 deletion
+6
-2
paddle/fluid/operators/async_listen_and_serv_op.cc
paddle/fluid/operators/async_listen_and_serv_op.cc
+5
-1
paddle/fluid/operators/detail/async_grpc_server.cc
paddle/fluid/operators/detail/async_grpc_server.cc
+1
-1
未找到文件。
paddle/fluid/operators/async_listen_and_serv_op.cc
浏览文件 @
e84f353e
...
@@ -96,6 +96,8 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
...
@@ -96,6 +96,8 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
block_list
.
push_back
(
blkid
);
block_list
.
push_back
(
blkid
);
}
}
}
}
PADDLE_ENFORCE_EQ
(
grad_map_str
.
size
(),
block_list
.
size
(),
"grad num should be equal to optimize block num"
);
auto
optimize_prepared
=
executor
.
Prepare
(
*
program
,
block_list
);
auto
optimize_prepared
=
executor
.
Prepare
(
*
program
,
block_list
);
std
::
unordered_map
<
std
::
string
,
std
::
unordered_map
<
std
::
string
,
...
@@ -107,7 +109,8 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
...
@@ -107,7 +109,8 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
rpc_service_
->
SetScope
(
&
recv_scope
);
rpc_service_
->
SetScope
(
&
recv_scope
);
rpc_service_
->
SetDevCtx
(
&
dev_ctx
);
rpc_service_
->
SetDevCtx
(
&
dev_ctx
);
// TODO(qiao) set proper fields for table lookup and update
// set proper fields for table lookup and update
rpc_service_
->
SetExecutor
(
&
executor
);
rpc_service_
->
SetExecutor
(
&
executor
);
VLOG
(
3
)
<<
"prefetch block id is "
<<
prefetch_block
->
ID
();
VLOG
(
3
)
<<
"prefetch block id is "
<<
prefetch_block
->
ID
();
auto
prefetch_prepared
=
executor
.
Prepare
(
*
program
,
prefetch_block
->
ID
());
auto
prefetch_prepared
=
executor
.
Prepare
(
*
program
,
prefetch_block
->
ID
());
...
@@ -142,6 +145,7 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
...
@@ -142,6 +145,7 @@ void AsyncListenAndServOp::RunImpl(const framework::Scope &scope,
}
}
AsyncExecuteBlock
(
&
executor
,
grad_to_prepared
[
recv_var_name
].
get
(),
AsyncExecuteBlock
(
&
executor
,
grad_to_prepared
[
recv_var_name
].
get
(),
&
recv_scope
);
&
recv_scope
);
// TODO(qiao): explain why
if
(
var
->
IsType
<
framework
::
SelectedRows
>
())
{
if
(
var
->
IsType
<
framework
::
SelectedRows
>
())
{
var
->
GetMutable
<
framework
::
SelectedRows
>
()
->
mutable_rows
()
->
clear
();
var
->
GetMutable
<
framework
::
SelectedRows
>
()
->
mutable_rows
()
->
clear
();
}
}
...
...
paddle/fluid/operators/detail/async_grpc_server.cc
浏览文件 @
e84f353e
...
@@ -91,7 +91,7 @@ class RequestGet final : public RequestBase {
...
@@ -91,7 +91,7 @@ class RequestGet final : public RequestBase {
framework
::
Scope
*
scope
,
framework
::
Scope
*
scope
,
const
platform
::
DeviceContext
*
dev_ctx
)
const
platform
::
DeviceContext
*
dev_ctx
)
:
RequestBase
(
service
,
cq
,
dev_ctx
),
responder_
(
&
ctx_
),
scope_
(
scope
)
{
:
RequestBase
(
service
,
cq
,
dev_ctx
),
responder_
(
&
ctx_
),
scope_
(
scope
)
{
int
method_id
=
static_cast
<
int
>
(
detail
::
GrpcMethod
::
kGetVariable
);
auto
method_id
=
static_cast
<
int
>
(
detail
::
GrpcMethod
::
kGetVariable
);
service_
->
RequestAsyncUnary
(
method_id
,
&
ctx_
,
&
request_
,
&
responder_
,
cq_
,
service_
->
RequestAsyncUnary
(
method_id
,
&
ctx_
,
&
request_
,
&
responder_
,
cq_
,
cq_
,
this
);
cq_
,
this
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录