From 5ac5bd03d824c6b0eb13a7a810d4951229bf9497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:58:17 +0800 Subject: [PATCH] [CodeStyle][Typos][S-42] Fix typo (stop) (#71004) --- _typos.toml | 3 --- .../distributed/ps/service/brpc_ps_server.cc | 4 ++-- .../distributed/ps/service/brpc_ps_server.h | 4 ++-- .../distributed/ps/service/graph_brpc_server.cc | 2 +- .../distributed/ps/service/graph_brpc_server.h | 6 +++--- .../fluid/distributed/ps/service/heter_server.cc | 16 ++++++++-------- .../fluid/distributed/ps/service/heter_server.h | 8 ++++---- .../ps/service/ps_service/graph_py_service.cc | 4 ++-- .../ps/service/ps_service/graph_py_service.h | 2 +- paddle/fluid/platform/profiler/cuda_tracer.cc | 8 ++++---- .../profiler/custom_device/custom_tracer.cc | 8 ++++---- paddle/fluid/platform/profiler/host_tracer.cc | 8 ++++---- paddle/fluid/platform/profiler/tracer_base.h | 2 +- paddle/fluid/platform/profiler/xpu_tracer.cc | 8 ++++---- paddle/phi/api/profiler/tracer_base.h | 2 +- .../distributed/auto_parallel/static/cluster.py | 2 +- 16 files changed, 42 insertions(+), 45 deletions(-) diff --git a/_typos.toml b/_typos.toml index 337b8231e8631..61042f52967f0 100644 --- a/_typos.toml +++ b/_typos.toml @@ -83,9 +83,6 @@ statment = 'statment' staticly = 'staticly' staticaly = 'staticaly' Stati = 'Stati' -STOPED = 'STOPED' -Stoped = 'Stoped' -stoped = 'stoped' storeage = 'storeage' sotring = 'sotring' stragety = 'stragety' diff --git a/paddle/fluid/distributed/ps/service/brpc_ps_server.cc b/paddle/fluid/distributed/ps/service/brpc_ps_server.cc index 6a0c1bdf9ab56..eb3550667b841 100644 --- a/paddle/fluid/distributed/ps/service/brpc_ps_server.cc +++ b/paddle/fluid/distributed/ps/service/brpc_ps_server.cc @@ -93,7 +93,7 @@ uint64_t BrpcPsServer::Start(const std::string &ip, uint32_t port) { } _environment->RegistePsServer(ip, port, _rank); - cv_.wait(lock, [&] { return stoped_; }); + cv_.wait(lock, [&] { return stopped_; }); PSHost host; host.ip = ip; @@ -849,7 +849,7 @@ int32_t BrpcPsService::StopServer(Table *table, auto *p_server = _server; std::thread t_stop([p_server]() { p_server->Stop(); - VLOG(3) << "Server Stoped"; + VLOG(3) << "Server Stopped"; }); t_stop.detach(); return 0; diff --git a/paddle/fluid/distributed/ps/service/brpc_ps_server.h b/paddle/fluid/distributed/ps/service/brpc_ps_server.h index 321adf156c4d8..ea16e0d2f0da3 100644 --- a/paddle/fluid/distributed/ps/service/brpc_ps_server.h +++ b/paddle/fluid/distributed/ps/service/brpc_ps_server.h @@ -44,7 +44,7 @@ class BrpcPsServer : public PSServer { virtual uint64_t Start(const std::string &ip, uint32_t port); virtual int32_t Stop() { std::unique_lock lock(mutex_); - stoped_ = true; + stopped_ = true; cv_.notify_all(); _server.Stop(1000); @@ -64,7 +64,7 @@ class BrpcPsServer : public PSServer { virtual int32_t Initialize(); mutable std::mutex mutex_; std::condition_variable cv_; - bool stoped_ = false; + bool stopped_ = false; brpc::Server _server; std::shared_ptr _service; std::vector> _pserver_channels; diff --git a/paddle/fluid/distributed/ps/service/graph_brpc_server.cc b/paddle/fluid/distributed/ps/service/graph_brpc_server.cc index 6c525d9a57096..f6c515a53e8f4 100644 --- a/paddle/fluid/distributed/ps/service/graph_brpc_server.cc +++ b/paddle/fluid/distributed/ps/service/graph_brpc_server.cc @@ -346,7 +346,7 @@ int32_t GraphBrpcService::StopServer(Table *table, GraphBrpcServer *p_server = reinterpret_cast(_server); std::thread t_stop([p_server]() { p_server->Stop(); - LOG(INFO) << "Server Stoped"; + LOG(INFO) << "Server Stopped"; }); p_server->export_cv()->notify_all(); t_stop.detach(); diff --git a/paddle/fluid/distributed/ps/service/graph_brpc_server.h b/paddle/fluid/distributed/ps/service/graph_brpc_server.h index f933ddaacd6e5..eb2455d36c5ab 100644 --- a/paddle/fluid/distributed/ps/service/graph_brpc_server.h +++ b/paddle/fluid/distributed/ps/service/graph_brpc_server.h @@ -36,8 +36,8 @@ class GraphBrpcServer : public PSServer { virtual brpc::Channel *GetCmdChannel(size_t server_index); virtual int32_t Stop() { std::unique_lock lock(mutex_); - if (stoped_) return 0; - stoped_ = true; + if (stopped_) return 0; + stopped_ = true; // cv_.notify_all(); _server.Stop(1000); _server.Join(); @@ -51,7 +51,7 @@ class GraphBrpcServer : public PSServer { virtual int32_t Initialize(); mutable std::mutex mutex_; std::condition_variable cv_; - bool stoped_ = false; + bool stopped_ = false; int rank; brpc::Server _server; std::shared_ptr _service; diff --git a/paddle/fluid/distributed/ps/service/heter_server.cc b/paddle/fluid/distributed/ps/service/heter_server.cc index b83163570a1f2..57b51649c8d1f 100644 --- a/paddle/fluid/distributed/ps/service/heter_server.cc +++ b/paddle/fluid/distributed/ps/service/heter_server.cc @@ -49,15 +49,15 @@ void HeterServer::StartHeterService(bool need_encrypt) { { std::lock_guard lock(this->mutex_ready_); - stoped_ = false; + stopped_ = false; ready_ = 1; } condition_ready_.notify_all(); - VLOG(4) << "stopped: " << stoped_ << ", ready_: " << ready_; + VLOG(4) << "stopped: " << stopped_ << ", ready_: " << ready_; std::unique_lock running_lock(mutex_); cv_.wait(running_lock, [&] { - VLOG(4) << "Heter Server is Stop? " << stoped_; - return stoped_; + VLOG(4) << "Heter Server is Stop? " << stopped_; + return stopped_; }); VLOG(4) << "start service done"; } @@ -85,15 +85,15 @@ void HeterServer::StartHeterInterService(bool need_encrypt) { } { std::lock_guard lock(this->mutex_ready_); - stoped_ = false; + stopped_ = false; ready_ = 1; } condition_ready_.notify_all(); - VLOG(4) << "stopped: " << stoped_ << ", ready_: " << ready_; + VLOG(4) << "stopped: " << stopped_ << ", ready_: " << ready_; std::unique_lock running_lock(mutex_); cv_.wait(running_lock, [&] { - VLOG(4) << "Heter Server is Stop? " << stoped_; - return stoped_; + VLOG(4) << "Heter Server is Stop? " << stopped_; + return stopped_; }); VLOG(4) << "start service done"; } diff --git a/paddle/fluid/distributed/ps/service/heter_server.h b/paddle/fluid/distributed/ps/service/heter_server.h index a6a9c60621ec0..12c351587e063 100644 --- a/paddle/fluid/distributed/ps/service/heter_server.h +++ b/paddle/fluid/distributed/ps/service/heter_server.h @@ -582,11 +582,11 @@ class HeterServer { virtual ~HeterServer() {} void Stop() { std::unique_lock lock(mutex_); - if (stoped_ == true) return; + if (stopped_ == true) return; if (!IsExit()) { service_.ForceExit(); } - stoped_ = true; + stopped_ = true; cv_.notify_all(); server_.Stop(1000); server_.Join(); @@ -594,7 +594,7 @@ class HeterServer { bool IsStop() { std::unique_lock lock(mutex_); - return stoped_; + return stopped_; } bool IsExit() { return service_.IsExit(); } @@ -664,7 +664,7 @@ class HeterServer { static std::mutex mtx_; std::condition_variable cv_; std::condition_variable condition_ready_; - bool stoped_ = true; + bool stopped_ = true; std::string endpoint_; std::string endpoint_inter_; // for switch diff --git a/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.cc b/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.cc index 44a6057efdeb5..1f562ff24e37e 100644 --- a/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.cc +++ b/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.cc @@ -501,9 +501,9 @@ std::vector GraphPyClient::pull_graph_list( void GraphPyClient::StopServer() { VLOG(0) << "going to stop server"; std::unique_lock lock(mutex_); - if (stoped_) return; + if (stopped_) return; auto status = this->worker_ptr->StopServer(); - if (status.get() == 0) stoped_ = true; + if (status.get() == 0) stopped_ = true; } void GraphPyClient::FinalizeWorker() { this->worker_ptr->FinalizeWorker(); } } // namespace paddle::distributed diff --git a/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.h b/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.h index 5c5655e4bbf12..1effe0c83972a 100644 --- a/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.h +++ b/paddle/fluid/distributed/ps/service/ps_service/graph_py_service.h @@ -211,7 +211,7 @@ class GraphPyClient : public GraphPyService { int client_id; std::shared_ptr<::paddle::distributed::GraphBrpcClient> worker_ptr; std::thread* client_thread; - bool stoped_ = false; + bool stopped_ = false; }; } // namespace distributed } // namespace paddle diff --git a/paddle/fluid/platform/profiler/cuda_tracer.cc b/paddle/fluid/platform/profiler/cuda_tracer.cc index 27a851f6341c5..140551afad2ee 100644 --- a/paddle/fluid/platform/profiler/cuda_tracer.cc +++ b/paddle/fluid/platform/profiler/cuda_tracer.cc @@ -49,7 +49,7 @@ CudaTracer::CudaTracer() = default; void CudaTracer::PrepareTracing() { PADDLE_ENFORCE_EQ( - state_ == TracerState::UNINITED || state_ == TracerState::STOPED, + state_ == TracerState::UNINITED || state_ == TracerState::STOPPED, true, common::errors::PreconditionNotMet("Tracer must be UNINITED")); EnableCuptiActivity(); @@ -72,14 +72,14 @@ void CudaTracer::StopTracing() { TracerState::STARTED, common::errors::PreconditionNotMet("Tracer must be STARTED")); DisableCuptiActivity(); - state_ = TracerState::STOPED; + state_ = TracerState::STOPPED; } void CudaTracer::CollectTraceData(TraceEventCollector* collector) { PADDLE_ENFORCE_EQ( state_, - TracerState::STOPED, - common::errors::PreconditionNotMet("Tracer must be STOPED")); + TracerState::STOPPED, + common::errors::PreconditionNotMet("Tracer must be STOPPED")); ProcessCuptiActivity(collector); } diff --git a/paddle/fluid/platform/profiler/custom_device/custom_tracer.cc b/paddle/fluid/platform/profiler/custom_device/custom_tracer.cc index b2db390691eac..fd9df3c202055 100644 --- a/paddle/fluid/platform/profiler/custom_device/custom_tracer.cc +++ b/paddle/fluid/platform/profiler/custom_device/custom_tracer.cc @@ -59,7 +59,7 @@ void CustomTracer::Release() { void CustomTracer::PrepareTracing() { PADDLE_ENFORCE_EQ( - state_ == TracerState::UNINITED || state_ == TracerState::STOPED, + state_ == TracerState::UNINITED || state_ == TracerState::STOPPED, true, common::errors::PreconditionNotMet("CustomTracer must be UNINITED")); #ifdef PADDLE_WITH_CUSTOM_DEVICE @@ -88,14 +88,14 @@ void CustomTracer::StopTracing() { #ifdef PADDLE_WITH_CUSTOM_DEVICE phi::DeviceManager::ProfilerStopTracing(dev_type_, &collector_, context_); #endif - state_ = TracerState::STOPED; + state_ = TracerState::STOPPED; } void CustomTracer::CollectTraceData(TraceEventCollector* collector) { PADDLE_ENFORCE_EQ( state_, - TracerState::STOPED, - common::errors::PreconditionNotMet("Tracer must be STOPED")); + TracerState::STOPPED, + common::errors::PreconditionNotMet("Tracer must be STOPPED")); #ifdef PADDLE_WITH_CUSTOM_DEVICE phi::DeviceManager::ProfilerCollectTraceData( dev_type_, &collector_, tracing_start_ns_, context_); diff --git a/paddle/fluid/platform/profiler/host_tracer.cc b/paddle/fluid/platform/profiler/host_tracer.cc index 093df80aa4bee..c4b337c3adaa7 100644 --- a/paddle/fluid/platform/profiler/host_tracer.cc +++ b/paddle/fluid/platform/profiler/host_tracer.cc @@ -139,7 +139,7 @@ void HostTracer::PrepareTracing() { void HostTracer::StartTracing() { PADDLE_ENFORCE_EQ( - state_ == TracerState::READY || state_ == TracerState::STOPED, + state_ == TracerState::READY || state_ == TracerState::STOPPED, true, common::errors::PreconditionNotMet("TracerState must be READY")); HostEventRecorder::GetInstance().GatherEvents(); @@ -156,14 +156,14 @@ void HostTracer::StopTracing() { TracerState::STARTED, common::errors::PreconditionNotMet("TracerState must be STARTED")); HostTraceLevel::GetInstance().SetLevel(HostTraceLevel::kDisabled); - state_ = TracerState::STOPED; + state_ = TracerState::STOPPED; } void HostTracer::CollectTraceData(TraceEventCollector* collector) { PADDLE_ENFORCE_EQ( state_, - TracerState::STOPED, - common::errors::PreconditionNotMet("TracerState must be STOPED")); + TracerState::STOPPED, + common::errors::PreconditionNotMet("TracerState must be STOPPED")); HostEventSection host_events = HostEventRecorder::GetInstance().GatherEvents(); ProcessHostEvents(host_events, collector); diff --git a/paddle/fluid/platform/profiler/tracer_base.h b/paddle/fluid/platform/profiler/tracer_base.h index 131159baff01b..58fa6fc72edb6 100644 --- a/paddle/fluid/platform/profiler/tracer_base.h +++ b/paddle/fluid/platform/profiler/tracer_base.h @@ -22,7 +22,7 @@ namespace platform { class TracerBase { public: // The state machine for a Tracer. - enum class TracerState { UNINITED, READY, STARTED, STOPED }; + enum class TracerState { UNINITED, READY, STARTED, STOPPED }; virtual void PrepareTracing() { state_ = TracerState::READY; } diff --git a/paddle/fluid/platform/profiler/xpu_tracer.cc b/paddle/fluid/platform/profiler/xpu_tracer.cc index 0bc056eb4d844..9b4a08b745a69 100644 --- a/paddle/fluid/platform/profiler/xpu_tracer.cc +++ b/paddle/fluid/platform/profiler/xpu_tracer.cc @@ -39,7 +39,7 @@ namespace paddle::platform { void XPUTracer::PrepareTracing() { PADDLE_ENFORCE_EQ( - state_ == TracerState::UNINITED || state_ == TracerState::STOPED, + state_ == TracerState::UNINITED || state_ == TracerState::STOPPED, true, common::errors::PreconditionNotMet("XPUTracer must be UNINITED")); #ifdef PADDLE_WITH_XPTI @@ -71,7 +71,7 @@ void XPUTracer::StopTracing() { XPTI_CALL(phi::dynload::xptiActivityDisable()); VLOG(3) << "disable xpti activity"; #endif - state_ = TracerState::STOPED; + state_ = TracerState::STOPPED; } #ifdef PADDLE_WITH_XPTI @@ -158,8 +158,8 @@ void AddMemcpyRecord(const baidu::xpu::xpti::XPTIEventMem* memcpy, void XPUTracer::CollectTraceData(TraceEventCollector* collector) { PADDLE_ENFORCE_EQ( state_, - TracerState::STOPED, - common::errors::PreconditionNotMet("Tracer must be STOPED")); + TracerState::STOPPED, + common::errors::PreconditionNotMet("Tracer must be STOPPED")); #ifdef PADDLE_WITH_XPTI XPTI_CALL(phi::dynload::xptiActivityFlushAll()); baidu::xpu::xpti::XPTIEvent* record = nullptr; diff --git a/paddle/phi/api/profiler/tracer_base.h b/paddle/phi/api/profiler/tracer_base.h index 011331b607f8c..5dae161367fa2 100644 --- a/paddle/phi/api/profiler/tracer_base.h +++ b/paddle/phi/api/profiler/tracer_base.h @@ -21,7 +21,7 @@ namespace phi { class TracerBase { public: // The state machine for a Tracer. - enum class TracerState { UNINITED, READY, STARTED, STOPED }; + enum class TracerState { UNINITED, READY, STARTED, STOPPED }; virtual void PrepareTracing() { state_ = TracerState::READY; } diff --git a/python/paddle/distributed/auto_parallel/static/cluster.py b/python/paddle/distributed/auto_parallel/static/cluster.py index fabf98e294786..a2f6d60f8afd3 100644 --- a/python/paddle/distributed/auto_parallel/static/cluster.py +++ b/python/paddle/distributed/auto_parallel/static/cluster.py @@ -1338,7 +1338,7 @@ def is_by_json_config(json_config): retry = False logger.info("server stopped success") else: - logger.info("server stoped failed! retry later") + logger.info("server stopped failed! retry later") time.sleep(1) logger.info( f'cluster_topo_info: {json.dumps(cluster.mesh_group.to_json(), indent=3)}'