Skip to content

[misc] fix: deprecate rollout.mode config option#4690

Merged
vermouth1992 merged 1 commit intoverl-project:mainfrom
yurekami:fix/issue-4604-deprecate-rollout-mode
Dec 28, 2025
Merged

[misc] fix: deprecate rollout.mode config option#4690
vermouth1992 merged 1 commit intoverl-project:mainfrom
yurekami:fix/issue-4604-deprecate-rollout-mode

Conversation

@yurekami
Copy link
Contributor

@yurekami yurekami commented Dec 27, 2025

Summary

Addresses #4604 - Deprecates the actor_rollout_ref.rollout.mode config option since only async mode is now supported.

Changes:

  1. RolloutConfig validation (verl/workers/config/rollout.py):

    • Added validation in __post_init__ to raise ValueError for "sync" mode
    • Added DeprecationWarning for unknown modes
  2. Simplified main_ppo.py:

    • Removed sync mode check (moved to config validation)
    • Always uses AsyncActorRolloutRefWorker instead of conditional selection
  3. Removed dead code paths:

    • fsdp_workers.py: Removed sync mode switch-to-trainer-mode code
    • megatron_workers.py: Same cleanup
    • ray_trainer.py: Simplified async mode checks since sync is no longer valid

Backward Compatibility:

The mode field is kept in the config for backward compatibility with existing shell scripts that set actor_rollout_ref.rollout.mode=async. These scripts will continue to work.

Follow-up Work:

Shell scripts and documentation that explicitly set mode=async can be updated in separate PRs to remove the now-redundant setting.

The `mode` field in RolloutConfig is deprecated since only "async" mode
is supported. This PR:

1. Adds validation in RolloutConfig.__post_init__ to:
   - Raise ValueError for "sync" mode (moved from main_ppo.py)
   - Warn about unknown modes

2. Simplifies main_ppo.py to always use AsyncActorRolloutRefWorker
   since sync mode is no longer supported

3. Removes dead code paths for sync mode in:
   - fsdp_workers.py
   - megatron_workers.py

4. Simplifies ray_trainer.py to always assume async mode

The `mode` field is kept for backward compatibility with existing
shell scripts that set `actor_rollout_ref.rollout.mode=async`.

Fixes verl-project#4604

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 effectively deprecates the rollout.mode configuration option, correctly removing the 'sync' mode and simplifying the codebase to only support 'async' mode. The changes are well-contained and the validation logic has been appropriately moved to the configuration class. I have one suggestion to make the validation stricter to avoid silent behavior changes for users with misconfigured modes, which could be easily missed.

Comment on lines +224 to +235
if self.mode == "sync":
raise ValueError(
"Rollout mode 'sync' has been removed. Please set "
"`actor_rollout_ref.rollout.mode=async` or remove the mode setting entirely."
)
if self.mode != "async":
warnings.warn(
f"Unknown rollout mode '{self.mode}'. Only 'async' mode is supported. "
"The 'mode' field is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

Using warnings.warn for unknown rollout.mode values can lead to silent behavior changes that might be missed by users, as DeprecationWarning is often suppressed by default. Since only 'async' mode is supported now, any other value should be treated as an error to prevent unexpected behavior. For example, a typo like mode=asyn would have previously fallen back to sync-like behavior, but with this change, it would be treated as 'async' with just a potentially hidden warning. Raising a ValueError for all non-'async' modes is safer and more explicit about the supported configuration.

        if self.mode != "async":
            if self.mode == "sync":
                raise ValueError(
                    "Rollout mode 'sync' has been removed. Please set "
                    "`actor_rollout_ref.rollout.mode=async` or remove the mode setting entirely."
                )
            raise ValueError(
                f"Unknown rollout mode '{self.mode}'. Only 'async' mode is supported. "
                "Please set `actor_rollout_ref.rollout.mode=async` or remove the mode setting entirely."
            )

@vermouth1992 vermouth1992 changed the title fix: deprecate rollout.mode config option [misc] fix: deprecate rollout.mode config option Dec 28, 2025
@vermouth1992 vermouth1992 merged commit eb6991a into verl-project:main Dec 28, 2025
79 of 85 checks passed
boren-ms pushed a commit to boren-ms/verl that referenced this pull request Dec 30, 2025
jsfanfanfan pushed a commit to meituan-search/verl that referenced this pull request Jan 9, 2026
vyomakesh0728 added a commit to vyomakesh0728/verl that referenced this pull request Jan 22, 2026
sophiayyya pushed a commit to sophiayyya/verl that referenced this pull request Jan 25, 2026
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