huggingface / optimum-intel

🤗 Optimum Intel: Accelerate inference with Intel optimization tools
https://huggingface.co/docs/optimum/main/en/intel/index
Apache License 2.0
388 stars 110 forks source link

Enable IPEXModel with deepspeed #732

Closed jiqing-feng closed 3 months ago

jiqing-feng commented 4 months ago

This PR enables IPEXModel with deepspeed and needs to use the intel_extension_for_pytorch environment to run.

HuggingFaceDocBuilderDev commented 4 months ago

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.

jiqing-feng commented 4 months ago

Hi @echarlaix . This PR is ready for review. The main change for IPEXModel is the new method of _from_models. Do you accept it? If so, I will add some tests for this API per your instructions. If not, could you share your idea of how to enable deepspeed by IPEXModel? Thx!

jiqing-feng commented 3 months ago

Hi @echarlaix . Can you take a look at my new changes? I integrated the ipex_jit_trace in the __init__ method so users can use the init method to get an exported model. I think it is more friendly to users as they can get an exported model from an eager mode model without importing ipex_jit_trace from optimum-intel.

I will add some tests for __init__ if you agree with this design.

jiqing-feng commented 3 months ago

HI @IlyasMoutawwakil . Can you help take a look at this PR? Thx!

jiqing-feng commented 3 months ago

Hi @echarlaix . Thanks for your review, I have fixed all your comments.