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

Optimize checkpointing #505

Merged
merged 3 commits into from
Mar 6, 2024
Merged

Optimize checkpointing #505

merged 3 commits into from
Mar 6, 2024

Conversation

dacorvo
Copy link
Collaborator

@dacorvo dacorvo commented Mar 5, 2024

What does this PR do?

This modifies the decoder models export code to reduce the disk usage when creating checkpoints:

  • use torch_dtype = auto when loading the model to avoid casting weigths to float32 (the default),
  • do not use snapshot_download before exporting to avoid downloading both pytorch and safetensors weights.

@dacorvo dacorvo marked this pull request as ready for review March 5, 2024 15:58
@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.

dacorvo added 3 commits March 5, 2024 16:06
This avoids checkpoint weights to be stored as float32.
When the model needs to be exported, using snapshot_download before export is not
efficient as it fetches both pytorch and safetensors weigths.
@dacorvo dacorvo force-pushed the optimize_checkpointing branch from 2e0e4c7 to 87bf726 Compare March 5, 2024 16:12
@dacorvo dacorvo merged commit 249d0b6 into main Mar 6, 2024
11 checks passed
@dacorvo dacorvo deleted the optimize_checkpointing branch March 6, 2024 09: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.

3 participants