Skip to content

[rollout] feat: use rollout and validate parallel process - #4863

Merged
wuxibin89 merged 8 commits into
verl-project:mainfrom
chenjiaoAngel:async_validate_parallel
Jan 15, 2026
Merged

wuxibin89 merged 8 commits into
verl-project:mainfrom
chenjiaoAngel:async_validate_parallel

Conversation

@chenjiaoAngel

@chenjiaoAngel chenjiaoAngel commented Jan 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

validate process and rollout process can be paralled in fully-async mode. This can reduce rollouter ilde and improve timing_s/gen speed when in short-long response_length case.

This is below profiler: (qwen2.5-Math-7b)

image image image image

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, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching

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.

we can use dapo_7b_math_fsdp2_8_8.sh, and add +async_training.parallel_validate_and_rollout=True command

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.

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

Copy link
Copy Markdown
Contributor

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 introduces parallel processing for validation in the FullyAsyncRollouter by using a ThreadPoolExecutor. This allows validation to run asynchronously, controlled by the parallel_validate_and_rollout configuration. The changes refactor the validation logic to support both synchronous and asynchronous execution paths. My review identifies a critical issue with unhandled exceptions in a fire-and-forget asyncio task, which could lead to silent failures. I have also pointed out several high-severity issues related to Python best practices, such as placing imports inside methods, accessing private attributes, using non-idiomatic boolean comparisons, and including non-English comments, all of which impact code quality and maintainability.

@wuxibin89
wuxibin89 merged commit 941207f into verl-project:main Jan 15, 2026
67 of 71 checks passed

cpu_cores = multiprocessing.cpu_count()
# cpu case use cpu_cores; io case use cpu_cores*2
self.validate_executor = ThreadPoolExecutor(max_workers=cpu_cores)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need more than 1 thread in this case ? Aren't we only making single validate call during validation ?

On high end GPU nodes there are > 100s of CPU core and this will essentially create 100s of unused threads and take memory 100*8MB.

print("[FullyAsyncRollouter] validate_task is running, wait last validate_task to finish")
self.validate_task.get()
self.validate_task = asyncio.create_task(
self.do_validate_async(timing_raw, version, global_steps, use_trainer_do_validate)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here we are only making call to validate method once.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is subject to conditional restrictions, which is controlled by need_validate (consistent with the previous trigger conditions).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was focusing more on the number of threads required to make a single validate call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The number of thread control by generate. validate process only has one thread

vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
…ct#4863)

### 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.

validate process and rollout process can be paralled in fully-async
mode. This can reduce rollouter ilde and improve timing_s/gen speed when
in short-long response_length case.

This is below profiler: (qwen2.5-Math-7b)

<img width="2496" height="1294" alt="image"
src="https://github.com/user-attachments/assets/3f028c27-4257-453c-9fcb-196cf2bac5b5"
/>

<img width="2500" height="1304" alt="image"
src="https://github.com/user-attachments/assets/9265e5ec-5bff-46a9-9cc7-e375849de39b"
/>
<img width="2498" height="1206" alt="image"
src="https://github.com/user-attachments/assets/06e81e89-d7f3-4781-8daf-7e06efeb78c5"
/>
<img width="2518" height="1362" alt="image"
src="https://github.com/user-attachments/assets/24304dc3-a6a9-4f5f-a242-1335b4d5e4b5"
/>


### 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`, `megatron`, `sglang`, `vllm`, `rollout`,
`trainer`, `ci`, `training_utils`, `recipe`, `hardware`, `deployment`,
`ray`, `worker`, `single_controller`, `misc`, `perf`, `model`, `algo`,
`env`, `tool`, `ckpt`, `doc`, `data`, `cfg`, `reward`
- If this PR involves multiple modules, separate them with `,` like
`[megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching`

### 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.

we can use `dapo_7b_math_fsdp2_8_8.sh`, and add
`+async_training.parallel_validate_and_rollout=True` command

### API and Usage Example

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

```python
# 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](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
- [ ] If your PR is related to the `recipe` submodule, please also
update the reference to the submodule commit via `git submodule update
--remote` or `cd recipe && git pull origin main`.

---------

Co-authored-by: Shangwei-Li <lishangwei@mail.ustc.edu.cn>
sophiayyya pushed a commit to sophiayyya/verl that referenced this pull request Jan 25, 2026
…ct#4863)

### 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.

validate process and rollout process can be paralled in fully-async
mode. This can reduce rollouter ilde and improve timing_s/gen speed when
in short-long response_length case.

This is below profiler: (qwen2.5-Math-7b)

<img width="2496" height="1294" alt="image"
src="https://github.com/user-attachments/assets/3f028c27-4257-453c-9fcb-196cf2bac5b5"
/>

<img width="2500" height="1304" alt="image"
src="https://github.com/user-attachments/assets/9265e5ec-5bff-46a9-9cc7-e375849de39b"
/>
<img width="2498" height="1206" alt="image"
src="https://github.com/user-attachments/assets/06e81e89-d7f3-4781-8daf-7e06efeb78c5"
/>
<img width="2518" height="1362" alt="image"
src="https://github.com/user-attachments/assets/24304dc3-a6a9-4f5f-a242-1335b4d5e4b5"
/>


### 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`, `megatron`, `sglang`, `vllm`, `rollout`,
`trainer`, `ci`, `training_utils`, `recipe`, `hardware`, `deployment`,
`ray`, `worker`, `single_controller`, `misc`, `perf`, `model`, `algo`,
`env`, `tool`, `ckpt`, `doc`, `data`, `cfg`, `reward`
- If this PR involves multiple modules, separate them with `,` like
`[megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching`

### 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.

we can use `dapo_7b_math_fsdp2_8_8.sh`, and add
`+async_training.parallel_validate_and_rollout=True` command

### API and Usage Example

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

```python
# 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](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
- [ ] If your PR is related to the `recipe` submodule, please also
update the reference to the submodule commit via `git submodule update
--remote` or `cd recipe && git pull origin main`.

---------

Co-authored-by: Shangwei-Li <lishangwei@mail.ustc.edu.cn>
DaizeDong pushed a commit to DaizeDong/verl that referenced this pull request Apr 19, 2026
…ct#4863)

### 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.

validate process and rollout process can be paralled in fully-async
mode. This can reduce rollouter ilde and improve timing_s/gen speed when
in short-long response_length case.

This is below profiler: (qwen2.5-Math-7b)

<img width="2496" height="1294" alt="image"
src="https://github.com/user-attachments/assets/3f028c27-4257-453c-9fcb-196cf2bac5b5"
/>

<img width="2500" height="1304" alt="image"
src="https://github.com/user-attachments/assets/9265e5ec-5bff-46a9-9cc7-e375849de39b"
/>
<img width="2498" height="1206" alt="image"
src="https://github.com/user-attachments/assets/06e81e89-d7f3-4781-8daf-7e06efeb78c5"
/>
<img width="2518" height="1362" alt="image"
src="https://github.com/user-attachments/assets/24304dc3-a6a9-4f5f-a242-1335b4d5e4b5"
/>


### 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`, `megatron`, `sglang`, `vllm`, `rollout`,
`trainer`, `ci`, `training_utils`, `recipe`, `hardware`, `deployment`,
`ray`, `worker`, `single_controller`, `misc`, `perf`, `model`, `algo`,
`env`, `tool`, `ckpt`, `doc`, `data`, `cfg`, `reward`
- If this PR involves multiple modules, separate them with `,` like
`[megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching`

### 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.

we can use `dapo_7b_math_fsdp2_8_8.sh`, and add
`+async_training.parallel_validate_and_rollout=True` command

### API and Usage Example

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

```python
# 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](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
- [ ] If your PR is related to the `recipe` submodule, please also
update the reference to the submodule commit via `git submodule update
--remote` or `cd recipe && git pull origin main`.

---------

Co-authored-by: Shangwei-Li <lishangwei@mail.ustc.edu.cn>
zwluestc pushed a commit to zwluestc/verl that referenced this pull request May 12, 2026
…ct#4863)

### 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.

validate process and rollout process can be paralled in fully-async
mode. This can reduce rollouter ilde and improve timing_s/gen speed when
in short-long response_length case.

This is below profiler: (qwen2.5-Math-7b)

<img width="2496" height="1294" alt="image"
src="https://github.com/user-attachments/assets/3f028c27-4257-453c-9fcb-196cf2bac5b5"
/>

<img width="2500" height="1304" alt="image"
src="https://github.com/user-attachments/assets/9265e5ec-5bff-46a9-9cc7-e375849de39b"
/>
<img width="2498" height="1206" alt="image"
src="https://github.com/user-attachments/assets/06e81e89-d7f3-4781-8daf-7e06efeb78c5"
/>
<img width="2518" height="1362" alt="image"
src="https://github.com/user-attachments/assets/24304dc3-a6a9-4f5f-a242-1335b4d5e4b5"
/>


### 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`, `megatron`, `sglang`, `vllm`, `rollout`,
`trainer`, `ci`, `training_utils`, `recipe`, `hardware`, `deployment`,
`ray`, `worker`, `single_controller`, `misc`, `perf`, `model`, `algo`,
`env`, `tool`, `ckpt`, `doc`, `data`, `cfg`, `reward`
- If this PR involves multiple modules, separate them with `,` like
`[megatron, fsdp, 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][fsdp, megatron] feat: dynamic batching`

### 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.

we can use `dapo_7b_math_fsdp2_8_8.sh`, and add
`+async_training.parallel_validate_and_rollout=True` command

### API and Usage Example

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

```python
# 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](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md).
- [ ] Apply [pre-commit
checks](https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting):
`pre-commit install && pre-commit run --all-files --show-diff-on-failure
--color=always`
- [ ] Add / Update [the
documentation](https://github.com/volcengine/verl/tree/main/docs).
- [ ] Add unit or end-to-end test(s) to [the CI
workflow](https://github.com/volcengine/verl/tree/main/.github/workflows)
to cover all the code. If not feasible, explain why: ...
- [ ] Once your PR is ready for CI, send a message in [the `ci-request`
channel](https://verl-project.slack.com/archives/C091TCESWB1) in [the
`verl` Slack
workspace](https://join.slack.com/t/verl-project/shared_invite/zt-3855yhg8g-CTkqXu~hKojPCmo7k_yXTQ).
(If not accessible, please try [the Feishu group
(飞书群)](https://applink.larkoffice.com/client/chat/chatter/add_by_link?link_token=772jd4f1-cd91-441e-a820-498c6614126a).)
- [ ] If your PR is related to the `recipe` submodule, please also
update the reference to the submodule commit via `git submodule update
--remote` or `cd recipe && git pull origin main`.

---------

Co-authored-by: Shangwei-Li <lishangwei@mail.ustc.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants