minor fixes
This commit is contained in:
parent
d0f71b5a3c
commit
2432c6fbdf
3 changed files with 8 additions and 3 deletions
|
@ -68,6 +68,7 @@ option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
|
||||||
|
|
||||||
# 3rd party libs
|
# 3rd party libs
|
||||||
option(LLAMA_CURL "llama: use libcurl to download model from an URL" OFF)
|
option(LLAMA_CURL "llama: use libcurl to download model from an URL" OFF)
|
||||||
|
option(LLAMA_NVAPI "llama: use NvAPI to control performance states on NVIDIA GPUs" ON)
|
||||||
|
|
||||||
# Required for relocatable CMake package
|
# Required for relocatable CMake package
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/build-info.cmake)
|
||||||
|
|
|
@ -12,6 +12,7 @@ endif()
|
||||||
#
|
#
|
||||||
|
|
||||||
# nvapi
|
# nvapi
|
||||||
|
|
||||||
if (LLAMA_NVAPI)
|
if (LLAMA_NVAPI)
|
||||||
add_library(nvapi nvapi.cpp nvapi.h)
|
add_library(nvapi nvapi.cpp nvapi.h)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#define LLAMA_API_INTERNAL
|
#define LLAMA_API_INTERNAL
|
||||||
#include "llama.h"
|
#include "llama.h"
|
||||||
|
|
||||||
#include "nvapi.h"
|
|
||||||
#include "unicode.h"
|
#include "unicode.h"
|
||||||
|
|
||||||
#include "ggml.h"
|
#include "ggml.h"
|
||||||
|
@ -30,6 +29,10 @@
|
||||||
# include "ggml-metal.h"
|
# include "ggml-metal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LLAMA_NVAPI
|
||||||
|
# include "nvapi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: replace with ggml API call
|
// TODO: replace with ggml API call
|
||||||
#define QK_K 256
|
#define QK_K 256
|
||||||
|
|
||||||
|
@ -17081,7 +17084,7 @@ void llama_backend_init(void) {
|
||||||
ggml_free(ctx);
|
ggml_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(GGML_USE_CUDA) && defined(LLAMA_NVAPI)
|
#ifdef LLAMA_NVAPI
|
||||||
// initalize NvAPI library
|
// initalize NvAPI library
|
||||||
nvapi_init();
|
nvapi_init();
|
||||||
#endif
|
#endif
|
||||||
|
@ -17096,7 +17099,7 @@ void llama_numa_init(enum ggml_numa_strategy numa) {
|
||||||
void llama_backend_free(void) {
|
void llama_backend_free(void) {
|
||||||
ggml_quantize_free();
|
ggml_quantize_free();
|
||||||
|
|
||||||
#if defined(GGML_USE_CUDA) && defined(LLAMA_NVAPI)
|
#ifdef LLAMA_NVAPI
|
||||||
// free NvAPI library
|
// free NvAPI library
|
||||||
nvapi_free();
|
nvapi_free();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue