Repository navigation
Add the GRPO-on-Substrate example: a real RL loop with actors as the reward executor - #101
Closed
Vicente Ferrara (vicentefb) wants to merge 4 commits into
Closed
Vicente Ferrara (vicentefb) wants to merge 4 commits into
Vicente Ferrara (vicentefb) wants to merge 4 commits into
Conversation
Vicente Ferrara (vicentefb)
requested review from
jessicaochen and
Tomer Glottmann (tomergee)
October 17, 2026 00:48
|
|
||
|
|
||
| """ | ||
| Real RL loop on CPU: GRPO (TRL) + Substrate actors as the reward executor. |
Collaborator
There was a problem hiding this comment.
I recommend clarifying that this is an RL Loop where all the pieces are in one python process on a CPU machine.
Usually when I hear Real RL Loop, I do expect disaggrated and accelerator usage. Timing & load from a single python process on CPU machine probably does not look like what a classic RL loop would produce.
jessicaochen
approved these changes
Oct 17, 2026
Collaborator
|
This example doesn't belong to this repo, see #109. |
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.
TRL's GRPOTrainer trains Qwen2.5-0.5B on MBPP on a CPU host, every completion runs inside a gVisor actor, and the reward is the share of the task's asserts that pass. Only the sandbox calls changed; the module docstring maps each one to its agent-sandbox counterpart.
What the example adds: a smoke mode that checks the wiring without loading the model; a JSONL record of every create, boot, eval, suspend, wake and heal with wall time, plus
report.pyfor p50/p95/max per event and per step; a first-request retry on wake, since Substrate wakes on the first request rather than on an explicit resume; a working-set knob (random-byte ballast per actor) for suspend and wake cost by size; and a multi-endpoint router that splits the reward fleet across clusters.examples/grpo/README.md has the prerequisites, the run ladder, what to record, and the measured results: ten-step runs on a 4-node cluster and on a 139-node cluster with ac5c5ee0 Substrate, 560 evaluations with no state lost, and the parking cost per step by working set, with a four-worker rerun that separates the placement effect from the build effect.