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

[QUESTION]What is the reason why bfloat16 requires gradient accumulation and allreductions need to be completed in fp32 #502

Closed
huhu0823 opened this issue Sep 15, 2023 · 3 comments
Labels
stale No activity in 60 days on issue or PR

Comments

@huhu0823
Copy link

huhu0823 commented Sep 15, 2023

Hi,I am currently studying the Megatron framework. I noticed that bfloat16 in megatron requires gradient accumulation, and allreductions need to be completed in fp32. Then the gradient communicates in fp32 format.
However, fp16 requires gradient accumulation, and allreductions can be completed in fp16.Then the gradient communicates in fp16 format.
I want to know what are the special reasons for these two different calculation methods

Line 159-160 of the megatron/arguments. py file

lQLPJxda3cZZmQjNApzNBeiwwTfxEK6Mif0E95eXr1raAA_1512_668

Copy link

Marking as stale. No activity in 60 days.

@github-actions github-actions bot added the stale No activity in 60 days on issue or PR label Nov 14, 2023
@Boreaso
Copy link

Boreaso commented Feb 22, 2024

Same question, anyone knows the reason?

@github-actions github-actions bot removed the stale No activity in 60 days on issue or PR label Feb 22, 2024
Copy link

Marking as stale. No activity in 60 days.

@github-actions github-actions bot added the stale No activity in 60 days on issue or PR label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No activity in 60 days on issue or PR
Projects
None yet
Development

No branches or pull requests

3 participants