From 3c3341790598988b11e20f3efe51bba292d36c42 Mon Sep 17 00:00:00 2001 From: silingtong123 <35439432+silingtong123@users.noreply.github.com> Date: Thu, 19 Dec 2019 10:36:43 +0800 Subject: [PATCH] modify the method of skipping CI in distributed unittests (#21764) --- .../paddle/fluid/tests/unittests/test_dist_ctr.py | 13 +------------ .../fluid/tests/unittests/test_dist_fleet_ctr.py | 11 ----------- .../fluid/tests/unittests/test_dist_fleet_geo.py | 11 ----------- .../tests/unittests/test_dist_se_resnext_async.py | 13 +------------ .../tests/unittests/test_dist_se_resnext_dgc.py | 13 +------------ .../tests/unittests/test_dist_se_resnext_nccl.py | 15 ++------------- .../tests/unittests/test_dist_se_resnext_sync.py | 13 +------------ 7 files changed, 6 insertions(+), 83 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_dist_ctr.py b/python/paddle/fluid/tests/unittests/test_dist_ctr.py index f1bbce8982..40c405321f 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_ctr.py +++ b/python/paddle/fluid/tests/unittests/test_dist_ctr.py @@ -22,17 +22,6 @@ import os flag_name = os.path.splitext(__file__)[0] -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 TestDistCTR2x2(TestDistBase): def _setup_config(self): self._sync_mode = True @@ -43,7 +32,7 @@ class TestDistCTR2x2(TestDistBase): "dist_ctr.py", delta=1e-2, check_error_log=True, log_name=flag_name) -@skip_ci +@unittest.skip(reason="Skip unstable ci") class TestDistCTRWithL2Decay2x2(TestDistBase): def _setup_config(self): self._sync_mode = True diff --git a/python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py b/python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py index acefd65b56..5d3c0fbdd0 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py +++ b/python/paddle/fluid/tests/unittests/test_dist_fleet_ctr.py @@ -19,17 +19,6 @@ import unittest from test_dist_fleet_base import TestFleetBase -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 TestDistMnist2x2(TestFleetBase): def _setup_config(self): self._sync_mode = False diff --git a/python/paddle/fluid/tests/unittests/test_dist_fleet_geo.py b/python/paddle/fluid/tests/unittests/test_dist_fleet_geo.py index e34d55b411..447f1c16e7 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_fleet_geo.py +++ b/python/paddle/fluid/tests/unittests/test_dist_fleet_geo.py @@ -24,17 +24,6 @@ from test_dist_fleet_base import TestFleetBase from dist_simnet_bow import train_network -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 TestDistGeoCtr_2x2(TestFleetBase): def _setup_config(self): self._sync_mode = False 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 index 3a34f744b2..cfa548de0f 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_async.py +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_async.py @@ -20,23 +20,12 @@ import os flag_name = os.path.splitext(__file__)[0] -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 + @unittest.skip(reason="Skip unstable ci") def test_dist_train(self): self.check_with_place( "dist_se_resnext.py", diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py index d929ccea64..b48ec89a2a 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py @@ -21,17 +21,6 @@ import os flag_name = os.path.splitext(__file__)[0] -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 TestDistSeResnetNCCL2DGC(TestDistBase): def _setup_config(self): self._sync_mode = True @@ -40,7 +29,7 @@ class TestDistSeResnetNCCL2DGC(TestDistBase): self._nccl2_mode = True self._use_dgc = True - @skip_ci + @unittest.skip(reason="Skip unstable ci") def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_nccl.py b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_nccl.py index f557bcb09f..41470ef141 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_nccl.py +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_nccl.py @@ -21,24 +21,13 @@ import os flag_name = os.path.splitext(__file__)[0] -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 TestDistSeResneXtNCCL(TestDistBase): def _setup_config(self): self._sync_mode = True self._use_reader_alloc = False self._nccl2_mode = True - @skip_ci + @unittest.skip(reason="Skip unstable ci") def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): @@ -56,7 +45,7 @@ class TestDistSeResneXtNCCLMP(TestDistBase): self._nccl2_mode = True self._mp_mode = True - @skip_ci + @unittest.skip(reason="Skip unstable ci") def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): 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 index 044a3706c6..cb4d07b4cc 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync.py +++ b/python/paddle/fluid/tests/unittests/test_dist_se_resnext_sync.py @@ -21,23 +21,12 @@ import os flag_name = os.path.splitext(__file__)[0] -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 + @unittest.skip(reason="Skip unstable ci") def test_dist_train(self): self.check_with_place( "dist_se_resnext.py", -- GitLab