From: Vulcan Date: Wed, 3 May 2023 16:24:43 +0000 (+0530) Subject: readme : partial OpenCL GPU support via CLBlast (#863) X-Git-Tag: upstream/1.7.4~1449 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=919e58b96ae509698344ead7ee0a51a150607b4c;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp readme : partial OpenCL GPU support via CLBlast (#863) * ggml : CLBlast support as in llama.cpp Building with CLBlast speeds up whisper.cpp ~2x on low end / older AMD APUs (CPU with integrated GPU) such as the A9. Usage: WHISPER_CLBLAST=1 make * CMake/Makefile : CLBlast support as in llama.cpp Building with CLBlast speeds up whisper.cpp ~2x on low end / older AMD APUs (CPU with integrated GPU) such as the A9. Usage: ``` Makefile: cd whisper.cpp WHISPER_CLBLAST=1 make CMake: cd whisper.cpp ; mkdir build ; cd build cmake -DWHISPER_CLBLAST=ON .. make ``` * Update README.md Added OpenCL Build Instructions * Instruction: Partial OpenCL GPU support via CLBlast Added build instructions and examples for Make and CMake to support OpenCL enabled GPUs. --- diff --git a/README.md b/README.md index 45ef0b86..e74cc371 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ High-performance inference of [OpenAI's Whisper](https://github.com/openai/whisp - Zero memory allocations at runtime - Runs on the CPU - [Partial GPU support for NVIDIA via cuBLAS](https://github.com/ggerganov/whisper.cpp#nvidia-gpu-support-via-cublas) +- [Partial OpenCL GPU support via CLBlast](https://github.com/ggerganov/whisper.cpp#opencl-gpu-support-via-clblast) - [C-style API](https://github.com/ggerganov/whisper.cpp/blob/master/whisper.h) Supported platforms: @@ -311,6 +312,29 @@ make clean WHISPER_CUBLAS=1 make -j ``` +## OpenCL GPU support via CLBlast + +For cards and integrated GPUs that support OpenCL, the Encoder processing can be largely offloaded to the GPU through CLBlast. This is especially useful for users with AMD APU's or low end devices for up to ~2x speedup. + +First, make sure you have installed `CLBlast` for your OS or Distribution: https://github.com/CNugteren/CLBlast + +Now build `whisper.cpp` with CLBlast support: + +``` +Makefile: +cd whisper.cpp +make clean +WHISPER_CLBLAST=1 make -j + +CMake: +cd whisper.cpp ; mkdir build ; cd build +cmake -DWHISPER_CLBLAST=ON .. +make clean +make -j +cp bin/* ../ +``` + + Run all the examples as usual. ## Limitations