intel / intel-xpu-backend-for-triton

OpenAI Triton backend for Intel® GPUs
MIT License
143 stars 44 forks source link

[timm][accuracy] Summary for `timm` models failed in Inductor accuracy check #439

Closed ESI-SYD closed 6 months ago

ESI-SYD commented 9 months ago

Accuracy check results of timm models based on triton 3.0.0 (6 test scenarios in total)

Test mode: inference and training Test datatype: amp_bf16 amp_fp16 float32

This issue can be split into multiple work items

Failed model list

=======================Failed in every scenario=============================
SelecSls42b infra_error
cait_m36_384    fail_to_run
crossvit_9_240  fail_accuracy
levit_128   fail_accuracy
xcit_large_24_p8_224    fail_accuracy
=======================Failed models in amp_bf16=============================
inference:
name    accuracy
adv_inception_v3    fail_accuracy
beit_base_patch16_224   fail_accuracy
deit_base_distilled_patch16_224 fail_accuracy
jx_nest_base    fail_accuracy
pit_b_224   fail_accuracy
twins_pcpvt_base    fail_accuracy
vit_base_patch16_224    fail_accuracy

training:
name    accuracy
botnet26t_256   fail_accuracy
coat_lite_mini  fail_accuracy
convmixer_768_32    fail_accuracy
cspdarknet53    fail_accuracy
eca_halonext26ts    fail_to_run
fbnetv3_b   fail_accuracy
gmixer_24_224   fail_accuracy
hrnet_w18   fail_accuracy
jx_nest_base    fail_accuracy
lcnet_050   fail_accuracy
mixer_b16_224   fail_accuracy
poolformer_m36  fail_accuracy
resnest101e fail_accuracy
sebotnet33ts_256    fail_accuracy
swin_base_patch4_window7_224    fail_accuracy
visformer_small fail_accuracy
=======================Failed models in amp_fp16=============================
inference:
name    accuracy
deit_base_distilled_patch16_224 fail_accuracy
fbnetc_100  fail_accuracy
gernet_l    fail_accuracy
ghostnet_100    fail_accuracy
gluon_inception_v3  fail_accuracy
jx_nest_base    fail_accuracy
mobilevit_s fail_accuracy
pit_b_224   fail_accuracy
res2next50  fail_accuracy
resnest101e fail_accuracy
twins_pcpvt_base    fail_accuracy
vit_base_patch16_224    fail_accuracy

training:
name    accuracy
beit_base_patch16_224   fail_accuracy
convit_base fail_accuracy
convmixer_768_32    fail_accuracy
cspdarknet53    fail_accuracy
deit_base_distilled_patch16_224 fail_accuracy
dm_nfnet_f0 fail_accuracy
eca_botnext26ts_256 fail_accuracy
eca_halonext26ts    fail_to_run
hrnet_w18   fail_accuracy
jx_nest_base    fail_accuracy
mobilevit_s fail_accuracy
resnest101e fail_accuracy
swin_base_patch4_window7_224    fail_accuracy
tf_efficientnet_b0  fail_accuracy
vit_base_patch16_224    fail_accuracy
=======================Failed models in float32=============================
inference:
name    accuracy
beit_base_patch16_224   fail_accuracy
coat_lite_mini  fail_accuracy
deit_base_distilled_patch16_224 fail_accuracy
jx_nest_base    fail_accuracy
mobilevit_s fail_accuracy
pit_b_224   fail_accuracy
twins_pcpvt_base    fail_accuracy
vit_base_patch16_224    fail_accuracy

training:
name    accuracy
eca_halonext26ts    fail_to_run
fbnetv3_b   fail_accuracy
pnasnet5large   fail_to_run
swin_base_patch4_window7_224    fail_accuracy

Reproduce: (replace with real dtype and model)

cd /path/to/pytorch
wget -O inductor_xpu_test.sh https://raw.githubusercontent.com/intel/intel-xpu-backend-for-triton/main/.github/scripts/inductor_xpu_test.sh
pip install pandas
bash inductor_xpu_test.sh torchbench $dtype $mode accuracy xpu 0 static 1 0 $model

Version:

root@a4bf01946f13:/home# python collect_env.py 
Collecting environment information...
PyTorch version: 2.1.0a0+git8a1575b
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-91-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      52 bits physical, 57 bits virtual
Byte Order:                         Little Endian
CPU(s):                             224
On-line CPU(s) list:                0-223
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8480+
CPU family:                         6
Model:                              143
Thread(s) per core:                 2
Core(s) per socket:                 56
Socket(s):                          2
Stepping:                           8
CPU max MHz:                        3800.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4000.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 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 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad 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 hwp hwp_act_window hwp_epp hwp_pkg_req 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
Virtualization:                     VT-x
L1d cache:                          5.3 MiB (112 instances)
L1i cache:                          3.5 MiB (112 instances)
L2 cache:                           224 MiB (112 instances)
L3 cache:                           210 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-55,112-167
NUMA node1 CPU(s):                  56-111,168-223
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 Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] bert-pytorch==0.0.1a4
[pip3] clip-anytorch==2.6.0
[pip3] CoCa-pytorch==0.1.0
[pip3] dalle2-pytorch==1.14.2
[pip3] ema-pytorch==0.3.3
[pip3] flake8==7.0.0
[pip3] functorch==1.14.0a0+b71aa0b
[pip3] intel-extension-for-pytorch==2.1.10+git99b4297
[pip3] mypy==1.8.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.23.5
[pip3] onnx==1.15.0
[pip3] open-clip-torch==2.24.0
[pip3] pytorch-warmup==0.1.1
[pip3] rotary-embedding-torch==0.3.3
[pip3] torch==2.1.0a0+git59f7c41
[pip3] torch-fidelity==0.3.0
[pip3] torch_geometric==2.4.0
[pip3] torchaudio==2.2.0a0+02586da
[pip3] torchbench==0.1
[pip3] torchdata==0.7.1
[pip3] torchmetrics==1.0.3
[pip3] torchmultimodal==0.1.0b0
[pip3] torchrec==0.6.0
[pip3] torchtext==0.17.0a0+2c5e344
[pip3] torchvision==0.18.0a0+806dba6
[pip3] triton==3.0.0
[pip3] vector_quantize_pytorch==1.12.17
[conda] bert-pytorch              0.0.1a4                   dev_0    <develop>
[conda] blas                      1.0                         mkl  
[conda] clip-anytorch             2.6.0                    pypi_0    pypi
[conda] coca-pytorch              0.1.0                    pypi_0    pypi
[conda] dalle2-pytorch            1.14.2                   pypi_0    pypi
[conda] ema-pytorch               0.3.3                    pypi_0    pypi
[conda] functorch                 1.14.0a0+b71aa0b          pypi_0    pypi
[conda] intel-extension-for-pytorch 2.1.10+git99b4297          pypi_0    pypi
[conda] mkl                       2023.1.0         h213fc3f_46344  
[conda] mkl-service               2.4.0           py310h5eee18b_1  
[conda] mkl_fft                   1.3.8           py310h5eee18b_0  
[conda] mkl_random                1.2.4           py310hdb19cb5_0  
[conda] numpy                     1.23.5                   pypi_0    pypi
[conda] open-clip-torch           2.24.0                   pypi_0    pypi
[conda] pytorch-warmup            0.1.1                    pypi_0    pypi
[conda] rotary-embedding-torch    0.3.3                    pypi_0    pypi
[conda] torch                     2.1.0a0+git59f7c41          pypi_0    pypi
[conda] torch-fidelity            0.3.0                    pypi_0    pypi
[conda] torch-geometric           2.4.0                    pypi_0    pypi
[conda] torchaudio                2.2.0a0+02586da          pypi_0    pypi
[conda] torchbench                0.1                       dev_0    <develop>
[conda] torchdata                 0.7.1                    pypi_0    pypi
[conda] torchmetrics              1.0.3                    pypi_0    pypi
[conda] torchmultimodal           0.1.0b0                  pypi_0    pypi
[conda] torchrec                  0.6.0                    pypi_0    pypi
[conda] torchtext                 0.17.0a0+2c5e344          pypi_0    pypi
[conda] torchvision               0.18.0a0+806dba6          pypi_0    pypi
[conda] triton                    3.0.0                    pypi_0    pypi
[conda] vector-quantize-pytorch   1.12.17                  pypi_0    pypi

triton: https://github.com/intel/intel-xpu-backend-for-triton/commit/97ac4f91d149a3392d6e14f5d39aa4953fb6c56e

etiotto commented 9 months ago

@whitneywhtsang did your latest float32 run for TIFF show these problems ?

whitneywhtsang commented 9 months ago

The following failures are fixed with setup:

Stonepia/pytorch    dev/triton-test-3.0 0f6d72ce16bd4b30402dcad97144d17cd7bc53ed
intel/intel-xpu-backend-for-triton  b6d3678483dbffa58f0470a46c0b512f223aabda    
intel-extension-for-pytorch 2.1.10+git99b4297       
torch   2.1.0a0+git59f7c41  
torchvision 0.16.0a0+47cd5ea    
timm    0.9.15.dev0 
=======================Failed models in amp_bf16=============================
training:
name    accuracy
botnet26t_256   fail_accuracy
coat_lite_mini  fail_accuracy
convmixer_768_32    fail_accuracy
cspdarknet53    fail_accuracy
fbnetv3_b   fail_accuracy
gmixer_24_224   fail_accuracy
hrnet_w18   fail_accuracy
jx_nest_base    fail_accuracy
lcnet_050   fail_accuracy
mixer_b16_224   fail_accuracy
poolformer_m36  fail_accuracy
sebotnet33ts_256    fail_accuracy
swin_base_patch4_window7_224    fail_accuracy
visformer_small fail_accuracy
=======================Failed models in amp_fp16=============================
inference:
name    accuracy
gernet_l    fail_accuracy
ghostnet_100    fail_accuracy
res2next50  fail_accuracy
resnest101e fail_accuracy

training:
name    accuracy
beit_base_patch16_224   fail_accuracy
convit_base fail_accuracy
convmixer_768_32    fail_accuracy
cspdarknet53    fail_accuracy
deit_base_distilled_patch16_224 fail_accuracy
eca_botnext26ts_256 fail_accuracy
hrnet_w18   fail_accuracy
jx_nest_base    fail_accuracy
mobilevit_s fail_accuracy
swin_base_patch4_window7_224    fail_accuracy
tf_efficientnet_b0  fail_accuracy
vit_base_patch16_224    fail_accuracy
=======================Failed models in float32=============================
training:
name    accuracy
fbnetv3_b   fail_accuracy
swin_base_patch4_window7_224    fail_accuracy
whitneywhtsang commented 9 months ago

@whitneywhtsang did your latest float32 run for TIFF show these problems ?

There are two failures fixed by the latest float32 run.

whitneywhtsang commented 8 months ago

With env:

export TIMM_FUSED_ATTN=0
Stonepia/pytorch    dev/triton-test-3.0 0f6d72ce16bd4b30402dcad97144d17cd7bc53ed
intel/intel-xpu-backend-for-triton  c5e75f5563e52fc1b1e810b33d152d3b0f448f33    
intel-extension-for-pytorch 2.1.10+git99b4297       
torch                       2.1.0a0+git0f6d72c      
torchvision                 0.16.0a0+47cd5ea        
timm                        0.8.22.dev0     

float32 training:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523), eca_halonext26ts (https://github.com/intel/intel-xpu-backend-for-triton/issues/524), pnasnet5large fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), levit_128, xcit_large_24_p8_224 (https://github.com/intel/intel-xpu-backend-for-triton/issues/525)

amp_bf16 training:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523), eca_halonext26ts (https://github.com/intel/intel-xpu-backend-for-triton/issues/524) fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), levit_128, xcit_large_24_p8_224 (https://github.com/intel/intel-xpu-backend-for-triton/issues/525), resnest101e

amp_fp16 training:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523), eca_halonext26ts (https://github.com/intel/intel-xpu-backend-for-triton/issues/524) fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), levit_128, xcit_large_24_p8_224 (https://github.com/intel/intel-xpu-backend-for-triton/issues/525) failed to load: mobilenetv2_100, rexnet_100 (https://github.com/intel/intel-xpu-backend-for-triton/issues/521)

float32 inference:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523) fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), coat_lite_mini

amp_bf16 inference:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523) fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), SelecSls42b, adv_inception_v3

amp_fp16 inference:

fail_to_run: cait_m36_384 (https://github.com/intel/intel-xpu-backend-for-triton/issues/523) fail_accuracy: crossvit_9_240 (https://github.com/intel/intel-xpu-backend-for-triton/issues/527), fbnetc_100, gluon_inception_v3, levit_128

vlad-penkin commented 6 months ago

Closing this ticket. All individual issues have been filed as a separate tickets to IPEX. IPEX Team is tracking overall progress.