-
Notifications
You must be signed in to change notification settings - Fork 6.6k
[Core] support saving and loading of sharded checkpoints #7830
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
Merged
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
b566c95
feat: support saving a model in sharded checkpoints.
sayakpaul 8605909
feat: make loading of sharded checkpoints work.
sayakpaul 885d5b6
add tests
sayakpaul 560fe32
cleanse the loading logic a bit more.
sayakpaul fc5d837
more resilience while loading from the Hub.
sayakpaul 0d3b9e1
parallelize shard downloads by using snapshot_download()/
sayakpaul df8e945
default to a shard size.
sayakpaul 6eff632
more fix
sayakpaul ed83244
Empty-Commit
sayakpaul 642ee39
debug
sayakpaul 36de0c4
fix
sayakpaul cc5656e
uality
sayakpaul 8898717
more debugging
sayakpaul 2dfb9a1
fix more
sayakpaul 179495f
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul 7e2c09b
merge main and fix conflicts.
sayakpaul 3535701
resolve conflicts.
sayakpaul 5ae8e46
initial comments from Benjamin
sayakpaul aefd0db
move certain methods to loading_utils
sayakpaul 80005be
add test to check if the correct number of shards are present.
sayakpaul d144526
add a test to check if loading of sharded checkpoints from the Hub is…
sayakpaul 8e52c6d
clarify the unit when passed as an int.
sayakpaul 9d2f19a
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul a8f5c03
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul c917be2
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul 7cf5340
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul d6f9b17
use hf_hub for sharding.
sayakpaul 1ae5987
remove unnecessary code
sayakpaul fda5d99
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul 2ec27d5
remove unnecessary function
sayakpaul c98d779
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul ed289c9
lucain's comments.
sayakpaul 9acbbea
fixes
sayakpaul 7326e25
address high-level comments.
sayakpaul 0706cae
fix test
sayakpaul 711fd50
subfolder shenanigans./
sayakpaul 32419ac
Update src/diffusers/utils/hub_utils.py
sayakpaul b03e13c
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul cbfd70f
Apply suggestions from code review
sayakpaul 868cfb6
remove _huggingface_hub_version as not needed.
sayakpaul 13fd063
address more feedback.
sayakpaul 0d32c45
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul bad44c0
add a test for local_files_only=True/
sayakpaul c779618
need hf hub to be at least 0.23.2
sayakpaul 302d59d
style
sayakpaul ab3a5aa
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul 7f88742
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul a7fc2ae
final comment.
sayakpaul f74fc67
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul 38749fc
clean up subfolder.
sayakpaul edbd8de
deal with suffixes in code.
sayakpaul 2ecd4da
_add_variant default.
sayakpaul d51d0b9
use weights_name_pattern
sayakpaul c2a71a0
remove add_suffix_keyword
sayakpaul a70e927
clean up downloading of sharded ckpts.
sayakpaul 65da7dc
don't return something special when using index.json
sayakpaul 5599388
fix more
sayakpaul 7cdf958
don't use bare except
sayakpaul 16dcdf8
remove comments and catch the errors better
sayakpaul 737e627
fix a couple of things when using is_file()
sayakpaul 491e1e2
resolve conflicts
sayakpaul 2a18518
empty
sayakpaul 51906c6
Merge branch 'main' into feat-save-sharded-ckpt
sayakpaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.