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

Neuron: When save_safetensor=False, no need to move model to CPU #29703

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

jeffhataws
Copy link
Contributor

What does this PR do?

save_safetensor=True is default as of release 4.35.0, which then required TPU hotfix #27799 (issue #27578). However, when the flag save_safetensor is set to False (compatibility mode), moving the model to CPU causes generation of too many graphs during checkpoint #28438. This PR disable moving of model to CPU when save_safetensor=False.

Fixes # 28438 (#28438)

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.

save_safetensor=True is default as of release 4.35.0, which then
required TPU hotfix huggingface#27799
(issue huggingface#27578).
However, when the flag save_safetensor is set to False (compatibility mode),
moving the model to CPU causes generation of too many graphs
during checkpoint huggingface#28438.
This PR disable moving of model to CPU when save_safetensor=False.
@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

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

Copy link
Contributor

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

Sure, sounds good to me! (And happy that we can just isolate this under TPU)

@muellerzr muellerzr requested a review from amyeroberts April 24, 2024 16:48
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 for fixing!

@amyeroberts amyeroberts merged commit d1d94d7 into huggingface:main Apr 24, 2024
21 checks passed
itazap pushed a commit that referenced this pull request May 14, 2024
)

save_safetensor=True is default as of release 4.35.0, which then
required TPU hotfix #27799
(issue #27578).
However, when the flag save_safetensor is set to False (compatibility mode),
moving the model to CPU causes generation of too many graphs
during checkpoint #28438.
This PR disable moving of model to CPU when save_safetensor=False.
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.

4 participants