From f5146bde18dae7f1413a05b60d5aa6e933b91cfd Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 29 May 2023 15:17:38 +0200 Subject: [PATCH] feat: add clblast support (#412) Signed-off-by: mudler --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 994d0f6..4c5bb0d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GOTEST=$(GOCMD) test GOVET=$(GOCMD) vet BINARY_NAME=local-ai -GOLLAMA_VERSION?=fbec625895ba0c458f783b62c8569135c5e80d79 +GOLLAMA_VERSION?=4bd3910005a593a6db237bc82c506d6d9fb81b18 GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all GPT4ALL_VERSION?=73db20ba85fbbdc66a56e2619394c0eea40dc72b GOGGMLTRANSFORMERS_VERSION?=4f18e5eb75089dc1fc8f1c955bb8f73d18520a46 @@ -41,6 +41,10 @@ ifeq ($(BUILD_TYPE),cublas) export LLAMA_CUBLAS=1 endif +ifeq ($(BUILD_TYPE),clblas) + CGO_LDFLAGS+=-lOpenCL -lclblast +endif + # glibc-static or glibc-devel-static required ifeq ($(STATIC),true) LD_FLAGS=-linkmode external -extldflags -static @@ -111,6 +115,8 @@ bloomz: @find ./bloomz -type f -name "*.h" -exec sed -i'' -e 's/ggml_/ggml_bloomz_/g' {} + @find ./bloomz -type f -name "*.cpp" -exec sed -i'' -e 's/gpt_/gpt_bloomz_/g' {} + @find ./bloomz -type f -name "*.h" -exec sed -i'' -e 's/gpt_/gpt_bloomz_/g' {} + + @find ./bloomz -type f -name "*.cpp" -exec sed -i'' -e 's/void replace/void json_bloomz_replace/g' {} + + @find ./bloomz -type f -name "*.cpp" -exec sed -i'' -e 's/::replace/::json_bloomz_replace/g' {} + bloomz/libbloomz.a: bloomz cd bloomz && make libbloomz.a