Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
4593597d
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看板
未验证
提交
4593597d
编写于
5月 04, 2021
作者:
B
Baibaifan
提交者:
GitHub
5月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add_c_sync_npu_kernel (#32687) (#32723)
上级
6a1957e7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
8 deletion
+10
-8
paddle/fluid/operators/collective/c_sync_calc_stream_op.cc
paddle/fluid/operators/collective/c_sync_calc_stream_op.cc
+4
-3
paddle/fluid/operators/collective/c_sync_calc_stream_op_npu_test.cc
...id/operators/collective/c_sync_calc_stream_op_npu_test.cc
+1
-1
paddle/fluid/operators/collective/c_sync_comm_stream_op.cc
paddle/fluid/operators/collective/c_sync_comm_stream_op.cc
+4
-3
paddle/fluid/operators/collective/c_sync_comm_stream_op_npu_test.cc
...id/operators/collective/c_sync_comm_stream_op_npu_test.cc
+1
-1
未找到文件。
paddle/fluid/operators/collective/c_sync_calc_stream_op.cc
浏览文件 @
4593597d
...
@@ -46,7 +46,7 @@ Call calculation stream synchronization.
...
@@ -46,7 +46,7 @@ Call calculation stream synchronization.
};
};
template
<
typename
T
>
template
<
typename
T
>
class
CSyncCalcStream
Cuda
Kernel
:
public
framework
::
OpKernel
<
T
>
{
class
CSyncCalcStreamKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
#if (defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)) && !defined(_WIN32)
#if (defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)) && !defined(_WIN32)
...
@@ -86,5 +86,6 @@ namespace ops = paddle::operators;
...
@@ -86,5 +86,6 @@ namespace ops = paddle::operators;
REGISTER_OP_WITHOUT_GRADIENT
(
c_sync_calc_stream
,
ops
::
CSyncCalcStreamOp
,
REGISTER_OP_WITHOUT_GRADIENT
(
c_sync_calc_stream
,
ops
::
CSyncCalcStreamOp
,
ops
::
CSyncCalcStreamOpMaker
);
ops
::
CSyncCalcStreamOpMaker
);
REGISTER_OP_CUDA_KERNEL
(
c_sync_calc_stream
,
REGISTER_OP_CUDA_KERNEL
(
c_sync_calc_stream
,
ops
::
CSyncCalcStreamKernel
<
float
>
);
ops
::
CSyncCalcStreamCudaKernel
<
float
>
);
REGISTER_OP_NPU_KERNEL
(
c_sync_calc_stream
,
ops
::
CSyncCalcStreamKernel
<
float
>
);
paddle/fluid/operators/collective/c_sync_calc_stream_op_npu_test.cc
浏览文件 @
4593597d
...
@@ -35,7 +35,7 @@ namespace m = paddle::operators::math;
...
@@ -35,7 +35,7 @@ namespace m = paddle::operators::math;
USE_OP
(
elementwise_add
);
USE_OP
(
elementwise_add
);
USE_OP_DEVICE_KERNEL
(
elementwise_add
,
NPU
);
USE_OP_DEVICE_KERNEL
(
elementwise_add
,
NPU
);
USE_
NO_KERNEL_OP
(
c_sync_calc_stream
);
USE_
OP_DEVICE_KERNEL
(
c_sync_calc_stream
,
NPU
);
template
<
typename
T
>
template
<
typename
T
>
void
Compare
(
f
::
Scope
*
scope
,
const
p
::
DeviceContext
&
ctx
)
{
void
Compare
(
f
::
Scope
*
scope
,
const
p
::
DeviceContext
&
ctx
)
{
...
...
paddle/fluid/operators/collective/c_sync_comm_stream_op.cc
浏览文件 @
4593597d
...
@@ -58,7 +58,7 @@ Call communication stream synchronization.
...
@@ -58,7 +58,7 @@ Call communication stream synchronization.
};
};
template
<
typename
T
>
template
<
typename
T
>
class
CSyncCommStream
Cuda
Kernel
:
public
framework
::
OpKernel
<
T
>
{
class
CSyncCommStreamKernel
:
public
framework
::
OpKernel
<
T
>
{
public:
public:
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
void
Compute
(
const
framework
::
ExecutionContext
&
ctx
)
const
override
{
auto
place
=
ctx
.
GetPlace
();
auto
place
=
ctx
.
GetPlace
();
...
@@ -97,5 +97,6 @@ namespace ops = paddle::operators;
...
@@ -97,5 +97,6 @@ namespace ops = paddle::operators;
REGISTER_OP_WITHOUT_GRADIENT
(
c_sync_comm_stream
,
ops
::
CSyncCommStreamOp
,
REGISTER_OP_WITHOUT_GRADIENT
(
c_sync_comm_stream
,
ops
::
CSyncCommStreamOp
,
ops
::
CSyncCommStreamOpMaker
);
ops
::
CSyncCommStreamOpMaker
);
REGISTER_OP_CUDA_KERNEL
(
c_sync_comm_stream
,
REGISTER_OP_CUDA_KERNEL
(
c_sync_comm_stream
,
ops
::
CSyncCommStreamKernel
<
float
>
);
ops
::
CSyncCommStreamCudaKernel
<
float
>
);
REGISTER_OP_NPU_KERNEL
(
c_sync_comm_stream
,
ops
::
CSyncCommStreamKernel
<
float
>
);
paddle/fluid/operators/collective/c_sync_comm_stream_op_npu_test.cc
浏览文件 @
4593597d
...
@@ -43,7 +43,7 @@ namespace p = paddle::platform;
...
@@ -43,7 +43,7 @@ namespace p = paddle::platform;
namespace
m
=
paddle
::
operators
::
math
;
namespace
m
=
paddle
::
operators
::
math
;
USE_OP
(
c_broadcast
);
USE_OP
(
c_broadcast
);
USE_
NO_KERNEL_OP
(
c_sync_comm_stream
);
USE_
OP_DEVICE_KERNEL
(
c_sync_comm_stream
,
NPU
);
USE_NO_KERNEL_OP
(
c_gen_hccl_id
);
USE_NO_KERNEL_OP
(
c_gen_hccl_id
);
USE_NO_KERNEL_OP
(
c_comm_init_hccl
);
USE_NO_KERNEL_OP
(
c_comm_init_hccl
);
USE_OP_DEVICE_KERNEL
(
c_broadcast
,
NPU
);
USE_OP_DEVICE_KERNEL
(
c_broadcast
,
NPU
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录