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

Add safetensors support #4659

Merged
merged 14 commits into from Dec 1, 2023
Merged

Conversation

jihnenglin
Copy link
Contributor

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.

@jihnenglin
Copy link
Contributor Author

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

@jeffra
Copy link
Contributor

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?

@jihnenglin
Copy link
Contributor Author

jihnenglin 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

@jihnenglin
Copy link
Contributor 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>
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.

None yet

5 participants