[trainer] feat: configurable replay buffer poll interval for the V1 trainer #8596
All Vouch review confidence checks passed
Residual risk 0.33 = Change Risk (0.78) × (1 − Review Confidence (0.58)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.78 · 622 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.385
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.078
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #8596"
general
weight: 0.35
jialei777
What does this PR do?
Part of https://github.com/verl-project/verl/issues/8595 (Qwen3.5 GRPO on TPU v7x). Independent of the other PRs there.
Adds
trainer.v1.sampler.poll_interval(default 2.0 s, so nothing changes unless it is set) and passes it to the built-inReplayBuffer/ReplayBufferAsync.Why: while a V1 training step waits for its batch, the built-in replay buffers check the rollout progress every
poll_intervalseconds, a constructor argument the trainer never sets, so it is always 2.0 s. A batch that completes between two checks waits for the next one: up to 2 s per step. With Qwen3.5-0.8B GRPO on 8 TPU v7x chips the step took 37 s with the rollout changes we propose in vllm-torchtpu (23 s with further rollout-side settings and changes that are not proposed here), so the poll alone could add about 5% to 9%.Not a duplicate: main (31cfccb4) has no way to set the interval from the config (the trainer builds the buffers with the constructor default); we searched the open PRs for
poll_interval(query below) before opening this one. The search also finds the draft #8526, which adds a different key,trainer.v1.decoupled_async.poll_interval, for its newdecoupled_asynctrainer mode and leaves theReplayBufferconstructor'spoll_intervalas it is. The two are independent; they touch different lines ofppo_trainer.yamland the generated configs, so at most a config rebase is needed (#8526's current diff applies cleanly on top of this branch).Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI)Test
Commands run on CPU against this branch (main 31cfccb4 plus this PR):
pytest tests/trainer/ppo/v1/test_trainer_base_on_cpu.py: 38 passed, 28 of them new (6 tests): the default stays 2.0 for every trainer mode; a configured value reaches the built-in buffers of every mode; 0, negative and non-finite values (inf,-inf,nan, and the strings"inf"/"nan") are rejected, and finite positive values, a numeric string included, are accepted; a custom sampler does not receive the key; with 0.1 the built-in async buffer has exactly the state of aReplayBufferAsyncsubclass that sets 0.1. Negative control: 24 of the new cases fail on main.pytest tests/trainer/ppo/v1/test_trainer_base_on_cpu.py tests/trainer/ppo/v1/test_replay_buffer_on_cpu.py tests/trainer/ppo/v1/test_separate_async_step_switch_on_cpu.py: 154 passed (126 on main).pytest tests/trainer/ppo: 484 passed (456 on main, plus the 28 new). Five async tests fail on main and here alike in our environment, which lackspytest-asyncio.bash scripts/generate_trainer_config.shleaves the four regenerated_generated_.yamlreference configs unchanged.poll_interval=0.1the remaining wait for the poll was about 0.24 s per step in our GRPO runs (TPU v7x, Qwen3.5-0.8B), instead of up to 2 s; there it was set through aReplayBufferAsyncsubclass, and the first test command above checks that this key gives the same buffer state.API and Usage Example
Design & Code Changes
trainer.v1.samplerinverl/trainer/config/ppo_trainer.yaml(the four_generated_.yamlreference configs regenerated), documented indocs/advance/v1_async_trainer.md._build_replay_buffer(verl/trainer/ppo/v1/trainer_base.py) passes it to the built-in buffers; a value that is not a finite number of seconds above 0 is rejected (an infinite interval would otherwise fail later, intime.sleep).Checklist Before Submitting
docs/advance/v1_async_trainer.md.tests/trainer/ppo/v1/test_trainer_base_on_cpu.py.ci-requestchannel.recipesubmodule: not related.AI assistance: developed with an AI coding assistant; the author has reviewed every changed line, and the tests above were run as described (on TPU v7x where stated).