Skip to content

Commit f5f6a1c

Browse files
committed
[TEST] feat(build): build noavx version along
Signed-off-by: mudler <[email protected]>
1 parent 5e0e93c commit f5f6a1c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ endif
155155
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
158+
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-cpp-noavx
158159
ALL_GRPC_BACKENDS+=backend-assets/grpc/llama-ggml
159160
ALL_GRPC_BACKENDS+=backend-assets/grpc/gpt4all
160161
ALL_GRPC_BACKENDS+=backend-assets/grpc/rwkv
@@ -311,7 +312,7 @@ build: prepare backend-assets grpcs ## Build the project
311312
CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(BINARY_NAME) ./
312313

313314
build-minimal:
314-
BUILD_GRPC_FOR_BACKEND_LLAMA=true GRPC_BACKENDS=backend-assets/grpc/llama-cpp GO_TAGS=none $(MAKE) build
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
315316

316317
build-api:
317318
BUILD_GRPC_FOR_BACKEND_LLAMA=true BUILD_API_ONLY=true GO_TAGS=none $(MAKE) build
@@ -644,13 +645,22 @@ else
644645
LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/llama grpc-server
645646
endif
646647

647-
backend-assets/grpc/llama-cpp: backend-assets/grpc backend/cpp/llama/grpc-server
648+
backend-assets/grpc/llama-cpp: backend-assets/grpc
649+
$(info ${GREEN}I llama-cpp build info:standard${RESET})
650+
$(MAKE) -C backend/cpp/llama purge
651+
$(MAKE) backend/cpp/llama/grpc-server
648652
cp -rfv backend/cpp/llama/grpc-server backend-assets/grpc/llama-cpp
649653
# TODO: every binary should have its own folder instead, so can have different metal implementations
650654
ifeq ($(BUILD_TYPE),metal)
651655
cp backend/cpp/llama/llama.cpp/build/bin/default.metallib backend-assets/grpc/
652656
endif
653657

658+
backend-assets/grpc/llama-cpp-noavx: backend-assets/grpc
659+
$(info ${GREEN}I llama-cpp build info:noavx${RESET})
660+
$(MAKE) -C backend/cpp/llama purge
661+
CMAKE_ARGS="-DLLAMA_AVX2=OFF" $(MAKE) backend/cpp/llama/grpc-server
662+
cp -rfv backend/cpp/llama/grpc-server backend-assets/grpc/llama-cpp-noavx
663+
654664
backend-assets/grpc/llama-ggml: sources/go-llama.cpp sources/go-llama.cpp/libbinding.a backend-assets/grpc
655665
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/go-llama.cpp LIBRARY_PATH=$(CURDIR)/sources/go-llama.cpp \
656666
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/llama-ggml ./backend/go/llm/llama-ggml/

0 commit comments

Comments
 (0)