Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
03d469ad
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
03d469ad
编写于
4月 23, 2019
作者:
G
guru4elephant
提交者:
GitHub
4月 23, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17005 from wopeizl/fix_ncclwrapper_win1
fix nccl wrapper on windows
上级
13295d90
51a0243a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
7 deletion
+11
-7
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
+2
-2
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+4
-0
未找到文件。
paddle/fluid/framework/fleet/nccl_wrapper.cc
浏览文件 @
03d469ad
...
@@ -24,7 +24,7 @@ std::shared_ptr<NCCLWrapper> NCCLWrapper::s_instance_ = NULL;
...
@@ -24,7 +24,7 @@ std::shared_ptr<NCCLWrapper> NCCLWrapper::s_instance_ = NULL;
bool
NCCLWrapper
::
is_initialized_
=
false
;
bool
NCCLWrapper
::
is_initialized_
=
false
;
void
NCCLWrapper
::
InitNCCL
()
{
void
NCCLWrapper
::
InitNCCL
()
{
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
PADDLE_ENFORCE
(
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_
));
...
@@ -33,14 +33,14 @@ void NCCLWrapper::InitNCCL() {
...
@@ -33,14 +33,14 @@ void NCCLWrapper::InitNCCL() {
}
}
void
NCCLWrapper
::
SetNCCLId
(
const
NCCLInfo
&
nccl_info
)
{
void
NCCLWrapper
::
SetNCCLId
(
const
NCCLInfo
&
nccl_info
)
{
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
nccl_info_
.
nccl_id_
=
nccl_info
.
nccl_id_
;
nccl_info_
.
nccl_id_
=
nccl_info
.
nccl_id_
;
#endif
#endif
return
;
return
;
}
}
NCCLInfo
NCCLWrapper
::
GetNCCLId
()
{
NCCLInfo
NCCLWrapper
::
GetNCCLId
()
{
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclGetUniqueId
(
&
(
nccl_info_
.
nccl_id_
)));
PADDLE_ENFORCE
(
platform
::
dynload
::
ncclGetUniqueId
(
&
(
nccl_info_
.
nccl_id_
)));
#endif
#endif
return
nccl_info_
;
return
nccl_info_
;
...
@@ -48,7 +48,7 @@ NCCLInfo NCCLWrapper::GetNCCLId() {
...
@@ -48,7 +48,7 @@ NCCLInfo NCCLWrapper::GetNCCLId() {
void
NCCLWrapper
::
SetRankInfo
(
const
int
local_rank
,
const
int
global_rank
,
void
NCCLWrapper
::
SetRankInfo
(
const
int
local_rank
,
const
int
global_rank
,
const
int
ranks
)
{
const
int
ranks
)
{
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
nccl_info_
.
local_rank_
=
local_rank
;
nccl_info_
.
local_rank_
=
local_rank
;
nccl_info_
.
my_global_rank_
=
global_rank
;
nccl_info_
.
my_global_rank_
=
global_rank
;
nccl_info_
.
global_ranks_
=
ranks
;
nccl_info_
.
global_ranks_
=
ranks
;
...
@@ -60,7 +60,7 @@ void NCCLWrapper::SetRankInfo(const int local_rank, const int global_rank,
...
@@ -60,7 +60,7 @@ void NCCLWrapper::SetRankInfo(const int local_rank, const int global_rank,
void
NCCLWrapper
::
SyncVar
(
const
int
root_rank
,
const
Scope
&
scope
,
void
NCCLWrapper
::
SyncVar
(
const
int
root_rank
,
const
Scope
&
scope
,
const
std
::
vector
<
std
::
string
>&
var_names
)
{
const
std
::
vector
<
std
::
string
>&
var_names
)
{
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
for
(
auto
&
name
:
var_names
)
{
for
(
auto
&
name
:
var_names
)
{
auto
var
=
scope
.
FindVar
(
name
);
auto
var
=
scope
.
FindVar
(
name
);
LoDTensor
*
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
LoDTensor
*
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
...
...
paddle/fluid/framework/fleet/nccl_wrapper.h
浏览文件 @
03d469ad
...
@@ -24,7 +24,7 @@ limitations under the License. */
...
@@ -24,7 +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"
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
#include "paddle/fluid/platform/dynload/nccl.h"
#include "paddle/fluid/platform/dynload/nccl.h"
#endif
#endif
#include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN
#include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN
...
@@ -41,7 +41,7 @@ class NCCLInfo {
...
@@ -41,7 +41,7 @@ class NCCLInfo {
int
local_rank_
;
int
local_rank_
;
int
global_ranks_
;
int
global_ranks_
;
int
my_global_rank_
;
int
my_global_rank_
;
#if
def PADDLE_WITH_CUDA
#if
defined(PADDLE_WITH_CUDA) && !defined(_WIN32)
ncclUniqueId
nccl_id_
;
ncclUniqueId
nccl_id_
;
ncclComm_t
comm_
;
ncclComm_t
comm_
;
cudaStream_t
stream_
;
cudaStream_t
stream_
;
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
03d469ad
...
@@ -58,7 +58,9 @@ limitations under the License. */
...
@@ -58,7 +58,9 @@ limitations under the License. */
#include "paddle/fluid/pybind/imperative.h"
#include "paddle/fluid/pybind/imperative.h"
#include "paddle/fluid/pybind/inference_api.h"
#include "paddle/fluid/pybind/inference_api.h"
#include "paddle/fluid/pybind/ir.h"
#include "paddle/fluid/pybind/ir.h"
#ifndef _WIN32
#include "paddle/fluid/pybind/nccl_wrapper_py.h"
#include "paddle/fluid/pybind/nccl_wrapper_py.h"
#endif
#include "paddle/fluid/pybind/protobuf.h"
#include "paddle/fluid/pybind/protobuf.h"
#include "paddle/fluid/pybind/pybind.h" // NOLINT
#include "paddle/fluid/pybind/pybind.h" // NOLINT
#include "paddle/fluid/pybind/reader_py.h"
#include "paddle/fluid/pybind/reader_py.h"
...
@@ -1415,7 +1417,9 @@ All parameter, weight, gradient are variables in Paddle.
...
@@ -1415,7 +1417,9 @@ All parameter, weight, gradient are variables in Paddle.
BindRecordIOWriter
(
&
m
);
BindRecordIOWriter
(
&
m
);
BindAsyncExecutor
(
&
m
);
BindAsyncExecutor
(
&
m
);
BindFleetWrapper
(
&
m
);
BindFleetWrapper
(
&
m
);
#ifndef _WIN32
BindNCCLWrapper
(
&
m
);
BindNCCLWrapper
(
&
m
);
#endif
BindGraph
(
&
m
);
BindGraph
(
&
m
);
BindNode
(
&
m
);
BindNode
(
&
m
);
BindInferenceApi
(
&
m
);
BindInferenceApi
(
&
m
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录