diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index ac87a7e93056d9565f5b44b8c4f0e51fd0a93537..e814e30deaa7beef1ee6214b62d5966c9e37ad1e 100644 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -56,12 +56,15 @@ if(APPLE) list(REMOVE_ITEM TEST_OPS test_desc_clone) list(REMOVE_ITEM TEST_OPS test_program_code) endif(NOT WITH_DISTRIBUTE) - message(WARNING "These tests has been disabled in OSX before being fixed:\n test_fuse_elewise_add_act_pass \n test_detection_map_op \n test_dist_se_resnext") + message(WARNING "These tests has been disabled in OSX before being fixed:\n test_fuse_elewise_add_act_pass \n test_detection_map_op \n test_dist_se_resnext_*") # this op is not support on mac list(REMOVE_ITEM TEST_OPS test_fusion_seqexpand_concat_fc_op) # TODO: add the unitest back when it fixed list(REMOVE_ITEM TEST_OPS test_detection_map_op) - list(REMOVE_ITEM TEST_OPS test_dist_se_resnext) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_dgc) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_async) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync_with_memopt) # TODO(tangwei12): add the unitest back when it fixed list(REMOVE_ITEM TEST_OPS test_dist_word2vec) list(REMOVE_ITEM TEST_OPS test_fuse_elewise_add_act_pass) @@ -132,7 +135,10 @@ list(REMOVE_ITEM TEST_OPS test_dist_transpiler) list(REMOVE_ITEM TEST_OPS test_parallel_executor_crf) list(REMOVE_ITEM TEST_OPS test_parallel_executor_crf_auto_growth) list(REMOVE_ITEM TEST_OPS test_parallel_executor_fetch_feed) -list(REMOVE_ITEM TEST_OPS test_dist_se_resnext) +list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_dgc) +list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync) +list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_async) +list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync_with_memopt) list(REMOVE_ITEM TEST_OPS test_dgc_op) list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_nccl) list(REMOVE_ITEM TEST_OPS test_dist_transformer) @@ -230,7 +236,15 @@ if(WITH_DISTRIBUTE) set_tests_properties(test_dist_mnist_backward_deps PROPERTIES TIMEOUT 350) set_tests_properties(test_dist_mnist_lars PROPERTIES TIMEOUT 350) set_tests_properties(test_dist_word2vec PROPERTIES TIMEOUT 350) - py_test_modules(test_dist_se_resnext MODULES test_dist_se_resnext) + + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_dgc) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_async) + list(REMOVE_ITEM TEST_OPS test_dist_se_resnext_sync_with_memopt) + py_test_modules(test_dist_se_resnext_dgc MODULES test_dist_se_resnext_dgc) + py_test_modules(test_dist_se_resnext_sync MODULES test_dist_se_resnext_sync) + py_test_modules(test_dist_se_resnext_async MODULES test_dist_se_resnext_async) + py_test_modules(test_dist_se_resnext_sync_with_memopt MODULES test_dist_se_resnext_sync_with_memopt) py_test_modules(test_dist_se_resnext_nccl MODULES test_dist_se_resnext_nccl) bash_test_modules(test_launch MODULES test_launch.sh) # FIXME(typhoonzero): add these tests back diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_async.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_async.py new file mode 100644 index 0000000000000000000000000000000000000000..0d99728965abf7a90377d39bfb91cad752cfe303 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_async.py @@ -0,0 +1,43 @@ +# 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 unittest +from test_dist_base import TestDistBase +import os + + +def skip_ci(func): + on_ci = bool(int(os.environ.get("SKIP_UNSTABLE_CI", '0'))) + + def __func__(*args, **kwargs): + if on_ci: + return + return func(*args, **kwargs) + + return __func__ + + +class TestDistSeResneXt2x2Async(TestDistBase): + def _setup_config(self): + self._sync_mode = False + self._use_reader_alloc = False + + @skip_ci + def test_dist_train(self): + self.check_with_place("dist_se_resnext.py", delta=100) + + +if __name__ == "__main__": + unittest.main() diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py similarity index 63% rename from python/paddle/fluid/tests/unittests/test_dist_se_resnext.py rename to python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py index 4e9ca01f43e929d7461f35b56b54ca91a0e35f44..24ef0736a019fec434e06785252ede84f3e15d34 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext.py +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py @@ -29,37 +29,6 @@ def skip_ci(func): return __func__ -class TestDistSeResneXt2x2(TestDistBase): - def _setup_config(self): - self._sync_mode = True - self._use_reader_alloc = False - - @skip_ci - def test_dist_train(self): - self.check_with_place("dist_se_resnext.py", delta=1e-7) - - -class TestDistseResnXt2x2WithMemopt(TestDistBase): - def _setup_config(self): - self._sync_mode = True - self._mem_opt = True - self._use_reader_alloc = False - - @skip_ci - def test_dist_train(self): - self.check_with_place("dist_se_resnext.py", delta=1e-7) - - -class TestDistSeResneXt2x2Async(TestDistBase): - def _setup_config(self): - self._sync_mode = False - self._use_reader_alloc = False - - @skip_ci - def test_dist_train(self): - self.check_with_place("dist_se_resnext.py", delta=100) - - class TestDistSeResnetNCCL2DGC(TestDistBase): def _setup_config(self): self._sync_mode = True diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync.py new file mode 100644 index 0000000000000000000000000000000000000000..23987f4eff42084f38059ca80f89753de08c04db --- /dev/null +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync.py @@ -0,0 +1,43 @@ +# 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 unittest +from test_dist_base import TestDistBase +import os + + +def skip_ci(func): + on_ci = bool(int(os.environ.get("SKIP_UNSTABLE_CI", '0'))) + + def __func__(*args, **kwargs): + if on_ci: + return + return func(*args, **kwargs) + + return __func__ + + +class TestDistSeResneXt2x2(TestDistBase): + def _setup_config(self): + self._sync_mode = True + self._use_reader_alloc = False + + @skip_ci + def test_dist_train(self): + self.check_with_place("dist_se_resnext.py", delta=1e-7) + + +if __name__ == "__main__": + unittest.main() diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync_with_memopt.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync_with_memopt.py new file mode 100644 index 0000000000000000000000000000000000000000..e39e07a58e8d9e816ce139566eab0f02d204c70d --- /dev/null +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync_with_memopt.py @@ -0,0 +1,44 @@ +# 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 unittest +from test_dist_base import TestDistBase +import os + + +def skip_ci(func): + on_ci = bool(int(os.environ.get("SKIP_UNSTABLE_CI", '0'))) + + def __func__(*args, **kwargs): + if on_ci: + return + return func(*args, **kwargs) + + return __func__ + + +class TestDistseResnXt2x2WithMemopt(TestDistBase): + def _setup_config(self): + self._sync_mode = True + self._mem_opt = True + self._use_reader_alloc = False + + @skip_ci + def test_dist_train(self): + self.check_with_place("dist_se_resnext.py", delta=1e-7) + + +if __name__ == "__main__": + unittest.main()