-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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] be more specific when doing accelerate imports. #8772
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Just want to point out this is more style, doesn't change import time I found when using main/the new methods
@@ -83,9 +83,9 @@ def run(self) -> dict: | |||
|
|||
accelerate_version = "not installed" | |||
if is_accelerate_available(): | |||
import accelerate | |||
from accelerate import __version__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -72,7 +72,7 @@ | |||
|
|||
|
|||
if is_accelerate_available(): | |||
import accelerate | |||
from accelerate import init_empty_weights, load_checkpoint_and_dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@muellerzr just making sure that all of your findings are from |
@sayakpaul yep! |
So if you want to support older versions/worry about that, definitely feel free to do so. :) |
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. |
IMO it's better to rely on a stable version of |
Agreed, |
@muellerzr |
What does this PR do?
By being more specific on the imports, we can cut down the overall import time in our library.
Follow this thread: https://huggingface.slack.com/archives/C021H1P1HKR/p1719924173632779.
We should try to identify more such opportunities.