Sitelet https://web.archive.org/web/20220404154911/https://github.com/arrayfire/arrayfire/issues/3201
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

[Question] How to disable intel mkl? #3201

Open
twmht opened this issue Dec 16, 2021 · 7 comments
Open

[Question] How to disable intel mkl? #3201

twmht opened this issue Dec 16, 2021 · 7 comments

Comments

@twmht
Copy link

@twmht twmht commented Dec 16, 2021

Hi,

Can I disable MKL when compiling from source? is mkl a must required package for arrayfire?

thank you

@twmht
Copy link
Author

@twmht twmht commented Dec 16, 2021 •

i did not see any MKL requirement on the page https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Linux

@twmht
Copy link
Author

@twmht twmht commented Dec 16, 2021

I find we can use -DAF_COMPUTE_LIBRARY=BLAS to change the backend. the install document needs to be updated.

@willyborn
Copy link
Contributor

@willyborn willyborn commented Dec 16, 2021 •

I changed to vcpkg description file: vcpkg.json (in source dir of arrayfire), so that it now uses openblas and fftw3. The improvement in speed on non-Intel CPU is remarkable. Since intel upgraded to OneMKL package, the existing improvement tricks no longer work.

The dependencyies section in the vkpkg.json file now has following content:

    "dependencies": [
        "boost-compute",
        "boost-functional",
        "boost-stacktrace",
        {
            "name": "forge",
            "version>=": "1.0.7",
            "platform": "windows"
        },
        "freeimage",
        {
            "name": "fontconfig",
            "platform": "!windows"
        },
        "glad",
        "spdlog",
		"fftw3",
		"openblas"
    ]

PS: intel-mkl is replace by fftw3 and openblas. The other content can change, depending on updates.
As you can see, this is the windows version, although I expect it to be similar for linux.

I hope this will help you.

@twmht
Copy link
Author

@twmht twmht commented Dec 17, 2021 •

@willyborn

I don't use VC for compiling, I just use cmake file to compile, so the config did not work for me.

Now I just change -DAF_COMPUTE_LIBRARY to BLAS, and now it can build without MKL.

@twmht
Copy link
Author

@twmht twmht commented Dec 17, 2021 •

Also, I think it's not ideal if the default backend is set to MKL, since I believe many of the users did not use intel cpu.

@9prady9
Copy link
Member

@9prady9 9prady9 commented Dec 23, 2021

@twmht The code has Intel-MKL as default backend. You can however use the combination of BLAS/FFTW/LAPACK libaries as well but you need to install them as per instructions on the wiki. Thanks for pointing out about the wiki. I have updated it now.

Note that this defaults to MKL because it is the fastest way to setup all required blas, fftw and lapack dependencies. As mentioned above you can change the cmake option to the other option with all necessary dependencies installed and it should work right away.

@praisethemoon
Copy link

@praisethemoon praisethemoon commented Jan 17, 2022 •

Hello, I have also came across through this when building from source on MacOS M1 by following the wiki, solved by using BLAS instead, I think the docs should be updated as well, thanks yall!

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

4 participants