Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
c18c2f6a
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c18c2f6a
编写于
3月 20, 2018
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sync all computation streams at the end of run
上级
c372ce28
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+9
-3
paddle/fluid/framework/parallel_executor.h
paddle/fluid/framework/parallel_executor.h
+1
-1
未找到文件。
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
c18c2f6a
...
@@ -482,7 +482,6 @@ void ParallelExecutor::ConstructDependencyGraph(
...
@@ -482,7 +482,6 @@ void ParallelExecutor::ConstructDependencyGraph(
bool
is_forwarding
=
true
;
bool
is_forwarding
=
true
;
for
(
auto
*
op
:
main_program
.
Block
(
0
).
AllOps
())
{
for
(
auto
*
op
:
main_program
.
Block
(
0
).
AllOps
())
{
bool
change_forward
=
false
;
bool
change_forward
=
false
;
if
(
!
is_forwarding
)
{
if
(
!
is_forwarding
)
{
// FIXME(yy): Do not hard code like this
// FIXME(yy): Do not hard code like this
if
(
op
->
OutputArgumentNames
().
size
()
==
1
&&
if
(
op
->
OutputArgumentNames
().
size
()
==
1
&&
...
@@ -573,7 +572,7 @@ void ParallelExecutor::ConstructDependencyGraph(
...
@@ -573,7 +572,7 @@ void ParallelExecutor::ConstructDependencyGraph(
Dependency graph has been constructed. However, there are still data
Dependency graph has been constructed. However, there are still data
harzaeds need to be handled.
harzaeds need to be handled.
*/
*/
PolishGraphToSupportDataHa
rzae
ds
();
PolishGraphToSupportDataHa
zar
ds
();
}
}
/**
/**
...
@@ -583,7 +582,7 @@ void ParallelExecutor::ConstructDependencyGraph(
...
@@ -583,7 +582,7 @@ void ParallelExecutor::ConstructDependencyGraph(
*
*
* https://en.wikipedia.org/wiki/Hazard_(computer_architecture)#Write_after_read_(WAR)
* https://en.wikipedia.org/wiki/Hazard_(computer_architecture)#Write_after_read_(WAR)
*/
*/
void
ParallelExecutor
::
PolishGraphToSupportDataHa
rzae
ds
()
const
{
void
ParallelExecutor
::
PolishGraphToSupportDataHa
zar
ds
()
const
{
for
(
auto
&
place_pair
:
member_
->
vars_
)
{
for
(
auto
&
place_pair
:
member_
->
vars_
)
{
for
(
auto
&
name_pair
:
place_pair
.
second
)
{
for
(
auto
&
name_pair
:
place_pair
.
second
)
{
if
(
name_pair
.
second
.
size
()
<=
1
)
{
if
(
name_pair
.
second
.
size
()
<=
1
)
{
...
@@ -813,6 +812,13 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
...
@@ -813,6 +812,13 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
fetch_ops
.
clear
();
fetch_ops
.
clear
();
*
member_
->
global_scope_
->
Var
(
fetched_var_name
)
->
GetMutable
<
LoDTensorArray
>
()
=
*
member_
->
global_scope_
->
Var
(
fetched_var_name
)
->
GetMutable
<
LoDTensorArray
>
()
=
fetched_data
->
tensors_
;
fetched_data
->
tensors_
;
// FIXME:
// It could be optimized by using multiple events in an operator.
// Manually sync computation during iter.
for
(
auto
&
p
:
member_
->
places_
)
{
platform
::
DeviceContextPool
::
Instance
().
Get
(
p
)
->
Wait
();
}
}
}
void
ParallelExecutor
::
RunOp
(
void
ParallelExecutor
::
RunOp
(
...
...
paddle/fluid/framework/parallel_executor.h
浏览文件 @
c18c2f6a
...
@@ -65,7 +65,7 @@ class ParallelExecutor {
...
@@ -65,7 +65,7 @@ class ParallelExecutor {
std
::
unordered_map
<
VarHandleBase
*
,
std
::
atomic
<
bool
>>&
pending_vars
,
std
::
unordered_map
<
VarHandleBase
*
,
std
::
atomic
<
bool
>>&
pending_vars
,
OpHandle
*
op
)
const
;
OpHandle
*
op
)
const
;
void
PolishGraphToSupportDataHa
rzae
ds
()
const
;
void
PolishGraphToSupportDataHa
zar
ds
()
const
;
};
};
}
// namespace framework
}
// namespace framework
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录