-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
fix deepspeed available detection #26252
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Could you show us how to see the following?
|
@ydshieh Reproduction (maybe add relevant
|
I tried to do it in a simple way import os
# given by `get_env`
os.environ["PYTHONPATH"] = "/transformers/src:/transformers/tests:"
# shows `/transformers/src:/transformers/tests:`
print(os.environ["PYTHONPATH"])
from transformers.deepspeed import is_deepspeed_available
print(is_deepspeed_available()) and it prints |
@ydshieh You would need to use: I believe setting |
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.
Thank you @fxmarty . Nice fix.
For the record, to reproduce (inside our docker env)
|
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.
Good call, grateful for the detail pr description 😄
As per title, make the deepspeed available function more robust as https://github.com/huggingface/accelerate/blob/69e4c3c54da3201eda288b500d138761e7a5221c/src/accelerate/utils/imports.py#L72
Having
tests/deepspeed
&get_env
that addstests/
in the path then makesis_deepspeed_availebl()
returnsTrue
although it should not, and in turn trainer.py tries to importDeepSpeedSchedulerWrapper
that is not imported in accelerate as accelerate rightfully detects that DeepSpeed is not available.This issue makes the test
tests/extended/test_trainer_ext.py::TestTrainerExt::test_run_seq2seq_apex
fail when APEX is installed but DeepSpeed is not.