Skip to content
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

Using Intel's mkl on Linux #2793

Open
RobertoMaurizzi opened this issue Mar 2, 2025 · 2 comments
Open

Using Intel's mkl on Linux #2793

RobertoMaurizzi opened this issue Mar 2, 2025 · 2 comments

Comments

@RobertoMaurizzi
Copy link

I'm trying to run some examples with Intel's mkl library. I'm running on Debian 12 so since their version of mkl is ancient (2020.4.304) I added the official Intel repository and installed from there with apt install intel-oneapi-mkl intel-oneapi-mkl-devel.

However, running cargo run --example mistral --release --features mkl -- --prompt 'Write an example fibonacci code in Rust' --sample-len 100 --quantized from latest main, I always get a linker error saying that there's an undefined reference to `hgemm_':

/usr/bin/ld: /media/robm/Extreme SSD/Devel/candle/target/release/deps/libcandle_core-1583f1d9914cd012.rlib(candle_core-1583f1d9914cd012.candle_core.b90b42375f6ed342-cgu.00.rcgu.o): in function `<candle_core::cpu_backend::CpuStorage as candle_core::backend::BackendStorage>::matmul':
          candle_core.b90b42375f6ed342-cgu.00:(.text._ZN93_$LT$candle_core..cpu_backend..CpuStorage$u20$as$u20$candle_core..backend..BackendStorage$GT$6matmul17h13715ea796a334c9E+0x1a3a): undefined reference to `hgemm_'
          collect2: error: ld returned 1 exit status

Is this supposed to be working or what said in #1456 is still true?

@LaurentMazare
Copy link
Collaborator

The intel-mkl-src crate doesn't seem to have been updated since the last issue so my guess is that you still need to install mkl manually.

@RobertoMaurizzi
Copy link
Author

I did install the libraries manually and also ran their /opt/intel/oneapi/setvars.sh script to define any required variables.
Funnily enough yesterday I found that if I try to compile a separate application with --features mkl it does compile properly (then it doesn't run properly because I'm still trying to understand how to use candle, but the behavior is the same also without any acceleration feature, so at least it builds/links 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants