Home
last modified time | relevance | path

Searched refs:PSContext (Results 1 – 25 of 57) sorted by relevance

123

/third_party/mindspore/mindspore/ccsrc/ps/
Dps_context.cc28 std::shared_ptr<PSContext> PSContext::instance() { in instance()
29 static std::shared_ptr<PSContext> ps_instance = nullptr; in instance()
31 ps_instance.reset(new (std::nothrow) PSContext()); in instance()
36 void PSContext::SetPSEnable(bool enabled) { in SetPSEnable()
79 bool PSContext::is_ps_mode() const { in is_ps_mode()
86 void PSContext::Reset() { in Reset()
99 std::string PSContext::ms_role() const { in ms_role()
114 bool PSContext::is_worker() const { in is_worker()
121 bool PSContext::is_server() const { in is_server()
128 bool PSContext::is_scheduler() const { in is_scheduler()
[all …]
Dscheduler.cc23 PSContext::instance()->cluster_config().scheduler_host = PSContext::instance()->scheduler_host(); in Run()
24 PSContext::instance()->cluster_config().scheduler_port = PSContext::instance()->scheduler_port(); in Run()
25PSContext::instance()->cluster_config().initial_worker_num = PSContext::instance()->initial_worker… in Run()
26PSContext::instance()->cluster_config().initial_server_num = PSContext::instance()->initial_server… in Run()
Dps_context.h55 class PSContext {
57 ~PSContext() = default;
58 PSContext(PSContext const &) = delete;
59 PSContext &operator=(const PSContext &) = delete;
60 static std::shared_ptr<PSContext> instance();
189 PSContext() in PSContext() function
/third_party/mindspore/mindspore/ccsrc/pipeline/jit/
Dinit.cc60 using PSContext = mindspore::ps::PSContext; typedef
344 (void)py::class_<PSContext, std::shared_ptr<PSContext>>(m, "PSContext") in PYBIND11_MODULE()
345 .def_static("get_instance", &PSContext::instance, "Get PS context instance.") in PYBIND11_MODULE()
346 .def("set_ps_enable", &PSContext::SetPSEnable, "Set PS mode enabled or disabled.") in PYBIND11_MODULE()
347 .def("is_ps_mode", &PSContext::is_ps_mode, "Get PS mode enable-disable status.") in PYBIND11_MODULE()
348 .def("reset", &PSContext::Reset, "Reset PS context attributes.") in PYBIND11_MODULE()
349 .def("is_worker", &PSContext::is_worker, "Get whether the role of this process is Worker.") in PYBIND11_MODULE()
350 .def("is_server", &PSContext::is_server, "Get whether the role of this process is PServer.") in PYBIND11_MODULE()
351 ….def("is_scheduler", &PSContext::is_scheduler, "Get whether the role of this process is Scheduler.… in PYBIND11_MODULE()
352 .def("ps_rank_id", &PSContext::ps_rank_id, "Get Worker and PServer rank id.") in PYBIND11_MODULE()
[all …]
Daction.cc602 if (ps::PSContext::instance()->is_ps_mode()) { in VmOptimizeAction()
823 const std::string &server_mode_ = ps::PSContext::instance()->server_mode(); in StartServerAction()
824 uint32_t worker_num = ps::PSContext::instance()->initial_worker_num(); in StartServerAction()
825 uint32_t server_num = ps::PSContext::instance()->initial_server_num(); in StartServerAction()
826 uint16_t fl_server_port = ps::PSContext::instance()->fl_server_port(); in StartServerAction()
830 size_t start_fl_job_threshold = ps::PSContext::instance()->start_fl_job_threshold(); in StartServerAction()
831 float update_model_ratio = ps::PSContext::instance()->update_model_ratio(); in StartServerAction()
833 uint64_t start_fl_job_time_window = ps::PSContext::instance()->start_fl_job_time_window(); in StartServerAction()
834 uint64_t update_model_time_window = ps::PSContext::instance()->update_model_time_window(); in StartServerAction()
844 float share_secrets_ratio = ps::PSContext::instance()->share_secrets_ratio(); in StartServerAction()
[all …]
/third_party/mindspore/mindspore/ccsrc/fl/server/
Dserver.cc94 std::string encrypt_type = ps::PSContext::instance()->encrypt_type(); in Run()
136 ps::PSContext::instance()->GenerateResetterRound(); in InitServerContext()
137 scheduler_ip_ = ps::PSContext::instance()->scheduler_host(); in InitServerContext()
138 scheduler_port_ = ps::PSContext::instance()->scheduler_port(); in InitServerContext()
139 worker_num_ = ps::PSContext::instance()->initial_worker_num(); in InitServerContext()
140 server_num_ = ps::PSContext::instance()->initial_server_num(); in InitServerContext()
141 std::string encrypt_type = ps::PSContext::instance()->encrypt_type(); in InitServerContext()
214 std::string encrypt_type = ps::PSContext::instance()->encrypt_type(); in InitIteration()
251 float dp_eps = ps::PSContext::instance()->dp_eps(); in InitCipher()
252 float dp_delta = ps::PSContext::instance()->dp_delta(); in InitCipher()
[all …]
Diteration.cc619 if (iteration_num_ == ps::PSContext::instance()->fl_iteration_num()) { in EndLastIter()
621 … << " is completed. Iteration number: " << ps::PSContext::instance()->fl_iteration_num(); in EndLastIter()
653 metrics_->set_fl_name(ps::PSContext::instance()->fl_name()); in SummarizeIteration()
654 metrics_->set_fl_iteration_num(ps::PSContext::instance()->fl_iteration_num()); in SummarizeIteration()
661 …std::ceil(ps::PSContext::instance()->start_fl_job_threshold() * ps::PSContext::instance()->update_… in SummarizeIteration()
664 …metrics_->set_rejected_client_num(ps::PSContext::instance()->start_fl_job_threshold() - update_mod… in SummarizeIteration()
685 ps::PSContext::instance()->set_start_fl_job_threshold(item.value().get<uint64_t>()); in UpdateHyperParams()
689 ps::PSContext::instance()->set_start_fl_job_time_window(item.value().get<uint64_t>()); in UpdateHyperParams()
693 ps::PSContext::instance()->set_update_model_ratio(item.value().get<float>()); in UpdateHyperParams()
697 ps::PSContext::instance()->set_update_model_time_window(item.value().get<uint64_t>()); in UpdateHyperParams()
[all …]
Dparameter_aggregator.cc227 if (ps::PSContext::instance()->server_mode() == ps::kServerModeFL || in InitOptimizerKernels()
228 ps::PSContext::instance()->server_mode() == ps::kServerModeHybrid) { in InitOptimizerKernels()
351 if (ps::PSContext::instance()->server_mode() == ps::kServerModeFL || in SelectAggregationAlgorithm()
352 ps::PSContext::instance()->server_mode() == ps::kServerModeHybrid) { in SelectAggregationAlgorithm()
354 } else if (ps::PSContext::instance()->server_mode() == ps::kServerModePS) { in SelectAggregationAlgorithm()
357 MS_LOG(EXCEPTION) << "Server doesn't support mode " << ps::PSContext::instance()->server_mode(); in SelectAggregationAlgorithm()
/third_party/mindspore/mindspore/ccsrc/fl/worker/
Dfl_worker.cc32 worker_num_ = ps::PSContext::instance()->worker_num(); in Run()
33 server_num_ = ps::PSContext::instance()->server_num(); in Run()
34 scheduler_ip_ = ps::PSContext::instance()->scheduler_ip(); in Run()
35 scheduler_port_ = ps::PSContext::instance()->scheduler_port(); in Run()
36 worker_step_num_per_iteration_ = ps::PSContext::instance()->worker_step_num_per_iteration(); in Run()
37 ps::PSContext::instance()->cluster_config().scheduler_host = scheduler_ip_; in Run()
38 ps::PSContext::instance()->cluster_config().scheduler_port = scheduler_port_; in Run()
39 ps::PSContext::instance()->cluster_config().initial_worker_num = worker_num_; in Run()
40 ps::PSContext::instance()->cluster_config().initial_server_num = server_num_; in Run()
/third_party/mindspore/mindspore/ccsrc/ps/core/
Dnode_recovery.cc32 node_->set_worker_num(PSContext::instance()->cluster_config().initial_worker_num); in Recover()
40 node_->set_server_num(PSContext::instance()->cluster_config().initial_server_num); in Recover()
48 node_->set_scheduler_ip(PSContext::instance()->cluster_config().scheduler_host); in Recover()
56 node_->set_scheduler_port(PSContext::instance()->cluster_config().scheduler_port); in Recover()
Dnode_manager.cc23 initial_total_node_num_ = PSContext::instance()->cluster_config().initial_server_num + in InitNode()
24 PSContext::instance()->cluster_config().initial_worker_num; in InitNode()
25 …meta_data_ = std::make_unique<ClusterMetadata>(PSContext::instance()->cluster_config().initial_wor… in InitNode()
26PSContext::instance()->cluster_config().initial_server_num); in InitNode()
171 …if (it->second.tv_sec + PSContext::instance()->cluster_config().heartbeat_timeout < current_time.t… in UpdateCluster()
198 << PSContext::instance()->cluster_config().cluster_available_timeout in CheckClusterTimeout()
Dscheduler_node.cc31 if (PSContext::instance()->scheduler_manage_port() != 0) { in Start()
32 …MS_LOG(WARNING) << "Start the scheduler http service, the ip:" << PSContext::instance()->scheduler… in Start()
33 << ", the port:" << PSContext::instance()->scheduler_manage_port(); in Start()
34 StartRestfulServer(kLocalIp, PSContext::instance()->scheduler_manage_port(), 1); in Start()
79 config_ = std::make_unique<FileConfiguration>(PSContext::instance()->config_file_path()); in Initialize()
87 if (PSContext::instance()->node_id().empty() && config_->Exists(kNodeId)) { in Initialize()
90 node_info_.node_id_ = PSContext::instance()->node_id(); in Initialize()
117 std::string scheduler_host = PSContext::instance()->cluster_config().scheduler_host; in CreateTcpServer()
118 uint32_t scheduler_port = PSContext::instance()->cluster_config().scheduler_port; in CreateTcpServer()
446 … std::chrono::seconds(PSContext::instance()->cluster_config().cluster_available_timeout))) { in StartUpdateClusterStateTimer()
[all …]
Dabstract_node.cc487 PSContext::instance()->cluster_config().scheduler_host = scheduler_ip; in GetOrCreateTcpComm()
488 PSContext::instance()->cluster_config().scheduler_port = static_cast<uint16_t>(scheduler_port); in GetOrCreateTcpComm()
489 PSContext::instance()->cluster_config().initial_worker_num = worker_num; in GetOrCreateTcpComm()
490 PSContext::instance()->cluster_config().initial_server_num = server_num; in GetOrCreateTcpComm()
492 PSContext::instance()->cluster_config().scheduler_host = scheduler_ip; in GetOrCreateTcpComm()
493 PSContext::instance()->cluster_config().scheduler_port = static_cast<uint16_t>(scheduler_port); in GetOrCreateTcpComm()
494 PSContext::instance()->cluster_config().initial_worker_num = worker_num; in GetOrCreateTcpComm()
495 PSContext::instance()->cluster_config().initial_server_num = server_num; in GetOrCreateTcpComm()
527 …std::this_thread::sleep_for(std::chrono::seconds(PSContext::instance()->cluster_config().heartbeat… in StartHeartbeatTimer()
561 …int64_t old_time = scheduler_time_.tv_sec + PSContext::instance()->cluster_config().scheduler_time… in CheckSchedulerTimeout()
[all …]
Dserver_node.h47 …bool Start(const uint32_t &timeout = PSContext::instance()->cluster_config().cluster_available_tim…
Dworker_node.h40 …bool Start(const uint32_t &timeout = PSContext::instance()->cluster_config().cluster_available_tim…
/third_party/ffmpeg/libavcodec/
Daacps.h72 typedef struct PSContext { struct
90 } PSContext; typedef
97 void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps);
100 int AAC_RENAME(ff_ps_apply)(AVCodecContext *avctx, PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R…
/third_party/mindspore/tests/ut/cpp/ps/core/
Dcluster_available_timeout_test.cc43 PSContext::instance()->SetPSEnable(true); in TEST_F()
44 PSContext::instance()->cluster_config().cluster_available_timeout = 3; in TEST_F()
45 …MS_LOG(INFO) << "The timeout is:" << PSContext::instance()->cluster_config().cluster_available_tim… in TEST_F()
Dcluster_metadata_test.cc45 PSContext::instance()->SetPSEnable(true); in TEST_F()
46 EXPECT_EQ(300, PSContext::instance()->cluster_config().cluster_available_timeout); in TEST_F()
/third_party/mindspore/mindspore/ccsrc/fl/server/kernel/round/
Dstart_fl_job_kernel.cc219 auto fbs_server_mode = fbb->CreateString(ps::PSContext::instance()->server_mode()); in BuildStartFLJobRsp()
220 auto fbs_fl_name = fbb->CreateString(ps::PSContext::instance()->fl_name()); in BuildStartFLJobRsp()
231 auto encrypt_type = fbb->CreateString(ps::PSContext::instance()->encrypt_type()); in BuildStartFLJobRsp()
240 fl_plan_builder.add_iterations(SizeToInt(ps::PSContext::instance()->fl_iteration_num())); in BuildStartFLJobRsp()
241 fl_plan_builder.add_epochs(SizeToInt(ps::PSContext::instance()->client_epoch_num())); in BuildStartFLJobRsp()
242 fl_plan_builder.add_mini_batch(SizeToInt(ps::PSContext::instance()->client_batch_size())); in BuildStartFLJobRsp()
243 fl_plan_builder.add_lr(ps::PSContext::instance()->client_learning_rate()); in BuildStartFLJobRsp()
Dreconstruct_secrets_kernel.cc32 if (ps::PSContext::instance()->resetter_round() == ps::ResetterRound::kReconstructSeccrets) { in InitKernel()
43 …DistributedCountService::GetInstance().RegisterCounter(name_unmask_, ps::PSContext::instance()->in… in InitKernel()
120 if (ps::PSContext::instance()->encrypt_type() == ps::kPWEncryptType) { in OnLastCountEvent()
/third_party/mindspore/mindspore/ccsrc/ps/core/communicator/
Dssl_http.cc50 std::make_unique<FileConfiguration>(PSContext::instance()->config_file_path()); in InitSSL()
65 std::string server_password = PSContext::instance()->server_password(); in InitSSL()
Dssl_client.cc46 std::make_unique<FileConfiguration>(PSContext::instance()->config_file_path()); in InitSSL()
61 std::string client_password = PSContext::instance()->client_password(); in InitSSL()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ps/
Dembedding_look_up_proxy_kernel.cc49 if (mindspore::ps::PSContext::instance()->is_worker()) { in InitKernel()
61 if (mindspore::ps::PSContext::instance()->is_worker()) { in InitKernel()
/third_party/mindspore/mindspore/parallel/
D_ps_context.py19 from mindspore._c_expression import PSContext
44 _ps_context = PSContext.get_instance()
/third_party/mindspore/mindspore/ccsrc/runtime/device/
Dkernel_runtime_manager.cc30 if (ps::PSContext::instance()->is_worker() && ps::PsDataPrefetch::GetInstance().cache_enable()) { in ClearRuntimeResource()
136 if (ps::PSContext::instance()->is_worker() && ps::PsDataPrefetch::GetInstance().cache_enable()) { in ReleaseKernelRuntime()

123