← All questions
Training & Fine-tuningVery Hard· Pipelining· Optimization· Distributed Training

How would you overlap rollout generation and gradient c...

Double-buffering allows the trainer to execute K inner gradient steps on batch N while rollout workers simultaneously generate batch N+1 using weights from iteration N. This approach hides synchronization latency by pipelining weight broadcasts with the final inner steps of the previous batch. Careful accounting is required because log-probabilities for the new batch are computed under older weights, meaning the clipping ratio must be adjusted to ensure consistency.

Code playground (Python)