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

fix: disable indexing for unsupported CPUs #3551

Merged
merged 5 commits into from
Jan 11, 2025

Conversation

Patrick-Erichsen
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen commented Dec 27, 2024

Description

Continue currently uses LanceDB for our vector search, but their binaries require that the target CPU has support for avx2 and fma. Previously, if a user's CPU didn't support these features, we would still attempt to invoke the LanceDB binaries, which would then cause the entire extension to crash (see #940 #3168).

This PR attempts to detect at runtime if a user's CPU has support for both avx2 and fma, and if not, we disable indexing to prevent subsequent attempts to invoke the LanceDB binary. The first time this occurs we show a toast warning and link to this PR for context.

Checklist

  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

Screenshot 2024-12-27 at 3 04 44 PM Screenshot 2024-12-27 at 2 49 54 PM

Testing instructions

Copy link

netlify bot commented Dec 27, 2024

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit f271024
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/6781582a57fec400080c9eed
😎 Deploy Preview https://deploy-preview-3551--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Patrick-Erichsen
Copy link
Collaborator Author

@mjkaye - mind running this command on your Debian Bookworm setup and sharing your output? I'd like to confirm on your machine that you're getting the correct output that will allow us to disable indexing.

@hex20dec
Copy link

Having the same crash issue. Running ubuntu 22.04, Here is my cpuinfo:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
stepping : 9
microcode : 0x21
cpu MHz : 1600.000
cache size : 8192 KB
physical id : 0
siblings : 8
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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid 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 ida arat pln pts md_clear flush_l1d
vmx flags : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit srbds mmio_unknown
bogomips : 6823.11
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

@mjkaye
Copy link

mjkaye commented Dec 31, 2024

@mjkaye - mind running this command on your Debian Bookworm setup and sharing your output? I'd like to confirm on your machine that you're getting the correct output that will allow us to disable indexing.

Below is the content of /proc/cpuinfo, converted to lower-case. I see that you're checking for AVX support, whereas you should be checking for AVX2 support. As you can see from the output, my CPU supports AVX but not AVX2. This can also be seen in @hex20dec's output.

processor	: 0
vendor_id	: genuineintel
cpu family	: 6
model		: 42
model name	: intel(r) core(tm) i5-2500k cpu @ 3.30ghz
stepping	: 7
microcode	: 0x28
cpu mhz		: 1599.891
cache size	: 6144 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 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 6599.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: genuineintel
cpu family	: 6
model		: 42
model name	: intel(r) core(tm) i5-2500k cpu @ 3.30ghz
stepping	: 7
microcode	: 0x28
cpu mhz		: 1599.887
cache size	: 6144 kb
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 4
apicid		: 2
initial apicid	: 2
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 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 6599.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: genuineintel
cpu family	: 6
model		: 42
model name	: intel(r) core(tm) i5-2500k cpu @ 3.30ghz
stepping	: 7
microcode	: 0x28
cpu mhz		: 1599.894
cache size	: 6144 kb
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 4
apicid		: 4
initial apicid	: 4
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 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 6599.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: genuineintel
cpu family	: 6
model		: 42
model name	: intel(r) core(tm) i5-2500k cpu @ 3.30ghz
stepping	: 7
microcode	: 0x28
cpu mhz		: 1599.893
cache size	: 6144 kb
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 6
initial apicid	: 6
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 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt tsc_deadline_timer aes xsave avx lahf_lm epb pti tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm ida arat pln pts
vmx flags	: vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit mmio_unknown
bogomips	: 6599.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

@mjkaye
Copy link

mjkaye commented Jan 3, 2025

  • Attempt to run Continue on a VM that does not have support for both avx2 and fma such as Debian Bookworm 12.2 (e.g.

Debian Bookworm supports AVX2 and FMA. Instead, this should be tested on a CPU that does not have support for those technologies, such as Sandy Bridge and Ivy Bridge Intel CPUs.

@sestinj
Copy link
Contributor

sestinj commented Jan 10, 2025

@hex20dec if you change the check to look for avx2 instead of avx does this solve the crash problem? The feedback loop on our side is going to be pretty slow, but if you can try a few different values in the CPU_FEATURES_TO_CHECK array I'm hopeful we can solve this quickly

@Patrick-Erichsen
Copy link
Collaborator Author

I've gone ahead and updated the flag to avx2

@sestinj
Copy link
Contributor

sestinj commented Jan 11, 2025

Ok from my understanding this should work with the avx2 change so I'm going to merge and let it get into our next pre-release. But if anyone notices that it's still broken, please comment in the issue and we'll gladly take another look

@sestinj sestinj merged commit 95a2329 into main Jan 11, 2025
22 checks passed
@sestinj sestinj deleted the pe/fix-lancedb-unsupported-cpus branch January 11, 2025 05:57
@FallDownTheSystem
Copy link
Contributor

Ryzen 7 9800X3D supports both, yet I got this message and now indexing is disabled. I never had any issues with indexing crashing.

@jtabox
Copy link

jtabox commented Jan 11, 2025

Same here unfortunately, after the latest update, Continue decided to stop indexing because of this issue. Also never had any issues with indexing.
My specs:

CPU:	AMD Ryzen 9 5900X 12-Core
OS:		Windows 11 Pro, ver.23H2
Build:	22631.4602

Is there some way to deactivate this check and revert the decision?
If you need more info let me know.

@dnszero
Copy link

dnszero commented Jan 11, 2025

Same here on win11 with an i7-12800h that supports fma, avx, and avx2. Never had an issue with indexing before, but Continue disables indexing now.

@AlexJ-StL
Copy link

I just updated to Version 0.9.251 and after restart I got the notification that indexing was disabled. This is the first time I have had any issue with it.
System: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz Windows 11 Pro 24H2 Build 26100.ge_release.240331-1435

@ArulGandhi
Copy link

I just update to latest prerelease version and got the toast about indexing being disabled. First time having an issue, and my CPU supports AVX2 and FMA.
System: Intel Core i5-1135G7 @ 2.40 GHz Windows 11 Home Insider Preview Single Language

@amishsthapit
Copy link

My extension just updated to v0.9.251 prerelease version and the indexing stopped informing my processor is not compatible. I am using AMD Ryzen 7 4700U and according to HwInfo it supports both AVX and FMA. So there must be some defect in the detection mechanism. Attached HwInfo for reference.

image

@danielaskdd
Copy link

False positive occurred on macOS in MacBook Pro 2019 - this machine's CPU actually supports AVX and FMA instructions.

@amishsthapit
Copy link

Just reviewed the code. It seems in Windows platform it is running following command:

wmic cpu get caption /format:list

This is giving me following response:

Caption=AMD64 Family 23 Model 96 Stepping 1

The code is then checking if this response has 'avx' & 'fma' words

const isSupportedLanceDbCpuTarget = cpuFlags
      ? CPU_FEATURES_TO_CHECK.every((feature) => cpuFlags.includes(feature))
      : true;

This is causing false positive.

@mjkaye
Copy link

mjkaye commented Jan 13, 2025

I have been trying to test this PR today, in order to help debug why people are getting the false-positives, on Linux at least.

For context, my CPU does not support AVX2 or FMA and experiences the crash reported in #3168

The purpose of this PR, therefore, would be automatically to disable indexing on my machine.

Unfortunately the crash, as reported in that issue, occurs before the following is ever run, so I wasn't able to get that far:

if (!isSupportedLanceDbCpuTarget(ide)) {

The crash is triggered by:

import { LanceDbIndex } from "../../../indexing/LanceDbIndex";

Tracing back through the imports, the originating import statement is:

import CodebaseContextProvider from "../context/providers/CodebaseContextProvider";

I'm not familiar enough with JavaScript/TypeScript to know whether conditional imports are possible. Having said that, I can see that the following would break without that import:

new CodebaseContextProvider(codebaseContextParams),

I'm happy to test any other PRs that might resolve the issue.

@kloon15
Copy link

kloon15 commented Jan 13, 2025

I get the the false incompatible error on Windows and my CPU has support for both:

❯ grep -oE "avx2|fma" /proc/cpuinfo
fma
avx2

@doterik
Copy link

doterik commented Jan 13, 2025

What about fma3?

image

@DifferentialityDevelopment
Copy link
Contributor

DifferentialityDevelopment commented Jan 13, 2025

I have Ryzen 3600, I seriously doubt this is unsupported?
Got the message just now when I updated to latest pre-release version

@jimkberry
Copy link

At the risk of just piling on, indexing is disabled for:

cpu family      : 23
model           : 24
model name      : AMD Ryzen 5 3400G with Radeon Vega Graphics

$ grep -oE "avx2|fma" /proc/cpuinfo
fma
avx2

@emudojo
Copy link

emudojo commented Jan 13, 2025

same false positive for me on windows, before it was working ok

cpu get caption /format:list

Caption=Intel64 Family 6 Model 186 Stepping 2

@Patrick-Erichsen
Copy link
Collaborator Author

Hi folks, thank you all for following the toast notification to this PR to share your feedback.

It looks like we didn't get this right, so I've disabled the check in this PR: #3714. The PR also implements the dynamic import @mjkaye recommended that should allow users to manually disable indexing in the meantime. We'll ship these updates in the pre-release tonight.


We'd still like to get to the bottom of this issue for the users that actually are running unsupported CPUs, so it would be helpful if folks in this thread could share the output of the following respective commands on their machines:

  • Mac: sysctl -n machdep.cpu.features
  • Linux: cat /proc/cpuinfo
  • Windows: wmic cpu get caption /format:list

Alternatively, if anyone has a more robust set of commands to check for avx2 and fma, that would be greatly appreciated!

cc @danielaskdd @amishsthapit @ArulGandhi @AlexJ-StL @mjkaye

@danielaskdd
Copy link

Macbook Pro 2019 (CPU: Intel Core i9)
sysctl -n machdep.cpu.features

FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C

@Patrick-Erichsen
Copy link
Collaborator Author

Patrick-Erichsen commented Jan 14, 2025

@danielaskdd it looks like your output was same as on my 2019 MBP, e.g. AVX1.0 rather than some variant of avx2.

Chatted with @sestinj on this and we are leaning towards just ignoring this check altogether for macOS/Windows users since in the original issues (#940 & #3168) are predominately from Linux users.

@kloon15
Copy link

kloon15 commented Jan 14, 2025

Hi folks, thank you all for following the toast notification to this PR to share your feedback.

It looks like we didn't get this right, so I've disabled the check in this PR: #3714. The PR also implements the dynamic import @mjkaye recommended that should allow users to manually disable indexing in the meantime. We'll ship these updates in the pre-release tonight.

We'd still like to get to the bottom of this issue for the users that actually are running unsupported CPUs, so it would be helpful if folks in this thread could share the output of the following respective commands on their machines:

* Mac: `sysctl -n machdep.cpu.features`

* Linux: `cat /proc/cpuinfo`

* Windows: `wmic cpu get caption /format:list`

Alternatively, if anyone has a more robust set of commands to check for avx2 and fma, that would be greatly appreciated!

cc @danielaskdd @amishsthapit @ArulGandhi @AlexJ-StL @mjkaye

> wmic cpu
AddressWidth  Architecture  AssetTag                Availability  Caption                                Characteristics  ConfigManagerErrorCode  ConfigManagerUserConfig  CpuStatus  CreationClassName  CurrentClockSpeed  CurrentVoltage  DataWidth  Description                            DeviceID  ErrorCleared  ErrorDescription  ExtClock  Family  InstallDate  L2CacheSize  L2CacheSpeed  L3CacheSize  L3CacheSpeed  LastErrorCode  Level  LoadPercentage  Manufacturer  MaxClockSpeed  Name                                   NumberOfCores  NumberOfEnabledCore  NumberOfLogicalProcessors  OtherFamilyDescription  PartNumber              PNPDeviceID  PowerManagementCapabilities  PowerManagementSupported  ProcessorId       ProcessorType  Revision  Role  SecondLevelAddressTranslationExtensions  SerialNumber            SocketDesignation  Status  StatusInfo  Stepping  SystemCreationClassName  SystemName  ThreadCount  UniqueId  UpgradeMethod  Version  VirtualizationFirmwareEnabled  VMMonitorModeExtensions  VoltageCaps  

64            9             To Be Filled By O.E.M.  3             Intel64 Family 6 Model 183 Stepping 1  252                                                               1          Win32_Processor    3500               11              64         Intel64 Family 6 Model 183 Stepping 1  CPU0                                      100       205                  8192                       24576        0                            6      2               GenuineIntel  3500           13th Gen Intel(R) Core(TM) i5-13600KF  14             14                   20                                                 To Be Filled By O.E.M.                                            FALSE                     BFEBFBFF000B0671  3                        CPU   FALSE                                    To Be Filled By O.E.M.  LGA1700            OK      3                     Win32_ComputerSystem     KLOON-PC    20                     64                      FALSE                          FALSE                                 

The windows command is useless, it doesnt report cpu capabilities, nor does msinfo32, this would require a custom binary that can check for such capabilities (gcc has such builtin functions for example).

@DifferentialityDevelopment
Copy link
Contributor

Hi folks, thank you all for following the toast notification to this PR to share your feedback.
It looks like we didn't get this right, so I've disabled the check in this PR: #3714. The PR also implements the dynamic import @mjkaye recommended that should allow users to manually disable indexing in the meantime. We'll ship these updates in the pre-release tonight.
We'd still like to get to the bottom of this issue for the users that actually are running unsupported CPUs, so it would be helpful if folks in this thread could share the output of the following respective commands on their machines:

* Mac: `sysctl -n machdep.cpu.features`

* Linux: `cat /proc/cpuinfo`

* Windows: `wmic cpu get caption /format:list`

Alternatively, if anyone has a more robust set of commands to check for avx2 and fma, that would be greatly appreciated!
cc @danielaskdd @amishsthapit @ArulGandhi @AlexJ-StL @mjkaye

> wmic cpu
AddressWidth  Architecture  AssetTag                Availability  Caption                                Characteristics  ConfigManagerErrorCode  ConfigManagerUserConfig  CpuStatus  CreationClassName  CurrentClockSpeed  CurrentVoltage  DataWidth  Description                            DeviceID  ErrorCleared  ErrorDescription  ExtClock  Family  InstallDate  L2CacheSize  L2CacheSpeed  L3CacheSize  L3CacheSpeed  LastErrorCode  Level  LoadPercentage  Manufacturer  MaxClockSpeed  Name                                   NumberOfCores  NumberOfEnabledCore  NumberOfLogicalProcessors  OtherFamilyDescription  PartNumber              PNPDeviceID  PowerManagementCapabilities  PowerManagementSupported  ProcessorId       ProcessorType  Revision  Role  SecondLevelAddressTranslationExtensions  SerialNumber            SocketDesignation  Status  StatusInfo  Stepping  SystemCreationClassName  SystemName  ThreadCount  UniqueId  UpgradeMethod  Version  VirtualizationFirmwareEnabled  VMMonitorModeExtensions  VoltageCaps  

64            9             To Be Filled By O.E.M.  3             Intel64 Family 6 Model 183 Stepping 1  252                                                               1          Win32_Processor    3500               11              64         Intel64 Family 6 Model 183 Stepping 1  CPU0                                      100       205                  8192                       24576        0                            6      2               GenuineIntel  3500           13th Gen Intel(R) Core(TM) i5-13600KF  14             14                   20                                                 To Be Filled By O.E.M.                                            FALSE                     BFEBFBFF000B0671  3                        CPU   FALSE                                    To Be Filled By O.E.M.  LGA1700            OK      3                     Win32_ComputerSystem     KLOON-PC    20                     64                      FALSE                          FALSE                                 

The windows command is useless, it doesnt report cpu capabilities, nor does msinfo32, this would require a custom binary that can check for such capabilities (gcc has such builtin functions for example).

Have an AMD Ryzen 3600
wmic cpu get caption /format:list => Caption=AMD64 Family 23 Model 113 Stepping 0
CPU-Z Output:
image

@DifferentialityDevelopment
Copy link
Contributor

What about fma3?

image

Could well be that support for FMA is being checked but not FMA3 which Ryzen has but not FMA

@jtabox
Copy link

jtabox commented Jan 14, 2025

AMD Ryzen 9 5900X 12-Core Processor
(using Continue in Windows, but since the Windows command doesn't seem to work, I ran the Linux command in WSL):

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 25
model           : 33
model name      : AMD Ryzen 9 5900X 12-Core Processor
stepping        : 0
microcode       : 0xffffffff
cpu MHz         : 4000.043
cache size      : 512 KB
physical id     : 0
siblings        : 24
core id         : 0
cpu cores       : 12
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 mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
bugs            : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso
bogomips        : 8000.08
TLB size        : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management:

@AlexJ-StL
Copy link

I am taking a look at the code now. With any luck I will have a fix, potentially tonight.

Good news or bad news I will update here when I can no longer work on the issue.

Hi folks, thank you all for following the toast notification to this PR to share your feedback.

It looks like we didn't get this right, so I've disabled the check in this PR: #3714. The PR also implements the dynamic import @mjkaye recommended that should allow users to manually disable indexing in the meantime. We'll ship these updates in the pre-release tonight.

We'd still like to get to the bottom of this issue for the users that actually are running unsupported CPUs, so it would be helpful if folks in this thread could share the output of the following respective commands on their machines:

  • Mac: sysctl -n machdep.cpu.features
  • Linux: cat /proc/cpuinfo
  • Windows: wmic cpu get caption /format:list

Alternatively, if anyone has a more robust set of commands to check for avx2 and fma, that would be greatly appreciated!

cc @danielaskdd @amishsthapit @ArulGandhi @AlexJ-StL @mjkaye

@gasatrya
Copy link

image

I just tried the pre-released, and the indexing is disabled. I couldn't even add new doc because of it, also I couldn't @ that react native documentation that was indexed before. So, if the indexing disabled, I couldn't even use the custom @docs ?

@mjkaye
Copy link

mjkaye commented Jan 16, 2025

I am taking a look at the code now. With any luck I will have a fix, potentially tonight.

I added some more notes from my testing in #3714 (comment). I hope they're helpful.

@AlexJ-StL
Copy link

@Patrick-Erichsen Sorry for the late update. I worked on this and another project until the sun came up and I passed out. I may be making some headway. It took me a while to figure out where everything was located. I will update here.

@AlexJ-StL
Copy link

I am putting together my findings now. Hopefully I am able to finish it up before I have to deal with some family stuff that will take a few days. With that said, I believe that I have identified some issues and have solved them. I haven't fully tested the out come yet. We'll see how far I get. Shout out to @mjkaye ! You're notes saved me a ton of time and were extremely thoughtful. Lastly, I've never contributed to anything... ever... So, I don't know exactly how to do a pull request and all that, but I will figure it out one way or another.

@Patrick-Erichsen
Copy link
Collaborator Author

Patrick-Erichsen commented Jan 17, 2025

We will be cutting a release today that temporarily disabled this check. Planning to circle shortly afterwards to incorporate feedback from folks and give this a second try 👍

@AlexJ-StL appreciate all the work here! Check out our contributing docs for some info, and the general GitHub docs for info on things like opening a pull request

@libandreas
Copy link

libandreas commented Jan 18, 2025

I tried v0.9.251 with that feature, but the plugin kept crashing all host. It seems the checking is incorrect in my case, as I am still unable to use it consistently. Please consider creating a patch or adding an option to manually disable indexing.

Crashing happens even if i set disable on config

@Windows81
Copy link

Windows81 commented Jan 18, 2025

CC @Patrick-Erichsen:

I'm using Windows 11 22H2 (build 22621.1).

I know that the CPU I'm using supports AVX2 and FMA. I used a tool named CoreInfo and:

PS C:\Users\USERNAME> . "C:\Program Files\CoreInfo\Coreinfo.exe" | grep AVX2
AVX2            *       Supports AVX2 instruction extensions
PS C:\Users\USERNAME> . "C:\Program Files\CoreInfo\Coreinfo.exe" | grep FMA
FMA             *       Supports FMA extensions using YMM state

However, Continue uses wmic, which I haven't got any CPU flags from.

PS C:\Users\USERNAME> wmic cpu get caption
Caption
Intel64 Family 6 Model 183 Stepping 1

What Users Should Do

I modified C:\Users\USERNAME\.continue\.continuerc.json:

{
-  "disableIndexing": true
+  "disableIndexing": false
}

I also modified C:\Users\USERNAME\.continue\index\globalContext.json for good measure:

-  "isSupportedLanceDbCpuTarget": false,
+  "isSupportedLanceDbCpuTarget": true,

This change may or may not be necessary.

I modified C:\Users\USERNAME\.vscode-oss\extensions\continue.continue-0.9.251-win32-x64\out\extension.js in my system.

  const arch2 = import_os3.default.arch();
  const platform6 = import_os3.default.platform();
-  if (!isSupportedLanceDbCpuTarget(ide)) {
+  if (true) {
    globalContext.update("isSupportedLanceDbCpuTarget", true);
    return true;
  }

What Developers Should Do

Remove the wmic cpu get caption check.

Continue uses different checks on operating systems other than Windows. I put both of them into GitHub Code Search. I excluded results in Bash since scripts in Bash are not typically run on Windows.

Link to query

Ex grat:

if sys.platform in ["linux", "linux2"]:
    command = "cat /proc/cpuinfo"
elif sys.platform == "darwin":
    command = "/usr/sbin/sysctl -n machdep.cpu.features"
else:
    raise UnsupportedPlatformError(f"Unsupported platform: {sys.platform}")
if sys.platform in ['linux', 'linux2']:
    flags = os.popen('cat /proc/cpuinfo | grep ^flags | head -1').read()
elif sys.platform in ['darwin', ]:
    flags = os.popen('sysctl -n machdep.cpu.features machdep.cpu.leaf7_features').read()
else:
    raise SystemExit('Windows not supported yet...')

Notice how these checks are absent from Windows systems.

@mjkaye
Copy link

mjkaye commented Jan 23, 2025

We will be cutting a release today that temporarily disabled this check. Planning to circle shortly afterwards to incorporate feedback from folks and give this a second try 👍

Give me a shout when you have a PR ready to test.

@Patrick-Erichsen
Copy link
Collaborator Author

@Windows81 that is a good point. I believe the root of this issue was primarily folks on Linux - going back and looking at previous issues (#3168, #911, #2040), I don't see any reports on Windows or Mac.

What do folks think of just updating the CPU check logic to be default true on Windows/Mac, and only run the Linux check (cat /proc/cpuinfo)?

cc @mjkaye et al for opinions.

@mjkaye
Copy link

mjkaye commented Jan 23, 2025

cc @mjkaye et al for opinions.

Given that the reports tend to come from Linux users, restricting the check to the Linux platform seems like a reasonable first step.

It's logical that users of older CPUs are more likely to be Linux users. Linux performance is still fine on these devices, and we're not forced to upgrade hardware in order to run the latest OS version. I've been running local LLMs for the past year or so, and my system is quite usable.

One thing to note is that the command cat /proc/cpuinfo simply outputs the content of /proc/cpuinfo. To the Linux userspace, /proc/cpuinfo is just a read-only text file that was created at boot. I believe that using the native TypeScript file reading mechanism should work just fine, unless TypeScript places extra restrictions on file-opening.

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

Successfully merging this pull request may close these issues.