File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -130,14 +130,17 @@ def forward_before(self):
130
130
self .reqs = []
131
131
self .eplb_loader .asyn_expert_weight_transfer (self .reqs )
132
132
133
- def forward_end (self , dummy_run = False ):
133
+ def forward_end (self ,dummy_run = False ):
134
134
self .adaptor .get_rank_expert_workload (self .num_moe_layers ,dummy_run )
135
- if not self .update_in_flight and self .get_update_iteration ():
136
- moe_load = self .compute_and_set_moe_load (dummy_run )
137
- self .wakeup_eplb_worker ()
138
- self .update_in_flight = True
139
- self .wait_worker_iterations = 0
140
- self .weight_loading = False
135
+ if not self .update_in_flight :
136
+ load_gather_iteration , update_iteration = self .get_update_iteration ()
137
+ if load_gather_iteration :
138
+ moe_load = self .compute_and_set_moe_load (dummy_run )
139
+ if update_iteration :
140
+ self .wakeup_eplb_worker ()
141
+ self .update_in_flight = True
142
+ self .wait_worker_iterations = 0
143
+ self .weight_loading = False
141
144
142
145
if self .update_in_flight :
143
146
self .wait_worker_iterations = self .wait_worker_iterations + 1
You can’t perform that action at this time.
0 commit comments