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

Disable quick init for deepspeed #32066

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

muellerzr
Copy link
Contributor

What does this PR do?

As @philschmid tested, this method works for FSDP but not for DS (I think because DS needs their gathered params to not be in this way). So this PR disables it

DS vs FSDP training logs:

DS:

{'loss': 2.5297, 'grad_norm': 166.13894215336276, 'learning_rate': 1.9230769230769234e-06, 'epoch': 0.01}                                                                                 
{'loss': 2.3812, 'grad_norm': 7.978569298066882, 'learning_rate': 1.923076923076923e-05, 'epoch': 0.12}                                                                                   
{'loss': 2.1066, 'grad_norm': 3.4303861731711813, 'learning_rate': 3.846153846153846e-05, 'epoch': 0.24}                                                                                  
{'loss': 2.0788, 'grad_norm': 3.1286244034212807, 'learning_rate': 4.99613632163459e-05, 'epoch': 0.36}    

FSDP (where this is enabled):

{'loss': 2.5297, 'grad_norm': 165.95199584960938, 'learning_rate': 1.9230769230769234e-06, 'epoch': 0.01}                                                                                 
{'loss': 2.3801, 'grad_norm': 7.723988056182861, 'learning_rate': 1.923076923076923e-05, 'epoch': 0.12}                                                                                   
{'loss': 2.1089, 'grad_norm': 3.3734328746795654, 'learning_rate': 3.846153846153846e-05, 'epoch': 0.24}                                                                                  
{'loss': 2.0727, 'grad_norm': 2.6789469718933105, 'learning_rate': 4.99613632163459e-05, 'epoch': 0.36} 

FSDP prior to the init PR/without quick load:

{'loss': 2.5297, 'grad_norm': 166.12049865722656, 'learning_rate': 1.9230769230769234e-06, 'epoch': 0.01}                                                                                 
{'loss': 2.3754, 'grad_norm': 5.313587665557861, 'learning_rate': 1.923076923076923e-05, 'epoch': 0.12}                                                                                   
{'loss': 2.1038, 'grad_norm': 3.9090209007263184, 'learning_rate': 3.846153846153846e-05, 'epoch': 0.24}                                                                                  
{'loss': 2.0933, 'grad_norm': 3.003643274307251, 'learning_rate': 4.99613632163459e-05, 'epoch': 0.36} 

It's close enough that it's reasonable IMO

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@SunMarc @amyeroberts

@muellerzr muellerzr requested a review from amyeroberts July 18, 2024 21:11
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks!

@muellerzr muellerzr merged commit 62aa270 into main Jul 19, 2024
22 checks passed
@muellerzr muellerzr deleted the muellerzr-disable-deepspeed branch July 19, 2024 12:58
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