Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions areal/trainer/rl_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,8 @@ def _save_hf(self, epoch: int, epoch_step: int, global_step: int):
# Async mode: synchronization handled by AsyncCheckpointManager
if not self.saver.is_async:
dist.barrier(group=self.actor.cpu_group)
current_platform.synchronize()
if not is_single_controller():
current_platform.synchronize()

def _save_recover_checkpoint(self, epoch: int, epoch_step: int, global_step: int):
# Save recoverable checkpoints
Expand All @@ -1140,7 +1141,8 @@ def _save_recover_checkpoint(self, epoch: int, epoch_step: int, global_step: int
)

dist.barrier(group=self.actor.cpu_group)
current_platform.synchronize()
if not is_single_controller():
current_platform.synchronize()

def _evaluate_fn(
self,
Expand All @@ -1162,7 +1164,8 @@ def _evaluate_fn(
self.eval_rollout.wait(cnt, timeout=None)

dist.barrier(group=self.actor.cpu_group)
current_platform.synchronize()
if not is_single_controller():
current_platform.synchronize()

def _evaluate(
self,
Expand All @@ -1189,7 +1192,8 @@ def _evaluate(
global_step,
)
dist.barrier(group=self.actor.cpu_group)
current_platform.synchronize()
if not is_single_controller():
current_platform.synchronize()

def _export_and_commit_stats(self, epoch: int, epoch_step: int, global_step: int):
# Upload statistics to the logger (e.g., wandb)
Expand All @@ -1200,7 +1204,8 @@ def _export_and_commit_stats(self, epoch: int, epoch_step: int, global_step: int
self.stats_logger.commit(epoch, epoch_step, global_step, stats)

dist.barrier(group=self.actor.cpu_group)
current_platform.synchronize()
if not is_single_controller():
current_platform.synchronize()

def _validate_cfg(self):
"""validate config for incompatible settings before weight initialization, to avoid wasted resources on spawning workers and loading models."""
Expand Down
Loading