Skip to content
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

Performance Regression? #709

Open
chsasank opened this issue Sep 20, 2024 · 4 comments
Open

Performance Regression? #709

chsasank opened this issue Sep 20, 2024 · 4 comments
Assignees
Labels
ARC ARC GPU

Comments

@chsasank
Copy link

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 pytorch/pytorch#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
@alexsin368 alexsin368 self-assigned this Sep 24, 2024
@alexsin368
Copy link
Contributor

Hi @chsasank let me reproduce this on my end with an Arc 770 GPU and get back to you.

@alexsin368
Copy link
Contributor

alexsin368 commented Sep 25, 2024

@chsasank I installed IPEX 2.1.40+xpu with Python 3.11.9, same as you, but am only able to reproduce 1 out of the 2 issues you see. I'm getting 16.72 tflops and 239 GB/s bandwidth. What versoin of IPEX were you using previously that gave you better performance?

Output:

(asin_709) asin@arc770-tce:/hd1/asin/github_issues/ipex/709/device-benchmarks$ python benchmark.py --device xpu
benchmarking xpu using torch.float32
size, elapsed_time, tops
256, 0.015134882926940919, 0.0022170262011258295
304, 0.0019452333450317382, 0.02888544356054272
362, 0.003230786323547363, 0.029366181015594833
430, 0.005990338325500488, 0.02654507831771163
512, 0.0003607511520385742, 0.7441014518819801
608, 0.0024786949157714843, 0.18135004075727137
724, 0.0024233102798461915, 0.31321075733156817
861, 0.0004302978515625, 2.9666770525685107
1024, 0.000429534912109375, 4.999555536601351
1217, 0.005644941329956054, 0.6386196800433468
1448, 0.0004954814910888671, 12.254856928471918
1722, 0.0007058143615722656, 14.469014307460203
2048, 0.008519458770751952, 2.0165446710042185
2435, 0.006760978698730468, 4.2708795629576555
2896, 0.0030335426330566407, 16.013105516520692
3444, 0.004966378211975098, 16.450520133767384
4096, 0.014220595359802246, 9.664781958461635
4870, 0.01436784267425537, 16.077751631698735
5792, 0.023476672172546387, 16.55309165284687
6888, 0.039080238342285155, 16.724463971265074
size (GB), elapsed_time, bandwidth (GB/s)
0.004194304, 8.883476257324219e-05, 94.42934001296832
0.00593164, 0.00010395050048828125, 114.12431825027522
0.008388608, 0.00012614727020263672, 132.99705949284444
0.01186328, 0.0001530170440673828, 155.05828219732004
0.016777216, 0.0001926422119140625, 174.18005984570297
0.023726564, 0.00025010108947753906, 189.73579083213727
0.033554432, 0.0003323554992675781, 201.91892160018367
0.047453132, 0.0004426479339599609, 214.4057539158979
0.067108864, 0.0006081342697143554, 220.70410217638766
0.094906264, 0.0008357048034667968, 227.12867894571266
0.134217728, 0.0011615991592407227, 231.09129673911124
0.189812528, 0.001617121696472168, 234.7535481270031
0.268435456, 0.0022644281387329103, 237.08895982029836
0.37962506, 0.003170609474182129, 239.46503856197916

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.5 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.20240710)
CMake version: version 3.26.0
Libc version: glibc-2.35

Python version: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0] (64-bit runtime)
Python platform: Linux-6.8.0-45-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)
[1] _DeviceProperties(name='Intel(R) UHD Graphics 770', platform_name='Intel(R) Level-Zero', dev_type='gpu', driver_version='1.3.29735', has_fp64=0, total_memory=59677MB, max_compute_units=32, gpu_eu_count=32)
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:                        46 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               24
On-line CPU(s) list:                  0-23
Vendor ID:                            GenuineIntel
Model name:                           13th Gen Intel(R) Core(TM) i7-13700K
CPU family:                           6
Model:                                183
Thread(s) per core:                   2
Core(s) per socket:                   16
Socket(s):                            1
Stepping:                             1
CPU max MHz:                          5400.0000
CPU min MHz:                          800.0000
BogoMIPS:                             6835.20
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 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault 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 tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            640 KiB (16 instances)
L1i cache:                            768 KiB (16 instances)
L2 cache:                             24 MiB (10 instances)
L3 cache:                             30 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-23
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: Mitigation; Clear Register File
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    

@chsasank
Copy link
Author

I ran this benchmark back in January. So should be oneapi 2024.0.

It's great to see that you indeed got 16 tflops which is what I used to get. I wonder why I don't get the same perf.

Bandwidth is certainly a regression.

@alexsin368
Copy link
Contributor

@chsasank The performance regression needs to be within the scope of IPEX itself for my team and I to continue debugging. Let's figure out whether the regression is indeed to due to IPEX or another library in oneAPI.

Can you try reproducing the performance regression using the older version of IPEX you used before? That way, I can do some profiling to identify the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARC ARC GPU
Projects
None yet
Development

No branches or pull requests

3 participants