-
Notifications
You must be signed in to change notification settings - Fork 32
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
Building MKL.jl fails in v1.6.0 #60
Comments
I get a similar error with: julia> versioninfo()
Julia Version 1.6.0-beta1
Commit b84990e1ac (2021-01-08 12:42 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) E-2176M CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.0 (ORCJIT, skylake) |
I confirm the same error arises with
(I'm using macos Big Sur 11.1. Before arriving at this error I get a |
Is this in /Applications? I usually always install julia in my home directory - where I suppose I have permissions to write and hence didn't run into this issue. |
The problem is writing inside the .app package. It doesn't matter whether I install it in /Applications or /Users/Shared. I still have to enable write permissions to my user for the files inside the package. EDIT: I believe the issue happens in Big Sur, but I think it didn't happen in Mojave. I certainly did not encounter it until I upgraded. |
Friendly bump |
What if you install the app in your own home directory? Not really an MKL.jl issue, I suppose. |
Nope, same error. I also tried building MKL.jl in a julia build from source, not packagaged into an app. Same issue. |
I just downloaded the julia-1.6.0-rc1 binaries, and MKL.jl still fails to build. The first two lines in the log are:
The rest of the log is the stacktrace for that error. I checked Pkg and everything appears normal
I am not sure why it can't find the package. Everything is in local, non-root directories (and this is my home computer so I do have root access in any case). |
I am encountering the same problem under Linux (Ubuntu 20.10) with v1.6.0-rc1 and with v1.7.0-DEV.593. Could the problem be related to the |
@dmbates 1.7 is going to make this really easy once JuliaLang/julia#39455 is merged. Will no longer need to be built into the system image. We naturally need to fix the issue in 1.6, and perhaps @KristofferC may know what's going on. |
The relevant section in Base._track_dependencies[] = true
# START MKL INSERT
pushfirst!(LOAD_PATH, "@v#.#")
pushfirst!(LOAD_PATH, "@")
MKL = Base.require(Base, :MKL)
MKL.MKL_jll.__init__()
MKL.__init__()
popfirst!(LOAD_PATH)
popfirst!(LOAD_PATH)
# END MKL INSERT
tot_time_stdlib = @elapsed for stdlib in stdlibs
tt = @elapsed Base.require(Base, stdlib)
print_time(stdlib, tt)
end So MKL is going to be loaded before the |
That's great news, @ViralBShah . I look forward to working with it under v1.7 and, I hope, also under v1.6. The reason I am excited about it is I recently bought a laptop that has a 11th gen Intel core processor which supports avx512. In my typical benchmark for the |
Can you try 1.7 master? We were quite behind on openblas versions (due to bugs in openblas), but yesterday, we merged the move to 0.3.13 on 1.7 master. @chriselrod may also be interested in understanding the performance issues and if any of his packages could help. |
Aha! I may have hacked my way to a solution. I am far out of my depth here, but essentially, it just necessary to add Artifacts.jl as a dependency for both PackageCompiler and MKL. Here is what I did.
It seems to have worked since (edit: added steps to |
Similar result as before julia> @benchmark objective(updateL!(setθ!($m6,$θ6)))
BenchmarkTools.Trial:
memory estimate: 1.14 KiB
allocs estimate: 65
--------------
minimum time: 9.411 ms (0.00% GC)
median time: 9.445 ms (0.00% GC)
mean time: 9.503 ms (0.00% GC)
maximum time: 10.808 ms (0.00% GC)
--------------
samples: 526
evals/sample: 1
julia> using LinearAlgebra
julia> BLAS.openblas_get_config()
"OpenBLAS 0.3.13 USE64BITINT DYNAMIC_ARCH NO_AFFINITY Prescott MAX_THREADS=32" I will watch the status of JuliaLang/julia#39455 and try to use MKL once it has been merged. The changes in v1.6 and v1.7, especially with respect to precompilation, are just amazing and I look forward to enjoying them along with MKL. |
What functions do you need? Not much aside from gemm has been implemented, but multithreaded gemm beats multithreaded MKL by a bit on recent Intel <= 100x100 (and by a lot with AMD Ryzen) and is competitive into a few thousand square. And far ahead of everything else in that smallish range. |
@chriselrod Thanks for the pointer to Octavian. The core calculation in the example I mentioned is evaluating a symmetric product of the form |
I have a native multi-threaded LU: https://github.com/ViralBShah/HPL.jl/blob/master/src/hpl_shared.jl It should be straightforward to convert to cholesky (and needs to probably be tested and made robust). All the work done is in small gemm kernels, but needs a few other pieces. Those could just be converted by hand to native Julia with simple implementations to start with. The big one I suppose is the triangular solve. |
I just tested
Still has the same problem as before, the first two lines of the builg.log are
I presume my workaround from before will still work. |
Would the proposition from #60 (comment) be suitable to fix this issue? I am wondering especially because v1.6 has been officially released and MKL.jl still fails to build on several machines. |
I just confirmed that my workaround still works. |
I just confirmed that your workaround @mihalybaci can be cut short by only adding (v1.6) pkg> dev MKL
Cloning git-repo `https://github.com/JuliaLinearAlgebra/MKL.jl.git`
Resolving package versions...
Updating `~/.julia/environments/v1.6/Project.toml`
[33e6dc65] ~ MKL v0.4.0 ⇒ v0.4.0 `~/.julia/dev/MKL`
Updating `~/.julia/environments/v1.6/Manifest.toml`
[33e6dc65] ~ MKL v0.4.0 ⇒ v0.4.0 `~/.julia/dev/MKL`
Building MKL → `~/.julia/dev/MKL/deps/build.log`
(v1.6) pkg> activate MKL
(MKL) pkg> add Pkg, Artifacts
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Updating `~/.julia/dev/MKL/Project.toml`
[44cfe95a] + Pkg
[56f22d72] + Artifacts
No Changes to `~.julia/dev/MKL/Manifest.toml`
julia> Pkg.build("MKL", verbose=true)
Building MKL → `~/.julia/dev/MKL/deps/build.log`
[ Info: Splicing in code to load MKL in ~/julia-1.6.0/bin/../share/julia/base/sysimg.jl
[ Info: getting precompile script from: https://raw.githubusercontent.com/JuliaLang/julia/release-1.6/contrib/generate_precompile.jl
[ Info: PackageCompiler: creating base system image (incremental=false)...
[ Info: PackageCompiler: creating system image object file, this might take a while...
Generating REPL precompile statements... 29/29
Executing precompile statements... 1312/1312
Precompilation complete. Summary:
Total ─────── 138.887458 seconds
Generation ── 106.085874 seconds 76.3826%
Execution ─── 32.801584 seconds 23.6174%
[ Info: PackageCompiler: default sysimg replaced, restart Julia for the new sysimg to be in effect Weirdly, only adding |
@jtschneider - do you use the Julia VS Code extension? Both your version and mine work to set |
I do use VS code with the Julia extension, also on a machine where I just built the sysimage against [ Info: Precompiling VSCodeServer [9f5989ce-84fe-42d4-91ec-6a7a8d53ed0f]
julia> using LinearAlgebra
julia> BLAS.vendor()
:mkl I can open the REPL inside VSCode without any trouble (see above) and the LanguageServer is indexing my Packages in the (new) environment |
I see that MKL now works great in 1.7 through the beautiful BLAS trampoline machinery. Given the kludgy (in comparison) sysimg hijacking approach of MKL.jl in 1.6 and earlier, wouldn't it make sense to restrict MKL.jl to 1.7 and later? Does it make sense to maintain the older approach? |
@mihalybaci I had the same issue with MKL and my VS Code extension is now crashing too, so I'm curious if you finally figured out how to use VS Code + MKL + Julia 1.6... |
I never did figure out a solution. At the moment, I'm not doing anything where the difference between OpenBLAS and MKL really matters, so I haven't really tried. But since @jtschneider says that they're VS Code works, I figured it must be my environment, either within Julia or its packages, or how I've set up my VS code extension, though, as I mentioned in this issue julia-vscode/julia-vscode#1990 I tried a few things and only after removing my |
@pablosanjose, I think it would be unfortunate for MKL.jl to not support Julia v1.6. We tell our users to use MKL.jl to get the best performance for our package, I wouldn't want to tell them that to use MKL they have to build Julia from source or patch MKL.jl themselves. |
@pablosanjose The way this package is set up right now, it will use the new LBT mechanism on Julia 1.7 and newer, and the older mechanism on anything up to 1.6. Of course, currently, this seems broken for 1.6. |
following workaround from @jtschneider, I'm seeing the following error in julia-vscode: julia-vscode/julia-vscode#2124. Any ideas how to troubleshoot?
@mihalybaci did you ever find a workaround..? |
* Add Artifacts as dependency, fixes #60. * correct location for inserting MKL stub Co-authored-by: KristofferC <[email protected]>
I am running into errors building
MKL.jl
in Julia v1.6.0-beta1, and I have confirmed that it builds fine with Julia v1.5.3 ( no errors andBLAS.vendor()
returns:mkl
. The full message error I get is:My
versioninfo()
is:Let me know if there is any other information you need.
The text was updated successfully, but these errors were encountered: