intel-extension-for-pytorch icon indicating copy to clipboard operation
intel-extension-for-pytorch copied to clipboard

Performance Regression?

Open chsasank opened this issue 5 months ago • 4 comments

Describe the bug

My benchmark code is here: https://github.com/chsasank/device-benchmarks. Installed IPEX version 2.1.40+xpu and reran benchmarks now

(ipex) sasank@arc-reactor:~/device-benchmarks$ python benchmark.py  --device xpu
benchmarking xpu using torch.float32
size, elapsed_time, tops
256, 0.006260919570922852, 0.005359345639230775
304, 0.0024485349655151366, 0.022947978604086896
362, 0.00440666675567627, 0.021530072787507588
430, 0.008081912994384766, 0.019675292237182136
512, 0.0003328084945678711, 0.8065763355846578
608, 0.003543543815612793, 0.1268536378806607
724, 0.0035861968994140626, 0.21164673030753323
861, 0.0006769657135009766, 1.885700762300362
1024, 0.0007146120071411133, 3.0051043454912723
1217, 0.008795928955078126, 0.4098453550967751
1448, 0.0016879558563232422, 3.597282927307316
1722, 0.002561616897583008, 3.9867156191996784
2048, 0.01477653980255127, 1.162644936741806
2435, 0.01357724666595459, 2.1267438428739656
2896, 0.010721397399902344, 4.530793557978035
3444, 0.017465853691101076, 4.677670282422338
4096, 0.038442349433898924, 3.575196508432044
4870, 0.05310211181640625, 4.35015855487371
5792, 0.08499093055725097, 4.572387943372691
6888, 0.14080357551574707, 4.641899438632534
size (GB), elapsed_time, bandwidth (GB/s)
0.004194304, 9.052753448486328e-05, 92.66360834562022
0.00593164, 9.815692901611328e-05, 120.86034189244596
0.008388608, 0.00011904239654541016, 140.93479707122773
0.01186328, 0.0001466989517211914, 161.73639771532586
0.016777216, 0.0001789093017578125, 187.5499578295949
0.023726564, 0.00022954940795898436, 206.72293787174075
0.033554432, 0.0003112316131591797, 215.6235458178765
0.047453132, 0.00041189193725585935, 230.41544496426025
0.067108864, 0.0005517244338989258, 243.26950150007002
0.094906264, 0.0007545232772827148, 251.56616596850003
0.134217728, 0.0010475397109985351, 256.25325052748804
0.189812528, 0.001444840431213379, 262.74531622927407
0.268435456, 0.001982855796813965, 270.75640743146295
0.37962506, 0.0027803659439086916, 273.07560778587

I used to get 15 fp32 tflops and 452 GB/s bandwidth with earlier versions of ipex. Now it's significantly lower. Also see https://github.com/pytorch/pytorch/issues/136342. Getting low but very similar performance for pytorch nightly as well.

Versions

Collecting environment information...
PyTorch version: 2.1.0.post3+cxx11.abi
PyTorch CXX11 ABI: Yes
IPEX version: 2.1.40+xpu
IPEX commit: 80ed47655
Build type: Release

OS: Ubuntu 22.04.4 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: N/A
IGC version: 2024.2.1 (2024.2.1.20240711)
CMake version: N/A
Libc version: glibc-2.35

Python version: 3.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-40-generic-x86_64-with-glibc2.35
Is XPU available: True
DPCPP runtime version: 2024.2
MKL version: 2024.2
GPU models and configuration: 
[0] _DeviceProperties(name='Intel(R) Arc(TM) A770 Graphics', platform_name='Intel(R) Level-Zero', dev_type='gpu', driver_version='1.3.29735', has_fp64=0, total_memory=15473MB, max_compute_units=512, gpu_eu_count=512)
Intel OpenCL ICD version: 24.22.29735.27-914~22.04
Level Zero version: 1.3.29735.27-914~22.04

CPU:
Architecture:                         x86_64
CPU op-mode(s):                       32-bit, 64-bit
Address sizes:                        39 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               12
On-line CPU(s) list:                  0-11
Vendor ID:                            GenuineIntel
Model name:                           12th Gen Intel(R) Core(TM) i5-12400
CPU family:                           6
Model:                                151
Thread(s) per core:                   2
Core(s) per socket:                   6
Socket(s):                            1
Stepping:                             5
CPU max MHz:                          4400.0000
CPU min MHz:                          800.0000
BogoMIPS:                             4992.00
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 vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            288 KiB (6 instances)
L1i cache:                            192 KiB (6 instances)
L2 cache:                             7.5 MiB (6 instances)
L3 cache:                             18 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-11
Vulnerability Gather data sampling:   Not affected
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Not affected
Vulnerability Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:             Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] intel_extension_for_pytorch==2.1.40+xpu
[pip3] numpy==1.26.4
[pip3] torch==2.1.0.post3+cxx11.abi
[pip3] torchaudio==2.1.0.post3+cxx11.abi
[pip3] torchvision==0.16.0.post3+cxx11.abi
[conda] intel-extension-for-pytorch 2.1.40+xpu               pypi_0    pypi
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] torch                     2.1.0.post3+cxx11.abi          pypi_0    pypi
[conda] torchaudio                2.1.0.post3+cxx11.abi          pypi_0    pypi
[conda] torchvision               0.16.0.post3+cxx11.abi          pypi_0    pypi

chsasank avatar Sep 20 '24 03:09 chsasank