Replies: 2 comments
-
|
Marking as stale. No activity in 60 days. |
Beta Was this translation helpful? Give feedback.
-
|
I was thinking about this recently and based on all that I read it seems that there are 2 main strategies for bfloat16 training without accuracy loss:
I then questioned the need for FP32 grad accumulation and came across this paper (page 6, Section 5.1 “Precision options”), case D−MW. In this setup, gradients are not accumulated in FP32, so pure bf16 , but according to Table 3, performance is worse compared to the first option (and I’d assume options 1 and 2 have similar accuracy).
Probably, master copy in case of BF16 is an overkill, because the range of values is comparable.. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the README for the distributed optimizer, it is mentioned that when using bf16 training, a combination of bf16 model parameters and fp32 model grads is employed, and the distributed optimizer's fp32 main gradients are the same as the model's fp32 gradients. However, I am aware that in PyTorch, after the forward and backward passes, the gradients after forward+backward typically match the data type of the parameters. So, there should be always bf16 model grads given bf16 mdoel params, and this is apparently true in the case of fp16 training where an extra copy of fp32 main grads in the optimizer is necessary.
Could you please explain how it is possible to have bf16 parameters with fp32 gradients in the context of bf16 training? I am wondering why is there a difference between fp16 and bf16 training.
Beta Was this translation helpful? Give feedback.
All reactions