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

FusedAdam doesn't allocate master weights for bfloat16 #1728

Open
cbcase opened this issue Sep 13, 2023 · 2 comments
Open

FusedAdam doesn't allocate master weights for bfloat16 #1728

cbcase opened this issue Sep 13, 2023 · 2 comments
Assignees

Comments

@cbcase
Copy link
Contributor

cbcase commented Sep 13, 2023

If you look at https://github.com/NVIDIA/apex/blob/master/apex/optimizers/fused_adam.py#L184, the FusedAdam code doesn't allocate master weights when the parameter dtype is bfloat16, even if you set master_weights=True (and subsequently no master weights are passed to the kernel at https://github.com/NVIDIA/apex/blob/master/apex/optimizers/fused_adam.py#L235).

Is there a specific reason for this, or is it simply an oversight?

(Seeing as bfloat has fewer mantissa bits than fp16, fp32 master weights are even more important for bfloat16 -- though, really, they are a necessity for both.)

@Aidyn-A
Copy link
Collaborator

Aidyn-A commented Oct 20, 2023

@crcrpar, do you remember why we skip master_weights for bfloat16?

@crcrpar
Copy link
Collaborator

crcrpar commented Oct 20, 2023

@crcrpar, do you remember why we skip master_weights for bfloat16?

I'm unsure but I vaguely remember there wasn't master weights usage in fused adam so it feels like more of a fallout when fp16 - fp32 things were added

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

No branches or pull requests

3 participants