feat: async colocated GRPO with Megatron inference - #2884
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test b4265ac |
b4265ac to
34c41e9
Compare
|
/ok to test 34c41e9 |
34c41e9 to
5219117
Compare
cspades
left a comment
There was a problem hiding this comment.
Have some n00b questions but particularly the main RL loop LGTM!
|
|
||
| assert (not colocated_inference) or ( | ||
| isinstance(policy_generation, MegatronGeneration) | ||
| ), "Colocated async GRPO is unsupported for the desired generation backend." |
There was a problem hiding this comment.
More helpful user message: "Colocated async GRPO is only supported for the Megatron generation backend." (Add more generation backends to this message as they become supported.)
| policy_generation.finish_generation() | ||
| # Colocated engine stays alive across steps (preserves KV cache). | ||
| if not colocated_inference: | ||
| policy_generation.finish_generation() |
There was a problem hiding this comment.
INFO: Do you happen to know why non-colocated vLLM generation clear its prefix cache while we don't? Is it a performance trade-off to not re-populate the cache?
| if not self._inference_engine_initialized: | ||
| return | ||
| self._sleep() | ||
| torch.cuda.synchronize() |
There was a problem hiding this comment.
INFO: What's the context behind why this sync existed before? Did we need to make sure all streams on this device have completed their work before we refit in the non-colocated case?
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com> Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com> Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com> Co-authored-by: Anil Thomas <anlthms@users.noreply.github.com>
5219117 to
0946860
Compare
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
|
/ok to test bd52c73 |
Signed-off-by: Teodor-Dumitru Ene <teodord.ene@gmail.com>
|
/ok to test 9ef4202 |
What does this PR do ?
This PR adds async colocated capability to NeMo RL, which currently only supports async non-colocated and sync colocated.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information