Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
dbbcc43c
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dbbcc43c
编写于
9月 23, 2020
作者:
M
MrChengmo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
1c57d554
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
16 deletion
+23
-16
paddle/fluid/framework/distributed_strategy.proto
paddle/fluid/framework/distributed_strategy.proto
+1
-0
python/paddle/distributed/fleet/base/role_maker.py
python/paddle/distributed/fleet/base/role_maker.py
+1
-1
python/paddle/distributed/fleet/launch_utils.py
python/paddle/distributed/fleet/launch_utils.py
+21
-15
未找到文件。
paddle/fluid/framework/distributed_strategy.proto
浏览文件 @
dbbcc43c
...
...
@@ -97,6 +97,7 @@ message AsyncConfig {
optional
int32
thread_pool_size
=
6
[
default
=
1
];
optional
int32
send_wait_times
=
7
[
default
=
1
];
optional
bool
runtime_split_send_recv
=
8
[
default
=
false
];
optional
string
worker_device
=
9
[
default
=
'cpu'
];
}
message
PipelineConfig
{
optional
int32
micro_batch
=
1
[
default
=
1
];
}
...
...
python/paddle/distributed/fleet/base/role_maker.py
浏览文件 @
dbbcc43c
...
...
@@ -736,7 +736,7 @@ class PaddleCloudRoleMaker(RoleMakerBase):
elif
training_role
==
"HETER_TRAINER"
:
role
=
Role
.
HETER_WORKER
cur_port
=
os
.
getenv
(
"PADDLE_PORT"
,
None
)
assert
port
!=
None
assert
cur_
port
!=
None
cur_ip
=
os
.
getenv
(
"POD_IP"
,
None
)
assert
cur_ip
!=
None
curr_endpoint
=
":"
.
join
([
cur_ip
,
cur_port
])
...
...
python/paddle/distributed/fleet/launch_utils.py
浏览文件 @
dbbcc43c
...
...
@@ -621,15 +621,15 @@ class ParameterServerLauncher(object):
self
.
worker_num
=
0
self
.
heter_worker_num
=
0
self
.
server_endpoints
=
[]
self
.
server_endpoints
=
""
self
.
server_endpoints_ips
=
[]
self
.
server_endpoints_port
=
[]
self
.
worker_endpoints
=
[]
self
.
worker_endpoints
=
""
self
.
worker_endpoints_ips
=
[]
self
.
worker_endpoints_port
=
[]
self
.
heter_worker_endpoints
=
[]
self
.
heter_worker_endpoints
=
""
self
.
heter_worker_endpoints_ips
=
[]
self
.
heter_worker_endpoints_port
=
[]
...
...
@@ -730,7 +730,11 @@ class ParameterServerLauncher(object):
self
.
current_node_ip
=
self
.
node_ips
[
0
]
else
:
self
.
is_local
=
False
_
,
self
.
current_node_ip
=
get_host_name_ip
()
pod_ip
=
os
.
getenv
(
"POD_IP"
,
None
)
if
pod_ip
==
None
:
_
,
self
.
current_node_ip
=
get_host_name_ip
()
else
:
self
.
current_node_ip
=
pod_ip
assert
self
.
current_node_ip
in
self
.
node_ips
,
"Can't find your local ip {%s} in args.servers and args.workers ips: {%s}"
\
%
(
self
.
current_node_ip
,
self
.
node_ips
)
self
.
node_rank
=
self
.
node_ips
.
index
(
self
.
current_node_ip
)
...
...
@@ -803,16 +807,18 @@ class ParameterServerLauncher(object):
logger
.
info
(
"all workers exit, going to finish parameter server and heter_worker"
)
if
len
(
self
.
procs
[
"server"
])
>
0
:
for
i
,
proc
in
enumerate
(
self
.
procs
[
"server"
]):
self
.
log_fns
[
"server"
][
i
].
close
()
self
.
procs
[
"server"
][
i
].
proc
.
terminate
()
logger
.
info
(
"all parameter server are killed"
)
if
len
(
self
.
procs
[
"heter_worker"
])
>
0
:
for
i
,
proc
in
enumerate
(
self
.
procs
[
"heter_worker"
]):
self
.
log_fns
[
"heter_worker"
][
i
].
close
()
self
.
procs
[
"heter_worker"
][
i
].
proc
.
terminate
()
logger
.
info
(
"all heter_worker are killed"
)
if
len
(
self
.
procs
[
"server"
])
>
0
:
for
i
,
proc
in
enumerate
(
self
.
procs
[
"server"
]):
self
.
log_fns
[
"server"
][
i
].
close
()
self
.
procs
[
"server"
][
i
].
proc
.
terminate
()
logger
.
info
(
"all parameter server are killed"
)
else
:
# if node has not worker procs
# blocking training process
...
...
@@ -909,8 +915,8 @@ class ParameterServerLauncher(object):
"PADDLE_WITH_GLOO"
:
"1"
,
"PADDLE_GLOO_RENDEZVOUS"
:
"2"
,
"PADDLE_GLOO_FS_PATH"
:
self
.
gloo_rendezvous_dir
,
"FLAGS_selected_gpus"
:
0
,
"FLAGS_selected_xpus"
:
0
,
"FLAGS_selected_gpus"
:
"0"
,
"FLAGS_selected_xpus"
:
"0"
,
"CUDA_VISIBLE_DEVICES"
:
device_id
,
"XPU_VISIBLE_DEVICES"
:
device_id
,
}
...
...
@@ -978,8 +984,8 @@ class ParameterServerLauncher(object):
"PADDLE_WITH_GLOO"
:
"1"
,
"PADDLE_GLOO_RENDEZVOUS"
:
"2"
,
"PADDLE_GLOO_FS_PATH"
:
self
.
gloo_rendezvous_dir
,
"FLAGS_selected_gpus"
:
device_id
,
"FLAGS_selected_xpus"
:
device_id
,
"FLAGS_selected_gpus"
:
"0"
,
"FLAGS_selected_xpus"
:
"0"
,
"CUDA_VISIBLE_DEVICES"
:
device_id
,
"XPU_VISIBLE_DEVICES"
:
device_id
,
}
...
...
@@ -991,9 +997,9 @@ class ParameterServerLauncher(object):
if
idx
==
0
:
logger
.
info
(
"Local
serv
er start {} processes. First process distributed "
"Local
heter_work
er start {} processes. First process distributed "
"environment info (Only For Debug): {}"
.
format
(
len
(
pod
.
serv
ers
),
len
(
pod
.
heter_work
ers
),
pretty_print_envs
(
proc_env
,
(
"Distributed Envs"
,
"Value"
))))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录