diff --git a/CMakeLists.txt b/CMakeLists.txt index 391c128df..191e6044b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,16 @@ set(OPENSSL_USE_STATIC_LIBS TRUE) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build_deps/_install) # This is the critical line for installing another package +if (LLAMA_CUBLAS) + cmake_minimum_required(VERSION 3.17) + + find_package(CUDAToolkit) + if (CUDAToolkit_FOUND) + message(STATUS "cuBLAS found") + add_compile_definitions(GGML_USE_CUBLAS) + endif() +endif() + add_subdirectory(llama.cpp) add_executable(${PROJECT_NAME} main.cc) diff --git a/controllers/llamaCPP.cc b/controllers/llamaCPP.cc index d87b8f235..8b8fc62a5 100644 --- a/controllers/llamaCPP.cc +++ b/controllers/llamaCPP.cc @@ -4,6 +4,8 @@ #include #include #include +#include + std::string create_return_json(const std::string &id, const std::string &model, const std::string &content, Json::Value finish_reason = Json::Value()) { diff --git a/controllers/llamaCPP.h b/controllers/llamaCPP.h index 43bc4aa81..2494d317f 100644 --- a/controllers/llamaCPP.h +++ b/controllers/llamaCPP.h @@ -7,6 +7,7 @@ #include "llama.h" #include "build-info.h" #include "grammar-parser.h" +#include #ifndef NDEBUG // crash the server in debug mode, otherwise send an http 500 error @@ -1385,6 +1386,10 @@ class llamaCPP : public drogon::HttpSimpleController { params.model = conf["llama_model_path"].asString(); params.n_gpu_layers = conf["ngl"].asInt(); params.n_ctx = conf["ctx_len"].asInt(); + #ifdef GGML_USE_CUBLAS + LOG_INFO << "Setting up GGML CUBLAS PARAMS"; + params.mul_mat_q = false; + #endif // GGML_USE_CUBLAS if (params.model_alias == "unknown") { params.model_alias = params.model; } diff --git a/controllers/nitro_utils.h b/controllers/nitro_utils.h index 0115aaf93..94b50d7f1 100644 --- a/controllers/nitro_utils.h +++ b/controllers/nitro_utils.h @@ -50,7 +50,7 @@ inline void nitro_logo(){ std::cout << resetColor << c; colorIndex = 0; } else { - std::cout << rainbowColors[colorIndex % 6] << c; + std::cout << rainbowColors[colorIndex % 2] << c; colorIndex++; } }