From cc49a39e6ca163209ae6eca5811ff9feb3590eed Mon Sep 17 00:00:00 2001 From: seiriosPlus Date: Mon, 21 Sep 2020 13:48:56 +0800 Subject: [PATCH] add UT --- .../fluid/tests/unittests/test_communicator_async3.py | 6 +----- python/paddle/fluid/tests/unittests/test_dist_fleet_ps4.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_communicator_async3.py b/python/paddle/fluid/tests/unittests/test_communicator_async3.py index f53dcb920e6..2e4df9a0757 100644 --- a/python/paddle/fluid/tests/unittests/test_communicator_async3.py +++ b/python/paddle/fluid/tests/unittests/test_communicator_async3.py @@ -40,7 +40,7 @@ class TestCommunicator(unittest.TestCase): def test_communicator_async(self): role = role_maker.UserDefinedRoleMaker( current_id=0, - role=role_maker.Role.WORKER, + role=role_maker.Role.SERVER, worker_num=2, server_endpoints=["127.0.0.1:6001", "127.0.0.1:6002"]) @@ -52,10 +52,6 @@ class TestCommunicator(unittest.TestCase): optimizer = fleet.distributed_optimizer(optimizer, strategy) optimizer.minimize(avg_cost) - fleet.init_worker() - time.sleep(10) - fleet.stop_worker() - if __name__ == '__main__': unittest.main() diff --git a/python/paddle/fluid/tests/unittests/test_dist_fleet_ps4.py b/python/paddle/fluid/tests/unittests/test_dist_fleet_ps4.py index dc40b2eb5c6..d398bd073dc 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_fleet_ps4.py +++ b/python/paddle/fluid/tests/unittests/test_dist_fleet_ps4.py @@ -164,7 +164,7 @@ class TestPSPassWithBow(unittest.TestCase): fleet.init(role) loss, acc, _ = self.net() - optimizer = fluid.optimizer.SGD(base_lr) + optimizer = fluid.optimizer.Adam(base_lr) strategy = StrategyFactory.create_async_strategy() optimizer = fleet.distributed_optimizer(optimizer, strategy) optimizer.minimize(loss) -- GitLab