From 1d391cdf529fa721b1960c6774ca14638647ade0 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 27 Nov 2024 20:04:23 +0100 Subject: [PATCH] fix(llama.cpp): embed metal file into result binary for darwin Signed-off-by: Ettore Di Giacinto --- Makefile | 4 ---- backend/cpp/llama/Makefile | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 83ce9661affa..f6aadf1a5a67 100644 --- a/Makefile +++ b/Makefile @@ -745,10 +745,6 @@ backend-assets/grpc/llama-cpp-fallback: backend-assets/grpc backend/cpp/llama/ll $(info ${GREEN}I llama-cpp build info:fallback${RESET}) CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_AVX=off -DGGML_AVX2=off -DGGML_AVX512=off -DGGML_FMA=off -DGGML_F16C=off" $(MAKE) VARIANT="llama-fallback" build-llama-cpp-grpc-server cp -rfv backend/cpp/llama-fallback/grpc-server backend-assets/grpc/llama-cpp-fallback -# TODO: every binary should have its own folder instead, so can have different metal implementations -ifeq ($(BUILD_TYPE),metal) - cp backend/cpp/llama-fallback/llama.cpp/build/bin/ggml-metal.metal backend-assets/grpc/ -endif backend-assets/grpc/llama-cpp-cuda: backend-assets/grpc backend/cpp/llama/llama.cpp cp -rf backend/cpp/llama backend/cpp/llama-cuda diff --git a/backend/cpp/llama/Makefile b/backend/cpp/llama/Makefile index bd67d11077d4..17f55003ccbf 100644 --- a/backend/cpp/llama/Makefile +++ b/backend/cpp/llama/Makefile @@ -30,9 +30,7 @@ else ifeq ($(OS),Darwin) CMAKE_ARGS+=-DGGML_METAL=OFF else CMAKE_ARGS+=-DGGML_METAL=ON -# Until this is tested properly, we disable embedded metal file -# as we already embed it as part of the LocalAI assets - CMAKE_ARGS+=-DGGML_METAL_EMBED_LIBRARY=OFF + CMAKE_ARGS+=-DGGML_METAL_EMBED_LIBRARY=ON TARGET+=--target ggml-metal endif endif