Skip to content

Fix assert on Lamb optimizers with BF16#4451

Open
loadams wants to merge 18 commits intomasterfrom
loadams/lamb-bf16
Open

Fix assert on Lamb optimizers with BF16#4451
loadams wants to merge 18 commits intomasterfrom
loadams/lamb-bf16

Conversation

@loadams
Copy link
Collaborator

@loadams loadams commented Oct 4, 2023

No description provided.

@loadams loadams linked an issue Oct 4, 2023 that may be closed by this pull request
if (self.optimizer_name() == LAMB_OPTIMIZER or self.optimizer_name() == ONEBIT_LAMB_OPTIMIZER):
assert (self.dynamic_loss_scale()), "DeepSpeed {} optimizer requires dynamic loss scaling".format(
self.optimizer_name())
assert (self.dynamic_loss_scale() and not self.bfloat16_enabled()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try switching to check the optimizer wrapper as BFLOAT16 rather than just checking if bfloat is enabled

@tjruwase
Copy link
Contributor

tjruwase commented Oct 6, 2023

@loadams, let's add a unit test as well.

@loadams loadams requested a review from mrwyattii as a code owner January 3, 2024 21:25
@Liangliang-Ma
Copy link
Contributor

@loadams Just fail on this assert when using lamb with bf16. May I ask if this will keep going?

@loadams
Copy link
Collaborator Author

loadams commented Aug 21, 2024

@loadams Just fail on this assert when using lamb with bf16. May I ask if this will keep going?

Hi @Liangliang-Ma - apologies, I lost track of this PR. I'll work on getting this PR updated and merged.

@loadams
Copy link
Collaborator Author

loadams commented Aug 22, 2024

@loadams Just fail on this assert when using lamb with bf16. May I ask if this will keep going?

Hi @Liangliang-Ma - apologies, I lost track of this PR. I'll work on getting this PR updated and merged.

@Liangliang-Ma - does this branch resolve your issue? Or do you have any other feedback on the PR?

@Liangliang-Ma
Copy link
Contributor

@loadams Just fail on this assert when using lamb with bf16. May I ask if this will keep going?

Hi @Liangliang-Ma - apologies, I lost track of this PR. I'll work on getting this PR updated and merged.

@Liangliang-Ma - does this branch resolve your issue? Or do you have any other feedback on the PR?

Yes, this one works.

@loadams
Copy link
Collaborator Author

loadams commented Aug 29, 2024

Failing HPU tests are a transformers issue that should be fixed in transformers soon.

@loadams loadams requested a review from tohtana as a code owner November 5, 2024 16:28
@loadams loadams self-assigned this Jan 16, 2025
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.

LAMB requires dynamic loss scaling

3 participants