Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom blas #959

Open
wmx-github opened this issue Sep 12, 2024 · 0 comments
Open

custom blas #959

wmx-github opened this issue Sep 12, 2024 · 0 comments

Comments

@wmx-github
Copy link

ggerganov/llama.cpp#625
custom blas :
if your blas in C:/workspace/program/openblas

Blas is accelerated by compiling GGML provided, so in the ggml/src/CMakeLists.txt file , add the following code in this line of code if GGML_BLAS front

# add custom blas
if (CUSTOM_BLAS)
  set(BLAS_ROOT "C:/workspace/program/openblas")
  set(BLAS_INCLUDE_DIRS
        "${BLAS_ROOT}/include/"
        "${BLAS_ROOT}/include/openblas"
    )
  set(BLAS_LIBRARIES "${BLAS_ROOT}/lib/openblas.lib")
  list(APPEND GGML_CDEF_PUBLIC GGML_USE_BLAS)
  
  set(GGML_HEADERS_BLAS .. /include/ggml-blas.h)
  set(GGML_SOURCES_BLAS ggml-blas.cpp)
  
  set(GGML_EXTRA_LIBS     ${GGML_EXTRA_LIBS}     ${BLAS_LIBRARIES})
  set(GGML_EXTRA_INCLUDES ${GGML_EXTRA_INCLUDES} ${BLAS_INCLUDE_DIRS})
endif()

Then compile, specifying CUSTOM_BLAS=ON :

cmake -B build -DGGML_BLAS=OFF  -DCUSTOM_BLAS=ON
cmake --build build --config Release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant