Skip to content

Commit

Permalink
support parallel reward function
Browse files Browse the repository at this point in the history
  • Loading branch information
聂靖入 committed Oct 25, 2023
1 parent 6068728 commit 42a91c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trlx/trainer/accelerate_ppo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def make_experience(self, num_rollouts: int = 1024, iter_count: int = 0): # noq
else:
all_scores = None
max_len = torch.tensor(0, dtype=torch.long, device=device)

if self.config.train.reward_only_in_main_process:
if torch.distributed.is_initialized():
torch.distributed.broadcast(max_len, 0)
Expand Down

0 comments on commit 42a91c4

Please sign in to comment.