Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
121b2aed
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
121b2aed
编写于
3月 18, 2020
作者:
Y
Yi Liu
提交者:
GitHub
3月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
initialize global nccl context in dygraph (#23037)
initialize global nccl context in dygraph test=develop
上级
5a202af9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
8 deletion
+7
-8
paddle/fluid/imperative/CMakeLists.txt
paddle/fluid/imperative/CMakeLists.txt
+1
-1
paddle/fluid/imperative/nccl_context.cc
paddle/fluid/imperative/nccl_context.cc
+5
-4
paddle/fluid/platform/CMakeLists.txt
paddle/fluid/platform/CMakeLists.txt
+1
-3
未找到文件。
paddle/fluid/imperative/CMakeLists.txt
浏览文件 @
121b2aed
...
...
@@ -10,7 +10,7 @@ cc_library(engine SRCS engine.cc DEPS layer gradient_accumulator)
cc_library
(
imperative_profiler SRCS profiler.cc
)
if
(
NOT WIN32
)
if
(
WITH_NCCL
)
cc_library
(
nccl_context SRCS nccl_context.cc DEPS device_context
)
cc_library
(
nccl_context SRCS nccl_context.cc DEPS
collective_helper
device_context
)
endif
()
cc_library
(
data_loader SRCS data_loader.cc DEPS enforce
)
endif
(
NOT WIN32
)
...
...
paddle/fluid/imperative/nccl_context.cc
浏览文件 @
121b2aed
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
#include "paddle/fluid/imperative/nccl_context.h"
#include "paddle/fluid/platform/collective_helper.h"
namespace
paddle
{
namespace
imperative
{
...
...
@@ -115,7 +116,6 @@ void NCCLParallelContext::BcastNCCLId(ncclUniqueId *nccl_id, int root) {
void
NCCLParallelContext
::
Init
()
{
ncclUniqueId
nccl_id
;
ncclComm_t
comm
;
if
(
strategy_
.
local_rank_
==
0
)
{
// generate the unique ncclid on the root worker
platform
::
dynload
::
ncclGetUniqueId
(
&
nccl_id
);
...
...
@@ -128,12 +128,13 @@ void NCCLParallelContext::Init() {
<<
" local rank: "
<<
strategy_
.
local_rank_
<<
" gpu id: "
<<
gpu_id
;
PADDLE_ENFORCE
(
cudaSetDevice
(
gpu_id
));
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclCommInitRank
(
&
comm
,
strategy_
.
nranks_
,
nccl_id
,
strategy_
.
local_rank_
));
platform
::
NCCLComm
*
nccl_comm
=
platform
::
NCCLCommContext
::
Instance
().
CreateNCCLComm
(
&
nccl_id
,
strategy_
.
nranks_
,
strategy_
.
local_rank_
,
gpu_id
,
0
);
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
*
dev_ctx
=
static_cast
<
platform
::
CUDADeviceContext
*>
(
pool
.
Get
(
place_
));
dev_ctx
->
set_nccl_comm
(
comm
);
dev_ctx
->
set_nccl_comm
(
nccl_comm
->
comm
()
);
}
#endif
...
...
paddle/fluid/platform/CMakeLists.txt
浏览文件 @
121b2aed
...
...
@@ -78,9 +78,7 @@ cc_library(device_context SRCS device_context.cc init.cc DEPS simple_threadpool
place eigen3 stringpiece cpu_helper cpu_info framework_proto
${
GPU_CTX_DEPS
}
${
MKLDNN_CTX_DEPS
}
${
dgc_deps
}
dlpack cudnn_workspace_helper
)
if
(
WITH_DISTRIBUTE
)
cc_library
(
collective_helper SRCS collective_helper.cc DEPS framework_proto device_context enforce
)
endif
()
cc_library
(
collective_helper SRCS collective_helper.cc DEPS framework_proto device_context enforce
)
if
(
WIN32
)
if
(
WITH_GPU AND NOT WITH_DSO
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录