Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
466d177d
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看板
提交
466d177d
编写于
4月 16, 2019
作者:
D
dongdaxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add pybind dependency
test=develop
上级
4aa6f679
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
6 deletion
+7
-6
paddle/fluid/framework/fleet/nccl_wrapper.cc
paddle/fluid/framework/fleet/nccl_wrapper.cc
+5
-5
paddle/fluid/framework/fleet/nccl_wrapper.h
paddle/fluid/framework/fleet/nccl_wrapper.h
+1
-0
paddle/fluid/pybind/fleet_wrapper_py.cc
paddle/fluid/pybind/fleet_wrapper_py.cc
+0
-1
paddle/fluid/pybind/nccl_wrapper_py.cc
paddle/fluid/pybind/nccl_wrapper_py.cc
+1
-0
未找到文件。
paddle/fluid/framework/fleet/nccl_wrapper.cc
浏览文件 @
466d177d
...
@@ -24,9 +24,9 @@ std::shared_ptr<NCCLWrapper> NCCLWrapper::s_instance_ = NULL;
...
@@ -24,9 +24,9 @@ std::shared_ptr<NCCLWrapper> NCCLWrapper::s_instance_ = NULL;
bool
NCCLWrapper
::
is_initialized_
=
false
;
bool
NCCLWrapper
::
is_initialized_
=
false
;
void
NCCLWrapper
::
InitNCCL
()
{
void
NCCLWrapper
::
InitNCCL
()
{
platform
::
dynload
::
ncclCommInitRank
(
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclCommInitRank
(
&
(
nccl_info_
.
comm_
),
nccl_info_
.
global_ranks_
,
nccl_info_
.
nccl_id_
,
&
(
nccl_info_
.
comm_
),
nccl_info_
.
global_ranks_
,
nccl_info_
.
nccl_id_
,
nccl_info_
.
my_global_rank_
);
nccl_info_
.
my_global_rank_
)
)
;
return
;
return
;
}
}
...
@@ -55,9 +55,9 @@ void NCCLWrapper::SyncVar(const int root_rank, const Scope& scope,
...
@@ -55,9 +55,9 @@ void NCCLWrapper::SyncVar(const int root_rank, const Scope& scope,
auto
var
=
scope
.
FindVar
(
name
);
auto
var
=
scope
.
FindVar
(
name
);
LoDTensor
*
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
LoDTensor
*
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
int32_t
total_size
=
tensor
->
numel
();
int32_t
total_size
=
tensor
->
numel
();
platform
::
dynload
::
ncclBcast
(
reinterpret_cast
<
void
*>
(
tensor
->
data
<
float
>
()),
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclBcast
(
total_size
,
ncclFloat
,
root_rank
,
reinterpret_cast
<
void
*>
(
tensor
->
data
<
float
>
()),
total_size
,
ncclFloat
,
nccl_info_
.
comm_
,
nccl_info_
.
stream_
);
root_rank
,
nccl_info_
.
comm_
,
nccl_info_
.
stream_
)
);
cudaStreamSynchronize
(
nccl_info_
.
stream_
);
cudaStreamSynchronize
(
nccl_info_
.
stream_
);
}
}
}
}
...
...
paddle/fluid/framework/fleet/nccl_wrapper.h
浏览文件 @
466d177d
...
@@ -24,6 +24,7 @@ limitations under the License. */
...
@@ -24,6 +24,7 @@ limitations under the License. */
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/framework/variable_helper.h"
#include "paddle/fluid/framework/variable_helper.h"
#include "paddle/fluid/platform/dynload/nccl.h"
#include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN
#include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN
namespace
paddle
{
namespace
paddle
{
...
...
paddle/fluid/pybind/fleet_wrapper_py.cc
浏览文件 @
466d177d
...
@@ -36,7 +36,6 @@ limitations under the License. */
...
@@ -36,7 +36,6 @@ limitations under the License. */
#include "paddle/fluid/pybind/fleet_wrapper_py.h"
#include "paddle/fluid/pybind/fleet_wrapper_py.h"
namespace
py
=
pybind11
;
namespace
py
=
pybind11
;
namespace
pd
=
paddle
::
framework
;
namespace
paddle
{
namespace
paddle
{
namespace
pybind
{
namespace
pybind
{
...
...
paddle/fluid/pybind/nccl_wrapper_py.cc
浏览文件 @
466d177d
...
@@ -29,6 +29,7 @@ limitations under the License. */
...
@@ -29,6 +29,7 @@ limitations under the License. */
#include "paddle/fluid/framework/async_executor.h"
#include "paddle/fluid/framework/async_executor.h"
#include "paddle/fluid/framework/data_feed.h"
#include "paddle/fluid/framework/data_feed.h"
#include "paddle/fluid/framework/data_feed.pb.h"
#include "paddle/fluid/framework/data_feed.pb.h"
#include "paddle/fluid/framework/fleet/nccl_wrapper.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/inference/io.h"
#include "paddle/fluid/inference/io.h"
#include "paddle/fluid/platform/place.h"
#include "paddle/fluid/platform/place.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录