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

Fix assert on Lamb optimizers with BF16 #4451

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Conversation

loadams
Copy link
Contributor

@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
@@ -1014,8 +1014,8 @@ def _do_sanity_check(self):
self.optimizer_name()), "{} is not a supported DeepSpeed Optimizer".format(self.optimizer_name())

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
Contributor 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.

@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
Contributor 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
Contributor 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
Contributor 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
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