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

Better error when a bad directory is given for weight merging #2852

Open muellerzr opened 3 weeks ago

muellerzr commented 3 weeks ago

What does this PR do?

This PR expounds the error messages given when passing in a checkpoint directory, specifying if model or optimizer FSDP directories were found.

Each of these have pytorch_model_fsdp_0 and optimizer_0 for folders, so we can check for their existence and direct the user on what to do.

Fixes https://github.com/huggingface/accelerate/issues/2848

Before submitting

Who can review?

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.

@SunMarc

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.