intel / intel-extension-for-pytorch

A Python package for extending the official PyTorch that can easily obtain performance on Intel platform
Apache License 2.0
1.6k stars 246 forks source link

torch._dynamo.exc.InvalidBackend: Invalid backend: 'ipex', see `torch._dynamo.list_backends()` for available backends. #497

Open dlod-openvino opened 10 months ago

dlod-openvino commented 10 months ago

OS: Windows11; Python=3.9.18

Install the intel_extension_for_pytorch-2.1.10+xpu-cp39-cp39-win_amd64.whl

# get the wheels on Windows system
wget https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/xpu/torch-2.1.0a0%2Bcxx11.abi-cp39-cp39-win_amd64.whl
wget https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/xpu/torchvision-0.16.0a0%2Bcxx11.abi-cp39-cp39-win_amd64.whl
wget https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_stable/xpu/intel_extension_for_pytorch-2.1.10%2Bxpu-cp39-cp39-win_amd64.whl

# install the packages from the wheels
pip install torch-2.1.0a0+cxx11.abi-cp39-cp39-win_amd64.whl
pip install torchvision-0.16.0a0+cxx11.abi-cp39-cp39-win_amd64.whl
pip install intel_extension_for_pytorch-2.1.10+xpu-cp39-cp39-win_amd64.whl

Execute torch._dynamo.list_backends() There is no ipex in the list of backends as below:

(bigdl) D:>python Python 3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. --- import intel_extension_for_pytorch as ipex C:\Users\OV\anaconda3\envs\bigdl\lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: 'Could not find module 'C:\Users\OV\anaconda3\envs\bigdl\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax.'If you don't plan on using image functionality from torchvision.io, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg or libpng installed before building torchvision from source? warn( --- import torch --- torch._dynamo.list_backends() ['cudagraphs', 'inductor', 'onnxrt', 'openxla', 'openxla_eval', 'tvm']

1703887639262

jingxu10 commented 9 months ago

The feature will be available in the future.

roansong commented 6 months ago

I ran the following and it worked:

>>> import intel_extension_for_pytorch
>>> import torch
>>> torch._dynamo.list_backends()
['cudagraphs', 'inductor', 'ipex', 'onnxrt', 'openxla', 'openxla_eval', 'tvm']