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

[core] Refactor from_pretrained #36033

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft

Conversation

Cyrilvallez
Copy link
Member

@Cyrilvallez Cyrilvallez commented Feb 4, 2025

What does this PR do?

Large refactor of from_pretrained:

  • Much more readable and maintainable in the future (hopefully, at least IMO)
  • Tensor Parallel (TP) dispatch layer by layer, providing the best tradeoff between speed (no overhead compared to full model dispatch in one go, actually even faster) and memory (almost no memory overhead beyond the expected size of the model on the current device)
  • faster model downloads (concurrent file download)

@HuggingFaceDocBuilderDev

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.

@Cyrilvallez Cyrilvallez force-pushed the refactor-from-pretrained branch from 1e626dd to bbab9b2 Compare February 5, 2025 09:34
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.

2 participants