-
Notifications
You must be signed in to change notification settings - Fork 0
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
posts/intel-pytorch-extension-tutorial/native-windows/ #43
Comments
Hi Christian Mills, Excellent tuition! Thank you for your share! However, under this tuition, I don't know why I could only import pytorch correctly, intel_extension_for_pytorch could not be imported. I wish someone could help me with it. Also, another way to make Intel-gpu available for Pytorch on Windows may be via DirectML. I successfully make it good with TensorFlow. I wonder which is better between intel_extension_for_pytorch and Directml. |
Hi @ArchDD, Intel's PyTorch extension offers some key benefits compared to using TensorFlow with DirectML. First, Intel's PyTorch extension still receives updates, with the most recent release being in August. In contrast, the Second, as mentioned in this post, Intel's PyTorch extension provides optimizations to take advantage of the Xe Matrix Extensions inside Arc GPUs. |
Thank you for providing the information about the difference between the two methods. It helps a lot on deciding which method to use. And I will check the installation again. |
Hi Christian Mills, I think I have installed correctly. I got message after import torch andintel_extension_for_pytorch: C:\Users\NUC\mambaforge\envs\pytorch-arc\Lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: '[WinError 127] Module not found. 'If you don't plan on using image functionality from 2.0.0a0+gitc6a572f I think torchvision can not work but anyway I don't need torchvision at the moment. However, I am wondering how to use Pycharm not jupyter notebook. Do you have any suggestion on it? Thank you so much! |
Hi @ArchDD, The Regarding Pycharm, I don't use it personally, but I believe it has a place to set environment variables. Checkout the documentation: |
Hi Christian Mills, |
ArchDD - conda install libpng and conda install jpeg will make the warnings go away |
Hi, Christian Mills,
|
Hi @georg-che, The console output seems to suggest the installation was successful. The test command at the bottom successfully prints the package versions for PyTorch, torchvision, and Intel's extension. That aside, version I only had time to briefly swap my Arc GPU into my desktop for a few days last December, but version Also, please limit posting a given question to a single location. I don't always have time to answer questions, but I try to set aside time on Thursdays and Fridays. |
Thanks for the reply, @cj-mills! |
OSError: [WinError 127] The specified procedure could not be found. Error loading "..\intel_extension_for_pytorch\bin\intel-ext-pt-gpu.dll" or one of its dependencies |
I am using Miniconda. I followed your documentation and now get the following error [1127/1130] Linking CXX static library csrc\gpu\oneDNN\src\dnnl.lib ignoring unknown argument: -fsycl ignoring unknown argument: -Wno-unknown-argument ignoring unknown argument: -Qoption,link,/machine:x64 [1129/1130] Linking CXX shared library csrc\gpu\intel-ext-pt-gpu.dll FAILED: csrc/gpu/intel-ext-pt-gpu.dll csrc/gpu/intel-ext-pt-gpu.lib C:\Windows\system32\cmd.exe /C "cd . && C:\Users\zhang\miniconda3\envs\oneAPI_env\Lib\site-packages\cmake\data\bin\cmake.exe -E vs_link_dll --intdir=csrc\gpu\CMakeFiles\intel-ext-pt-gpu.dir --rc=C:\PROGRA |
@triilman25 @JamasChuang94 |
@cj-mills |
@JamasChuang94 |
Updated PIP install script is this: Link can be generated from https://intel.github.io/intel-extension-for-pytorch/index.html#installation?platform=gpu&version=v2.3.110%2bxpu&os=windows&package=pip |
@cj-mills One note in the verify arc section is to add "import pandas as pd" before so that pd is defined. |
Can you make installation for WSL? |
@triilman25 The installation/setup process for WSL should be the same as native Ubuntu (at least it was the last time I tried it). You can follow my native Ubuntu tutorial starting from the linked section: |
if we install in WSL should we disable integrated driver (UHD/Iris) like previous tutorial ? |
If I remember correctly, you don't need to disable it for WSL.
Yep, that's expected and fine since we do not need the transformers library for the image classification training code. That warning is for the extension's LLM-related functionality. |
I got issue when I don't disable the integrated driver. the kernel always want restarted and never executes code bellow: xpu_device_count = torch.xpu.device_count() from this source code: def get_public_properties(obj):
return {
prop: getattr(obj, prop)
for prop in dir(obj)
if not prop.startswith("__") and not callable(getattr(obj, prop))
}
xpu_device_count = torch.xpu.device_count()
dict_properties_list = [get_public_properties(torch.xpu.get_device_properties(i)) for i in range(xpu_device_count)]
pd.DataFrame(dict_properties_list) |
@triilman25 Thanks for testing that, I'll make a note in the tutorial |
should I install |
Hi @triilman25, The |
https://christianjmills.com/posts/intel-pytorch-extension-tutorial/native-windows/#install-microsoft-visual-c-redistributable
|
NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2. I got some error. |
intel/AI-Playground#76 (comment) I got some solution for issue: |
this works. Just create new env variable (system or user): |
I still can't solve this issue: 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(
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2. |
@triilman25 Did |
when it execute it takes long time to show the result. |
https://pytorch.org/blog/intel-gpu-support-pytorch-2-5/ Can you explain about this blog? I quite understand but I don't catch the whole idea. |
@triilman25 It appears that PyTorch is finally integrating direct support for Intel GPUs without the need for Intel's extension. |
so do we needn't install intel extension (ipex) every we want using xpu in our project anymore? |
does |
The code (pip install torch ...) gives an error: |
You should not need to install Intel's extension with PyTorch 2.5+. However, there are still some installation prerequisites: Intel's extension supposedly supports |
Hi @apk2222, It appears they have updated the package version names: # For Intel® Arc™ A-Series Graphics, use the commands below:
conda install libuv
pip install torch==2.3.1.post0+cxx11.abi torchvision==0.18.1.post0+cxx11.abi torchaudio==2.3.1.post0+cxx11.abi intel-extension-for-pytorch==2.3.110.post0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/cn/
# For Intel® Core™ Ultra Processors with Intel® Core™ Ultra Processors with Intel® Arc™ Graphics (MTL-H), use the commands below:
conda install libuv
pip install torch==2.3.1.post0+cxx11.abi torchvision==0.18.1.post0+cxx11.abi torchaudio==2.3.1.post0+cxx11.abi intel-extension-for-pytorch==2.3.110.post0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/mtl/cn/
# For Intel® Core™ Ultra Series 2 with Intel® Arc™ Graphics, use the commands below:
conda install libuv
pip install torch==2.3.1.post0+cxx11.abi torchvision==0.18.1.post0+cxx11.abi torchaudio==2.3.1.post0+cxx11.abi intel-extension-for-pytorch==2.3.110.post0+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/lnl/cn/ There may also be some sort of configuration issue on their end as all the linked pip wheels seem to return the same error: <Error>
<Code>AllAccessDisabled</Code>
<Message>All access to this object has been disabled</Message>
<RequestId>X04V3TJE6ZD3NZ9C</RequestId>
<HostId>
nZgdTg7gTlzvcV1H+wE+TKUKZ1xUUwCWWOzaViZMHfq8/SOSA9cRhGWqJirZDnMu4XmW52G6QiM=
</HostId>
</Error> GitHub Issue: intel/intel-extension-for-pytorch#745 |
and just updated : # For Intel® Arc™ B-Series Graphics, use the commands below:
conda install libuv
python -m pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/bmg/cn/
# For Intel® Arc™ A-Series Graphics, use the commands below:
conda install libuv
python -m pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/cn/
# For Intel® Core™ Ultra Series 2 with Intel® Arc™ Graphics, use the commands below:
conda install libuv
python -m pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/lnl/cn/
# For Intel® Core™ Ultra Processors with Intel® Arc™ Graphics (MTL-H), use the commands below:
conda install libuv
python -m pip install torch==2.5.1+cxx11.abi torchvision==0.20.1+cxx11.abi torchaudio==2.5.1+cxx11.abi intel-extension-for-pytorch==2.5.10+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/mtl/cn/ |
Christian Mills - Getting Started with Intel’s PyTorch Extension for Arc GPUs on Windows
This tutorial provides a step-by-step guide to setting up Intel’s PyTorch extension on Windows to train models with Arc GPUs.
https://christianjmills.com/posts/intel-pytorch-extension-tutorial/native-windows/
The text was updated successfully, but these errors were encountered: