Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
a058b474
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看板
未验证
提交
a058b474
编写于
4月 12, 2022
作者:
L
Leo Chen
提交者:
GitHub
4月 12, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add dependency for send/recv to support pp parallel (#41652)
上级
a688ae2e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
9 deletion
+25
-9
paddle/fluid/framework/new_executor/interpretercore_util.cc
paddle/fluid/framework/new_executor/interpretercore_util.cc
+25
-9
未找到文件。
paddle/fluid/framework/new_executor/interpretercore_util.cc
浏览文件 @
a058b474
...
@@ -709,8 +709,13 @@ std::map<int, std::list<int>> build_op_downstream_map(
...
@@ -709,8 +709,13 @@ std::map<int, std::list<int>> build_op_downstream_map(
// add dependences for random op, make sure that the random op is scheduled
// add dependences for random op, make sure that the random op is scheduled
// sequentially
// sequentially
const
std
::
set
<
std
::
string
>
random_op_set
=
{
const
std
::
set
<
std
::
string
>
random_op_set
=
{
"bernoulli"
,
"poisson"
,
"multinomial"
,
"gaussian_random"
,
"bernoulli"
,
"poisson"
,
"multinomial"
,
"gaussian_random"
,
"uniform_random"
,
"randint"
,
"randperm"
,
"exponential"
};
"truncated_gaussian_random"
,
"uniform_random"
,
"randint"
,
"randperm"
,
"exponential"
,
"sampling_id"
"dropout"
,
"class_center_sample"
,
};
int
dependence_op_idx
=
-
1
;
int
dependence_op_idx
=
-
1
;
for
(
size_t
op_idx
=
0
;
op_idx
<
vec_instruction
.
size
();
++
op_idx
)
{
for
(
size_t
op_idx
=
0
;
op_idx
<
vec_instruction
.
size
();
++
op_idx
)
{
...
@@ -723,13 +728,26 @@ std::map<int, std::list<int>> build_op_downstream_map(
...
@@ -723,13 +728,26 @@ std::map<int, std::list<int>> build_op_downstream_map(
}
}
// add dependency for communication op
// add dependency for communication op
const
std
::
string
communication_op_prefix
=
"c_"
;
auto
is_comm_op
=
[](
std
::
string
op
)
->
bool
{
const
std
::
set
<
std
::
string
>
special_comm_op_set
=
{
"send"
,
"recv"
,
"send_v2"
,
"recv_v2"
,
};
const
std
::
string
communication_op_prefix
=
"c_"
;
if
(
op
.
find
(
communication_op_prefix
)
!=
std
::
string
::
npos
||
special_comm_op_set
.
count
(
op
))
{
return
true
;
}
return
false
;
};
dependence_op_idx
=
-
1
;
dependence_op_idx
=
-
1
;
for
(
size_t
op_idx
=
0
;
op_idx
<
vec_instruction
.
size
();
++
op_idx
)
{
for
(
size_t
op_idx
=
0
;
op_idx
<
vec_instruction
.
size
();
++
op_idx
)
{
if
(
vec_instruction
[
op_idx
].
OpBase
()
->
Type
().
find
(
if
(
is_comm_op
(
vec_instruction
[
op_idx
].
OpBase
()
->
Type
()))
{
communication_op_prefix
)
!=
std
::
string
::
npos
)
{
if
(
dependence_op_idx
!=
-
1
)
{
if
(
dependence_op_idx
!=
-
1
)
{
op2dependences
[
op_idx
].
insert
(
dependence_op_idx
);
op2dependences
[
op_idx
].
insert
(
dependence_op_idx
);
VLOG
(
4
)
<<
"Add depend from "
<<
vec_instruction
[
dependence_op_idx
].
OpBase
()
->
Type
()
<<
" to "
<<
vec_instruction
[
op_idx
].
OpBase
()
->
Type
();
}
}
dependence_op_idx
=
op_idx
;
dependence_op_idx
=
op_idx
;
}
}
...
@@ -833,10 +851,8 @@ std::map<int, std::list<int>> build_op_downstream_map(
...
@@ -833,10 +851,8 @@ std::map<int, std::list<int>> build_op_downstream_map(
for
(
size_t
j
=
first_read_fused_out_op
+
1
;
j
<
vec_instruction
.
size
();
for
(
size_t
j
=
first_read_fused_out_op
+
1
;
j
<
vec_instruction
.
size
();
++
j
)
{
++
j
)
{
if
(
j
==
target
+
1
&&
if
(
j
==
target
+
1
&&
vec_instruction
[
target
].
OpBase
()
->
Type
().
find
(
is_comm_op
(
vec_instruction
[
target
].
OpBase
()
->
Type
())
&&
communication_op_prefix
)
!=
std
::
string
::
npos
&&
is_comm_op
(
vec_instruction
[
j
].
OpBase
()
->
Type
()))
{
vec_instruction
[
j
].
OpBase
()
->
Type
().
find
(
communication_op_prefix
)
!=
std
::
string
::
npos
)
{
VLOG
(
4
)
<<
"Found consecutive communication ops, "
VLOG
(
4
)
<<
"Found consecutive communication ops, "
<<
vec_instruction
[
target
].
OpBase
()
->
Type
()
<<
" -> "
<<
vec_instruction
[
target
].
OpBase
()
->
Type
()
<<
" -> "
<<
vec_instruction
[
j
].
OpBase
()
->
Type
();
<<
vec_instruction
[
j
].
OpBase
()
->
Type
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录