huggingface / accelerate

🚀 A simple way to launch, train, and use PyTorch models on almost any device and distributed configuration, automatic mixed precision (including fp8), and easy-to-configure FSDP and DeepSpeed support
https://huggingface.co/docs/accelerate
Apache License 2.0
7.34k stars 875 forks source link

Default FSDP weights merge to safetensors #2853

Closed helloworld1 closed 2 weeks ago

helloworld1 commented 3 weeks ago

What does this PR do?

The new accelerate merge-weights should default use safetensors format. However, it is using bin format.

$ accelerate merge-weights checkpoint-2000/pytorch_model_fsdp_0/ checkpoint-2000-merged-weight

$ ls checkpoint-2000-merged-weight
pytorch_model.bin

After this change it is now model.safetensors

Fixes # (issue)

Before submitting

Who can review?

@muellerzr Anyone in the community is free to review the PR once the tests have passed. Feel free to tag members/contributors who may be interested in your PR.

HuggingFaceDocBuilderDev commented 3 weeks ago

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.