Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add safetensors support #4659

Merged
merged 14 commits into from
Dec 1, 2023
Merged

Conversation

ngitnenlim
Copy link

In response to DeepSpeed-MII issue #272

Introduce compatibility for HF repositories containing solely .safetensors checkpoints. In case of coexistence, prioritize .safetensors checkpoints over .bin ones.

@ngitnenlim
Copy link
Author

@microsoft-github-policy-service agree company="Gigabyte Technology"

@jeffra
Copy link
Collaborator

jeffra commented Nov 13, 2023

This is great, thank you @jihnenglin! Can you also create a PR on the MII side to update https://github.com/microsoft/DeepSpeed-MII/blob/main/requirements/requirements.txt to add safetensors as a dependency?

@ngitnenlim
Copy link
Author

ngitnenlim commented Nov 14, 2023

This is great, thank you @jihnenglin! Can you also create a PR on the MII side to update https://github.com/microsoft/DeepSpeed-MII/blob/main/requirements/requirements.txt to add safetensors as a dependency?

Sure, will do!

Edit: DeepSpeed-MII PR #296

@ngitnenlim
Copy link
Author

I've made it automatically fetch *.safentensors checkpoints by default, and only fallback to download *.bin checkpoints if there are no *.safentensors.

Cleaning up this implementation a bit to avoid the deep if-else branching statements
@mrwyattii
Copy link
Contributor

I've made it automatically fetch *.safentensors checkpoints by default, and only fallback to download *.bin checkpoints if there are no *.safentensors.

Thanks @jihnenglin! I cleaned up your implementation a little bit so we could avoid some of the deeper nested if-else branching and make it a bit easier to read the code. LGTM

@loadams
Copy link
Contributor

loadams commented Nov 28, 2023

The only a6000 test failing is a known failure, so we could bypass this if we need.

@mrwyattii mrwyattii merged commit 7122362 into microsoft:master Dec 1, 2023
8 of 9 checks passed
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
Co-authored-by: Jeff Rasley <jerasley@microsoft.com>
Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants