Skip to content

[rollout,vllm] feat: disable sleep mode in fully-async mode#4521

Merged
wuxibin89 merged 7 commits intoverl-project:mainfrom
chenjiaoAngel:test
Dec 17, 2025
Merged

[rollout,vllm] feat: disable sleep mode in fully-async mode#4521
wuxibin89 merged 7 commits intoverl-project:mainfrom
chenjiaoAngel:test

Conversation

@chenjiaoAngel
Copy link
Contributor

@chenjiaoAngel chenjiaoAngel commented Dec 15, 2025

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.

  • 在fully-async 模式下,添加enable_sleep_mode 参数支持,可以使用虚拟显存功能,可充分利用显存,减少OOM 现象
  • 默认下是True,与原来保持一致

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

可参考[recipe/fully_async_policy/shell/dapo_30b_a3b_base_math_fsdp.sh] 脚本进行使用,新增+actor_rollout_ref.rollout.enable_sleep_mode=False\ 命令即可;

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.

Copy link
Contributor

@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 introduces an enable_sleep_mode flag to control a vLLM server setting, which in turn affects CUDA memory allocation behavior. The changes span a new shell script for configuration, a modification to the rollout configuration class, and logic in the vLLM async server. My review identifies a critical bug in the new shell script that would cause it to fail, and a high-severity logging inconsistency in the Python code. I've provided suggestions to fix both issues.

@wuxibin89 wuxibin89 requested a review from ArronHZG December 15, 2025 12:35
@chenjiaoAngel chenjiaoAngel changed the title [rollout][feat]: add enable_sleep_mode args in vllm_async_server.py to use set_expandable_segments(true) function when in fully-async mode [rollout] feat: add enable_sleep_mode args in vllm_async_server.py to use set_expandable_segments(true) function when in fully-async mode Dec 16, 2025
@wuxibin89 wuxibin89 changed the title [rollout] feat: add enable_sleep_mode args in vllm_async_server.py to use set_expandable_segments(true) function when in fully-async mode [rollout,vllm] feat: disable sleep mode in fully-async mode Dec 16, 2025
@wuxibin89
Copy link
Collaborator

Please format code: https://github.com/volcengine/verl/blob/main/CONTRIBUTING.md#code-linting-and-formatting

@ArronHZG
Copy link
Collaborator

Does this PR suggest that turning off sleep mode during rollout can save GPU memory? If so, approximately how much can it save?

@chenjiaoAngel
Copy link
Contributor Author

Does this PR suggest that turning off sleep mode during rollout can save GPU memory? If so, approximately how much can it save?

in my case, it can save at least 2-3G; and it also can improve profile

@chenjiaoAngel
Copy link
Contributor Author

@wuxibin89 wuxibin89 merged commit b5d6a30 into verl-project:main Dec 17, 2025
47 of 55 checks passed
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
…ject#4521)

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

- 在fully-async 模式下,添加enable_sleep_mode 参数支持,可以使用虚拟显存功能,可充分利用显存,减少OOM 现象
- 默认下是True,与原来保持一致

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

可参考[recipe/fully_async_policy/shell/dapo_30b_a3b_base_math_fsdp.sh]
脚本进行使用,新增`+actor_rollout_ref.rollout.enable_sleep_mode=False\` 命令即可;

### 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).)
sophiayyya pushed a commit to sophiayyya/verl that referenced this pull request Jan 25, 2026
…ject#4521)

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

- 在fully-async 模式下,添加enable_sleep_mode 参数支持,可以使用虚拟显存功能,可充分利用显存,减少OOM 现象
- 默认下是True,与原来保持一致

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

可参考[recipe/fully_async_policy/shell/dapo_30b_a3b_base_math_fsdp.sh]
脚本进行使用,新增`+actor_rollout_ref.rollout.enable_sleep_mode=False\` 命令即可;

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