diff --git a/paddle/fluid/distributed/ps/wrapper/fleet.cc b/paddle/fluid/distributed/ps/wrapper/fleet.cc index 93294bc84dc57d6cd96551cc1d05a183d9cfb1a8..7086f4ce95be888978fd4b87eb501f56ab868816 100644 --- a/paddle/fluid/distributed/ps/wrapper/fleet.cc +++ b/paddle/fluid/distributed/ps/wrapper/fleet.cc @@ -129,6 +129,8 @@ void FleetWrapper::InitWorker(const std::string& dist_desc, paddle::distributed::PSClientFactory::Create(ps_param)); worker_ptr_->Configure(ps_param, dense_pull_regions, ps_env_, index); } + dist_desc_ = dist_desc; + is_initialized_ = true; } else { VLOG(3) << "Client can be initialized only once"; } diff --git a/python/paddle/distributed/ps/the_one_ps.py b/python/paddle/distributed/ps/the_one_ps.py index 05d6ce9b78a0eaa87a6064e0acca0c488b2af4c1..cca1d1552fbb8afb195e0ce0e1bb3950f50f8093 100755 --- a/python/paddle/distributed/ps/the_one_ps.py +++ b/python/paddle/distributed/ps/the_one_ps.py @@ -1171,8 +1171,6 @@ class TheOnePSRuntime(RuntimeBase): gpus_env = os.getenv("FLAGS_selected_gpus") gpus_env = [int(s) for s in gpus_env.split(",")] main_program._fleet_opt["worker_places"] = gpus_env - PSGPU = core.PSGPU() - PSGPU.init_gpu_ps(gpus_env) def sync_strategy_envs(): kwargs = {} diff --git a/python/paddle/fluid/tests/unittests/ps/CMakeLists.txt b/python/paddle/fluid/tests/unittests/ps/CMakeLists.txt index a41df079cbb174ed0cc68647b4ca26701cf71208..674d3b1baeec079d1ed0497253288b8dd36f7513 100755 --- a/python/paddle/fluid/tests/unittests/ps/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/ps/CMakeLists.txt @@ -4,7 +4,9 @@ file( "test_*.py") string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}") -list(REMOVE_ITEM TEST_OPS "test_gpubox_ps") +if(NOT WITH_HETERPS OR WITH_PSLIB) + list(REMOVE_ITEM TEST_OPS "test_gpubox_ps") +endif() foreach(TEST_OP ${TEST_OPS}) py_test_modules(${TEST_OP} MODULES ${TEST_OP}) @@ -12,6 +14,6 @@ foreach(TEST_OP ${TEST_OPS}) set_tests_properties(${TEST_OP} PROPERTIES TIMEOUT 50) endforeach() -#if(WITH_HETERPS) -# set_tests_properties(test_gpubox_ps PROPERTIES LABELS "RUN_TYPE=GPUPS") -#endif() +if(WITH_HETERPS AND NOT WITH_PSLIB) + set_tests_properties(test_gpubox_ps PROPERTIES LABELS "RUN_TYPE=GPUPS") +endif()