Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
6ad18809
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看板
未验证
提交
6ad18809
编写于
6月 10, 2021
作者:
T
tangwei12
提交者:
GitHub
6月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix geo ut (#33441)
Change-Id: I4e09e7710f6693bff5388983270781a4ef70519e
上级
df4a978c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
13 deletion
+10
-13
python/paddle/fluid/tests/unittests/test_communicator_geo.py
python/paddle/fluid/tests/unittests/test_communicator_geo.py
+10
-13
未找到文件。
python/paddle/fluid/tests/unittests/test_communicator_geo.py
浏览文件 @
6ad18809
...
@@ -28,6 +28,8 @@ import paddle.fluid as fluid
...
@@ -28,6 +28,8 @@ import paddle.fluid as fluid
import
paddle.distributed.fleet.base.role_maker
as
role_maker
import
paddle.distributed.fleet.base.role_maker
as
role_maker
import
paddle.distributed.fleet
as
fleet
import
paddle.distributed.fleet
as
fleet
from
paddle.distributed.utils
import
find_free_ports
paddle
.
enable_static
()
paddle
.
enable_static
()
...
@@ -101,12 +103,9 @@ class TestCommunicatorGeoEnd2End(unittest.TestCase):
...
@@ -101,12 +103,9 @@ class TestCommunicatorGeoEnd2End(unittest.TestCase):
os
.
environ
[
"PADDLE_PSERVER_NUMS"
]
=
"1"
os
.
environ
[
"PADDLE_PSERVER_NUMS"
]
=
"1"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
os
.
environ
[
"PADDLE_PORT"
]
=
"36001"
os
.
environ
[
"PADDLE_TRAINER_ID"
]
=
"0"
os
.
environ
[
"PADDLE_TRAINER_ID"
]
=
"0"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_TRAINERS_NUM"
]
=
"1"
os
.
environ
[
"PADDLE_PSERVERS_IP_PORT_LIST"
]
=
\
os
.
environ
[
"POD_IP"
]
=
"127.0.0.1"
"127.0.0.1:36001"
role
=
role_maker
.
PaddleCloudRoleMaker
()
role
=
role_maker
.
PaddleCloudRoleMaker
()
...
@@ -150,8 +149,6 @@ class RunServer(TestCommunicatorGeoEnd2End):
...
@@ -150,8 +149,6 @@ class RunServer(TestCommunicatorGeoEnd2End):
pass
pass
os.environ["TRAINING_ROLE"] = "PSERVER"
os.environ["TRAINING_ROLE"] = "PSERVER"
os.environ["http_proxy"] = ""
os.environ["https_proxy"] = ""
half_run_server = RunServer()
half_run_server = RunServer()
half_run_server.run_ut()
half_run_server.run_ut()
...
@@ -160,9 +157,12 @@ half_run_server.run_ut()
...
@@ -160,9 +157,12 @@ half_run_server.run_ut()
server_file
=
"run_server_for_communicator_geo.py"
server_file
=
"run_server_for_communicator_geo.py"
with
open
(
server_file
,
"w"
)
as
wb
:
with
open
(
server_file
,
"w"
)
as
wb
:
wb
.
write
(
run_server_cmd
)
wb
.
write
(
run_server_cmd
)
port
=
find_free_ports
(
1
).
pop
()
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
os
.
environ
[
"
http_proxy"
]
=
""
os
.
environ
[
"
PADDLE_PORT"
]
=
str
(
port
)
os
.
environ
[
"
https_proxy"
]
=
""
os
.
environ
[
"
PADDLE_PSERVERS_IP_PORT_LIST"
]
=
"127.0.0.1:{}"
.
format
(
port
)
_python
=
sys
.
executable
_python
=
sys
.
executable
...
@@ -173,17 +173,14 @@ half_run_server.run_ut()
...
@@ -173,17 +173,14 @@ half_run_server.run_ut()
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stderr
=
subprocess
.
PIPE
)
outs
,
errs
=
ps_proc
.
communicate
(
timeout
=
15
)
time
.
sleep
(
5
)
time
.
sleep
(
1
)
os
.
environ
[
"TRAINING_ROLE"
]
=
"TRAINER"
os
.
environ
[
"TRAINING_ROLE"
]
=
"TRAINER"
os
.
environ
[
"http_proxy"
]
=
""
os
.
environ
[
"https_proxy"
]
=
""
self
.
run_ut
()
self
.
run_ut
()
ps_proc
.
kill
()
ps_proc
.
kill
()
ps_proc
.
wait
()
ps_proc
.
wait
()
outs
,
errs
=
ps_proc
.
communicate
()
if
os
.
path
.
exists
(
server_file
):
if
os
.
path
.
exists
(
server_file
):
os
.
remove
(
server_file
)
os
.
remove
(
server_file
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录