Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
0e07f20e
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
0e07f20e
编写于
9月 28, 2021
作者:
K
kuizhiqing
提交者:
GitHub
9月 28, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
py2 to py3 bug and iface fix for pslib (#36102)
上级
53f9768d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
12 addition
and
10 deletion
+12
-10
python/paddle/fluid/incubate/fleet/base/role_maker.py
python/paddle/fluid/incubate/fleet/base/role_maker.py
+8
-7
python/paddle/fluid/incubate/fleet/parameter_server/pslib/__init__.py
...e/fluid/incubate/fleet/parameter_server/pslib/__init__.py
+1
-0
python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py
...ncubate/fleet/parameter_server/pslib/optimizer_factory.py
+1
-1
python/paddle/fluid/incubate/fleet/utils/hdfs.py
python/paddle/fluid/incubate/fleet/utils/hdfs.py
+2
-2
未找到文件。
python/paddle/fluid/incubate/fleet/base/role_maker.py
浏览文件 @
0e07f20e
...
@@ -383,7 +383,7 @@ class MPISymetricRoleMaker(MPIRoleMaker):
...
@@ -383,7 +383,7 @@ class MPISymetricRoleMaker(MPIRoleMaker):
return the current number of worker
return the current number of worker
"""
"""
if
self
.
_check_role_generation
():
if
self
.
_check_role_generation
():
return
self
.
_get_size
()
/
self
.
_proc_per_node
return
int
(
self
.
_get_size
()
/
self
.
_proc_per_node
)
return
0
return
0
def
_server_num
(
self
):
def
_server_num
(
self
):
...
@@ -391,30 +391,30 @@ class MPISymetricRoleMaker(MPIRoleMaker):
...
@@ -391,30 +391,30 @@ class MPISymetricRoleMaker(MPIRoleMaker):
return the current number of server
return the current number of server
"""
"""
if
self
.
_check_role_generation
():
if
self
.
_check_role_generation
():
return
self
.
_get_size
()
/
self
.
_proc_per_node
return
int
(
self
.
_get_size
()
/
self
.
_proc_per_node
)
else
:
else
:
self
.
generate_role
()
self
.
generate_role
()
return
self
.
_get_size
()
/
self
.
_proc_per_node
return
int
(
self
.
_get_size
()
/
self
.
_proc_per_node
)
def
worker_index
(
self
):
def
worker_index
(
self
):
"""
"""
return the index of worker
return the index of worker
"""
"""
if
self
.
_check_role_generation
():
if
self
.
_check_role_generation
():
return
self
.
_rank
/
self
.
_proc_per_node
return
int
(
self
.
_rank
/
self
.
_proc_per_node
)
else
:
else
:
self
.
generate_role
()
self
.
generate_role
()
return
self
.
_get_size
()
/
2
return
int
(
self
.
_get_size
()
/
2
)
def
server_index
(
self
):
def
server_index
(
self
):
"""
"""
return the index of server
return the index of server
"""
"""
if
self
.
_check_role_generation
():
if
self
.
_check_role_generation
():
return
self
.
_rank
/
self
.
_proc_per_node
return
int
(
self
.
_rank
/
self
.
_proc_per_node
)
else
:
else
:
self
.
generate_role
()
self
.
generate_role
()
return
self
.
_get_size
()
/
self
.
_proc_per_node
return
int
(
self
.
_get_size
()
/
self
.
_proc_per_node
)
def
_all_reduce
(
self
,
input
,
output
,
mode
=
"sum"
):
def
_all_reduce
(
self
,
input
,
output
,
mode
=
"sum"
):
"""
"""
...
@@ -612,6 +612,7 @@ class GeneralRoleMaker(RoleMakerBase):
...
@@ -612,6 +612,7 @@ class GeneralRoleMaker(RoleMakerBase):
# set running status of http server
# set running status of http server
self
.
_http_server_d
[
"running"
]
=
False
self
.
_http_server_d
[
"running"
]
=
False
self
.
_iface
=
self
.
__get_default_iface
()
self
.
_iface
=
self
.
__get_default_iface
()
self
.
_iface
=
""
if
self
.
_iface
==
"lo"
else
self
.
_iface
# this environment variable can be empty
# this environment variable can be empty
self
.
_prefix
=
os
.
getenv
(
"SYS_JOB_ID"
,
""
)
self
.
_prefix
=
os
.
getenv
(
"SYS_JOB_ID"
,
""
)
...
...
python/paddle/fluid/incubate/fleet/parameter_server/pslib/__init__.py
浏览文件 @
0e07f20e
...
@@ -270,6 +270,7 @@ class PSLib(Fleet):
...
@@ -270,6 +270,7 @@ class PSLib(Fleet):
self
.
_role_maker
.
_barrier_worker
()
self
.
_role_maker
.
_barrier_worker
()
if
self
.
_role_maker
.
is_first_worker
():
if
self
.
_role_maker
.
is_first_worker
():
self
.
_fleet_ptr
.
stop_server
()
self
.
_fleet_ptr
.
stop_server
()
if
self
.
_heter_ptr
:
self
.
_heter_ptr
.
stop_xpu_service
()
self
.
_heter_ptr
.
stop_xpu_service
()
self
.
_role_maker
.
_barrier_worker
()
self
.
_role_maker
.
_barrier_worker
()
self
.
_role_maker
.
_barrier_all
()
self
.
_role_maker
.
_barrier_all
()
...
...
python/paddle/fluid/incubate/fleet/parameter_server/pslib/optimizer_factory.py
浏览文件 @
0e07f20e
...
@@ -846,7 +846,7 @@ class DistributedAdam(DistributedOptimizerImplBase):
...
@@ -846,7 +846,7 @@ class DistributedAdam(DistributedOptimizerImplBase):
"user_define_dump_filename"
,
""
)
"user_define_dump_filename"
,
""
)
opt_info
[
"dump_fields_path"
]
=
strategy
.
get
(
"dump_fields_path"
,
""
)
opt_info
[
"dump_fields_path"
]
=
strategy
.
get
(
"dump_fields_path"
,
""
)
opt_info
[
"dump_param"
]
=
strategy
.
get
(
"dump_param"
,
[])
opt_info
[
"dump_param"
]
=
strategy
.
get
(
"dump_param"
,
[])
gpus_env
=
os
.
getenv
(
"FLAGS_selected_gpus"
)
gpus_env
=
os
.
getenv
(
"FLAGS_selected_gpus"
,
"0"
)
opt_info
[
"worker_places"
]
=
[
int
(
s
)
for
s
in
gpus_env
.
split
(
","
)]
opt_info
[
"worker_places"
]
=
[
int
(
s
)
for
s
in
gpus_env
.
split
(
","
)]
opt_info
[
"use_ps_gpu"
]
=
strategy
.
get
(
"use_ps_gpu"
,
False
)
opt_info
[
"use_ps_gpu"
]
=
strategy
.
get
(
"use_ps_gpu"
,
False
)
if
server
.
_server
.
downpour_server_param
.
downpour_table_param
[
if
server
.
_server
.
downpour_server_param
.
downpour_table_param
[
...
...
python/paddle/fluid/incubate/fleet/utils/hdfs.py
浏览文件 @
0e07f20e
...
@@ -25,8 +25,8 @@ import errno
...
@@ -25,8 +25,8 @@ import errno
import
time
import
time
import
logging
import
logging
import
six
import
six
from
.
import
fs
#
from . import fs
from
.fs
import
FS
,
LocalFS
,
FSFileExistsError
,
FSFileNotExistsError
,
ExecuteError
,
FSTimeOut
,
FSShellCmdAborted
from
paddle.distributed.fleet.utils
.fs
import
FS
,
LocalFS
,
FSFileExistsError
,
FSFileNotExistsError
,
ExecuteError
,
FSTimeOut
,
FSShellCmdAborted
from
paddle.fluid
import
core
from
paddle.fluid
import
core
import
functools
import
functools
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录