JuliaMath / IntelVectorMath.jl

Julia bindings for the Intel Vector Math Library
Other
73 stars 18 forks source link

Adding MKL_jll artifact #39

Closed Crown421 closed 4 years ago

Crown421 commented 4 years ago

This pull request add dependence on the MKL_jll artifact, and changes all references from the libmkl_vml_avx libraries to the libmkl_rt library. This has the advantage that MKL chooses the correct instruction set on runtime, making this package and its precompile cache hardware independent. (Thanks @KristofferC !)

Paradiso.jl currently checks for the existence of a local install of MKL and uses it if one is found. However, given that MKL_jll is now an explicit dependency, it will installed regardless. Given this, it might as well be used. This will be revisited if it becomes useful to enable user choice for a specific version of MKL via a manual external install.

Crown421 commented 4 years ago

This currently fails only on Mac with Julia 1.3, but not with nightly. According to the log IVM actually returns different results. Will try tomorrow or so on my Mac to investigate.

KristofferC commented 4 years ago

Paradiso.jl currently checks for the existence of a local install of MKL and uses it if one is found. This will be revisited if it becomes useful to enable user choice for a specific version of MKL via a manual external install.

In Pardiso.jl I thought about removing that check and just tell people to use Override.toml instead (https://julialang.github.io/Pkg.jl/v1/artifacts/#Overriding-artifact-locations-1).

Crown421 commented 4 years ago

Reading about this I think I agree on the use of the Override.toml.

KristofferC commented 4 years ago

This currently fails only on Mac with Julia 1.3, but not with nightly. According to the log IVM actually returns different results.

Yeah, something is weird, the result changes a lot based on the length of the input vector:

julia> IntelVectorMath.gamma!(copy(INPUT[1:200]))[1:5]
5-element Array{Float64,1}:
     1.5191049997264277e21
     1.3775142112900882e11
     1.1814039832680319
     1.0624313147244564
 15581.002689052646

julia> IntelVectorMath.gamma!(copy(INPUT[1:800]))[1:5]
5-element Array{Float64,1}:
 Inf
 Inf
  0.9233209669728436
  0.9676118954476614
 Inf

I don't understand why it passes on nightly...

KristofferC commented 4 years ago

See https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/700 for some more info about the test failure.

Crown421 commented 4 years ago

I have added a warning the readme, and an __init__ function, that warns if it detects that SpecialFunctions is already loaded.

KristofferC commented 4 years ago

Nice :)

aminya commented 4 years ago

Thank you for the work!