Enable Ragged Rollouts: Allow Variable-Length list[sample] per Batch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.5k
- Forks
- 1.3k
- Avg merge
- 5h 36m
- Merged PRs (30d)
- 22
Description
Could we support padding-style samples—i.e., samples that are masked out so they don’t participate in weight updates or advantage computation? The main use case is when each rollout returns a variable number of samples. My current approach is to pad with dummy samples to force every rollout to return a fixed-length list[sample].
Even better would be supporting variable-length list[sample] within a batch. For example, with rollout_batch_size = 1 and n_samples_per_prompt = 2, the first rollout might return one sample and the second rollout two samples—giving 3 in total, which can’t be evenly divided by 1 * 2
This happens with longer conversations, where one sample has to be split into multiple samples. Consequently, the length of the list[sample] returned by a single rollout becomes variable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files, tests, or entry points. Start by tracing how rollouts are batched and how list[sample] lengths are validated, then define how padding masks should affect weight updates and advantage computation; done means variable-length samples work within a batch without dummy samples or uneven-size failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100