Skip to content

Commit 2ae18a6

Browse files
committed
fix
Signed-off-by: 0oshowero0 <o0shower0o@outlook.com>
1 parent 8856909 commit 2ae18a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

recipe/transfer_queue/ray_trainer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,9 @@ def _balance_batch(
11181118
world_size = self.actor_rollout_wg.world_size
11191119
if keep_minibatch:
11201120
# Decouple the DP balancing and mini-batching.
1121-
minibatch_size = self.config.actor_rollout_ref.actor.get("ppo_mini_batch_size")
1121+
minibatch_size = self.config.actor_rollout_ref.actor.get("ppo_mini_batch_size", None)
1122+
if minibatch_size is None:
1123+
raise ValueError("'ppo_mini_batch_size' must be set in actor config when 'keep_minibatch' is True.")
11221124
minibatch_num = len(global_seqlen_lst) // minibatch_size
11231125
global_partition_lst = [[] for _ in range(world_size)]
11241126
for i in range(minibatch_num):

0 commit comments

Comments
 (0)