transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Cannot import name 'deepspeed_reinit' from 'transformers.deepspeed'

Open rubenCrayon opened this issue 1 year ago • 1 comments

System Info

Bug found when following the optimization steps provided in https://huggingface.co/blog/optimum-inference.

It seems like transformers/deepspeed.py does not contain the method 'deepspeed_reinit' so it's not possible to import it when loading ORTModel objects.

Thanks in advance for your incredible work. @stas00, @pacman100

Who can help?

No response

Information

  • [X] The official example scripts
  • [ ] My own modified scripts

Tasks

  • [X] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [ ] My own task or dataset (give details below)

Reproduction

Install optimum[onnxruntime]==1.2.0

Run: from optimum.onnxruntime import ORTModelForQuestionAnswering or import optimum.onnxruntime

Expected behavior

The package should import the ORTModels without any issue, enabling the optimization of the ONNX models using DeepSpeed

rubenCrayon avatar Mar 09 '23 08:03 rubenCrayon

Hi @rubenCrayon! deepspeed_reinit was removed a few versions ago, you should use a more recent version of Optimum. Which may requires to change your script a bit, in that case I recommend that you open an issue in Optimum: https://github.com/huggingface/optimum/issues

regisss avatar Mar 09 '23 13:03 regisss

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

github-actions[bot] avatar Apr 08 '23 15:04 github-actions[bot]