Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
5a6cd05f
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看板
未验证
提交
5a6cd05f
编写于
6月 29, 2023
作者:
TaoTao Li
提交者:
GitHub
6月 29, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update dygraph collective process group (#54863)
* update dygraph collective fix ut * remove debug log
上级
bbcaaffd
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
132 addition
and
295 deletion
+132
-295
paddle/fluid/distributed/collective/process_group_nccl.cc
paddle/fluid/distributed/collective/process_group_nccl.cc
+122
-293
paddle/fluid/distributed/collective/process_group_nccl.h
paddle/fluid/distributed/collective/process_group_nccl.h
+5
-1
paddle/fluid/pybind/distributed_py.cc
paddle/fluid/pybind/distributed_py.cc
+1
-0
python/paddle/distributed/collective.py
python/paddle/distributed/collective.py
+4
-1
未找到文件。
paddle/fluid/distributed/collective/process_group_nccl.cc
浏览文件 @
5a6cd05f
此差异已折叠。
点击以展开。
paddle/fluid/distributed/collective/process_group_nccl.h
浏览文件 @
5a6cd05f
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "paddle/phi/backends/gpu/forwards.h"
#include "paddle/phi/backends/gpu/forwards.h"
#include "paddle/phi/common/place.h"
#include "paddle/phi/common/place.h"
#include "paddle/phi/core/device_context.h"
#include "paddle/phi/core/device_context.h"
#include "paddle/phi/core/distributed/nccl_comm_context.h"
#include "paddle/phi/core/distributed/store/store.h"
#include "paddle/phi/core/distributed/store/store.h"
namespace
paddle
{
namespace
paddle
{
...
@@ -68,6 +69,7 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
...
@@ -68,6 +69,7 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
public:
public:
static
std
::
shared_ptr
<
ProcessGroupNCCL
>
CreateProcessGroupNCCL
(
static
std
::
shared_ptr
<
ProcessGroupNCCL
>
CreateProcessGroupNCCL
(
const
std
::
shared_ptr
<
phi
::
distributed
::
Store
>&
store
,
const
std
::
shared_ptr
<
phi
::
distributed
::
Store
>&
store
,
int
device_id
,
int
rank
,
int
rank
,
int
size
,
int
size
,
int
gid
);
int
gid
);
...
@@ -219,7 +221,7 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
...
@@ -219,7 +221,7 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
void
SyncCalcStream
(
const
Place
&
place
);
void
SyncCalcStream
(
const
Place
&
place
);
std
::
shared_ptr
<
ProcessGroup
::
Task
>
RunFnInNCCLEnv
(
std
::
shared_ptr
<
ProcessGroup
::
Task
>
RunFnInNCCLEnv
(
std
::
function
<
void
(
ncclComm_t
,
gpuStream_t
)
>
fn
,
std
::
function
<
void
(
gpuStream_t
)
>
fn
,
const
phi
::
DenseTensor
&
tensor
,
const
phi
::
DenseTensor
&
tensor
,
CommType
comm_type
,
CommType
comm_type
,
bool
sync_op
,
bool
sync_op
,
...
@@ -249,6 +251,8 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
...
@@ -249,6 +251,8 @@ class ProcessGroupNCCL final : public ProcessGroupWithStream {
void
CreateNCCLManagerCache
(
const
std
::
string
&
places_key
,
void
CreateNCCLManagerCache
(
const
std
::
string
&
places_key
,
const
std
::
vector
<
Place
>&
places
);
const
std
::
vector
<
Place
>&
places
);
phi
::
distributed
::
NCCLCommContext
*
GetCommContext
();
private:
private:
std
::
shared_ptr
<
phi
::
distributed
::
Store
>
store_
;
std
::
shared_ptr
<
phi
::
distributed
::
Store
>
store_
;
...
...
paddle/fluid/pybind/distributed_py.cc
浏览文件 @
5a6cd05f
...
@@ -1238,6 +1238,7 @@ void BindDistributed(py::module *m) {
...
@@ -1238,6 +1238,7 @@ void BindDistributed(py::module *m) {
.
def_static
(
"create"
,
.
def_static
(
"create"
,
distributed
::
ProcessGroupNCCL
::
CreateProcessGroupNCCL
,
distributed
::
ProcessGroupNCCL
::
CreateProcessGroupNCCL
,
py
::
arg
(
"store"
),
py
::
arg
(
"store"
),
py
::
arg
(
"device_id"
),
py
::
arg
(
"rank"
),
py
::
arg
(
"rank"
),
py
::
arg
(
"world_size"
),
py
::
arg
(
"world_size"
),
py
::
arg
(
"group_id"
)
=
0
,
py
::
arg
(
"group_id"
)
=
0
,
...
...
python/paddle/distributed/collective.py
浏览文件 @
5a6cd05f
...
@@ -151,7 +151,10 @@ def _new_process_group_impl(
...
@@ -151,7 +151,10 @@ def _new_process_group_impl(
if
backend
==
"gloo"
:
if
backend
==
"gloo"
:
pg
=
core
.
ProcessGroupGloo
.
create
(
store
,
rank
,
world_size
,
group_id
)
pg
=
core
.
ProcessGroupGloo
.
create
(
store
,
rank
,
world_size
,
group_id
)
elif
backend
==
"nccl"
:
elif
backend
==
"nccl"
:
pg
=
core
.
ProcessGroupNCCL
.
create
(
store
,
rank
,
world_size
,
group_id
)
pg
=
core
.
ProcessGroupNCCL
.
create
(
store
,
genv
.
device_id
,
rank
,
world_size
,
group_id
)
elif
backend
==
"xccl"
:
elif
backend
==
"xccl"
:
pg
=
core
.
ProcessGroupCustom
.
create
(
pg
=
core
.
ProcessGroupCustom
.
create
(
store
,
genv
.
device_type
,
rank
,
world_size
,
group_id
store
,
genv
.
device_type
,
rank
,
world_size
,
group_id
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录