Repository navigation
perf(verl): batch rollout status polling - #612
Open
Bozhen Peng (kiteretsu903) wants to merge 1 commit into
Open
Bozhen Peng (kiteretsu903) wants to merge 1 commit into
Bozhen Peng (kiteretsu903) wants to merge 1 commit into
Conversation
Contributor
|
It is useful but using "POST /api/rollouts/status" is strange for a read-only endpoint. Maybe "GET /api/rollouts/statuses"? |
Contributor
Author
Thanks for the feedback! The design is to check 256 rollouts at once, and their IDs can go beyond 8 KB proxy limit on GET. But POST puts the IDs in the request body to avoid this problem. |
This branch has not been deployed
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.
perf(verl): batch rollout status polling
I noticed that both rollout managers fetch the full rollout, including its input and config, every time they check whether an agent has finished. The Search-R1 example creates 2,048 rollouts per training batch, so that can mean 2,048 separate HTTP requests in a single sweep, even when everyone is still running.
This adds a read-only
POST /api/rollouts/statusendpoint and uses it to check up to 256 rollouts at a time. Full details are fetched when a rollout finishes, so completion hooks still receive the input and metadata they need. The status response keeps all lifecycle fields, including timestamps. I also kept transient retries while making permanent errors such as a missing rollout fail immediately.In a local benchmark with 2,048 rollouts and synthetic 4 KB inputs, one status sweep went from 2,048 requests to 8, and response data fell from 9.20 MB to 0.40 MB. Median sweep time over three trials was 1.82 s before and 22 ms after.
The Gateway and trainer need to be upgraded together for the new endpoint. I documented the request format, batch limit, authentication, and error behavior.
Validation
I used Python 3.12 with the locked CPU dependencies and added focused coverage for batch boundaries, retries, lifecycle fields, hook rewards, timestamps, and asynchronous group carry-over.
python -m pytest -q --durations=10 tests— 145 passed.python -m pytest -q tests/server tests/controller tests/test_package.py tests/examples/test_swe_smith_images.py— 64 passed in a separate environment with only the release workflow's core/dev dependencies.ruff check .,ruff format --check .,python scripts/check_headers.py, andpre-commit run --all-files --show-diff-on-failure— passed.pyright --venvpath /home/admin1/os-contributions/agent-lightning-research— no errors or warnings.uv build --no-sources --out-dir /mnt/d/Documents/os-contributions/verification/agent-lightning-next/dist— passed; checked the updated modules in both archives.mkdocs build --strict --site-dir /mnt/d/Documents/os-contributions/verification/agent-lightning-next/site— passed.