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

Better check for deepspeed availability #379

Merged
merged 3 commits into from
May 20, 2022
Merged

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented May 20, 2022

We are having issues in the tests of Transformers where there is a folder called deepspeed containing test files for DeepSpeed.
That folder gets interpreted as the "DeepSpeed" package by Accelerate, which then tries to import things.

This PR fixes that by making the test for deepspeed more robust (like we have for Datasets in Transformers).

@sgugger sgugger requested a review from muellerzr May 20, 2022 14:36
Copy link
Collaborator

@muellerzr muellerzr left a comment

Choose a reason for hiding this comment

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

LG2M! Just one question

# AND checking it has an author field in the metadata that is HuggingFace.
if package_exists:
try:
_ = importlib_metadata.version("deepspeed")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_ = importlib_metadata.version("deepspeed")

If I'm not mistaken this is unnecessary. You can do _deepspeed_metadata.get("version") if it's needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

importlib_metadata.metadata will also then raise the same error if it's not installed

@sgugger sgugger merged commit 41427c5 into main May 20, 2022
@sgugger sgugger deleted the better_deepspeed_check branch May 20, 2022 15:05
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 20, 2022

The documentation is not available anymore as the PR was closed or merged.

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.

None yet

3 participants