Skip to content

Commit 9171aaa

Browse files
authored
[fleet_executor] remove SetCreatingFlag (#38539)
1 parent 48f061f commit 9171aaa

10 files changed

+11
-12
lines changed

paddle/fluid/distributed/fleet_executor/carrier.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ class Carrier final {
7373
Interceptor* SetInterceptor(int64_t interceptor_id,
7474
std::unique_ptr<Interceptor>);
7575

76-
void SetCreatingFlag(bool flag) {}
7776
void SetMsgBus(const std::shared_ptr<MessageBus>& msg_bus) {
7877
msg_bus_ = msg_bus;
7978
}

paddle/fluid/distributed/fleet_executor/task_loop.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <vector>
2222

2323
#include "paddle/fluid/framework/blocking_queue.h"
24+
#include "paddle/fluid/platform/macros.h"
2425

2526
namespace paddle {
2627
namespace distributed {
@@ -66,6 +67,8 @@ class TaskLoop {
6667
}
6768

6869
private:
70+
DISABLE_COPY_AND_ASSIGN(TaskLoop);
71+
6972
void AbortNotInLoopThread();
7073

7174
static thread_local TaskLoop* thread_local_loop_;

paddle/fluid/distributed/fleet_executor/task_loop_thread.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <mutex>
1919
#include <thread>
2020

21+
#include "paddle/fluid/platform/macros.h"
22+
2123
namespace paddle {
2224
namespace distributed {
2325

@@ -31,6 +33,8 @@ class TaskLoopThread {
3133
TaskLoop* StartLoop();
3234

3335
private:
36+
DISABLE_COPY_AND_ASSIGN(TaskLoopThread);
37+
3438
void Loop();
3539

3640
bool start_;

paddle/fluid/distributed/fleet_executor/task_loop_thread_pool.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <memory>
1818
#include <vector>
1919

20+
#include "paddle/fluid/platform/macros.h"
21+
2022
namespace paddle {
2123
namespace distributed {
2224

@@ -37,6 +39,8 @@ class TaskLoopThreadPool {
3739
std::vector<TaskLoop*> GetAllLoops();
3840

3941
private:
42+
DISABLE_COPY_AND_ASSIGN(TaskLoopThreadPool);
43+
4044
bool start_;
4145
int thread_num_;
4246
std::vector<std::unique_ptr<TaskLoopThread>> threads_;

paddle/fluid/distributed/fleet_executor/test/compute_interceptor_run_op_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ TEST(ComputeInterceptor, Compute) {
8484
a->SetPlace(place);
8585
a->SetMicroBatchScope(scopes);
8686

87-
carrier.SetCreatingFlag(false);
88-
8987
// start
9088
InterceptorMessage msg;
9189
msg.set_message_type(DATA_IS_READY);

paddle/fluid/distributed/fleet_executor/test/compute_interceptor_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ TEST(ComputeInterceptor, Compute) {
6969
carrier.SetInterceptor(1, InterceptorFactory::Create("Compute", 1, node_b));
7070
carrier.SetInterceptor(2, InterceptorFactory::Create("Compute", 2, node_c));
7171

72-
carrier.SetCreatingFlag(false);
73-
7472
InterceptorMessage msg;
7573
msg.set_message_type(DATA_IS_READY);
7674
// test run three times

paddle/fluid/distributed/fleet_executor/test/interceptor_ping_pong_test.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ TEST(InterceptorTest, PingPong) {
6868
0, InterceptorFactory::Create("PingPong", 0, nullptr));
6969

7070
carrier.SetInterceptor(1, std::make_unique<PingPongInterceptor>(1, nullptr));
71-
carrier.SetCreatingFlag(false);
7271

7372
InterceptorMessage msg;
7473
a->Send(1, msg);

paddle/fluid/distributed/fleet_executor/test/interceptor_ping_pong_with_brpc_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ TEST(InterceptorTest, PingPong) {
113113
if (pid == 0) {
114114
Carrier* carrier =
115115
FleetExecutor::CreateCarrier(0, interceptor_id_to_rank);
116-
carrier->SetCreatingFlag(false);
117116
auto msg_bus = std::make_shared<MessageBus>();
118117
carrier->SetMsgBus(msg_bus);
119118
// NOTE: need Init msg_bus after carrier SetMsgBus
@@ -128,7 +127,6 @@ TEST(InterceptorTest, PingPong) {
128127
} else {
129128
Carrier* carrier =
130129
FleetExecutor::CreateCarrier(1, interceptor_id_to_rank);
131-
carrier->SetCreatingFlag(false);
132130
auto msg_bus = std::make_shared<MessageBus>();
133131
carrier->SetMsgBus(msg_bus);
134132
msg_bus->Init(1, {{0, ip0}, {1, ip1}}, ip1);

paddle/fluid/distributed/fleet_executor/test/interceptor_pipeline_long_path_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ TEST(AmplifierInterceptor, Amplifier) {
8080
carrier.SetInterceptor(4, InterceptorFactory::Create("Amplifier", 4, node_e));
8181
carrier.SetInterceptor(5, InterceptorFactory::Create("Compute", 5, node_f));
8282

83-
carrier.SetCreatingFlag(false);
84-
8583
// start
8684
InterceptorMessage msg;
8785
msg.set_message_type(DATA_IS_READY);

paddle/fluid/distributed/fleet_executor/test/interceptor_pipeline_short_path_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ TEST(AmplifierInterceptor, Amplifier) {
9696
carrier.SetInterceptor(2, InterceptorFactory::Create("Compute", 2, node_c));
9797
carrier.SetInterceptor(3, InterceptorFactory::Create("Amplifier", 3, node_d));
9898

99-
carrier.SetCreatingFlag(false);
100-
10199
// start
102100
InterceptorMessage msg;
103101
msg.set_message_type(DATA_IS_READY);

0 commit comments

Comments
 (0)