#8076·verl

FSDP engine ignores `fsdp_config.dtype`: `dtype=float16` gives FP16 rollouts with BF16 training (no error or warning)

Author: aryanyadav0402Created Sep 30, 2026Updated Sep 30, 2026

System Info

  • verl 6093e007 (the behaviour is unchanged on main at 3084c261, by code reading)
  • vLLM 0.29.0, torch 2.13.0+cu130, transformers 5.12.1, Python 3.12
  • 1× NVIDIA RTX A6000 (48 GB), FSDP (strategy: fsdp), trainer.use_v1=false
  • (Versions from our environment record; scripts/diagnose.py output available on request.)

Information

  • My own modified scripts

Tasks

  • My own task or dataset: GRPO on GSM8K with Qwen3-1.7B

Reproduction

To train in FP16, the natural reading of the config is to set the FSDP dtype field, together with the rollout dtype:

actor_rollout_ref.rollout.dtype=float16
actor_rollout_ref.actor.fsdp_config.dtype=float16

This runs without any error or warning. The rollout is FP16: the vLLM engine log shows dtype=torch.float16. But the FSDP actor still computes in BF16:

  • The dtype field is defined on the base EngineConfig (verl/workers/config/engine.py L98) and inherited by FSDPEngineConfig, whose docstring (L251) documents it as "Mixed precision training param dtype, default "bfloat16"".
  • The FSDP engine never reads it. The compute dtype comes only from fsdp_config.mixed_precision.param_dtype, and when mixed_precision is None (the default) it's hard-coded to BF16 (verl/workers/engine/fsdp/transformer_impl.py, ~L391–400 on main):
    python
    mixed_precision_config = self.engine_config.mixed_precision
    if mixed_precision_config is not None:
        param_dtype = PrecisionType.to_dtype(mixed_precision_config.get("param_dtype", "bf16"))
        ...
    else:
        param_dtype = torch.bfloat16
  • A code search on main finds engine_config.dtype used only in the Megatron engine. (I've checked the engine-based FSDP worker, verl/workers/engine/fsdp/transformer_impl.py, which is what our runs use. I haven't checked the legacy fsdp_workers.py path.)
  • Side effect: the ShardedGradScaler path (created when param_dtype == torch.float16) is also skipped.

Measured effect (the same one-step GRPO gate, 4 prompts × 2 samples, differing only in the dtype overrides; rollout_corr/k3_kl):

Config Trainer compute Rollout rollout_corr/k3_kl
default BF16 BF16 7.6e-4
rollout.dtype=float16 + fsdp_config.dtype=float16 BF16 (silently) FP16 4.5e-4
rollout.dtype=float16 + fsdp_config.mixed_precision.param_dtype=fp16 FP16 FP16 7.2e-6

With the second config, the rollout/trainer mismatch stays at the BF16 level, about 63× above true FP16/FP16. That defeats the purpose of FP16 for mismatch reduction (cf. Qi et al., arXiv 2510.26788). These are single-step numbers on 8 responses, so they're indicative, but the gap is large. The working setting is:

actor_rollout_ref.rollout.dtype=float16
++actor_rollout_ref.actor.fsdp_config.mixed_precision.param_dtype=fp16
++actor_rollout_ref.actor.fsdp_config.mixed_precision.reduce_dtype=fp32
++actor_rollout_ref.actor.fsdp_config.mixed_precision.buffer_dtype=fp32

Expected behavior

Any one of these would prevent the silent mismatch:

  1. When mixed_precision is unset, have the FSDP engine derive param_dtype from fsdp_config.dtype, so dtype=float16 gives FP16 compute plus the gradient scaler; or
  2. raise or warn at config validation when fsdp_config.dtype != "bfloat16" and mixed_precision is unset, or when the rollout dtype and the FSDP compute dtype differ; and/or
  3. fix the FSDPEngineConfig.dtype docstring so it says it has no effect on the FSDP compute dtype.

I'm happy to open a PR for option 2 or 3 if that's useful.