Skip to content

Commit 6abffb9

Browse files
committed
fix evaluation
1 parent 1644adf commit 6abffb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

applications/ColossalChat/coati/distributed/producer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def loop(self) -> None:
180180
break
181181
if self.eval_interval > 0 and self.eval_dataset_config is not None:
182182
if (
183-
self.consumer_global_step % self.eval_interval == 0
183+
self.consumer_global_step - self.lastest_eval_step >= self.eval_interval
184184
and self.consumer_global_step > self.lastest_eval_step
185185
):
186186
to_log_msg = {}
@@ -256,6 +256,8 @@ def loop(self) -> None:
256256
state_dict = ray_broadcast_tensor_dict(
257257
None, self.num_producers, device=self.device, group_name=f"sync_model_{pp_idx}"
258258
)
259+
if "consumer_global_step" in state_dict:
260+
self.consumer_global_step = state_dict.pop("consumer_global_step").item()
259261
self.load_state_dict(state_dict)
260262
else:
261263
print(

0 commit comments

Comments
 (0)