Don't block the Ray transport loop on training RPCs - #104
Open
sfc-gh-truwase wants to merge 1 commit into
Open
Conversation
ray.get in forward_backward/step froze the in-process vLLM scheduler that shares RayTransport's event loop. Await ObjectRefs under a train-op lock so generate can progress and DP collectives stay single-flight. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ray.getinArcticRLRayServer.forward_backward/forward/step/save/load_checkpointwithawait asyncio.gather(same as the HTTP server) so the in-process vLLM request scheduler can keep running during train.asyncio.Lockso unblocking the loop cannot interleave two DP collectives.stepdoes not callray.getand that two in-flightsteps stay single-flight.This is independent of the TRL backend. On the current TRL branch the same commit is cherry-picked as
8339f97onfix/ray-transport-nonblocking-gatherfor a GSM8K Ray before/after.Test plan
pytest tests/common/test_ray_server_training_gather.pyfix/ray-transport-nonblocking-gathervstrl-training-client) — compare wall, step p50/p95, weight_sync p50, idlefwd_bwd+stepsucceeds (no new hang)Made with Cursor