diff --git a/verl/workers/config/actor.py b/verl/workers/config/actor.py index f33bb9269cc..88e6256458e 100644 --- a/verl/workers/config/actor.py +++ b/verl/workers/config/actor.py @@ -305,6 +305,10 @@ def __post_init__(self): """Validate FSDP actor configuration parameters.""" super().__post_init__() self.engine = self.fsdp_config + # Sync strategy to engine config so engine_workers can pick the right FSDP version. + # EngineConfig.strategy defaults to None, so without this, engine_workers.py always + # falls back to FSDP1 even when actor.strategy="fsdp2". + object.__setattr__(self.engine, "strategy", self.strategy) # backward compatibility if self.ulysses_sequence_parallel_size > 1: diff --git a/verl/workers/config/critic.py b/verl/workers/config/critic.py index ab5ae4fc83e..cf63fa8ef8b 100644 --- a/verl/workers/config/critic.py +++ b/verl/workers/config/critic.py @@ -197,6 +197,10 @@ def __post_init__(self): """Validate FSDP critic configuration parameters.""" super().__post_init__() self.engine = self.fsdp + # Sync strategy to engine config so engine_workers can pick the right FSDP version. + # EngineConfig.strategy defaults to None, so without this, engine_workers.py always + # falls back to FSDP1 even when critic.strategy="fsdp2". + object.__setattr__(self.engine, "strategy", self.strategy) if self.strategy in {"fsdp", "fsdp2"}: if self.ulysses_sequence_parallel_size > 1: