JuliaLinearAlgebra / libblastrampoline

Using PLT trampolines to provide a BLAS and LAPACK demuxing library.
MIT License
66 stars 17 forks source link

Issues with blis_jll #36

Closed ViralBShah closed 2 years ago

ViralBShah commented 3 years ago

blis_jll now has ILP64 the way we want it. But the library does not have enough symbols. I always believed it had a complete set of BLAS symbols. I haven't yet investigated if the issue is in BLIS, the way it is built, or LBT.

https://github.com/JuliaLinearAlgebra/BLIS.jl/issues/3 https://github.com/JuliaPackaging/Yggdrasil/pull/2666

julia> using LinearAlgebra, blis_jll
julia> BLAS.lbt_forward(blis_jll.blis, clear=true)
33
giordano commented 2 years ago

I believe the issue is that most symbols are prefixed with bli_:

% nm ~/.julia/artifacts/3bd06aa4f9939a35f5cb53773bd177f94ec99078/lib/libblis.so | cut -d' ' -f3 | grep "^bli_" | wc -l
5825
ViralBShah commented 2 years ago

I always thought it was supposed to be a drop in replacement for BLAS and perhaps even LAPACK, or had a compatibility layer for that.

giordano commented 2 years ago

Perhaps @xrq-phys can help?

xrq-phys commented 2 years ago

I once tired relinking to BLIS with the old MKL.jl approach, got LinearAlgebra to work while leaving some warnings.

According to what I know, BLIS ensures level-1/2/3 BLAS routines' interoperability but some auxiliary stuff might not work. Let me check.

xrq-phys commented 2 years ago

https://github.com/JuliaLinearAlgebra/libblastrampoline/blob/72e1f7df6065c9d81469ba0b5b42ddb23920923a/src/autodetection.c#L33

while:

> symbols $HOME/.julia/artifacts/3bf8ed6853e261110c92cfc7fa10d2340f2f2e6a/lib/libblis.4.0.0.dylib | grep isamax_
                0x0000000000107900 (    0xa0) isamax_ [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
> symbols $HOME/.julia/artifacts/3bf8ed6853e261110c92cfc7fa10d2340f2f2e6a/lib/libblis.4.0.0.dylib | grep dgemm_ 
                0x0000000000008e40 (   0xab0) bli_dgemm_armv8a_asm_6x8 [FUNC, PEXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
                0x000000000006c5d0 (   0x480) bli_dgemm_firestorm_ref [FUNC, PEXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
                0x00000000000d98d0 (   0x250) bli_dgemm_ex [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
                0x00000000000e0590 (    0xa0) bli_dgemm_ukernel [FUNC, PEXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
                0x0000000000108bb0 (   0x540) dgemm_64_ [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 
                0x0000000000116e30 (   0x790) dgemm_batch_64_ [FUNC, EXT, NameNList, MangledNameNList, Merged, NList, FunctionStarts] 

The renaming in Yggdrasil seems not enough.