From d55cbbee3280ffbbe7570aae0ac2aad3994e7711 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Tue, 15 Aug 2023 12:56:21 -0400 Subject: [PATCH] Update to newer llama.cpp and disable older forks. --- gpt4all-backend/CMakeLists.txt | 28 ++++++---------------------- gpt4all-backend/llama.cpp-mainline | 2 +- gpt4all-backend/llama.cpp.cmake | 2 ++ gpt4all-chat/CMakeLists.txt | 16 ++++------------ 4 files changed, 13 insertions(+), 35 deletions(-) diff --git a/gpt4all-backend/CMakeLists.txt b/gpt4all-backend/CMakeLists.txt index b4833025..051b87dd 100644 --- a/gpt4all-backend/CMakeLists.txt +++ b/gpt4all-backend/CMakeLists.txt @@ -69,11 +69,6 @@ foreach(BUILD_VARIANT IN LISTS BUILD_VARIANTS) # Include GGML set(LLAMA_K_QUANTS YES) include_ggml(llama.cpp-mainline -mainline-${BUILD_VARIANT} ON) - if (NOT LLAMA_METAL) - set(LLAMA_K_QUANTS NO) - include_ggml(llama.cpp-230511 -230511-${BUILD_VARIANT} ON) - include_ggml(llama.cpp-230519 -230519-${BUILD_VARIANT} ON) - endif() # Function for preparing individual implementations function(prepare_target TARGET_NAME BASE_LIB) @@ -104,29 +99,18 @@ foreach(BUILD_VARIANT IN LISTS BUILD_VARIANTS) prepare_target(replit-mainline llama-mainline) if (NOT LLAMA_METAL) - add_library(llamamodel-230519-${BUILD_VARIANT} SHARED - llamamodel.cpp llmodel_shared.cpp) - target_compile_definitions(llamamodel-230519-${BUILD_VARIANT} PRIVATE - LLAMA_VERSIONS===2 LLAMA_DATE=230519) - prepare_target(llamamodel-230519 llama-230519) - add_library(llamamodel-230511-${BUILD_VARIANT} SHARED - llamamodel.cpp llmodel_shared.cpp) - target_compile_definitions(llamamodel-230511-${BUILD_VARIANT} PRIVATE - LLAMA_VERSIONS=<=1 LLAMA_DATE=230511) - prepare_target(llamamodel-230511 llama-230511) - - add_library(gptj-${BUILD_VARIANT} SHARED - gptj.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) - prepare_target(gptj ggml-230511) +# add_library(gptj-${BUILD_VARIANT} SHARED +# gptj.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) +# prepare_target(gptj ggml-230511) add_library(falcon-${BUILD_VARIANT} SHARED falcon.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) target_compile_definitions(falcon-${BUILD_VARIANT} PRIVATE LLAMA_VERSIONS=>=3 LLAMA_DATE=999999) prepare_target(falcon llama-mainline) - add_library(mpt-${BUILD_VARIANT} SHARED - mpt.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) - prepare_target(mpt ggml-230511) +# add_library(mpt-${BUILD_VARIANT} SHARED +# mpt.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) +# prepare_target(mpt ggml-230511) add_library(bert-${BUILD_VARIANT} SHARED bert.cpp utils.h utils.cpp llmodel_shared.cpp llmodel_shared.h) diff --git a/gpt4all-backend/llama.cpp-mainline b/gpt4all-backend/llama.cpp-mainline index 69796668..acfc5478 160000 --- a/gpt4all-backend/llama.cpp-mainline +++ b/gpt4all-backend/llama.cpp-mainline @@ -1 +1 @@ -Subproject commit 697966680b27d9b4f05668605b863cb9aea3e15f +Subproject commit acfc5478ff3446ca3b54553967a3dea09b7c771a diff --git a/gpt4all-backend/llama.cpp.cmake b/gpt4all-backend/llama.cpp.cmake index 70dcc920..aa2248e1 100644 --- a/gpt4all-backend/llama.cpp.cmake +++ b/gpt4all-backend/llama.cpp.cmake @@ -296,6 +296,8 @@ function(include_ggml DIRECTORY SUFFIX WITH_LLAMA) add_library(ggml${SUFFIX} OBJECT ${DIRECTORY}/ggml.c ${DIRECTORY}/ggml.h + ${DIRECTORY}/ggml-alloc.c + ${DIRECTORY}/ggml-alloc.h ${GGML_SOURCES_QUANT_K} ${GGML_SOURCES_CUDA} ${GGML_METAL_SOURCES} diff --git a/gpt4all-chat/CMakeLists.txt b/gpt4all-chat/CMakeLists.txt index 76ff4a0c..7af80c16 100644 --- a/gpt4all-chat/CMakeLists.txt +++ b/gpt4all-chat/CMakeLists.txt @@ -180,18 +180,10 @@ install(TARGETS llmodel DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) # We should probably iterate through the list of the cmake for backend, but these need to be installed # to the this component's dir for the finicky qt installer to work -install(TARGETS gptj-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS gptj-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llama-230511-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llama-230511-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llama-230519-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llama-230519-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) +#install(TARGETS gptj-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) +#install(TARGETS gptj-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS llama-mainline-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS llama-mainline-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llamamodel-230511-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llamamodel-230511-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llamamodel-230519-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS llamamodel-230519-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS llamamodel-mainline-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS llamamodel-mainline-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) if(APPLE) @@ -199,8 +191,8 @@ install(TARGETS llamamodel-mainline-metal DESTINATION lib COMPONENT ${COMPONENT_ endif() install(TARGETS falcon-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS falcon-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS mpt-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) -install(TARGETS mpt-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) +#install(TARGETS mpt-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) +#install(TARGETS mpt-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS replit-mainline-avxonly DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) install(TARGETS replit-mainline-default DESTINATION lib COMPONENT ${COMPONENT_NAME_MAIN}) if(APPLE)