Skip to content

Commit 04b4d9d

Browse files
committed
Fixups
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent 4b445af commit 04b4d9d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Makefile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ ALL_GRPC_BACKENDS=backend-assets/grpc/langchain-huggingface
156156
ALL_GRPC_BACKENDS+=backend-assets/grpc/bert-embeddings
157157
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-cpp
158158
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-cpp-noavx
159+
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-cpp-fallback
159160
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-ggml
160161
ALL_GRPC_BACKENDS+=backend-assets/grpc/gpt4all
161162
ALL_GRPC_BACKENDS+=backend-assets/grpc/rwkv
@@ -294,6 +295,7 @@ clean: ## Remove build related file
294295
rm -rf backend-assets/*
295296
$(MAKE) -C backend/cpp/grpc clean
296297
$(MAKE) -C backend/cpp/llama clean
298+
rm -rf backend/cpp/llama-* || true
297299
$(MAKE) dropreplace
298300
$(MAKE) protogen-clean
299301
rmdir pkg/grpc/proto || true
@@ -312,7 +314,7 @@ build: prepare backend-assets grpcs ## Build the project
312314
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(BINARY_NAME) ./
313315

314316
build-minimal:
315-
BUILD_GRPC_FOR_BACKEND_LLAMA=true GRPC_BACKENDS="backend-assets/grpc/llama-cpp backend-assets/grpc/llama-cpp-noavx" GO_TAGS=none $(MAKE) build
317+
BUILD_GRPC_FOR_BACKEND_LLAMA=true GRPC_BACKENDS="backend-assets/grpc/llama-cpp" GO_TAGS=none $(MAKE) build
316318

317319
build-api:
318320
BUILD_GRPC_FOR_BACKEND_LLAMA=true BUILD_API_ONLY=true GO_TAGS=none $(MAKE) build
@@ -657,22 +659,17 @@ ifeq ($(BUILD_TYPE),metal)
657659
endif
658660

659661
backend-assets/grpc/llama-cpp-noavx: backend-assets/grpc
660-
$(info ${GREEN}I llama-cpp build info:noavx${RESET})
661662
cp -rf backend/cpp/llama backend/cpp/llama-noavx
662663
$(MAKE) -C backend/cpp/llama-noavx purge
663-
CMAKE_ARGS+=-DLLAMA_AVX2=OFF
664-
$(MAKE) VARIANT="llama-noavx" build-llama-cpp-grpc-server
664+
$(info ${GREEN}I llama-cpp build info:noavx${RESET})
665+
CMAKE_ARGS="$(CMAKE_ARGS) -DLLAMA_AVX512=OFF -DLLAMA_AVX2=OFF" $(MAKE) VARIANT="llama-noavx" build-llama-cpp-grpc-server
665666
cp -rfv backend/cpp/llama-noavx/grpc-server backend-assets/grpc/llama-cpp-noavx
666667

667668
backend-assets/grpc/llama-cpp-fallback: backend-assets/grpc
668-
$(info ${GREEN}I llama-cpp build info:fallback${RESET})
669669
cp -rf backend/cpp/llama backend/cpp/llama-fallback
670670
$(MAKE) -C backend/cpp/llama-fallback purge
671-
CMAKE_ARGS+=-DLLAMA_F16C=OFF
672-
CMAKE_ARGS+=-DLLAMA_AVX512=OFF
673-
CMAKE_ARGS+=-DLLAMA_AVX2=OFF
674-
CMAKE_ARGS+=-DLLAMA_FMA=OFF
675-
$(MAKE) VARIANT="llama-fallback" build-llama-cpp-grpc-server
671+
$(info ${GREEN}I llama-cpp build info:fallback${RESET})
672+
CMAKE_ARGS="$(CMAKE_ARGS) -DLLAMA_F16C=OFF -DLLAMA_AVX512=OFF -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF" $(MAKE) VARIANT="llama-fallback" build-llama-cpp-grpc-server
676673
cp -rfv backend/cpp/llama-fallback/grpc-server backend-assets/grpc/llama-cpp-fallback
677674

678675
backend-assets/grpc/llama-ggml: sources/go-llama.cpp sources/go-llama.cpp/libbinding.a backend-assets/grpc

backend/cpp/llama/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ clean: purge
5959
rm -rf llama.cpp
6060

6161
grpc-server: llama.cpp llama.cpp/examples/grpc-server
62+
@echo "Building grpc-server with $(BUILD_TYPE) build type and $(CMAKE_ARGS)"
6263
ifneq (,$(findstring sycl,$(BUILD_TYPE)))
6364
bash -c "source $(ONEAPI_VARS); \
6465
cd llama.cpp && mkdir -p build && cd build && cmake .. $(CMAKE_ARGS) && cmake --build . --config Release"

0 commit comments

Comments
 (0)