pytorch / executorch

On-device AI across mobile, embedded and edge for PyTorch
https://pytorch.org/executorch/
Other
1.71k stars 292 forks source link

Stories110M unable to run #5451

Closed dvorjackz closed 19 hours ago

dvorjackz commented 1 day ago

🐛 Describe the bug

When trying to run stories with cmake-out/examples/models/llama2/llama_main --model_path=xnnpack_llama2.pte --tokenizer_path=tokenizer.bin --prompt=..., I get the following errors:

What do you do when a monster attacks you?I 00:00:01.429093 executorch:text_prefiller.cpp:52] Prefill token result numel(): 32000

I 00:00:01.429651 executorch:runner.cpp:231] RSS after prompt prefill: 655.671875 MiB (0 if unsupported)
E 00:00:01.559637 executorch:tensor_impl.cpp:104] Attempted to resize a bounded tensor with capacity of 14 elements to 13 elements.

Versions

PyTorch version: 2.5.0+cpu                                   
Is debug build: False                                        
CUDA used to build PyTorch: Could not collect                
ROCM used to build PyTorch: N/A                              

OS: CentOS Stream 9 (x86_64)                                 
GCC version: (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)                                                                      
Clang version: Could not collect                                                                                           
CMake version: version 3.30.3                                                                                              
Libc version: glibc-2.34                                                                                                   

Python version: 3.10.0 (default, Mar  3 2022, 09:58:08) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-6.4.3-0_fbk12_hardened_2624_g7d95a0297d81-x86_64-with-glibc2.34
Is CUDA available: False
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA PG509-210
Nvidia driver version: 550.90.07
cuDNN version: Could not collect
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:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             22
On-line CPU(s) list:                0-21
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) Platinum 8339HC CPU @ 1.80GHz
CPU family:                         6
Model:                              85
Thread(s) per core:                 1
Core(s) per socket:                 22
Socket(s):                          1
Stepping:                           11
BogoMIPS:                           3591.60
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 arat vnmi umip pku ospke avx512_vnni md_clear arch_capabilities
Virtualization:                     VT-x
Hypervisor vendor:                  KVM
Virtualization type:                full
L1d cache:                          704 KiB (22 instances)
L1i cache:                          704 KiB (22 instances)
L2 cache:                           88 MiB (22 instances)
L3 cache:                           16 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-21
Vulnerability Gather data sampling: Unknown: Dependent on hypervisor status
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Vulnerable
Vulnerability Retbleed:             Vulnerable
Vulnerability Spec store bypass:    Vulnerable
Vulnerability Spectre v1:           Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers
Vulnerability Spectre v2:           Vulnerable, IBPB: disabled, STIBP: disabled, PBRSB-eIBRS: Vulnerable
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Mitigation; TSX disabled

Versions of relevant libraries:
[pip3] executorch==0.4.0a0+cb200d7
[pip3] numpy==1.26.4
[pip3] torch==2.5.0+cpu
[pip3] torchao==0.5.0+git0916b5b
[pip3] torchaudio==2.5.0+cpu
[pip3] torchsr==1.0.4
[pip3] torchvision==0.20.0+cpu
[conda] executorch                0.4.0a0+cb200d7          pypi_0    pypi
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] torch                     2.5.0+cpu                pypi_0    pypi
[conda] torchaudio                2.5.0+cpu                pypi_0    pypi
[conda] torchsr                   1.0.4                    pypi_0    pypi
[conda] torchvision               0.20.0+cpu               pypi_0    pypi
guangy10 commented 1 day ago

Can you add the AOT steps how you generate the .pte? I believe that we are running the tinyllama continuously in our CI to avoid breakage. Maybe the issue is because you are testing with a AOT path that is not covered by the CI?

lucylq commented 1 day ago

Thanks @guangy10, that's right. The readme command does not use kv cache, while CI does. Updating the readme to use kv cache for now, which works. https://github.com/pytorch/executorch/pull/5460