alpaca.cpp
alpaca.cpp copied to clipboard
Successful AVX=1 activation on old processor - Ivy Bridge (i3770k) - speed increased
Installation with default CMakeLists.txt parameters for me, working on the old i3770k caused a stop error and the chat did not open. managed to solve the problem a few days ago by disabling all microinstructions, but the performance did not suit me, a dozen characters were displayed in responses for more than a minute. https://github.com/antimatter15/alpaca.cpp/issues/160#issuecomment-1488201502 Now I propose the second option for editing CMakeLists.txt - here are the lines changed in it: (all parameters avx2 are replaced by avx)
else() message(STATUS "x86 detected") if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:AVX") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:AVX") else() if(NOT LLAMA_NO_AVX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") endif() if(NOT LLAMA_NO_AVX2) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") endif() if(NOT LLAMA_NO_FMA) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c") endif() endif()
after compiling with these settings, the program works correctly with activated AVX and the speed of responses has increased
(full modified CMakeLists.txt in attachment) CMakeLists.txt