Closed joshuar9 closed 2 years ago
Was MKL support removed?
No, it is still working
Are there issues using MKL that make it less preferable to OpenBLAS/Clapack?
MKL is slow on AMD, it is not universal enough. Also, it needs LD_PRELOAD as below.
Assuming there aren't huge issues, how can I build the python api so I can use the Kaldi binaries with MKL?
You need something like LD_PRELOAD=$MKLROOT/lib/intel64/libmkl_core.so python when you run python, it is pretty widely covered on the web.
This more or less works now, I made a changes to improve linking, you just have to specify HAVE_MKL=1 HAVE_OPENBLAS_CLAPACK=0 in makefile.
I wanted to build Vosk using Kaldi binaries built with the MKL math library. I read that MKL has a more performant version of BLAS and Lapack on intel architectures, compared to OpenBLAS and clapack.
I built vosk in the src directory using
KALDI_MKL=$KALDI_MKL KALDI_ROOT=$KALDI_ROOT make -j $(nproc)
where $KALDI_MKL=1 and $KALDI_ROOT is the root directory for kaldi
Then I did
pip install -e .
in the python directory and it didn't throw any errors.But when I tried to use the vosk python api in the vosk-server project https://github.com/alphacep/vosk-server by, for example, running the websocket server example, I got this error:
I saw this issue https://github.com/alphacep/vosk-api/issues/188 where someone was trying to build the c api, and they were told to link to the MKL libraries.
I'm not sure how to do that with python. Searching some more, I also found commit https://github.com/alphacep/vosk-api/commit/31bb0557d9f2a98c8672bbe9013e419d05eee8dc
But I was a bit confused because the latest python/setup.py doesn't mention anything about MKL.
I wanted to know:
I appreciate any insight you can offer.