-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Fix MKL build issue by correctly finding and linking MKL libraries #2272
base: master
Are you sure you want to change the base?
Conversation
I was able to build this either by this way #2295 (comment) if (WHISPER_MKL)
find_package(MKL REQUIRED)
set(MKL_INCLUDE_DIRS "${MKLROOT}/include")
set(MKL_LIBRARIES "${MKLROOT}/lib")
endif()
if (WHISPER_MKL)
include_directories(${MKL_INCLUDE_DIRS})
link_directories(${MKL_LIBRARIES})
target_link_libraries(whisper PRIVATE "D:/actuall/path/to/mkl_rt.lib")
endif() on Windows 10 with i5-10400F CPU. Even with successful build I haven't notice any difference in speed. Have you? |
I tested this on Linux, so I don't know the difference on Windows. You can check the output of whisper.cpp. |
Works for me too on Windows 11. but it's slow, OpenCL 10 times faster... Remove-Item -Recurse -Force build
cmake -B build . -DWHISPER_MKL=ON
cmake --build build -j8
Copy-Item "C:\Program Files (x86)\Intel\oneAPI\mkl\2024.2\bin\*.dll" -Destination "build\bin\Debug"
wget.exe -nc "https://github.com/thewh1teagle/vibe/raw/main/samples/multi.wav"
.\build\bin\Debug\main.exe -m "c:\Users\User\AppData\Local\github.com.thewh1teagle.vibe\ggml-medium.bin" -f multi.wav |
I tried this modification, but doesn't change much (30s) (other test is in here. so far only OpenBLAS make significant speedup. am i doing anything wrong?) also here's my linux modification
|
Fix MKL Build Issue
Description
This pull request fixes an issue with building whisper.cpp using Intel MKL. The changes ensure that CMake correctly finds and links the MKL libraries.
Changes Made
find_package(MKL REQUIRED)
to locate MKL.MKL_INCLUDE_DIRS
andMKL_LIBRARIES
to ensure proper include and link paths.MKL
headers and libraries only ifWHISPER_MKL
is enabled.Testing
Successfully built whisper.cpp with the MKL option enabled on an Intel Xeon CPU without GPU.
Related Issues
Fixes # (if applicable)