Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
04496d89
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看板
未验证
提交
04496d89
编写于
12月 30, 2021
作者:
Z
zmxdream
提交者:
GitHub
12月 30, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PSCore]Fix test fleet base 2 (#38588)
上级
15cbf81b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
46 deletion
+11
-46
python/paddle/distributed/fleet/base/fleet_base.py
python/paddle/distributed/fleet/base/fleet_base.py
+8
-0
python/paddle/fluid/tests/unittests/test_dist_fleet_a_sync_optimizer_sync.py
.../tests/unittests/test_dist_fleet_a_sync_optimizer_sync.py
+0
-4
python/paddle/fluid/tests/unittests/test_fleet_base_2.py
python/paddle/fluid/tests/unittests/test_fleet_base_2.py
+3
-42
未找到文件。
python/paddle/distributed/fleet/base/fleet_base.py
浏览文件 @
04496d89
...
@@ -627,6 +627,8 @@ class Fleet(object):
...
@@ -627,6 +627,8 @@ class Fleet(object):
"""
"""
self
.
_runtime_handle
.
_init_server
(
*
args
,
**
kwargs
)
self
.
_runtime_handle
.
_init_server
(
*
args
,
**
kwargs
)
@
is_non_distributed_check
@
inited_runtime_handler
def
load_model
(
self
,
path
,
mode
):
def
load_model
(
self
,
path
,
mode
):
"""
"""
load fleet model from path
load fleet model from path
...
@@ -699,6 +701,8 @@ class Fleet(object):
...
@@ -699,6 +701,8 @@ class Fleet(object):
"""
"""
self
.
_runtime_handle
.
_stop_worker
()
self
.
_runtime_handle
.
_stop_worker
()
@
is_non_distributed_check
@
inited_runtime_handler
def
save
(
self
,
dirname
,
feed
=
[],
fetch
=
[],
**
configs
):
def
save
(
self
,
dirname
,
feed
=
[],
fetch
=
[],
**
configs
):
inference
=
True
inference
=
True
...
@@ -742,6 +746,8 @@ class Fleet(object):
...
@@ -742,6 +746,8 @@ class Fleet(object):
self
.
_runtime_handle
.
_save_persistables
(
self
.
_runtime_handle
.
_save_persistables
(
executor
,
dirname
,
main_program
=
None
,
mode
=
increment_mode
)
executor
,
dirname
,
main_program
=
None
,
mode
=
increment_mode
)
@
is_non_distributed_check
@
inited_runtime_handler
def
save_inference_model
(
self
,
def
save_inference_model
(
self
,
executor
,
executor
,
dirname
,
dirname
,
...
@@ -777,6 +783,8 @@ class Fleet(object):
...
@@ -777,6 +783,8 @@ class Fleet(object):
executor
,
dirname
,
feeded_var_names
,
target_vars
,
main_program
,
executor
,
dirname
,
feeded_var_names
,
target_vars
,
main_program
,
export_for_deployment
,
mode
)
export_for_deployment
,
mode
)
@
is_non_distributed_check
@
inited_runtime_handler
def
save_persistables
(
self
,
executor
,
dirname
,
main_program
=
None
,
mode
=
0
):
def
save_persistables
(
self
,
executor
,
dirname
,
main_program
=
None
,
mode
=
0
):
"""
"""
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_a_sync_optimizer_sync.py
浏览文件 @
04496d89
...
@@ -62,10 +62,6 @@ class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
...
@@ -62,10 +62,6 @@ class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
self
.
assertEqual
(
sends
,
0
)
self
.
assertEqual
(
sends
,
0
)
self
.
assertEqual
(
sgds
,
0
)
self
.
assertEqual
(
sgds
,
0
)
fleet
.
init_worker
()
time
.
sleep
(
8
)
fleet
.
stop_worker
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_fleet_base_2.py
浏览文件 @
04496d89
...
@@ -24,9 +24,9 @@ class TestFleetBase(unittest.TestCase):
...
@@ -24,9 +24,9 @@ class TestFleetBase(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36000"
os
.
environ
[
"PADDLE_PORT"
]
=
"36000"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"
2
"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"
1
"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
\
#
os.environ["PADDLE_PSERVERS_IP_PORT_LIST"] = \
"127.0.0.1:36001,127.0.0.2:36001"
#
"127.0.0.1:36001,127.0.0.2:36001"
def
test_ps_minimize
(
self
):
def
test_ps_minimize
(
self
):
import
paddle
import
paddle
...
@@ -78,45 +78,6 @@ class TestFleetBase(unittest.TestCase):
...
@@ -78,45 +78,6 @@ class TestFleetBase(unittest.TestCase):
fleet
.
load_model
(
path
=
"/tmp"
,
mode
=
0
)
fleet
.
load_model
(
path
=
"/tmp"
,
mode
=
0
)
fleet
.
load_model
(
path
=
"/tmp"
,
mode
=
1
)
fleet
.
load_model
(
path
=
"/tmp"
,
mode
=
1
)
self
.
assertRaises
(
Exception
,
fleet
.
save_inference_model
,
dirname
=
'/tmp/'
,
feeded_var_names
=
[
'x'
,
'y'
],
target_vars
=
[
avg_cost
],
executor
=
"exe"
)
self
.
assertRaises
(
Exception
,
fleet
.
save_inference_model
,
dirname
=
'/tmp/'
,
feeded_var_names
=
[
'x'
,
'y'
],
target_vars
=
[
avg_cost
],
executor
=
exe
,
main_program
=
compiled_prog
)
self
.
assertRaises
(
Exception
,
fleet
.
save_inference_model
,
dirname
=
'afs:/tmp/'
,
feeded_var_names
=
[
'x'
,
'y'
],
target_vars
=
[
avg_cost
],
executor
=
exe
,
main_program
=
compiled_prog
)
self
.
assertRaises
(
Exception
,
fleet
.
save_persistables
,
executor
=
pe
,
dirname
=
'/tmp/'
)
self
.
assertRaises
(
Exception
,
fleet
.
save_persistables
,
executor
=
"exe"
,
dirname
=
'/tmp/'
)
self
.
assertRaises
(
Exception
,
fleet
.
save_persistables
,
executor
=
exe
,
dirname
=
'/tmp/'
,
main_program
=
compiled_prog
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录