-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Use huggingface_hub helper function to split state dict #31091
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good in theory to me; @Wauplin, could you give this a quick look as well?
Could you make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well! Thanks for taking care of this @SunMarc :)
If I'm not mistaken there are similar methods for tf / flax in transformers
that could benefit from it. Can be done in separate PRs though.
I'll have a look and do it in another PR after this PR gets merged and tested ! Just a quick question @Wauplin , the current helper function in huggingface-hub introduced a regression in transformers (not able to handle kiB, miB). Is is fine ? If so, I can modify the failing test : |
@SunMarc Done in huggingface/huggingface_hub#2304
I'm not a |
WDYT @amyeroberts ? |
@Wauplin @SunMarc Sounds good to me! Agreed, I don't think we need to handle a deprecation cycle here |
…31091) * shard saving from hf hub * index = None * fix tests * indent
* shard saving from hf hub * index = None * fix tests * indent
* shard saving from hf hub * index = None * fix tests * indent
* shard saving from hf hub * index = None * fix tests * indent
* shard saving from hf hub * index = None * fix tests * indent
* shard saving from hf hub * index = None * fix tests * indent
What does this PR do ?
This PR uses the helper function from huggingface-hub to split a state dict into shards instead of
shard_checkpoint
. This will make maintenance easier for all HF libraries. Similar PR have been created in accelerate and diffusers.