Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
eac973d1
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
eac973d1
编写于
11月 04, 2022
作者:
L
LiYuRio
提交者:
GitHub
11月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
forbid backward for comm (#47636)
上级
ac2a94c7
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
26 addition
and
83 deletion
+26
-83
paddle/fluid/operators/collective/alltoall_op.cc
paddle/fluid/operators/collective/alltoall_op.cc
+1
-19
paddle/fluid/operators/collective/alltoall_op.cu.cc
paddle/fluid/operators/collective/alltoall_op.cu.cc
+1
-1
paddle/fluid/operators/collective/c_allgather_op.cc
paddle/fluid/operators/collective/c_allgather_op.cc
+3
-19
paddle/fluid/operators/collective/c_allgather_op.cu.cc
paddle/fluid/operators/collective/c_allgather_op.cu.cc
+1
-1
paddle/fluid/operators/collective/c_allreduce_max_op.cc
paddle/fluid/operators/collective/c_allreduce_max_op.cc
+4
-7
paddle/fluid/operators/collective/c_allreduce_min_op.cc
paddle/fluid/operators/collective/c_allreduce_min_op.cc
+4
-7
paddle/fluid/operators/collective/c_allreduce_prod_op.cc
paddle/fluid/operators/collective/c_allreduce_prod_op.cc
+4
-7
paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc
paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc
+1
-1
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
+1
-1
paddle/fluid/operators/collective/c_reducescatter_op.cc
paddle/fluid/operators/collective/c_reducescatter_op.cc
+3
-17
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
+1
-1
paddle/fluid/operators/collective/recv_v2_op.cu.cc
paddle/fluid/operators/collective/recv_v2_op.cu.cc
+1
-1
paddle/fluid/operators/collective/send_v2_op.cu.cc
paddle/fluid/operators/collective/send_v2_op.cu.cc
+1
-1
未找到文件。
paddle/fluid/operators/collective/alltoall_op.cc
浏览文件 @
eac973d1
...
...
@@ -61,31 +61,13 @@ Scatter tensors from all participators to all participators.
}
};
template
<
typename
T
>
class
AllToAllOpGradMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
public:
using
framework
::
SingleGradOpMaker
<
T
>::
SingleGradOpMaker
;
protected:
void
Apply
(
GradOpPtr
<
T
>
retv
)
const
override
{
retv
->
SetType
(
"alltoall"
);
retv
->
SetInput
(
"X"
,
this
->
OutputGrad
(
"Out"
));
retv
->
SetOutput
(
"Out"
,
this
->
InputGrad
(
"X"
));
retv
->
SetAttrMap
(
this
->
Attrs
());
}
};
}
// namespace operators
}
// namespace paddle
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OPERATOR
(
alltoall
,
ops
::
AllToAllOp
,
ops
::
AllToAllOpMaker
,
ops
::
AllToAllOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
AllToAllOpGradMaker
<
paddle
::
imperative
::
OpBase
>
)
REGISTER_OP_WITHOUT_GRADIENT
(
alltoall
,
ops
::
AllToAllOp
,
ops
::
AllToAllOpMaker
)
REGISTER_OP_CPU_KERNEL
(
alltoall
,
ops
::
AllToAllOpCPUKernel
<
float
>
,
...
...
paddle/fluid/operators/collective/alltoall_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -95,7 +95,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
alltoall
,
ops
::
AllToAllOpCUDAKernel
<
float
>
,
ops
::
AllToAllOpCUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
AllToAllOpCUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
AllToAllOpCUDAKernel
<
int
>
,
...
...
paddle/fluid/operators/collective/c_allgather_op.cc
浏览文件 @
eac973d1
...
...
@@ -63,31 +63,15 @@ reference: https://docs.nvidia.com/deeplearning/sdk/nccl-developer-guide/docs/us
}
};
template
<
typename
T
>
class
CAllGatherOpGradMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
public:
using
framework
::
SingleGradOpMaker
<
T
>::
SingleGradOpMaker
;
protected:
void
Apply
(
GradOpPtr
<
T
>
retv
)
const
override
{
retv
->
SetType
(
"c_reducescatter"
);
retv
->
SetInput
(
"X"
,
this
->
OutputGrad
(
"Out"
));
retv
->
SetOutput
(
"Out"
,
this
->
InputGrad
(
"X"
));
retv
->
SetAttrMap
(
this
->
Attrs
());
}
};
}
// namespace operators
}
// namespace paddle
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OPERATOR
(
c_allgather
,
ops
::
CAllGatherOp
,
ops
::
CAllGatherOpGradMaker
<
paddle
::
framework
::
OpDesc
>
,
ops
::
CAllGatherOpGradMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
CAllGatherOpMaker
);
REGISTER_OP_WITHOUT_GRADIENT
(
c_allgather
,
ops
::
CAllGatherOp
,
ops
::
CAllGatherOpMaker
);
REGISTER_OP_CPU_KERNEL
(
c_allgather
,
ops
::
CAllGatherOpCPUKernel
<
float
>
,
...
...
paddle/fluid/operators/collective/c_allgather_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -96,7 +96,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
c_allgather
,
ops
::
CAllGatherOpCUDAKernel
<
float
>
,
ops
::
CAllGatherOpCUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
CAllGatherOpCUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
CAllGatherOpCUDAKernel
<
int
>
,
...
...
paddle/fluid/operators/collective/c_allreduce_max_op.cc
浏览文件 @
eac973d1
...
...
@@ -41,13 +41,10 @@ DECLARE_INPLACE_OP_INFERER(AllreduceMaxInplaceInferer, {"X", "Out"});
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OPERATOR
(
c_allreduce_max
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceMaxOpMaker
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
AllreduceMaxInplaceInferer
)
REGISTER_OP_WITHOUT_GRADIENT
(
c_allreduce_max
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceMaxOpMaker
,
ops
::
AllreduceMaxInplaceInferer
)
REGISTER_OP_CPU_KERNEL
(
c_allreduce_max
,
ops
::
CAllReduceOpCPUKernel
<
ops
::
kRedMax
,
float
>
,
...
...
paddle/fluid/operators/collective/c_allreduce_min_op.cc
浏览文件 @
eac973d1
...
...
@@ -41,13 +41,10 @@ DECLARE_INPLACE_OP_INFERER(AllreduceMinInplaceInferer, {"X", "Out"});
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OPERATOR
(
c_allreduce_min
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceMinOpMaker
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
AllreduceMinInplaceInferer
)
REGISTER_OP_WITHOUT_GRADIENT
(
c_allreduce_min
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceMinOpMaker
,
ops
::
AllreduceMinInplaceInferer
)
REGISTER_OP_CPU_KERNEL
(
c_allreduce_min
,
ops
::
CAllReduceOpCPUKernel
<
ops
::
kRedMin
,
float
>
,
...
...
paddle/fluid/operators/collective/c_allreduce_prod_op.cc
浏览文件 @
eac973d1
...
...
@@ -41,13 +41,10 @@ DECLARE_INPLACE_OP_INFERER(AllreduceProdInplaceInferer, {"X", "Out"});
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OPERATOR
(
c_allreduce_prod
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceProdOpMaker
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
framework
::
OpDesc
>
,
paddle
::
framework
::
EmptyGradOpMaker
<
paddle
::
imperative
::
OpBase
>
,
ops
::
AllreduceProdInplaceInferer
)
REGISTER_OP_WITHOUT_GRADIENT
(
c_allreduce_prod
,
ops
::
CAllReduceOp
,
ops
::
CAllReduceProdOpMaker
,
ops
::
AllreduceProdInplaceInferer
)
REGISTER_OP_CPU_KERNEL
(
c_allreduce_prod
,
ops
::
CAllReduceOpCPUKernel
<
ops
::
kRedProd
,
float
>
,
...
...
paddle/fluid/operators/collective/c_allreduce_sum_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -20,7 +20,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
c_allreduce_sum
,
ops
::
CAllReduceOpCUDAKernel
<
ops
::
kRedSum
,
float
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
CAllReduceOpCUDAKernel
<
ops
::
kRedSum
,
plat
::
bfloat16
>
,
#endif
ops
::
CAllReduceOpCUDAKernel
<
ops
::
kRedSum
,
double
>
,
...
...
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -108,7 +108,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
c_broadcast
,
ops
::
CBroadcastOpCUDAKernel
<
float
>
,
ops
::
CBroadcastOpCUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
CBroadcastOpCUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
CBroadcastOpCUDAKernel
<
int
>
,
...
...
paddle/fluid/operators/collective/c_reducescatter_op.cc
浏览文件 @
eac973d1
...
...
@@ -66,29 +66,15 @@ Reference: https://docs.nvidia.com/deeplearning/sdk/nccl-developer-guide/docs/us
}
};
template
<
typename
T
>
class
CReduceScatterOpGradMaker
:
public
framework
::
SingleGradOpMaker
<
T
>
{
public:
using
framework
::
SingleGradOpMaker
<
T
>::
SingleGradOpMaker
;
protected:
void
Apply
(
GradOpPtr
<
T
>
retv
)
const
override
{
retv
->
SetType
(
"c_allgather"
);
retv
->
SetInput
(
"X"
,
this
->
OutputGrad
(
"Out"
));
retv
->
SetOutput
(
"Out"
,
this
->
InputGrad
(
"X"
));
retv
->
SetAttrMap
(
this
->
Attrs
());
}
};
}
// namespace operators
}
// namespace paddle
namespace
ops
=
paddle
::
operators
;
namespace
plat
=
paddle
::
platform
;
REGISTER_OP
ERATOR
(
c_reducescatter
,
ops
::
CReduceScatterOp
,
ops
::
CReduceScatterOpMaker
);
REGISTER_OP
_WITHOUT_GRADIENT
(
c_reducescatter
,
ops
::
CReduceScatterOp
,
ops
::
CReduceScatterOpMaker
);
REGISTER_OP_CPU_KERNEL
(
c_reducescatter
,
ops
::
CReduceScatterOpCPUKernel
<
float
>
,
...
...
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -84,7 +84,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
c_reducescatter
,
ops
::
CReduceScatterOpCUDAKernel
<
float
>
,
ops
::
CReduceScatterOpCUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
CReduceScatterOpCUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
CReduceScatterOpCUDAKernel
<
int
>
,
...
...
paddle/fluid/operators/collective/recv_v2_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -236,7 +236,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
recv_v2
,
ops
::
RecvOpV2CUDAKernel
<
float
>
,
ops
::
RecvOpV2CUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
RecvOpV2CUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
RecvOpV2CUDAKernel
<
int
>
,
...
...
paddle/fluid/operators/collective/send_v2_op.cu.cc
浏览文件 @
eac973d1
...
...
@@ -221,7 +221,7 @@ namespace plat = paddle::platform;
REGISTER_OP_CUDA_KERNEL
(
send_v2
,
ops
::
SendOpV2CUDAKernel
<
float
>
,
ops
::
SendOpV2CUDAKernel
<
double
>
,
#if
CUDNN_VERSION_MIN(8, 1, 0) &&
NCCL_VERSION_CODE >= 21000
#if NCCL_VERSION_CODE >= 21000
ops
::
SendOpV2CUDAKernel
<
plat
::
bfloat16
>
,
#endif
ops
::
SendOpV2CUDAKernel
<
int
>
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录