[recipe] feat: Revamp single-controller demo with agentic multi-turn rollout and add CI#63
Merged
0oshowero0 merged 2 commits intoAscend:mainfrom Mar 28, 2026
Merged
Conversation
Signed-off-by: Chi Zhang <czhangseu@gmail.com>
CLA Signature Passvermouth1992, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
0oshowero0
approved these changes
Mar 28, 2026
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
single_controller_demo.pyto showcase a realistic agentic RLHF training loop: replaces theprevious hardcoded tensor inputs and
AsyncvLLMServerwith a multi-turnAgentLoopthat interleavesLLM generation with simulated tool calls, an OpenAI-style
MessageDatasetwith interleaved imagesupport, a proper
DataLoader-based training loop, and an explicitcompute_rewardstep that writesadvantages back through TQ.
KVBatchMetainteractions #57 throughout the recipe — useskv_batch_get_by_meta,the return value of
kv_batch_put(cumulativeKVBatchMeta), and removes all manualkv_meta.fields.append(...)calls.@dataclassclasses (TrainerConfig,AgentLoopConfig,MessageDatasetConfig) andargparseCLI, replacing the flatOmegaConf.createdict. Trainer configand TQ config are now cleanly separated.
recipe-check.ymlCI workflow that runs the demo end-to-end on every push/PR with reducedparameters (
--num-samples 8 --global-batch-size 4 --rollout-agent-num-workers 1) to keep CI fast.Key changes
AsyncvLLMServer(Ray actor, single-turn)AgentLoop(multi-turn with tool calls, per-sample async)[[1,2],[3,4],...]tensorsMessageDataset+DataLoaderwith random multi-modal messagestime.sleep)compute_reward()producing per-token advantages via TQkv_batch_get(keys=..., fields=...)+ manual field trackingkv_batch_get_by_meta(meta=...)+kv_batch_putreturn valueOmegaConfdict@dataclasshierarchy +argparseCLIrecipe-check.ymlworkflowTest plan
python recipe/simple_use_case/single_controller_demo.py --num-samples 8 --global-batch-size 4recipe-check.ymlworkflow passes in CIpytest tests) still pass