mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #176] Why is it necessary to convert BF16 to FP32 for addition in reduce operations? #151
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lixingyii on GitHub (May 24, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/176
We noticed that in the code for reduce operations, the hidden data needs to be read from the buffer, converted from BF16 to float (FP32) for summation, and then converted back to BF16 for storage. Is this data format conversion necessary? Will directly using BF16 for addition affect numerical precision?

@LyricZhao commented on GitHub (May 27, 2025):
Yes and yes. BF16 addition has low precision due to its number of mantissa, which will leads to lower model performance (tested with experiments). Generally, the whole model training process cannot have even one BF16 accumulator. FP32 accumulator is a must.