Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
a66bb67a
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看板
未验证
提交
a66bb67a
编写于
11月 29, 2022
作者:
J
JZ-LIANG
提交者:
GitHub
11月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Bugfix for Collective default calc stream (#48308)
* get default calc stream from execution ctx instead of global dev ctx pool.
上级
fc882c7b
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
34 addition
and
32 deletion
+34
-32
paddle/fluid/operators/collective/alltoall_op.cu.cc
paddle/fluid/operators/collective/alltoall_op.cu.cc
+2
-2
paddle/fluid/operators/collective/barrier_op.cu.cc
paddle/fluid/operators/collective/barrier_op.cu.cc
+2
-2
paddle/fluid/operators/collective/c_allgather_op.cu.cc
paddle/fluid/operators/collective/c_allgather_op.cu.cc
+2
-2
paddle/fluid/operators/collective/c_allreduce_op.h
paddle/fluid/operators/collective/c_allreduce_op.h
+4
-2
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
+2
-2
paddle/fluid/operators/collective/c_concat_op.cu.cc
paddle/fluid/operators/collective/c_concat_op.cu.cc
+2
-2
paddle/fluid/operators/collective/c_reduce_op.h
paddle/fluid/operators/collective/c_reduce_op.h
+2
-2
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
+2
-2
paddle/fluid/operators/collective/c_scatter_op.cu.cc
paddle/fluid/operators/collective/c_scatter_op.cu.cc
+2
-2
paddle/fluid/operators/collective/global_gather_op.cu.cc
paddle/fluid/operators/collective/global_gather_op.cu.cc
+2
-2
paddle/fluid/operators/collective/global_scatter_op.cu.cc
paddle/fluid/operators/collective/global_scatter_op.cu.cc
+2
-2
paddle/fluid/operators/collective/partial_allgather_op.cu.cc
paddle/fluid/operators/collective/partial_allgather_op.cu.cc
+2
-2
paddle/fluid/operators/collective/partial_recv_op.cu.cc
paddle/fluid/operators/collective/partial_recv_op.cu.cc
+2
-2
paddle/fluid/operators/collective/partial_send_op.cu.cc
paddle/fluid/operators/collective/partial_send_op.cu.cc
+2
-2
paddle/fluid/operators/collective/recv_v2_op.cu.cc
paddle/fluid/operators/collective/recv_v2_op.cu.cc
+2
-2
paddle/fluid/operators/collective/send_v2_op.cu.cc
paddle/fluid/operators/collective/send_v2_op.cu.cc
+2
-2
未找到文件。
paddle/fluid/operators/collective/alltoall_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -46,8 +46,8 @@ class AllToAllOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/barrier_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -39,8 +39,8 @@ class BarrierOpCUDAKernel : public framework::OpKernel<T> {
int
rid
=
ctx
.
Attr
<
int
>
(
"ring_id"
);
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
auto
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
auto
stream
=
ctx
.
cuda_device_context
().
stream
();
ncclRedOp_t
nccl_red_type
=
ncclSum
;
PADDLE_ENFORCE_GPU_SUCCESS
(
platform
::
dynload
::
ncclAllReduce
(
sendbuff
,
recvbuff
,
numel
,
dtype
,
nccl_red_type
,
comm
->
comm
(),
stream
));
...
...
paddle/fluid/operators/collective/c_allgather_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -67,8 +67,8 @@ class CAllGatherOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/c_allreduce_op.h
浏览文件 @
a66bb67a
...
...
@@ -482,8 +482,10 @@ class CAllReduceOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should not use global ctx for calc stream.
// auto dev_ctx = platform::DeviceContextPool::Instance().Get(place);
// stream = static_cast<phi::GPUContext*>(dev_ctx)->stream();
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/c_broadcast_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -53,8 +53,8 @@ class CBroadcastOpCUDAKernel : public framework::OpKernel<T> {
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/c_concat_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -89,8 +89,8 @@ class CConcatOpCUDAKernel : public framework::OpKernel<T> {
const
T
*
send_buff
=
x
->
data
<
T
>
();
T
*
recv_buff
=
temp_out
.
data
<
T
>
();
gpuStream_t
stream
=
nullptr
;
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
PADDLE_ENFORCE_GPU_SUCCESS
(
platform
::
dynload
::
ncclAllGather
(
send_buff
,
...
...
paddle/fluid/operators/collective/c_reduce_op.h
浏览文件 @
a66bb67a
...
...
@@ -311,8 +311,8 @@ class CReduceOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/c_reducescatter_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -54,8 +54,8 @@ class CReduceScatterOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/c_scatter_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -60,8 +60,8 @@ class CScatterOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/global_gather_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -82,8 +82,8 @@ struct GlobalGatherFunctor<phi::GPUContext, T> {
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
ring_id
,
place
);
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/global_scatter_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -81,8 +81,8 @@ struct GlobalScatterFunctor<phi::GPUContext, T> {
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
ring_id
,
place
);
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/partial_allgather_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -75,8 +75,8 @@ class PartialAllGatherOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/partial_recv_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -81,8 +81,8 @@ class PartialRecvOpCUDAKernel : public framework::OpKernel<T> {
gpuStream_t
stream
=
nullptr
;
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/partial_send_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -77,8 +77,8 @@ class PartialSendCUDAKernel : public framework::OpKernel<T> {
auto
place
=
ctx
.
GetPlace
();
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/recv_v2_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -157,8 +157,8 @@ class RecvOpV2CUDAKernel : public framework::OpKernel<T> {
}
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
paddle/fluid/operators/collective/send_v2_op.cu.cc
浏览文件 @
a66bb67a
...
...
@@ -151,8 +151,8 @@ class SendOpV2CUDAKernel : public framework::OpKernel<T> {
auto
place
=
ctx
.
GetPlace
();
auto
comm
=
platform
::
NCCLCommContext
::
Instance
().
Get
(
rid
,
place
);
if
(
ctx
.
Attr
<
bool
>
(
"use_calc_stream"
))
{
auto
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
stream
=
static_cast
<
phi
::
GPUContext
*>
(
dev_ctx
)
->
stream
();
// should ExecutionContext for calc stream.
stream
=
ctx
.
cuda_device_context
().
stream
();
}
else
{
stream
=
comm
->
stream
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录