Skip to content

Run the AsyncGRPO train test against a transformers-backed vLLM server - #8137

Open
qgallouedec wants to merge 21 commits into
mainfrom
async-grpo-test-server
Open

qgallouedec wants to merge 21 commits into
mainfrom
async-grpo-test-server

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Part of #7841, prepares #8146.

The AsyncGRPO train tests stub the rollout worker, so rewards, tools and sampling never run in them. This adds TransformersVLLMServer, a local HTTP server that answers the vLLM endpoints the worker calls and samples with transformers on the trainer's GPU. The vllm_server fixture also hands it to the trainer in place of WeightTransferClient, which needs vLLM and one GPU per NCCL rank, so each sync loads the weights into the server. test_train now runs the real worker against it, and the rollout workers drop their vLLM check, since they only use aiohttp.


Note

Low Risk
Primarily test and dependency changes plus relaxing an import guard on rollout workers; production weight sync still uses vLLM when configured.

Overview
Async AsyncRolloutWorker construction no longer requires a full vLLM install—only aiohttp—matching the worker’s HTTP-only client role; aiohttp>=3.13.3 is added to dev dependencies for that reason.

Tests gain TransformersVLLMServer, a local HTTP shim that implements the rollout endpoints (including sampling masks / inference routes) and samples with transformers on the trainer device, plus InProcessWeightTransferClient to copy synced weights into that server instead of NCCL WeightTransferClient. test_train drives the real rollout worker against this server (with varied_reward so groups stay scorable) and asserts weights reach the served model; the stub rollout/weight-transfer fixtures are opt-in via usefixtures rather than autouse. @require_vllm is dropped from rollout-worker wiring tests that only instantiate the worker.

Reviewed by Cursor Bugbot for commit 1a688df. Bugbot is set up for automated code reviews on this repo. Configure here.

The trainer's real rollout worker and weight sync now run in test_init_minimal and test_train, against a local HTTP
server that answers the vLLM endpoints they call and samples with transformers.
@github-actions github-actions Bot added the 🔧 maintenance CI, tooling, tests, or repo upkeep label Nov 5, 2026
NCCL refuses two ranks on one device, so the fixture hands the trainer's weight stream to the server in place of the
NCCL broadcast. The server now samples from the current policy instead of the initial weights.
# Conflicts:
#	tests/experimental/test_async_grpo_trainer.py
With the server following the policy, lr=0.1 collapses it to one completion within about 20 steps. Every group then
has equal rewards and is dropped for zero std, so no step completes and the test waits forever.
Their trainers sync weights through vLLM's client. Installing vLLM in the main experimental job would pin torch to
vLLM's version (2.13 instead of 2.15) for every experimental test.
The workers reach the server over HTTP with aiohttp and import nothing from vLLM. The weight sync, which does, keeps its
own check in WeightTransferClient.
The fixture gives the trainer the server in place of WeightTransferClient, which needs vLLM and one device per NCCL
rank. The train tests then run without vLLM, and the gates that only covered the worker's vLLM check go.
# Conflicts:
#	tests/experimental/test_async_distillation_trainer.py
The fixture starts a server per model id. The server reports a 512-token context, answers the top-k candidate-set
endpoint, serves vision-language checkpoints, replays scripted completions, and joins its request threads on close.
test_train no longer needs its token_budget.
# Conflicts:
#	tests/experimental/test_async_grpo_trainer.py
@qgallouedec
qgallouedec marked this pull request as ready for review November 9, 2026 10:30
@qgallouedec
qgallouedec requested a review from AmineDiro November 9, 2026 10:32
@bot-ci-comment

bot-ci-comment Bot commented Nov 9, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 86ef884. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T10:44:01.851435Z 86ef884 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AmineDiro
AmineDiro added this pull request to stack #8192 November 9, 2026 13:35
return Handler


@pytest.fixture

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this fixture define a scope here ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, on purpose. Each test trains the served model and may give the server a script, so a shared server would carry both into the next test. It also uses monkeypatch, which is function-scoped, and the model loads in a few seconds.

…erClient, and name the fixture make_vllm_server
…at train without a server, instead of applying them to every test

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 maintenance CI, tooling, tests, or repo upkeep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants