未验证 提交 b3185296 编写于 作者: Z zmxdream 提交者: GitHub

[heterps]fix heter service (#37860)

* fix heter service. test=develop

* fix heter section worker in debug mode
上级 4035bd2b
...@@ -336,7 +336,7 @@ class HeterServer { ...@@ -336,7 +336,7 @@ class HeterServer {
bool IsExit() { return service_.IsExit(); } bool IsExit() { return service_.IsExit(); }
HeterServer() { this->ready_ = 0; } HeterServer() : service_(), ready_(0) {}
void RegisterServiceHandler(std::string message_name, void RegisterServiceHandler(std::string message_name,
HeterServiceHandler func); HeterServiceHandler func);
...@@ -391,7 +391,7 @@ class HeterServer { ...@@ -391,7 +391,7 @@ class HeterServer {
DISABLE_COPY_AND_ASSIGN(HeterServer); DISABLE_COPY_AND_ASSIGN(HeterServer);
std::mutex mutex_ready_; std::mutex mutex_ready_;
int ready_ = 0; int ready_;
}; };
} // end namespace distributed } // end namespace distributed
......
...@@ -277,7 +277,7 @@ void HeterSectionWorker::CopyParameters(int microbatch_id, ...@@ -277,7 +277,7 @@ void HeterSectionWorker::CopyParameters(int microbatch_id,
void HeterSectionWorker::Run() { void HeterSectionWorker::Run() {
if (debug_) { if (debug_) {
size_t total_ops_size = forward_ops_.size() + backward_ops_.size(); size_t total_ops_size = forward_ops_.size() + backward_ops_.size();
op_name_.resize(total_ops_size); op_name_.reserve(total_ops_size);
op_total_time_.resize(total_ops_size); op_total_time_.resize(total_ops_size);
platform::SetNumThreads(1); platform::SetNumThreads(1);
// forward op + backward op // forward op + backward op
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册