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

[Distributed] Support index + multi-bin loading #1275

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

kwen2501
Copy link
Contributor

@kwen2501 kwen2501 commented Oct 5, 2024

Some HF format uses index + multiple binaries instead of index + multiple safetensors.
Distributed workflows already support the later, this PR adds support for the former too.
(The reason is that quantized checkpoint cannot save as safetensor format yet.)

Copy link

pytorch-bot bot commented Oct 5, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1275

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 9ef2171 with merge base 766bee9 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 5, 2024
@kwen2501 kwen2501 requested a review from lessw2020 October 5, 2024 04:36
@kwen2501 kwen2501 changed the base branch from main to dtensor_shard October 5, 2024 04:37
@mikekg
Copy link

mikekg commented Oct 5, 2024

Does this compose with #1255 ?

@kwen2501
Copy link
Contributor Author

kwen2501 commented Oct 6, 2024

Does this compose with #1255 ?

Thanks for the review. I hope yes.
Distributed already have support for "index + multi-safetensor" format (thanks to @lessw2020 ).
This PR only adds support for "index + multi-bin" format. (The reason is that quantized checkpoint cannot save as safetensor format yet.)

@mikekg
Copy link

mikekg commented Oct 6, 2024

Does this compose with #1255 ?

Thanks for the review. I hope yes. Distributed already have support for "index + multi-safetensor" format (thanks to @lessw2020 ). This PR only adds support for "index + multi-bin" format. (The reason is that quantized checkpoint cannot save as safetensor format yet.)

How much of this can be shared with local-only weight loading? Should distributed weight loading just be a general case of local loading (or vice versa, local just a special case of distributed?) Not suggesting to abandon this PR at all, but similar to what you've done to merging model.py and model_dist.py (yay! Awesome work!!!!) could be a real value here.

Copy link
Contributor

@lessw2020 lessw2020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
Thanks for adding this!

@kwen2501 kwen2501 merged commit 75f3a35 into dtensor_shard Oct 7, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants