From 21029421219d729df314d0ba611f6d03694a294d Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:15:15 +0800 Subject: [PATCH] testing LLAMA_PORTABLE flag for building --- Makefile | 8 +++++++- README.md | 1 + colab.ipynb | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d878735c6..f625a32e6 100644 --- a/Makefile +++ b/Makefile @@ -118,7 +118,7 @@ ifeq ($(UNAME_M),$(filter $(UNAME_M),x86_64 i686)) FULLCFLAGS += -mavx2 -msse3 -mfma -mf16c -mavx else # if not on windows, they are clearly building it themselves, so lets just use whatever is supported - ifdef LLAMA_COLAB + ifdef LLAMA_PORTABLE CFLAGS += -mavx2 -msse3 -mfma -mf16c -mavx else CFLAGS += -march=native -mtune=native @@ -152,11 +152,17 @@ ifdef LLAMA_CUBLAS CUBLAS_OBJS = ggml-cuda.o ggml_v2-cuda.o ggml_v2-cuda-legacy.o NVCC = nvcc NVCCFLAGS = --forward-unknown-to-host-compiler -use_fast_math + ifdef CUDA_DOCKER_ARCH NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=$(CUDA_DOCKER_ARCH) +else +ifdef LLAMA_PORTABLE + NVCCFLAGS += -Wno-deprecated-gpu-targets -arch=all-major else NVCCFLAGS += -arch=native +endif endif # CUDA_DOCKER_ARCH + ifdef LLAMA_CUDA_FORCE_DMMV NVCCFLAGS += -DGGML_CUDA_FORCE_DMMV endif # LLAMA_CUDA_FORCE_DMMV diff --git a/README.md b/README.md index d3090b7ed..084527a14 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ You can then run koboldcpp anywhere from the terminal by running `koboldcpp` to - KoboldCpp has a few unofficial third-party community created docker images. Feel free to try them out, but do not expect up-to-date support: - https://github.com/korewaChino/koboldCppDocker - https://github.com/noneabove1182/koboldcpp-docker +- If you're building your own docker, remember to set CUDA_DOCKER_ARCH or enable LLAMA_PORTABLE ## Questions and Help - **First, please check out [The KoboldCpp FAQ and Knowledgebase](https://github.com/LostRuins/koboldcpp/wiki) which may already have answers to your questions! Also please search through past issues and discussions.** diff --git a/colab.ipynb b/colab.ipynb index 854bffdf3..f085fce7e 100644 --- a/colab.ipynb +++ b/colab.ipynb @@ -67,7 +67,7 @@ "!echo Finding prebuilt binary for {kvers}\r\n", "!wget -O dlfile.tmp https://kcppcolab.concedo.workers.dev/?{kvers} && mv dlfile.tmp koboldcpp_cublas.so\r\n", "!test -f koboldcpp_cublas.so && echo Prebuilt Binary Exists || echo Prebuilt Binary Does Not Exist\r\n", - "!test -f koboldcpp_cublas.so && echo Build Skipped || make koboldcpp_cublas LLAMA_CUBLAS=1 LLAMA_COLAB=1\r\n", + "!test -f koboldcpp_cublas.so && echo Build Skipped || make koboldcpp_cublas LLAMA_CUBLAS=1 LLAMA_PORTABLE=1\r\n", "!cp koboldcpp_cublas.so koboldcpp_cublas.dat\r\n", "!apt install aria2 -y\r\n", "!aria2c -x 10 -o model.ggml --summary-interval=5 --download-result=default --allow-overwrite=true --file-allocation=none $Model\r\n",