Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ea04bef8
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
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看板
未验证
提交
ea04bef8
编写于
4月 17, 2023
作者:
K
Kim Yann
提交者:
GitHub
4月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rem cncl keyword in py (#52939)
上级
d2b0d63f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
2 addition
and
55 deletion
+2
-55
python/paddle/distributed/fleet/launch.py
python/paddle/distributed/fleet/launch.py
+1
-1
python/paddle/distributed/fleet/launch_utils.py
python/paddle/distributed/fleet/launch_utils.py
+0
-1
python/paddle/distributed/parallel.py
python/paddle/distributed/parallel.py
+1
-1
python/paddle/distributed/spawn.py
python/paddle/distributed/spawn.py
+0
-43
python/paddle/distributed/utils/launch_utils.py
python/paddle/distributed/utils/launch_utils.py
+0
-9
未找到文件。
python/paddle/distributed/fleet/launch.py
浏览文件 @
ea04bef8
...
...
@@ -757,7 +757,7 @@ def launch():
check_backend
(
args
.
backend
)
distribute_mode
=
DistributeMode
.
COLLECTIVE
# assert args.backend in ['gloo', 'nccl', 'bkcl', '
cncl', '
heter', 'unknown']
# assert args.backend in ['gloo', 'nccl', 'bkcl', 'heter', 'unknown']
if
args
.
backend
==
'gloo'
:
logger
.
warning
(
"launch start with CPUONLY mode"
)
...
...
python/paddle/distributed/fleet/launch_utils.py
浏览文件 @
ea04bef8
...
...
@@ -1986,7 +1986,6 @@ def check_backend(backend):
'nccl'
,
'gloo'
,
'bkcl'
,
'cncl'
,
'auto'
,
'heter'
,
'xccl'
,
...
...
python/paddle/distributed/parallel.py
浏览文件 @
ea04bef8
...
...
@@ -886,7 +886,7 @@ def _start_kv_server(port, http_server_d, size):
def
_is_cpuonly
(
backend
):
check_backend
(
backend
)
if
(
backend
in
[
'auto'
,
'nccl'
,
'bkcl'
,
'heter'
,
'cncl'
]
backend
in
[
'auto'
,
'nccl'
,
'bkcl'
,
'heter'
]
and
(
core
.
is_compiled_with_cuda
()
or
core
.
is_compiled_with_xpu
())
)
or
backend
==
'xccl'
:
...
...
python/paddle/distributed/spawn.py
浏览文件 @
ea04bef8
...
...
@@ -126,8 +126,6 @@ def _get_default_backend():
return
'nccl'
elif
'xpu'
in
device
:
return
'bkcl'
elif
'mlu'
in
device
:
return
'cncl'
elif
'cpu'
in
device
:
return
'gloo'
else
:
...
...
@@ -259,45 +257,6 @@ def _get_subprocess_env_list(nprocs, options):
"XPU_VISIBLE_DEVICES (%s)."
%
(
card_id
,
","
.
join
(
env_devices_list
))
)
elif
options
[
'backend'
]
==
'cncl'
:
args
.
selected_devices
=
options
.
get
(
'mlus'
,
None
)
if
args
.
selected_devices
is
None
:
args
.
selected_devices
=
options
.
get
(
'selected_devices'
,
None
)
env_devices
=
os
.
getenv
(
"MLU_VISIBLE_DEVICES"
,
None
)
if
env_devices
is
None
or
env_devices
==
""
:
env_devices_list
=
[
str
(
x
)
for
x
in
range
(
core
.
get_custom_device_count
(
'mlu'
))
]
else
:
env_devices_list
=
env_devices
.
split
(
','
)
if
args
.
selected_devices
is
None
:
if
len
(
env_devices_list
)
<
nprocs
:
raise
RuntimeError
(
"the number of visible devices(%d) is less than the number "
"of spawn processes(%d), please ensure that the correct "
"`nprocs` argument is passed or the environment variable "
"`MLU_VISIBLE_DEVICES` is correctly configured."
%
(
len
(
env_devices_list
),
nprocs
)
)
args
.
selected_devices
=
","
.
join
(
[
str
(
env_devices_list
[
x
])
for
x
in
range
(
0
,
nprocs
)]
)
else
:
selected_device_list
=
args
.
selected_devices
.
split
(
','
)
if
len
(
selected_device_list
)
!=
nprocs
:
raise
ValueError
(
"The number of selected devices(%s) is not equal to "
"the number of spawn processes(%d), please ensure that the "
"correct `nprocs` and `mlus` arguments are passed."
%
(
len
(
selected_device_list
),
nprocs
)
)
for
card_id
in
selected_device_list
:
if
card_id
not
in
env_devices_list
:
raise
ValueError
(
"The selected mlu card %s cannot found in "
"MLU_VISIBLE_DEVICES (%s)."
%
(
card_id
,
","
.
join
(
env_devices_list
))
)
elif
options
[
'backend'
]
==
'gloo'
:
# TODO check gpu / xpu flag must not exist
warnings
.
warn
(
...
...
@@ -372,8 +331,6 @@ def _set_trainer_env(env_dict, backend):
set_flags
({
'FLAGS_selected_gpus'
:
env_dict
[
'FLAGS_selected_gpus'
]})
elif
backend
==
'bkcl'
:
set_flags
({
'FLAGS_selected_xpus'
:
env_dict
[
'FLAGS_selected_xpus'
]})
elif
backend
==
'cncl'
:
set_flags
({
'FLAGS_selected_mlus'
:
env_dict
[
'FLAGS_selected_mlus'
]})
else
:
# NOTE(xiongkun) why not raise Error ?
# So far, we added support for CPU parallel, and will be applied when paddle is not
...
...
python/paddle/distributed/utils/launch_utils.py
浏览文件 @
ea04bef8
...
...
@@ -427,15 +427,6 @@ def _prepare_trainer_env(cluster, trainer, backend=None):
"PADDLE_TRAINERS_NUM"
:
"%d"
%
cluster
.
trainers_nranks
(),
"PADDLE_TRAINER_ENDPOINTS"
:
","
.
join
(
cluster
.
trainers_endpoints
()),
}
elif
backend
==
'cncl'
:
proc_env
=
{
"FLAGS_selected_mlus"
:
"%s"
%
","
.
join
([
str
(
g
)
for
g
in
trainer
.
gpus
]),
"PADDLE_TRAINER_ID"
:
"%d"
%
trainer
.
rank
,
"PADDLE_CURRENT_ENDPOINT"
:
"%s"
%
trainer
.
endpoint
,
"PADDLE_TRAINERS_NUM"
:
"%d"
%
cluster
.
trainers_nranks
(),
"PADDLE_TRAINER_ENDPOINTS"
:
","
.
join
(
cluster
.
trainers_endpoints
()),
}
elif
backend
==
'gloo'
:
# NOTE (xiongkun) default fall back into cpu only
proc_env
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录