Skip to content

IPEX xpu wheel files for windows using the wrong version of Pytorch? Also no torchvision #398

@Mindset-Official

Description

@Mindset-Official

Describe the issue

python -m pip install torch==2.0.0a0 intel_extension_for_pytorch==2.0.110+gitba7f6c1 -f https://developer.intel.com/ipex-whl-stable-xpu

wheel files seem to include torch 2.0.0a0 but notes say that xpu is only available for torch 2.0.1a0

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\mymin\AppData\Local\Programs\Python\Python310\lib\site-packages\intel_extension_for_pytorch_init_.py", line 89, in
raise err
OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\mymin\AppData\Local\Programs\Python\Python310\lib\site-packages\intel_extension_for_pytorch\bin\intel-ext-pt-gpu.dll" or one of its dependencies.
torch.xpu.is_available()
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'torch' has no attribute 'xpu'

Also there seems to be no version of torchvision for windows? Not sure if this is a mistake or just part of the expiremental nature? as is xpu is not detected and doesn't work on windows so it defaults to cpu still.

Activity

jingxu10

jingxu10 commented on Aug 4, 2023

@jingxu10
Contributor

Because of the experimental nature, the pytorch wheel shipped is 2.0.1 code base, but didn't get version updated in its version.txt file. torchvision wheels are not available at this moment as well.

@min-jean-cho could you check the error above?

OSError: [WinError 126] The specified module could not be found. Error loading "C:\Users\mymin\AppData\Local\Programs\Python\Python310\lib\site-packages\intel_extension_for_pytorch\bin\intel-ext-pt-gpu.dll" or one of its dependencies.
min-jean-cho

min-jean-cho commented on Aug 4, 2023

@min-jean-cho
Contributor

Thanks @Mindset-Official for trying out. Could you please double check if you have activated oneAPI environment, call "{YOUR_PATH_TO_ONEAPI}\setvars.bat" (e.g., call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat")?

Mindset-Official

Mindset-Official commented on Aug 4, 2023

@Mindset-Official
Author

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and

Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

min-jean-cho

min-jean-cho commented on Aug 4, 2023

@min-jean-cho
Contributor

Glad to hear that! Let us know if any other questions.

Nuullll

Nuullll commented on Aug 7, 2023

@Nuullll

Since Intel hasn't released a corresponding torchvision wheel for windows, the SD Web UI tries to install the latest torchvision == 0.15.2, which requires torch == 2.0.1. So pip install torchvision will uninstall the intel torch because of incompatible version and install torch == 2.0.1 instead. Then intel_extension_for_pytorch bails out because of wrong dll version from torch 2.0.1.

I have to hack torchvision-0.15.1.dist-info/METADATA in the python site-packages to force it compatible with torch == 2.0.0a0.

Metadata-Version: 2.1
Name: torchvision
Version: 0.15.1
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: soumith@pytorch.org
License: BSD
Requires-Python: >=3.8
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: requests
- Requires-Dist: torch (==2.0.0)
+ Requires-Dist: torch (==2.0.0a0)
Requires-Dist: pillow (!=8.3.*,>=5.3.0)
Provides-Extra: scipy
Requires-Dist: scipy ; extra == 'scipy'
Nuullll

Nuullll commented on Aug 7, 2023

@Nuullll

So we really need an intel torchvision wheel for windows. Is that planned in the near future?

Mindset-Official

Mindset-Official commented on Aug 7, 2023

@Mindset-Official
Author

Since Intel hasn't released a corresponding torchvision wheel for windows, the SD Web UI tries to install the latest torchvision == 0.15.2, which requires torch == 2.0.1. So pip install torchvision will uninstall the intel torch because of incompatible version and install torch == 2.0.1 instead. Then intel_extension_for_pytorch bails out because of wrong dll version from torch 2.0.1.

I have to hack torchvision-0.15.1.dist-info/METADATA in the python site-packages to force it compatible with torch == 2.0.0a0.

Metadata-Version: 2.1
Name: torchvision
Version: 0.15.1
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: soumith@pytorch.org
License: BSD
Requires-Python: >=3.8
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: requests
- Requires-Dist: torch (==2.0.0)
+ Requires-Dist: torch (==2.0.0a0)
Requires-Dist: pillow (!=8.3.*,>=5.3.0)
Provides-Extra: scipy
Requires-Dist: scipy ; extra == 'scipy'

Try this <@323514682155466753> 'torch==2.0.0a0 torchvision==0.15.2a0 intel_extension_for_pytorch==2.0.110+gitba7f6c1 -f https://developer.intel.com/ipex-whl-stable-xpu' 0.15.2a0 seems to install correctly for me. It should atleast install without error

Nuullll

Nuullll commented on Aug 8, 2023

@Nuullll

Thanks @Mindset-Official. torchvision-0.15.2a0+cxx11.abi-cp310-cp310-linux_x86_64.whl seems to be a linux wheel, I doubt it would work as expected on native windows. Anyway I'd give it a try.

Update:

ERROR: torchvision-0.15.2a0+cxx11.abi-cp310-cp310-linux_x86_64.whl is not a supported wheel on this platform.
charygu

charygu commented on Nov 27, 2023

@charygu

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and

Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Mindset-Official

Mindset-Official commented on Nov 27, 2023

@Mindset-Official
Author

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

charygu

charygu commented on Nov 27, 2023

@charygu

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

Thank you for your reply. I think my oneapi is not good, I am using 2024 as 2023.2 is not available to download from intel. Could you tell me where to download oneapi-basekit 2023.2?

charygu

charygu commented on Nov 28, 2023

@charygu

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

I found the solution finally. Thank you very much.

makejiang

makejiang commented on Nov 30, 2023

@makejiang

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

I found the solution finally. Thank you very much.

Hi @charygu, could you share your solution? It is killing me. Thanks!

charygu

charygu commented on Nov 30, 2023

@charygu

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

I found the solution finally. Thank you very much.

Hi @charygu, could you share your solution? It is killing me. Thanks!

I didn't stick to oneAPI of windows installer. Instead, I installed it by using conda in my conda env. Then you may get the 2023.2.0 version which includes the dependencies "intel-ext-pt-gpu.dll" needs.

makejiang

makejiang commented on Dec 1, 2023

@makejiang

Okay, thanks. I was able to get it to run by deleting python and installing miniconda as default, I then ran everything in oneapi environment and
Python 3.10.12 | packaged by Anaconda, Inc. | (main, Jul 5 2023, 19:01:18) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import torch
import intel_extension_for_pytorch
torch.xpu.is_available()
True

appreciate the help and response. I will give it a shot and see how everything works in windows.

Hi, Mindset-Official, Could you tell me how you fix that issue? Did you get this fixed on native Windows?

Yeah, what I did in that post fixed it. You can probably run it without miniconda but I left it as is. Definitely make sure to run the environment and call those variables every time you run.

I found the solution finally. Thank you very much.

Hi @charygu, could you share your solution? It is killing me. Thanks!

I didn't stick to oneAPI of windows installer. Instead, I installed it by using conda in my conda env. Then you may get the 2023.2.0 version which includes the dependencies "intel-ext-pt-gpu.dll" needs.

Thanks charygu, 2023.2 works!

Cyberavater

Cyberavater commented on Jan 19, 2024

@Cyberavater

Can anyone give or link me to a proper guide to use this on Windows?

YimingLiu000

YimingLiu000 commented on Feb 26, 2024

@YimingLiu000

Hi@charygu, could you tell me how to activate oneAPI in conda environment? I can use conda install the 2023.2.0 version, but don't know how to load it.

karthika-ml

karthika-ml commented on Jul 6, 2024

@karthika-ml

Hi, here is an amazing blog that I found to configure the intel-ipex to your pytorch on a windows: https://christianjmills.com/posts/intel-pytorch-extension-tutorial/native-windows/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @makejiang@Nuullll@jingxu10@Cyberavater@charygu

        Issue actions

          IPEX xpu wheel files for windows using the wrong version of Pytorch? Also no torchvision · Issue #398 · intel/intel-extension-for-pytorch