| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A simple guide to compile Llama.cpp and llama-cpp-python using CLBlast for older generation AMD GPUs (the ones that don't support ROCm, like RX 5500).
pip install cmake
pip uninstall -y llama-cpp-python llama-cpp-python-cuda
Move the OpenCL folder under the C drive. Alternatively, edit the CLBlastConfig-release.cmake file to point to where you save the folder OpenCL.
# Import target "clblast" for configuration "Release"
set_property(TARGET clblast APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(clblast PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/clblast.lib"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "C:/OpenCL/lib/OpenCL.lib"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/clblast.dll"
)
Edit the IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE to where you put OpenCL folder.
Reinstall llama-cpp-python using the following flags.The location C:\CLBlast\lib\cmake\CLBlast should be inside of where you downloaded the folder CLBlast from this repo (you can put it anywhere, just make sure you pass it to the -DCLBlast_DIR flag)
$env:CMAKE_ARGS="-DLLAMA_CLBLAST=on -DCLBlast_DIR=C:\CLBlast\lib\cmake\CLBlast" $env:FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
CMAKE_ARGS="-DLLAMA_CLBLAST=on -DCLBlast_DIR=C:\CLBlast\lib\cmake\CLBlast" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dir
All done, fire it up and you should see something like this when you load a model using llama-cpp-python:
pip install cmake
git clone https://github.com/ggerganov/llama.cpp cd llama.cpp
mkdir build cd build cmake .. -DLLAMA_CLBLAST=on -DCLBlast_DIR=C:/CLBlast
cmake --build . --config Release
Add the the clblast.dll folder to your path. Or alternatively. Just copy the clblast.dll to the Release folder where you have your llama-cpp executables.
Run a model
cd bin/Release .\main.exe -m 'C:\YOUR-MODELS-FOLDER\codellama-7b-instruct.Q5_K_S.gguf' -ngl 40 -t 6 -p 'write a python function to delete all folders that are bigger than 100 mb on current directory'
where the flags mean:
Error:
Error The code execution cannot proceed because clblast.dll was not found
Solution: Put clblast.dll in the same folder as the executables. You can find the clblast.dll in C:\CLBlast\lib on this repo. Or add the folder where you have the clblast.dll to your path.
Error:
CMake Error in CMakeLists.txt:
Imported target "clblast" includes non-existent path
"C:/OpenCL/include"
Solution Edit the CLBlastConfig-release.cmake file to point to where you saved the folder OpenCL if it is different from C:\OpenCL.
| Back | FazBrowse Home | New Git URL |