facebookresearch/fairseq

BF16 + FSDP

Open

#4,298 opened on Mar 22, 2022

View on GitHub
 (0 comments) (2 reactions) (0 assignees)Python (6,224 forks)batch import
enhancementhelp wantedneeds triage

Repository metrics

Stars
 (29,107 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

🚀 Feature Request

Support BF16 with FSDP!

Motivation

Training with BF16 is usually more stable than fp16, which is very important when we want to train large models with FSDP. Additionally, many models (e.g. T5) are trained with BF16 and if we want to continue training them via Fairseq with mixed-precisio, using fp16 will result in NaNs.

Additional context

Currently FullyShardedDataParallel is not compatible with bf16 (as can be seen here). It will be really helpful to support it.

Contributor guide