[trainer, cfg] fix: wire critic batching keys into TrainingWorkerConfig - #7465
Open
YeonwooSung wants to merge 1 commit into
Open
[trainer, cfg] fix: wire critic batching keys into TrainingWorkerConfig#7465YeonwooSung wants to merge 1 commit into
YeonwooSung wants to merge 1 commit into
Conversation
Fixes verl-project#7462 Co-authored-by: Grok <grok@x.ai> Signed-off-by: YeonwooSung <neos960518@gmail.com>
YeonwooSung
requested review from
PeterSH6,
eric-haibin-lin,
tongyx361,
vermouth1992 and
wuxibin89
as code owners
August 19, 2026 02:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes #7462.
The critic worker is a bare
TrainingWorkerand only reads batching knobs fromengine_config. Trainers copied token lengths onto that engine and skippeduse_dynamic_bsz/*_micro_batch_size_per_gpu. Combined withEngineConfig.use_dynamic_bszdefaulting toTrue,critic.use_dynamic_bsz=falsewas a no-op.V1 (
trainer.use_v1=true, the default) also wroteppo_infer_max_token_len_per_gpuonto the train budget, socritic.ppo_max_token_len_per_gpuwas ignored.This PR:
CriticConfig.apply_engine_batching()and uses it in v0, v1, and experimental/separation trainers.ppo_infer_max_token_len_per_gpu/ppo_infer_micro_batch_size_per_gpuin critic YAML (defaulting to the documented forward / training knobs).Checklist Before Starting
[{modules}] {type}: {description}(This will be checked by the CI)Not a duplicate of #7460 (that issue is
critic.model.model_typebeing overwritten). Same construction site, different fields. No open PR already wires these batching keys.Test
Local machine did not have the full verl test env (
ray/torchnot installed in the login Python). Ruff passed on the touched files. Please run the CPU test in CI.API and Usage Example
# these now reach the critic engine critic.use_dynamic_bsz=false critic.ppo_micro_batch_size_per_gpu=4 critic.ppo_max_token_len_per_gpu=4096 critic.forward_max_token_len_per_gpu=2048V1 no longer overwrites the train token budget with the infer value.
Design & Code Changes
TrainingWorker.train_batchreadsengine_config.use_dynamic_bsz/max_token_len_per_gpu/micro_batch_size_per_gpu. Actor already assigns those fromActorConfig. The critic path now does the same via one helper so v0 / v1 / separation cannot drift again.Checklist Before Submitting
pre-commit install && pre-commit run --all-files --show-diff-on-failure --color=alwaysray/torchare available.ci-requestchannel in theverlSlack workspace.recipesubmodule, please also update the reference to the submodule commit viagit submodule update --remoteorcd recipe && git pull origin main.AI assistance was used to locate the bug and draft the patch. A human author reviewed every changed line.