Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
e78d7f57
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e78d7f57
编写于
10月 27, 2019
作者:
W
WangXi
提交者:
gongweibao
10月 27, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Print the rank which trainer is error in launch.py, test=develop (#20838)
上级
48669aa8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
16 addition
and
5 deletion
+16
-5
python/paddle/distributed/launch.py
python/paddle/distributed/launch.py
+16
-5
未找到文件。
python/paddle/distributed/launch.py
浏览文件 @
e78d7f57
...
@@ -51,7 +51,7 @@ logger = logging.getLogger()
...
@@ -51,7 +51,7 @@ logger = logging.getLogger()
logger
.
setLevel
(
logging
.
INFO
)
logger
.
setLevel
(
logging
.
INFO
)
log_handler
=
logging
.
StreamHandler
()
log_handler
=
logging
.
StreamHandler
()
log_format
=
logging
.
Formatter
(
log_format
=
logging
.
Formatter
(
'%(
asctime)s - %(filename)s:%(lineno)d - %(levelname)s:
%(message)s'
)
'%(
levelname)s %(asctime)s %(filename)s:%(lineno)d]
%(message)s'
)
log_handler
.
setFormatter
(
log_format
)
log_handler
.
setFormatter
(
log_format
)
logger
.
addHandler
(
log_handler
)
logger
.
addHandler
(
log_handler
)
...
@@ -214,10 +214,14 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
...
@@ -214,10 +214,14 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
procs
=
[]
procs
=
[]
cmds
=
[]
cmds
=
[]
ranks
=
[]
for
i
in
range
(
0
,
selected_gpus_num
):
for
i
in
range
(
0
,
selected_gpus_num
):
rank
=
(
node_id
*
selected_gpus_num
+
i
)
current_env
.
update
({
current_env
.
update
({
"FLAGS_selected_gpus"
:
"%s"
%
selected_gpus
[
i
],
"FLAGS_selected_gpus"
:
"%s"
%
selected_gpus
[
i
],
"PADDLE_TRAINER_ID"
:
"%d"
%
(
node_id
*
selected_gpus_num
+
i
)
,
"PADDLE_TRAINER_ID"
:
"%d"
%
rank
,
"PADDLE_CURRENT_ENDPOINT"
:
"PADDLE_CURRENT_ENDPOINT"
:
"%s:%d"
%
(
current_node_ip
,
args
.
started_port
+
i
),
"%s:%d"
%
(
current_node_ip
,
args
.
started_port
+
i
),
"PADDLE_TRAINERS_NUM"
:
"%d"
%
nranks
,
"PADDLE_TRAINERS_NUM"
:
"%d"
%
nranks
,
...
@@ -242,19 +246,22 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
...
@@ -242,19 +246,22 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
proc
=
subprocess
.
Popen
(
cmd
,
env
=
current_env
)
proc
=
subprocess
.
Popen
(
cmd
,
env
=
current_env
)
procs
.
append
(
proc
)
procs
.
append
(
proc
)
ranks
.
append
(
rank
)
try
:
try
:
alive
=
True
alive
=
True
error
=
False
error
=
False
error_rank
=
[]
# wait all process finish or one error
# wait all process finish or one error
while
alive
and
not
error
:
while
alive
and
not
error
:
alive
=
False
alive
=
False
for
p
in
procs
:
for
rank
,
p
in
zip
(
ranks
,
procs
)
:
ret
=
p
.
poll
()
ret
=
p
.
poll
()
if
ret
is
None
:
if
ret
is
None
:
alive
=
True
alive
=
True
elif
ret
!=
0
:
elif
ret
!=
0
:
error
=
True
error
=
True
error_rank
.
append
(
rank
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
if
error
:
if
error
:
...
@@ -266,11 +273,15 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
...
@@ -266,11 +273,15 @@ paddlecloud environment.".format(args.cluster_node_ips, node_ips))
terminate_procs
(
procs
)
terminate_procs
(
procs
)
raise
raise
except
SystemExit
:
except
SystemExit
:
logger
.
error
(
"One trainer process abort, exit"
)
logger
.
error
(
"ABORT!!! Out of all {} trainers, the trainer process with rank={} was aborted. Please check its log."
.
format
(
nranks
,
error_rank
))
terminate_procs
(
procs
)
terminate_procs
(
procs
)
raise
raise
except
:
except
:
logger
.
error
(
"Trainer process abort, exit"
)
logger
.
error
(
"ABORT!!! Out of all {} trainers, the trainer process with rank={} was aborted. Please check its log."
.
format
(
nranks
,
error_rank
))
terminate_procs
(
procs
)
terminate_procs
(
procs
)
raise
raise
finally
:
finally
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录