verl icon indicating copy to clipboard operation
verl copied to clipboard

[Bug] Multiple config default value mismatches between YAML and Python dataclasses (`enforce_eager`, `data_loader_seed`, `n_gpus_per_node`)

Open imitater-dou opened this issue 6 months ago • 0 comments

System Info

Discovered via static code analysis comparing YAML configs in verl/trainer/config/ with Python dataclasses in verl/workers/config/.

Information

  • [x] The official example scripts

Tasks

  • [x] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)

Reproduction

The following mismatches exist between YAML defaults (loaded via Hydra in normal use) and Python dataclass defaults (used when instantiating configs directly in tests or custom scripts):

Config field YAML default Python dataclass default File (YAML → Python)
rollout.enforce_eager False True rollout/rollout.yaml:44 → config/rollout.py:194
rollout.skip_tokenizer_init True False rollout/rollout.yaml:344 → config/rollout.py:268
actor.data_loader_seed 42 1 actor/actor.yaml:121 → config/actor.py:178
critic.data_loader_seed 42 1 critic/critic.yaml:58 → config/critic.py:91
reward_model.n_gpus_per_node 8 0 reward/reward.yaml:34 → config/reward.py:87

The last one (n_gpus_per_node=0) is particularly severe: in main_ppo.py:172, the reward worker pool is sized as [n_gpus_per_node] * nnodes. With n_gpus_per_node=0, the pool is created with size 0, causing a resource allocation failure when the reward model is enabled without going through Hydra.

Expected behavior

Python dataclass defaults should match YAML defaults so that behavior is identical regardless of whether configs are loaded via Hydra or instantiated directly. This is especially important for testing and custom integrations.

Suggested fixes:

  • enforce_eager: change Python default to False
  • skip_tokenizer_init: change Python default to True
  • data_loader_seed (actor + critic): change Python default to 42
  • n_gpus_per_node: change Python default to 8, or add a validator that raises when enable=True and n_gpus_per_node == 0

imitater-dou avatar May 26 '26 06:05 imitater-dou