Skip to content

Using torchvision with intel_extension_for_pytorch gives error #557

Closed
@tom-hehir

Description

@tom-hehir

Describe the bug

I am trying to use pytorch and torchvision with intel_extension_for_pytorch.

If I call the following code

import torch
import intel_extension_for_pytorch as ipex

I get the following error

/home/tmh61/rds/hpc-work/miniforge3/envs/pvc3/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/rds/user/tmh61/hpc-work/miniforge3/envs/pvc3/lib/python3.10/site-packages/torchvision/image.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs'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(

(Note that this error also appears when calling python collect_env.py to get my environment information).

Versions

/home/tmh61/rds/hpc-work/miniforge3/envs/pvc3/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/rds/user/tmh61/hpc-work/miniforge3/envs/pvc3/lib/python3.10/site-packages/torchvision/image.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs'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(
Collecting environment information...
PyTorch version: 2.1.0a0+cxx11.abi
PyTorch CXX11 ABI: Yes
IPEX version: 2.1.10+xpu
IPEX commit: a12f9f650
Build type: Release

OS: Rocky Linux release 8.9 (Green Obsidian) (x86_64)
GCC version: (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)
Clang version: N/A
IGC version: N/A
CMake version: version 3.26.5
Libc version: glibc-2.28

Python version: 3.10.13 (tags/v3.10.13-25-g07fbd8e9251-dirty:07fbd8e9251, Sep 27 2023, 23:32:09) [GCC 13.2.0] (64-bit runtime)
Python platform: Linux-4.18.0-477.43.1.el8_8.x86_64-x86_64-with-glibc2.28
Is XPU available: True
DPCPP runtime version: N/A
MKL version: N/A
GPU models and configuration:
[0] _DeviceProperties(name='Intel(R) Data Center GPU Max 1550', platform_name='Intel(R) Level-Zero', dev_type='gpu, support_fp64=1, total_memory=131072MB, max_compute_units=1024, gpu_eu_count=1024)
Intel OpenCL ICD version: 23.22.26516.34-682.el8_8
Level Zero version: 1.3.26516.34-682.el8_8

CPU:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              96
On-line CPU(s) list: 0-95
Thread(s) per core:  1
Core(s) per socket:  48
Socket(s):           2
NUMA node(s):        2
Vendor ID:           GenuineIntel
CPU family:          6
Model:               143
Model name:          Intel(R) Xeon(R) Platinum 8468
Stepping:            8
CPU MHz:             2100.000
BogoMIPS:            4200.00
L1d cache:           48K
L1i cache:           32K
L2 cache:            2048K
L3 cache:            107520K
NUMA node0 CPU(s):   0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94
NUMA node1 CPU(s):   1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 invpcid_single cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] intel-extension-for-pytorch==2.1.10+xpu
[pip3] lovely-numpy==0.2.11
[pip3] numpy==1.24.3
[pip3] pytorch-lightning==1.9.4
[pip3] torch==2.1.0a0+cxx11.abi
[pip3] torchmetrics==0.11.4
[pip3] torchvision==0.16.0
[conda] intel-extension-for-pytorch 2.1.10              py310_xpu_0    intel
[conda] lovely-numpy              0.2.11             pyhd8ed1ab_0    conda-forge
[conda] mkl                       2024.0.0            intel_49656    intel
[conda] mkl-dpcpp                 2024.0.0            intel_49656    intel
[conda] mkl-include               2024.0.0            intel_49656    intel
[conda] mkl-service               2.4.0           py310h3539a15_41    intel
[conda] mkl_fft                   1.3.6           py310h1d81ff8_61    intel
[conda] mkl_random                1.2.2           py310h5a378b4_81    intel
[conda] mkl_umath                 0.1.1           py310h2b1685c_91    intel
[conda] numpy                     1.24.3          py310ha320b8e_5    intel
[conda] numpy-base                1.24.3          py310hbac2b65_5    intel
[conda] onemkl-sycl-blas          2024.0.0            intel_49656    intel
[conda] onemkl-sycl-datafitting   2024.0.0            intel_49656    intel
[conda] onemkl-sycl-dft           2024.0.0            intel_49656    intel
[conda] onemkl-sycl-lapack        2024.0.0            intel_49656    intel
[conda] onemkl-sycl-rng           2024.0.0            intel_49656    intel
[conda] onemkl-sycl-sparse        2024.0.0            intel_49656    intel
[conda] onemkl-sycl-stats         2024.0.0            intel_49656    intel
[conda] onemkl-sycl-vm            2024.0.0            intel_49656    intel
[conda] pytorch                   2.1.0               py310_xpu_0    intel
[conda] pytorch-lightning         1.9.4              pyhd8ed1ab_1    conda-forge
[conda] pytorch-mutex             1.0                         cpu    intel
[conda] torchmetrics              0.11.4             pyhd8ed1ab_0    conda-forge
[conda] torchvision               0.16.0                py310_cpu    pytorch

Metadata

Metadata

Assignees

Labels

XPU/GPUXPU/GPU specific issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions