verl icon indicating copy to clipboard operation
verl copied to clipboard

[Bug][trainer] separate_async doubles adaptive switch step-up

Open hsusul opened this issue 3 months ago • 1 comments

Summary

V1 separate_async applies switch_threshold_step_up twice whenever sustained trainer idle triggers adaptive hybrid-rollout switching.

The docs and config define the field as one ratio increment after switch_threshold_release_steps, but PPOTrainerSeparateAsync._adapt_switch_threshold() contains the same addition twice. With the defaults, an intended +0.05 adjustment becomes +0.10, so hybrid trainer GPUs are retained for rollout more aggressively than configured. That can delay weight updates and increase policy staleness.

Expected behavior

After the release interval, increase _switch_threshold_ratio exactly once by switch_threshold_step_up, clamped at 1.0. Keep calm-step decreases and all defaults unchanged.

For ratio=0.50, step_up=0.05, and release_steps=2, consecutive idle steps should yield:

0.50, 0.55, 0.60

Current behavior yields:

0.50, 0.60, 0.70

Proposed fix

Remove the duplicate addition and update the existing CPU switching regression so its expected sequence is derived from the configured single-step contract.

Duplicate searches for switch_threshold_step_up and adaptive separate_async threshold behavior found only merged PR #7373, which introduced this path; no open issue or PR addresses the double increment.

This report was prepared with AI assistance and reviewed against current main (c2429f29), the config, docs, tests, and introducing history.

hsusul avatar Sep 02 '26 00:09 hsusul

Closing as an investigation error before any code change or PR.

The apparent duplicate addition was caused by my inspection command using overlapping inclusive ranges (sed -n '1,280p' followed by sed -n '280,620p'), which printed source line 280 twice. Re-checking with numbered lines and directly reading origin/main confirms _adapt_switch_threshold() contains exactly one switch_threshold_step_up addition, and the existing CPU test matches that behavior.

Current main is correct; this report is not reproducible. No repository code was changed or published. This correction was prepared with AI assistance and verified against origin/main.

hsusul avatar Sep 02 '26 00:09 hsusul