Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check overflow for bf16 data type #4512

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

BacharL
Copy link
Collaborator

@BacharL BacharL commented Oct 15, 2023

Always check for fp16
bf16 dynamic range is similar to fp32. don't check overflow by default.

@tjruwase
Copy link
Contributor

@hablb, thanks for the PR. While I understand restricting overflow checks to fp16 only, I don't see the benefit of providing a config option to enable overflow checks for bf16/fp32. Can you please explain the need for the config option? I think the restriction part is fine.

@BacharL
Copy link
Collaborator Author

BacharL commented Oct 19, 2023

Thanks @tjruwase
I removed the configuration variable. Just skipping overflow check for fp16 now.

@tjruwase tjruwase added this pull request to the merge queue Oct 27, 2023
Merged via the queue into microsoft:master with commit 244040c Oct 27, 2023
loadams added a commit that referenced this pull request Oct 31, 2023
loadams added a commit that referenced this pull request Nov 3, 2023
baodii pushed a commit to baodii/DeepSpeed that referenced this pull request Nov 7, 2023
Always check for fp16
bf16 dynamic range is similar to fp32. don't check overflow by default.

Co-authored-by: Olatunji Ruwase <[email protected]>
@jinzhuer
Copy link

Dear @hablb ,Besides wasting computational resources, are there any other downsides to performing overflow checks on bf16 data types? Would performing overflow checks on bf16 data types cause any other bugs?

@BacharL
Copy link
Collaborator Author

BacharL commented Nov 27, 2023

No other downsides, however this check significant overhead as it reduces all gradients, communicates and synchronizes with the cpu.

jon-tow added a commit to Stability-AI/DeepSpeed that referenced this pull request Nov 28, 2023
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
Always check for fp16
bf16 dynamic range is similar to fp32. don't check overflow by default.

Co-authored-by: Olatunji Ruwase <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants