Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
5cc83f79
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5cc83f79
编写于
12月 11, 2018
作者:
Y
Yancey1989
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update by comment
上级
82726402
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
11 deletion
+18
-11
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+18
-11
未找到文件。
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
5cc83f79
...
...
@@ -110,23 +110,30 @@ ParallelExecutor::ParallelExecutor(
// Bcast Parameters to all GPUs
#if defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
auto
*
nccl_id_var
=
scope
->
FindVar
(
NCCL_ID_VARNAME
);
std
::
unique_ptr
<
ncclUniqueId
>
nccl_id
=
nullptr
;
ncclUniqueId
*
nccl_id
=
nullptr
;
bool
need_group_call
=
true
;
if
(
nccl_id_var
!=
nullptr
)
{
nccl_id
.
reset
(
nccl_id_var
->
GetMutable
<
ncclUniqueId
>
());
}
else
if
(
exec_strategy
.
type_
==
ExecutionStrategy
::
kParallelGraph
)
{
nccl_id
.
reset
(
new
ncclUniqueId
());
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclGetUniqueId
(
nccl_id
.
get
()));
*
member_
->
global_scope_
->
Var
(
NCCL_ID_VARNAME
)
->
GetMutable
<
ncclUniqueId
>
()
=
*
nccl_id
.
get
();
if
(
exec_strategy
.
type_
==
ExecutionStrategy
::
kParallelGraph
)
{
// parallel graph mode should initialize nccl by ncclCommInitRank since
// it call nccl operator per device per thread.
if
(
nccl_id_var
==
nullptr
)
{
nccl_id
=
new
ncclUniqueId
();
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclGetUniqueId
(
nccl_id
));
*
member_
->
global_scope_
->
Var
(
NCCL_ID_VARNAME
)
->
GetMutable
<
ncclUniqueId
>
()
=
*
nccl_id
;
}
else
{
nccl_id
=
nccl_id_var
->
GetMutable
<
ncclUniqueId
>
();
}
need_group_call
=
false
;
}
else
if
(
nccl_id_var
!=
nullptr
)
{
// the other executor type.
// the distributed training with nccl mode would initialize the nccl id in
// startup_program.
nccl_id
=
nccl_id_var
->
GetMutable
<
ncclUniqueId
>
();
}
else
{
// init
nccl_id in NCCLContextMap
// init
lize NCCL by ncclCommInitAll, do not need nccl_id.
}
member_
->
nccl_ctxs_
.
reset
(
new
platform
::
NCCLContextMap
(
member_
->
places_
,
nccl_id
.
get
(),
num_trainers
,
trainer_id
,
need_group_call
));
member_
->
places_
,
nccl_id
,
num_trainers
,
trainer_id
,
need_group_call
));
#else
PADDLE_THROW
(
"Not compiled with CUDA"
);
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录