Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
3d1741b7
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看板
未验证
提交
3d1741b7
编写于
12月 28, 2020
作者:
L
liuyuhui
提交者:
GitHub
12月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Kunlun] bug fix of PR2: Support MultiDevicePass and BKCL in parallel executor (#29926)
上级
332da133
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
4 deletion
+9
-4
paddle/fluid/framework/ir/multi_devices_graph_pass/multi_devices_graph_pass.h
...rk/ir/multi_devices_graph_pass/multi_devices_graph_pass.h
+3
-0
paddle/fluid/framework/parallel_executor.cc
paddle/fluid/framework/parallel_executor.cc
+5
-3
paddle/fluid/platform/device_context.h
paddle/fluid/platform/device_context.h
+1
-1
未找到文件。
paddle/fluid/framework/ir/multi_devices_graph_pass/multi_devices_graph_pass.h
浏览文件 @
3d1741b7
...
@@ -39,10 +39,13 @@ class Graph;
...
@@ -39,10 +39,13 @@ class Graph;
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
#if defined(PADDLE_WITH_NCCL)
class
NCCLContextMap
;
class
NCCLContextMap
;
class
NCCLCommunicator
;
class
NCCLCommunicator
;
#elif defined(PADDLE_WITH_XPU_BKCL)
class
BKCLContextMap
;
class
BKCLContextMap
;
class
BKCLCommunicator
;
class
BKCLCommunicator
;
#endif
}
}
namespace
framework
{
namespace
framework
{
...
...
paddle/fluid/framework/parallel_executor.cc
浏览文件 @
3d1741b7
...
@@ -968,9 +968,6 @@ void ParallelExecutor::BCastParamsToDevices(
...
@@ -968,9 +968,6 @@ void ParallelExecutor::BCastParamsToDevices(
continue
;
continue
;
}
}
auto
&
dims
=
main_tensor
.
dims
();
auto
&
dims
=
main_tensor
.
dims
();
VLOG
(
1
)
<<
"bcast var="
<<
var
;
if
(
paddle
::
platform
::
is_gpu_place
(
main_tensor
.
place
()))
{
if
(
paddle
::
platform
::
is_gpu_place
(
main_tensor
.
place
()))
{
#if defined(PADDLE_WITH_NCCL)
#if defined(PADDLE_WITH_NCCL)
std
::
vector
<
void
*>
buffers
;
std
::
vector
<
void
*>
buffers
;
...
@@ -1013,6 +1010,11 @@ void ParallelExecutor::BCastParamsToDevices(
...
@@ -1013,6 +1010,11 @@ void ParallelExecutor::BCastParamsToDevices(
std
::
vector
<
void
*>
buffers
;
std
::
vector
<
void
*>
buffers
;
buffers
.
reserve
(
member_
->
places_
.
size
());
buffers
.
reserve
(
member_
->
places_
.
size
());
size_t
numel
=
main_tensor
.
numel
();
size_t
numel
=
main_tensor
.
numel
();
// TODO(liuyuhui): BKCL only support parameters using float type,
// other parameters need to be strongly converted to float before
// broadcasting,
// but broadcast is equivalent to no type of operation, does not affect
// correctness.
BKCLDataType
data_type
=
BKCL_FLOAT
;
BKCLDataType
data_type
=
BKCL_FLOAT
;
// BKCLDataType data_type = platform::ToBKCLDataType(main_tensor.type());
// BKCLDataType data_type = platform::ToBKCLDataType(main_tensor.type());
for
(
size_t
i
=
0
;
i
<
member_
->
places_
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
member_
->
places_
.
size
();
++
i
)
{
...
...
paddle/fluid/platform/device_context.h
浏览文件 @
3d1741b7
...
@@ -123,7 +123,7 @@ class XPUDeviceContext : public DeviceContext {
...
@@ -123,7 +123,7 @@ class XPUDeviceContext : public DeviceContext {
void
Wait
()
const
override
;
void
Wait
()
const
override
;
#ifdef PADDLE_WITH_XPU_BKCL
#ifdef PADDLE_WITH_XPU_BKCL
/*! \brief Return
nc
cl context. */
/*! \brief Return
bk
cl context. */
BKCLContext_t
bkcl_context
()
const
{
return
bkcl_context_
;
}
BKCLContext_t
bkcl_context
()
const
{
return
bkcl_context_
;
}
/*! \brief Set bkcl context. */
/*! \brief Set bkcl context. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录