Skip to content

[BREAKING][rollout] feat: adapt to verl LLMServerClient refactor#52

Merged
SamitHuang merged 3 commits intoverl-project:mainfrom
SamitHuang:feat/adapt-verl-llm-server-client
May 1, 2026
Merged

[BREAKING][rollout] feat: adapt to verl LLMServerClient refactor#52
SamitHuang merged 3 commits intoverl-project:mainfrom
SamitHuang:feat/adapt-verl-llm-server-client

Conversation

@SamitHuang
Copy link
Copy Markdown
Collaborator

Adapt verl-omni's diffusion agent loop and ray trainer to verl-project/verl#6129, which removed AsyncLLMServerManager and made AgentLoopManager / AgentLoopWorker consume an LLMServerClient produced by a separately-owned LLMServerManager.

verl-omni changes:

  • DiffusionAgentLoopWorker.init now takes (config, llm_client, teacher_client, reward_loop_worker_handles), matching the positional contract that AgentLoopManager.create() uses when spawning workers. _get_rollout_and_model_config was also dropped upstream, so the config slicing is inlined to keep the diff minimal.
  • ray_diffusion_trainer now creates an LLMServerManager first, hands its client to AgentLoopManager.create(), and uses llm_server_manager.get_replicas() (instead of async_rollout_manager.rollout_replicas) to wire the CheckpointEngineManager. This mirrors the new pattern in upstream verl/trainer/ppo/ray_trainer.py.
  • tests/agent_loop/test_diffusion_agent_loop.py is updated for the new API; in standalone test mode LLMServerManager spins up its own replicas via rollout.nnodes / n_gpus_per_node.

Pin / docs / CI:

  • Bump the pinned verl commit to a4351480 (the merge commit of #5209), which is the first commit that ships verl/experimental/reward_loop/router/ in the wheel AND contains the #6129 refactor that this change adapts to. With this commit, the workaround in PR [doc, ci] chore: bump verl pin past router packaging fix (#5209) #51 (clone + editable install) is no longer required.
  • Restore the simple uv pip install git+...@<commit> install line in docs/start/install.md.
  • Bump the same pin in .github/workflows/{cpu_unit_tests,sanity,type-coverage-check}.yml.

This is a BREAKING change because DiffusionAgentLoopWorker.init signature changed. Any downstream code that subclasses or directly instantiates DiffusionAgentLoopWorker must switch from (servers, load_balancer_handle, teacher_servers, teacher_load_balancer_handle) to (llm_client, teacher_client). No public CLI/config surface is affected.

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, vllm_omni, rollout, trainer, ci, training_utils, recipe, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward, diffusion, omni, tests, docker
    • If this PR involves multiple modules, separate them with , like [diffusion, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][diffusion, fsdp] feat: new rollout scheduler

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

  • Read the Contribute Guide.
  • Apply pre-commit checks: pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=always
  • Add / Update the documentation.
  • Add unit or end-to-end test(s) to the CI workflow to cover all the code. If not feasible, explain why: ...

@SamitHuang SamitHuang requested a review from zhtmike as a code owner April 30, 2026 19:08
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the verl dependency to a newer commit and refactors the agent loop and trainer components to integrate with the LLMServerManager architecture. The DiffusionAgentLoopWorker now receives an LLMServerClient instead of managing server handles internally, and the RayDiffusionTrainer has been updated to handle the lifecycle of the LLM server. Feedback was provided to improve type safety by explicitly marking the teacher_client parameter as optional in the DiffusionAgentLoopWorker constructor.

Comment thread verl_omni/agent_loop/diffusion_agent_loop.py Outdated
Comment thread tests/agent_loop/test_diffusion_agent_loop.py Outdated
Comment thread verl_omni/trainer/diffusion/ray_diffusion_trainer.py Outdated
@SamitHuang SamitHuang added the ready-for-ci read for running CI label May 1, 2026
SamitHuang and others added 3 commits May 1, 2026 13:56
Adapt verl-omni's diffusion agent loop and ray trainer to verl-project/verl#6129,
which removed AsyncLLMServerManager and made AgentLoopManager / AgentLoopWorker
consume an LLMServerClient produced by a separately-owned LLMServerManager.

verl-omni changes:
- DiffusionAgentLoopWorker.__init__ now takes (config, llm_client, teacher_client,
  reward_loop_worker_handles), matching the positional contract that
  AgentLoopManager.create() uses when spawning workers. _get_rollout_and_model_config
  was also dropped upstream, so the config slicing is inlined to keep the diff
  minimal.
- ray_diffusion_trainer now creates an LLMServerManager first, hands its client to
  AgentLoopManager.create(), and uses llm_server_manager.get_replicas() (instead of
  async_rollout_manager.rollout_replicas) to wire the CheckpointEngineManager. This
  mirrors the new pattern in upstream verl/trainer/ppo/ray_trainer.py.
- tests/agent_loop/test_diffusion_agent_loop.py is updated for the new API; in
  standalone test mode LLMServerManager spins up its own replicas via
  rollout.nnodes / n_gpus_per_node.

Pin / docs / CI:
- Bump the pinned verl commit to a4351480 (the merge commit of #5209), which is
  the first commit that ships verl/experimental/reward_loop/router/ in the wheel
  AND contains the #6129 refactor that this change adapts to. With this commit,
  the workaround in PR verl-project#51 (clone + editable install) is no longer required.
- Restore the simple `uv pip install git+...@<commit>` install line in
  docs/start/install.md.
- Bump the same pin in .github/workflows/{cpu_unit_tests,sanity,type-coverage-check}.yml.

This is a BREAKING change because DiffusionAgentLoopWorker.__init__ signature changed.
Any downstream code that subclasses or directly instantiates DiffusionAgentLoopWorker
must switch from (servers, load_balancer_handle, teacher_servers, teacher_load_balancer_handle)
to (llm_client, teacher_client). No public CLI/config surface is affected.

Signed-off-by: samithuang <285365963@qq.com>
Signed-off-by: samithuang <285365963@qq.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Samit <285365963@qq.com>
Signed-off-by: samithuang <285365963@qq.com>
@SamitHuang SamitHuang force-pushed the feat/adapt-verl-llm-server-client branch from c26e9e4 to 7c1e490 Compare May 1, 2026 13:56
@SamitHuang SamitHuang merged commit 819ce03 into verl-project:main May 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ci read for running CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants