-
Notifications
You must be signed in to change notification settings - Fork 298
Description
Describe the bug
Background
I created a new conda environment and used v2.3.110+xpu to install using pip on Windows.However, after the installation, Numpy had problems.
Experimental procedures
The command execution order is as follows:
-
conda create -n a770 python=3.11
-
conda activate a770
-
conda install libuv
-
python -m pip install torch==2.3.1+cxx11.abi torchvision==0.18.1+cxx11.abi torchaudio==2.3.1+cxx11.abi intel-extension-for-pytorch==2.3.110+xpu --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/cn/
-
The output is:
Successfully installed MarkupSafe-3.0.1 annotated-types-0.7.0 dpcpp-cpp-rt-2024.2.1 filelock-3.16.1 fsspec-2024.9.0 intel-cmplr-lib-rt-2024.2.1 intel-cmplr-lib-ur-2024.2.1 intel-cmplr-lic-rt-2024.2.1 intel-extension-for-pytorch-2.3.110+xpu intel-opencl-rt-2024.2.1 intel-openmp-2024.2.1 intel-sycl-rt-2024.2.1 jinja2-3.1.4 mkl-202 4.2.1 mkl-dpcpp-2024.2.1 mpmath-1.3.0 networkx-3.4.1 numpy-2.1.2 onemkl-sycl-blas-2024.2.1 onemkl-sycl-datafitting-2024.2.1 onemkl-sycl-dft-2024.2.1 pydantic -2.9.2 pydantic-core-2.23.4 ruamel.yaml-0.18.6 ruamel.yaml.clib-0.2.8 sympy-1.13.3 tbb-2021.13.1 torch-2.3.1+cxx11.abi torchaudio-2.3.1+cxx11.abi torchvision-0.18.1+cxx11.abi typing-extensions-4.12.2 -
Execute again:
python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.version); print(ipex.version); [print(f'[{i}]: {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];" -
The output is:
C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load image Python extension: 'Could not find module 'C:\Users\12710.conda\envs\a770\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 fromtorchvision.io
, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you havelibjpeg
orlibpng
installed before buildingtorchvision
from source?
warn(
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.2 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.
Traceback (most recent call last): File "", line 1, in
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\intel_extension_for_pytorch_init_.py", line 8, in
import torchvision
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision_init_.py", line 6, in
from torchvision import meta_registrations, datasets, io, models, ops, transforms, utils
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\models_init.py", line 2, in
from .convnext import *
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\models\convnext.py", line 8, in
from ..ops.misc import Conv2dNormActivation, Permute
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\ops_init_.py", line 23, in
from .poolers import MultiScaleRoIAlign
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\ops\poolers.py", line 10, in
from .roi_align import roi_align
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torchvision\ops\roi_align.py", line 4, in
import torch.dynamo
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo_init.py", line 64, in
torch.manual_seed = disable(torch.manual_seed)
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\decorators.py", line 50, in disable
return DisableContext()(fn)
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\eval_frame.py", line 410, in call
(filename is None or trace_rules.check(fn))
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 3378, in check
return check_verbose(obj, is_inlined_call).skipped
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 3361, in check_verbose
rule = torch._dynamo.trace_rules.lookup_inner(
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 3442, in lookup_inner
rule = get_torch_obj_rule_map().get(obj, None)
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 2782, in get_torch_obj_rule_map
obj = load_object(k)
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 2811, in load_object
val = _load_obj_from_str(x[0])
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch_dynamo\trace_rules.py", line 2795, in load_obj_from_str
return getattr(importlib.import_module(module), obj_name)
File "C:\Users\12710.conda\envs\a770\Lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\12710.conda\envs\a770\Lib\site-packages\torch\nested_internal\nested_tensor.py", line 417, in
values=torch.randn(3, 3, device="meta"),
C:\Users\12710.conda\envs\a770\Lib\site-packages\torch\nested_internal\nested_tensor.py:417: UserWarning: Failed to initialize NumPy:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.2 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.
(Triggered internally at C:\Jenkins\workspace\IPEX-WW-BUILDS@5\frameworks.ai.pytorch.private-gpu\torch\csrc\utils\tensor_numpy.cpp:84.)
values=torch.randn(3, 3, device="meta"),
C:\Users\12710.conda\envs\a770\Lib\site-packages\intel_extension_for_pytorch\llm_init_.py:9: UserWarning: failed to use huggingface generation fuctions due to: No module named 'transformers'.
warnings.warn(f"failed to use huggingface generation fuctions due to: {e}.")
2.3.1+cxx11.abi
2.3.110+xpu
[0]: _XpuDeviceProperties(name='Intel(R) Arc(TM) A770 Graphics', platform_name='Intel(R) Level-Zero', type='gpu', driver_version='1.3.30714', total_memory=15930MB, max_compute_units=512, gpu_eu_count=512, gpu_subslice_count=64, max_work_group_size=1024, max_num_sub_groups=128, sub_group_sizes=[8 16 32], has_fp16=1, has_fp64=0, has_atomic64=1)
analyze
I used this version of IPEX before, but I reinstalled it for some reason. When I used it before, I could call GPU for training normally except for the known torchvision error. After reinstalling, my previous model could not be trained because of Numpy.
It is worth noting that I reinstalled the latest version of OneAPI toolkit: BaseKit_p_2024.2.1.101.exe. And used the recommended installation to install all packages.
Versions
StatusCode : 200
StatusDescription : OK
Content : # Referenced from https://github.com/pytorch/pytorch/blob/master/torch/utils/collect_env.py
# Run it with python collect_env.py
.
import json
import locale
import re
import subprocess
import sys
impo...
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
Strict-Transport-Security: max-age=31536000
X-Content-Type-Options: nosniff
...
Forms : {}
Headers : {[Connection, keep-alive], [Content-Security-Policy, default-src 'none'; style-src 'unsafe-inline';
sandbox], [Strict-Transport-Security, max-age=31536000], [X-Content-Type-Options, nosniff]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 17618