Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
ed856d25
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看板
未验证
提交
ed856d25
编写于
12月 30, 2020
作者:
T
tangwei12
提交者:
GitHub
12月 30, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ut (#29989)
* fix ut Change-Id: I151e152919a1863db07792bffb42d0ca68995756
上级
4cbcc9b6
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
105 addition
and
115 deletion
+105
-115
python/paddle/fluid/tests/unittests/CMakeLists.txt
python/paddle/fluid/tests/unittests/CMakeLists.txt
+2
-5
python/paddle/fluid/tests/unittests/test_dist_fleet_a_sync_optimizer_async.py
...tests/unittests/test_dist_fleet_a_sync_optimizer_async.py
+0
-4
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
+2
-0
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py
+2
-105
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr2.py
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr2.py
+94
-0
python/paddle/fluid/tests/unittests/test_dist_fleet_sparse_embedding_ctr.py
...d/tests/unittests/test_dist_fleet_sparse_embedding_ctr.py
+5
-1
未找到文件。
python/paddle/fluid/tests/unittests/CMakeLists.txt
浏览文件 @
ed856d25
...
...
@@ -458,8 +458,6 @@ if(WITH_DISTRIBUTE)
list
(
REMOVE_ITEM DIST_TEST_OPS
"test_dist_train"
)
list
(
REMOVE_ITEM DIST_TEST_OPS
"test_dist_word2vec"
)
# FIXME(seiriosX) will fix this
list
(
REMOVE_ITEM DIST_TEST_OPS
"test_dist_fleet_sparse_embedding_ctr"
)
list
(
REMOVE_ITEM DIST_TEST_OPS
"test_dist_fleet_gloo"
)
py_test_modules
(
test_recv_save_op MODULES test_recv_save_op ENVS
${
dist_ENVS
}
)
...
...
@@ -636,9 +634,6 @@ if(NOT WIN32 AND NOT APPLE)
set_tests_properties
(
test_multiprocess_dataloader_static PROPERTIES TIMEOUT 120
)
endif
()
# setting timeout value for old unittests
# set_tests_properties(test_dist_fleet_sparse_embedding_ctr PROPERTIES TIMEOUT 200)
if
(
NOT WIN32
)
set_tests_properties
(
test_multiprocess_reader_exception PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_layers PROPERTIES TIMEOUT 120
)
...
...
@@ -651,6 +646,8 @@ endif()
if
(
WITH_DISTRIBUTE
)
set_tests_properties
(
test_communicator_half_async PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_dist_fleet_ctr2 PROPERTIES TIMEOUT 120
)
set_tests_properties
(
test_dist_fleet_sparse_embedding_ctr PROPERTIES TIMEOUT 120
)
endif
()
if
(
WITH_DISTRIBUTE AND NOT APPLE
)
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_a_sync_optimizer_async.py
浏览文件 @
ed856d25
...
...
@@ -72,10 +72,6 @@ class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
self
.
assertEqual
(
sends
,
0
)
self
.
assertEqual
(
sgds
,
0
)
fleet
.
init_worker
()
time
.
sleep
(
8
)
fleet
.
stop_worker
()
def
test_a_sync_optimizer_pserver
(
self
):
os
.
environ
[
"TRAINING_ROLE"
]
=
"PSERVER"
import
paddle.distributed.fleet
as
fleet
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_base.py
浏览文件 @
ed856d25
...
...
@@ -32,6 +32,8 @@ import tempfile
import
unittest
import
paddle
paddle
.
enable_static
()
import
paddle.fluid
as
fluid
import
paddle.distributed.fleet.base.role_maker
as
role_maker
import
paddle.distributed.fleet
as
fleet
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py
浏览文件 @
ed856d25
...
...
@@ -20,72 +20,6 @@ import tempfile
from
test_dist_fleet_base
import
TestFleetBase
class
TestDistMnistSync2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"sync"
self
.
_reader
=
"pyreader"
self
.
_need_test
=
1
def
check_with_place
(
self
,
model_file
,
delta
=
1e-3
,
check_error_log
=
False
,
need_envs
=
{}):
required_envs
=
{
"PATH"
:
os
.
getenv
(
"PATH"
,
""
),
"PYTHONPATH"
:
os
.
getenv
(
"PYTHONPATH"
,
""
),
"LD_LIBRARY_PATH"
:
os
.
getenv
(
"LD_LIBRARY_PATH"
,
""
),
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"CPU_NUM"
:
"2"
}
required_envs
.
update
(
need_envs
)
if
check_error_log
:
required_envs
[
"GLOG_v"
]
=
"3"
required_envs
[
"GLOG_logtostderr"
]
=
"1"
tr0_losses
,
tr1_losses
=
self
.
_run_cluster
(
model_file
,
required_envs
)
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
True
)
@
unittest
.
skip
(
reason
=
"Skip unstable ut, open it when geo fixed"
)
class
TestDistMnistAuto2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"auto"
self
.
_reader
=
"pyreader"
def
check_with_place
(
self
,
model_file
,
delta
=
1e-3
,
check_error_log
=
False
,
need_envs
=
{}):
required_envs
=
{
"PATH"
:
os
.
getenv
(
"PATH"
,
""
),
"PYTHONPATH"
:
os
.
getenv
(
"PYTHONPATH"
,
""
),
"LD_LIBRARY_PATH"
:
os
.
getenv
(
"LD_LIBRARY_PATH"
,
""
),
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"CPU_NUM"
:
"2"
}
required_envs
.
update
(
need_envs
)
if
check_error_log
:
required_envs
[
"GLOG_v"
]
=
"3"
required_envs
[
"GLOG_logtostderr"
]
=
"1"
tr0_losses
,
tr1_losses
=
self
.
_run_cluster
(
model_file
,
required_envs
)
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
True
)
class
TestDistMnistAsync2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"async"
...
...
@@ -115,44 +49,7 @@ class TestDistMnistAsync2x2(TestFleetBase):
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
True
)
# @unittest.skip(reason="Skip unstable ut, reader need to be rewrite")
class
TestDistMnistAsyncDataset2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"async"
self
.
_reader
=
"dataset"
def
check_with_place
(
self
,
model_file
,
delta
=
1e-3
,
check_error_log
=
False
,
need_envs
=
{}):
required_envs
=
{
"PATH"
:
os
.
getenv
(
"PATH"
,
""
),
"PYTHONPATH"
:
os
.
getenv
(
"PYTHONPATH"
,
""
),
"LD_LIBRARY_PATH"
:
os
.
getenv
(
"LD_LIBRARY_PATH"
,
""
),
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"SAVE_MODEL"
:
"1"
,
"dump_param"
:
"concat_0.tmp_0"
,
"dump_fields"
:
"dnn-fc-3.tmp_0,dnn-fc-3.tmp_0@GRAD"
,
"dump_fields_path"
:
tempfile
.
mkdtemp
(),
"Debug"
:
"1"
}
required_envs
.
update
(
need_envs
)
if
check_error_log
:
required_envs
[
"GLOG_v"
]
=
"3"
required_envs
[
"GLOG_logtostderr"
]
=
"1"
tr0_losses
,
tr1_losses
=
self
.
_run_cluster
(
model_file
,
required_envs
)
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
True
)
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
False
)
class
TestDistCtrHalfAsync2x2
(
TestFleetBase
):
...
...
@@ -187,7 +84,7 @@ class TestDistCtrHalfAsync2x2(TestFleetBase):
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
Tru
e
)
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
Fals
e
)
if
__name__
==
"__main__"
:
...
...
python/paddle/fluid/tests/unittests/test_dist_fleet_ctr2.py
0 → 100644
浏览文件 @
ed856d25
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
print_function
import
os
import
unittest
import
tempfile
from
test_dist_fleet_base
import
TestFleetBase
class
TestDistMnistSync2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"sync"
self
.
_reader
=
"pyreader"
self
.
_need_test
=
1
def
check_with_place
(
self
,
model_file
,
delta
=
1e-3
,
check_error_log
=
False
,
need_envs
=
{}):
required_envs
=
{
"PATH"
:
os
.
getenv
(
"PATH"
,
""
),
"PYTHONPATH"
:
os
.
getenv
(
"PYTHONPATH"
,
""
),
"LD_LIBRARY_PATH"
:
os
.
getenv
(
"LD_LIBRARY_PATH"
,
""
),
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"CPU_NUM"
:
"2"
}
required_envs
.
update
(
need_envs
)
if
check_error_log
:
required_envs
[
"GLOG_v"
]
=
"3"
required_envs
[
"GLOG_logtostderr"
]
=
"1"
tr0_losses
,
tr1_losses
=
self
.
_run_cluster
(
model_file
,
required_envs
)
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
False
)
# @unittest.skip(reason="Skip unstable ut, reader need to be rewrite")
class
TestDistMnistAsyncDataset2x2
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"async"
self
.
_reader
=
"dataset"
def
check_with_place
(
self
,
model_file
,
delta
=
1e-3
,
check_error_log
=
False
,
need_envs
=
{}):
required_envs
=
{
"PATH"
:
os
.
getenv
(
"PATH"
,
""
),
"PYTHONPATH"
:
os
.
getenv
(
"PYTHONPATH"
,
""
),
"LD_LIBRARY_PATH"
:
os
.
getenv
(
"LD_LIBRARY_PATH"
,
""
),
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"SAVE_MODEL"
:
"1"
,
"dump_param"
:
"concat_0.tmp_0"
,
"dump_fields"
:
"dnn-fc-3.tmp_0,dnn-fc-3.tmp_0@GRAD"
,
"dump_fields_path"
:
tempfile
.
mkdtemp
(),
"Debug"
:
"1"
}
required_envs
.
update
(
need_envs
)
if
check_error_log
:
required_envs
[
"GLOG_v"
]
=
"3"
required_envs
[
"GLOG_logtostderr"
]
=
"1"
tr0_losses
,
tr1_losses
=
self
.
_run_cluster
(
model_file
,
required_envs
)
def
test_dist_train
(
self
):
self
.
check_with_place
(
"dist_fleet_ctr.py"
,
delta
=
1e-5
,
check_error_log
=
False
)
if
__name__
==
"__main__"
:
unittest
.
main
()
python/paddle/fluid/tests/unittests/test_dist_fleet_sparse_embedding_ctr.py
浏览文件 @
ed856d25
...
...
@@ -19,6 +19,9 @@ import shutil
import
tempfile
import
unittest
import
paddle
paddle
.
enable_static
()
import
paddle.fluid
as
fluid
from
test_dist_fleet_base
import
TestFleetBase
...
...
@@ -110,7 +113,7 @@ class TestDistMnistAsync2x2WithDecay(TestFleetBase):
"FLAGS_rpc_deadline"
:
"5000"
,
# 5sec to fail fast
"http_proxy"
:
""
,
"CPU_NUM"
:
"2"
,
"DECAY"
:
"
1
"
"DECAY"
:
"
0
"
}
required_envs
.
update
(
need_envs
)
...
...
@@ -163,6 +166,7 @@ class TestDistMnistAsync2x2WithUnifrom(TestFleetBase):
check_error_log
=
True
)
@
unittest
.
skip
(
reason
=
"Skip unstable ut, need tensor table to enhance"
)
class
TestDistMnistAsync2x2WithGauss
(
TestFleetBase
):
def
_setup_config
(
self
):
self
.
_mode
=
"async"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录