Skip to content

Commit

Permalink
doc clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
qgallouedec committed Feb 5, 2025
1 parent 3a738f9 commit 05778b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions trl/trainer/grpo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ def broadcast_and_slice_dict(accelerator: Accelerator, tensor_dict: dict[str, Te
"""
Broadcasts a dictionary of tensors from one process to all processes and slices the tensors based on the process
index.
```
Process 0 Process 0 Process 1
[[ 1, 2, 3], -> [[1, 2, 3], [[ 7, 8, 9],
[ 4, 5, 6], [4, 5, 6]] [10, 11, 12]]
[ 7, 8, 9],
[10, 11, 12]]
}
```
"""

is_from = accelerator.local_process_index == from_process
Expand Down

0 comments on commit 05778b8

Please sign in to comment.