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

Illegal instruction (CPU feature misdetection) #258

Open
MostAwesomeDude opened this issue Jun 14, 2023 · 1 comment
Open

Illegal instruction (CPU feature misdetection) #258

MostAwesomeDude opened this issue Jun 14, 2023 · 1 comment

Comments

@MostAwesomeDude
Copy link

I have a test harness which uses rwkv.cpp or llama.cpp. Either way, when it loads, I get this error:

$ result/bin/agent.py rwkv models/rwkv-pile-14b.bin
~ Initializing adapter: rwkv
Illegal instruction (core dumped)

The root cause is a VFMADD231SS, which my CPU doesn't support. Here's my CPU info, by the way:

$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 62
model name      : Intel(R) Xeon(R) CPU E5-1607 v2 @ 3.00GHz
stepping        : 4
microcode       : 0x42e
cpu MHz         : 2992.861
cache size      : 10240 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 4
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
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 arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl v
mx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti 
ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm arat pln pts md_clear flush_l1d
vmx flags       : vnmi preemption_timer posted_intr invvpid ept_x_only ept_1gb flexpriority apicv tsc_offset vtpr mtf vapic ept vpid unrestricted_
guest vapic_reg vid ple
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips        : 5985.72
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual

I can work around this by using a few cmake flags. Note that just disabling FMA causes compilation to break; I have to disable AVX and AVX2 as well.

  • In llama.cpp, I can set LLAMA_FMA=OFF, LLAMA_AVX=OFF, LLAMA_AVX2=OFF
  • And in rwkv.cpp, I can set RWKV_FMA=OFF, RWKV_AVX=OFF, RWKV_AVX2=OFF
@ghost
Copy link

ghost commented Jun 15, 2023 via email

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

No branches or pull requests

1 participant