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

USE_INTEL_MKL and USE_INTEL_LIBM doesn't seem to have any effect anymore? #41470

Closed
carstenbauer opened this issue Jul 5, 2021 · 8 comments
Closed
Labels
building Build system, or building Julia or its dependencies docs This change adds or pertains to documentation

Comments

@carstenbauer
Copy link
Member

Compiling the current master with USE_INTEL_MKL = 1 and USE_INTEL_LIBM = 1 in the Make.user doesn't seem to have any effect for me (on a linux HPC cluster).

Compilation runs through smoothly without any relevant warnings / errors and the produced binary runs just fine as well. However, it is still using libopenlibm and libopenblas64_.so:

julia> versioninfo()
Julia Version 1.8.0-DEV.128
Commit 5faad5fee9* (2021-07-04 21:16 UTC)
Platform Info:
  OS: Linux (x86_64-suse-linux)
  CPU: Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.0 (ORCJIT, skylake-avx512)
julia> using LinearAlgebra; BLAS.get_config()
LinearAlgebra.BLAS.LBTConfig
Libraries:
└ [ILP64] libopenblas64_.so

Any idea what's going on here? Seems like a bug to me.

(I know about MKL.jl but it currently doesn't have an option to use the system-wide MKL installation instead of MKL_jll.jl. Also it doesn't switch out LIBM.)

@ViralBShah
Copy link
Member

ViralBShah commented Jul 5, 2021

I'm pretty sure that with the migration to LBT, we no longer support these options. We have MKL.jl for MKL (where you opened an issue to use your cluster's MKL). For libm, we pretty much are native Julia now, and USE_INTEL_LIBM doesn't do much at all.

If we mention these things in the build docs somewhere, we need to update them.

@ViralBShah ViralBShah added docs This change adds or pertains to documentation building Build system, or building Julia or its dependencies labels Jul 5, 2021
@ViralBShah
Copy link
Member

For people who do want to use other libms (I imagine faster log and exp), some work would be necessary in setting it all up in Base in a more modern way.

@carstenbauer
Copy link
Member Author

Yes, given that we can make MKL.jl use a system-wide MKL I agree that USE_INTEL_MKL is redundant. However, that we seem to have lost the option to use a faster LIBM is a bit unfortunate. When I compared OpenBLAS vs Intel LIBM in 2018 the difference was about a factor of 2 (see https://discourse.julialang.org/t/use-intel-libm-1/16817/2). Of course, I hope that we will just have fast, native Julia implementations but we aren't there yet, are we?

@carstenbauer
Copy link
Member Author

If we mention these things in the build docs somewhere, we need to update them.

Yes, the build docs should certainly be updated.

@DilumAluthge
Copy link
Member

If we mention these things in the build docs somewhere, we need to update them.

Yes, the build docs should certainly be updated.

#41474

@simeonschaub
Copy link
Member

When I compared OpenBLAS vs Intel LIBM in 2018 the difference was about a factor of 2 (see https://discourse.julialang.org/t/use-intel-libm-1/16817/2). Of course, I hope that we will just have fast, native Julia implementations but we aren't there yet, are we?

sinh at least should be all native Julia now: #37426

@carstenbauer
Copy link
Member Author

carstenbauer commented Jul 5, 2021

That's great!

The thing is, though, that

  1. I can't compare the current implementations to Intel LIBM anymore (at least not in Julia).
  2. It seems that the USE_INTEL_LIBM feature has been dropped rather unconsciously / without consideration (please correct me if I'm wrong). So it's unclear to me which LIBM functions are pure Julia and which call into OpenBLAS's LIBM. (And if the latter, I can hardly do anything about it.)

I would have liked a more systematic comparison (w.r.t. feature completeness and speed) of the "Julia LIBM" and e.g. Intel LIBM before dropping USE_INTEL_LIBM. But we are where we are now and I guess that's life 😄

@carstenbauer
Copy link
Member Author

Alright, since we seem to be close to a pure-Julia LIBM [1,2] and for MKL we have MKL.jl - potentially with the option to use an Overrides.toml to use a system-wide installation - I'm going to close this.

[1] https://twitter.com/Viral_B_Shah/status/1367241342670299142

[2]

% grep -r "call.*libm\b" base 
base/math.jl:    ccall((:remainder, libm),Float64,(Float64,Float64),x,y)
base/math.jl:    ccall((:remainderf, libm),Float32,(Float32,Float32),x,y)
base/math.jl:    f = ccall((:modff, libm), Float32, (Float32, Ptr{Float32}), x, temp)
base/math.jl:    f = ccall((:modf, libm), Float64, (Float64, Ptr{Float64}), x, temp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

4 participants