diff --git a/Makefile b/Makefile index dea93d83e..cf110833c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -default: koboldcpp koboldcpp_noavx2 koboldcpp_openblas koboldcpp_openblas_noavx2 koboldcpp_clblast +default: koboldcpp koboldcpp_noavx2 koboldcpp_openblas koboldcpp_openblas_noavx2 koboldcpp_clblast koboldcpp_cublas simple: koboldcpp koboldcpp_noavx2 dev: koboldcpp_openblas @@ -45,8 +45,8 @@ endif # # keep standard at C11 and C++11 -CFLAGS = -I. -Ofast -DNDEBUG -std=c11 -fPIC -CXXFLAGS = -I. -I./examples -Ofast -DNDEBUG -std=c++11 -fPIC +CFLAGS = -I. -I./include -I./include/CL -Ofast -DNDEBUG -std=c11 -fPIC +CXXFLAGS = -I. -I./examples -I./include -I./include/CL -Ofast -DNDEBUG -std=c++11 -fPIC LDFLAGS = # these are used on windows, to build some libraries with extra old device compatibility @@ -55,7 +55,7 @@ BONUSCFLAGS2 = OPENBLAS_FLAGS = -DGGML_USE_OPENBLAS -I/usr/local/include/openblas CLBLAST_FLAGS = -DGGML_USE_CLBLAST -DGGML_USE_OPENBLAS -I/usr/local/include/openblas -CUBLAS_FLAGS = -DGGML_USE_CUBLAS -I/usr/local/cuda/include +CUBLAS_FLAGS = -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I./include/cuda -I./include/cuda/crt #lets try enabling everything CFLAGS += -pthread -s @@ -251,7 +251,7 @@ gpttype_adapter.o: gpttype_adapter.cpp $(CXX) $(CXXFLAGS) -c $< -o $@ clean: - rm -vf *.o main quantize_llama quantize_gpt2 quantize_gptj quantize-stats perplexity embedding benchmark-q4_0-matmult main.exe quantize_llama.exe quantize_gptj.exe quantize_gpt2.exe koboldcpp.dll koboldcpp_openblas.dll koboldcpp_noavx2.dll koboldcpp_openblas_noavx2.dll koboldcpp_clblast.dll koboldcpp.so koboldcpp_openblas.so koboldcpp_noavx2.so koboldcpp_openblas_noavx2.so koboldcpp_clblast.so gptj.exe gpt2.exe + rm -vf *.o main quantize_llama quantize_gpt2 quantize_gptj quantize-stats perplexity embedding benchmark-q4_0-matmult main.exe quantize_llama.exe quantize_gptj.exe quantize_gpt2.exe koboldcpp.dll koboldcpp_openblas.dll koboldcpp_noavx2.dll koboldcpp_openblas_noavx2.dll koboldcpp_clblast.dll koboldcpp_cublas.dll koboldcpp.so koboldcpp_openblas.so koboldcpp_noavx2.so koboldcpp_openblas_noavx2.so koboldcpp_clblast.so koboldcpp_cublas.so gptj.exe gpt2.exe main: examples/main/main.cpp ggml.o llama.o common.o $(OBJS) $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) diff --git a/README.md b/README.md index 5ec570b62..bc483b785 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ What does it mean? You get llama.cpp with a fancy UI, persistent stories, editin - You will have to compile your binaries from source. A makefile is provided, simply run `make` - If you want you can also link your own install of OpenBLAS manually with `make LLAMA_OPENBLAS=1` - Alternatively, if you want you can also link your own install of CLBlast manually with `make LLAMA_CLBLAST=1`, for this you will need to obtain and link OpenCL and CLBlast libraries. - - For Arch Linux: Install `cblas` and `openblas`. In the makefile, find the `ifdef LLAMA_OPENBLAS` conditional and add `-lcblas` to `LDFLAGS`. +- For a full featured build, do `make LLAMA_OPENBLAS=1 LLAMA_CLBLAST=1` + - For Arch Linux: Install `cblas` and `openblas`. - For Debian: Install `libclblast-dev` and `libopenblas-dev`. - After all binaries are built, you can run the python script with the command `koboldcpp.py [ggml_model.bin] [port]` diff --git a/CL/Utils/Context.h b/include/CL/Utils/Context.h similarity index 100% rename from CL/Utils/Context.h rename to include/CL/Utils/Context.h diff --git a/CL/Utils/Context.hpp b/include/CL/Utils/Context.hpp similarity index 100% rename from CL/Utils/Context.hpp rename to include/CL/Utils/Context.hpp diff --git a/CL/Utils/Detail.hpp b/include/CL/Utils/Detail.hpp similarity index 100% rename from CL/Utils/Detail.hpp rename to include/CL/Utils/Detail.hpp diff --git a/CL/Utils/Device.hpp b/include/CL/Utils/Device.hpp similarity index 100% rename from CL/Utils/Device.hpp rename to include/CL/Utils/Device.hpp diff --git a/CL/Utils/Error.h b/include/CL/Utils/Error.h similarity index 100% rename from CL/Utils/Error.h rename to include/CL/Utils/Error.h diff --git a/CL/Utils/Error.hpp b/include/CL/Utils/Error.hpp similarity index 100% rename from CL/Utils/Error.hpp rename to include/CL/Utils/Error.hpp diff --git a/CL/Utils/ErrorCodes.h b/include/CL/Utils/ErrorCodes.h similarity index 100% rename from CL/Utils/ErrorCodes.h rename to include/CL/Utils/ErrorCodes.h diff --git a/CL/Utils/Event.h b/include/CL/Utils/Event.h similarity index 100% rename from CL/Utils/Event.h rename to include/CL/Utils/Event.h diff --git a/CL/Utils/Event.hpp b/include/CL/Utils/Event.hpp similarity index 100% rename from CL/Utils/Event.hpp rename to include/CL/Utils/Event.hpp diff --git a/CL/Utils/File.h b/include/CL/Utils/File.h similarity index 100% rename from CL/Utils/File.h rename to include/CL/Utils/File.h diff --git a/CL/Utils/File.hpp b/include/CL/Utils/File.hpp similarity index 100% rename from CL/Utils/File.hpp rename to include/CL/Utils/File.hpp diff --git a/CL/Utils/InteropContext.hpp b/include/CL/Utils/InteropContext.hpp similarity index 100% rename from CL/Utils/InteropContext.hpp rename to include/CL/Utils/InteropContext.hpp diff --git a/CL/Utils/OpenCLUtilsCpp_Export.h b/include/CL/Utils/OpenCLUtilsCpp_Export.h similarity index 100% rename from CL/Utils/OpenCLUtilsCpp_Export.h rename to include/CL/Utils/OpenCLUtilsCpp_Export.h diff --git a/CL/Utils/OpenCLUtils_Export.h b/include/CL/Utils/OpenCLUtils_Export.h similarity index 100% rename from CL/Utils/OpenCLUtils_Export.h rename to include/CL/Utils/OpenCLUtils_Export.h diff --git a/CL/Utils/Platform.hpp b/include/CL/Utils/Platform.hpp similarity index 100% rename from CL/Utils/Platform.hpp rename to include/CL/Utils/Platform.hpp diff --git a/CL/Utils/Utils.h b/include/CL/Utils/Utils.h similarity index 100% rename from CL/Utils/Utils.h rename to include/CL/Utils/Utils.h diff --git a/CL/Utils/Utils.hpp b/include/CL/Utils/Utils.hpp similarity index 100% rename from CL/Utils/Utils.hpp rename to include/CL/Utils/Utils.hpp diff --git a/CL/cl.h b/include/CL/cl.h similarity index 100% rename from CL/cl.h rename to include/CL/cl.h diff --git a/CL/cl2.hpp b/include/CL/cl2.hpp similarity index 100% rename from CL/cl2.hpp rename to include/CL/cl2.hpp diff --git a/CL/cl_d3d10.h b/include/CL/cl_d3d10.h similarity index 100% rename from CL/cl_d3d10.h rename to include/CL/cl_d3d10.h diff --git a/CL/cl_d3d11.h b/include/CL/cl_d3d11.h similarity index 100% rename from CL/cl_d3d11.h rename to include/CL/cl_d3d11.h diff --git a/CL/cl_dx9_media_sharing.h b/include/CL/cl_dx9_media_sharing.h similarity index 100% rename from CL/cl_dx9_media_sharing.h rename to include/CL/cl_dx9_media_sharing.h diff --git a/CL/cl_dx9_media_sharing_intel.h b/include/CL/cl_dx9_media_sharing_intel.h similarity index 100% rename from CL/cl_dx9_media_sharing_intel.h rename to include/CL/cl_dx9_media_sharing_intel.h diff --git a/CL/cl_egl.h b/include/CL/cl_egl.h similarity index 100% rename from CL/cl_egl.h rename to include/CL/cl_egl.h diff --git a/CL/cl_ext.h b/include/CL/cl_ext.h similarity index 100% rename from CL/cl_ext.h rename to include/CL/cl_ext.h diff --git a/CL/cl_ext_intel.h b/include/CL/cl_ext_intel.h similarity index 100% rename from CL/cl_ext_intel.h rename to include/CL/cl_ext_intel.h diff --git a/CL/cl_gl.h b/include/CL/cl_gl.h similarity index 100% rename from CL/cl_gl.h rename to include/CL/cl_gl.h diff --git a/CL/cl_gl_ext.h b/include/CL/cl_gl_ext.h similarity index 100% rename from CL/cl_gl_ext.h rename to include/CL/cl_gl_ext.h diff --git a/CL/cl_half.h b/include/CL/cl_half.h similarity index 100% rename from CL/cl_half.h rename to include/CL/cl_half.h diff --git a/CL/cl_icd.h b/include/CL/cl_icd.h similarity index 100% rename from CL/cl_icd.h rename to include/CL/cl_icd.h diff --git a/CL/cl_layer.h b/include/CL/cl_layer.h similarity index 100% rename from CL/cl_layer.h rename to include/CL/cl_layer.h diff --git a/CL/cl_platform.h b/include/CL/cl_platform.h similarity index 100% rename from CL/cl_platform.h rename to include/CL/cl_platform.h diff --git a/CL/cl_va_api_media_sharing_intel.h b/include/CL/cl_va_api_media_sharing_intel.h similarity index 100% rename from CL/cl_va_api_media_sharing_intel.h rename to include/CL/cl_va_api_media_sharing_intel.h diff --git a/CL/cl_version.h b/include/CL/cl_version.h similarity index 100% rename from CL/cl_version.h rename to include/CL/cl_version.h diff --git a/CL/license.txt b/include/CL/license.txt similarity index 100% rename from CL/license.txt rename to include/CL/license.txt diff --git a/CL/opencl.h b/include/CL/opencl.h similarity index 100% rename from CL/opencl.h rename to include/CL/opencl.h diff --git a/CL/opencl.hpp b/include/CL/opencl.hpp similarity index 100% rename from CL/opencl.hpp rename to include/CL/opencl.hpp diff --git a/cblas.h b/include/cblas.h similarity index 99% rename from cblas.h rename to include/cblas.h index fb8102294..48b47059d 100644 --- a/cblas.h +++ b/include/cblas.h @@ -4,7 +4,7 @@ #define CBLAS_H #include -#include "openblas_config.h" +#include #ifdef __cplusplus extern "C" { diff --git a/clblast_c.h b/include/clblast_c.h similarity index 100% rename from clblast_c.h rename to include/clblast_c.h diff --git a/openblas_config.h b/include/openblas_config.h similarity index 100% rename from openblas_config.h rename to include/openblas_config.h