whisper.cpp icon indicating copy to clipboard operation
whisper.cpp copied to clipboard

OpenBLAS v0.3.27 crashing where v0.3.26 doesn't (Windows)

Open royshil opened this issue 10 months ago • 3 comments

The latest OpenBLAS version v0.3.27 released 2 weeks ago is causing a crash on whisper_full(). https://github.com/OpenMathLib/OpenBLAS/releases/tag/v0.3.27

I verified that v0.3.26 (which ive been using so far) doesn't crash.

CPU Name: Intel(R) Core(TM) i7-8700T CPU @ 2.40GHz Windows Version: 10.0 Build 22631 (release: 23H2; revision: 3447; 64-bit)

Whisper system print: AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 0 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0

Any clues appreciated!

(this is for https://github.com/occ-ai/obs-localvocal e.g. Whisper for OBS)

royshil avatar Apr 17 '24 22:04 royshil

I have no problems with OpenBLAS 0.3.27. Maybe the libopenblas.dll you are using is still 0.3.26? Try copying libopenblas.dll from 0.3.27 to the directory of the binaries.

cd C:\whisper.cpp
Invoke-WebRequest https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-x64-64.zip -OutFile .\openblas.zip
Expand-Archive .\openblas.zip -DestinationPath .\openblas
$env:OPENBLAS_PATH = "C:\whisper.cpp\openblas"
cmake -B build -DWHISPER_OPENBLAS=ON -DWHISPER_OPENBLAS_INTERFACE64=ON
...
cmake --build build -j --config Release
...
copy .\openblas\bin\libopenblas.dll .\build\bin\Release\ # <==== COPY THE DLL FILE
.\build\bin\Release\main.exe -m .\ggml-model-whisper-medium.bin -f .\samples\jfk.wav

whisper_init_from_file_with_params_no_state: loading model from '.\ggml-model-whisper-medium.bin'
whisper_model_load: loading model
whisper_model_load: n_vocab       = 51865
whisper_model_load: n_audio_ctx   = 1500
whisper_model_load: n_audio_state = 1024
whisper_model_load: n_audio_head  = 16
whisper_model_load: n_audio_layer = 24
whisper_model_load: n_text_ctx    = 448
whisper_model_load: n_text_state  = 1024
whisper_model_load: n_text_head   = 16
whisper_model_load: n_text_layer  = 24
whisper_model_load: n_mels        = 80
whisper_model_load: ftype         = 1
whisper_model_load: qntvr         = 0
whisper_model_load: type          = 4 (medium)
whisper_model_load: adding 1608 extra tokens
whisper_model_load: n_langs       = 99
whisper_model_load:      CPU total size =  1533.14 MB
whisper_model_load: model size    = 1533.14 MB
whisper_init_state: kv self size  =  132.12 MB
whisper_init_state: kv cross size =  147.46 MB
whisper_init_state: compute buffer (conv)   =   28.68 MB
whisper_init_state: compute buffer (encode) =  594.22 MB
whisper_init_state: compute buffer (cross)  =    7.85 MB
whisper_init_state: compute buffer (decode) =  138.87 MB

system_info: n_threads = 4 / 8 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | METAL = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 1 | SSSE3 = 0 | VSX = 0 | CUDA = 0 | COREML = 0 | OPENVINO = 0

main: processing '.\samples\jfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, 5 beams + best of 5, lang = en, task = transcribe, timestamps = 1 ...


[00:00:00.000 --> 00:00:11.000]   And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.

tamo avatar Apr 21 '24 15:04 tamo

@tamo Thanks for testing Strangely enough they have two zip files x64 and x64-64 I used x64 And I see you used x64-64 So I'm wondering if there's a difference.

Also - I've compiled and linked whisper.cpp vs the v0.3.27 and then it failed, not the .dll drop-in way. If it makes a difference.

I'll do a few more tests to get to the bottom of it.

royshil avatar Apr 22 '24 00:04 royshil

0.3.27-x64 works fine here (without -DWHISPER_OPENBLAS_INTERFACE64=ON)

So I have no information about your crash except it is

on whisper_full().

I hope you'll find a solution but provide some more info if you need a help

tamo avatar Apr 23 '24 00:04 tamo