Background
The dtype-handling bug fixes are now merged (#2419 and related). The framework now correctly wires model.torch_dtype through to optimizer state, sharding, and checkpointing. What remains is a UX / default-behavior problem, tracked here separately because it needs broad validation.
Problem
For long full-parameter training (pre-training or extended fine-tuning), the safe pattern is fp32 master weights + fp32 optimizer state. But today, if a user leaves model.torch_dtype unset (or auto/bfloat16) and uses torch.optim.AdamW, the resident params and the AdamW EMA buffers (exp_avg, exp_avg_sq) end up in bf16. This is silently fragile: bf16 EMA quantization can slow convergence (higher final loss) or, in worse cases, cause unstable grad_norm / loss spikes / divergence. Users have to know to set torch_dtype: float32 themselves.
See the mixed-precision guide for the full explanation.
Proposed change
Default model.torch_dtype to float32 for full-parameter training when the optimizer is a torch.optim.* optimizer (TE FusedAdam and PEFT/LoRA are unaffected). The resolver (resolve_storage_dtype) is already implemented but left dormant/unwired from the bug-fix PR — this issue is about turning it on.
Why this is longer-term
Enabling the fp32 default increases resident memory, so a number of existing example configs will likely OOM and need retuning (lower micro-batch, more GPUs, or activation checkpointing). This requires GPU validation across the affected configs before flipping the default.
Scope / tasks
Background
The dtype-handling bug fixes are now merged (#2419 and related). The framework now correctly wires
model.torch_dtypethrough to optimizer state, sharding, and checkpointing. What remains is a UX / default-behavior problem, tracked here separately because it needs broad validation.Problem
For long full-parameter training (pre-training or extended fine-tuning), the safe pattern is fp32 master weights + fp32 optimizer state. But today, if a user leaves
model.torch_dtypeunset (orauto/bfloat16) and usestorch.optim.AdamW, the resident params and the AdamW EMA buffers (exp_avg,exp_avg_sq) end up in bf16. This is silently fragile: bf16 EMA quantization can slow convergence (higher final loss) or, in worse cases, cause unstablegrad_norm/ loss spikes / divergence. Users have to know to settorch_dtype: float32themselves.See the mixed-precision guide for the full explanation.
Proposed change
Default
model.torch_dtypetofloat32for full-parameter training when the optimizer is atorch.optim.*optimizer (TE FusedAdam and PEFT/LoRA are unaffected). The resolver (resolve_storage_dtype) is already implemented but left dormant/unwired from the bug-fix PR — this issue is about turning it on.Why this is longer-term
Enabling the fp32 default increases resident memory, so a number of existing example configs will likely OOM and need retuning (lower micro-batch, more GPUs, or activation checkpointing). This requires GPU validation across the affected configs before flipping the default.
Scope / tasks
resolve_storage_dtypeinto the recipes (train_ft,vlm/finetune,train_seq_cls,retrieval/train_bi_encoder).