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

OpenBLAS crash when using OPENBLAS_DYNAMIC_ARCH=1 #3369

Closed
ViralBShah opened this issue Jun 12, 2013 · 10 comments
Closed

OpenBLAS crash when using OPENBLAS_DYNAMIC_ARCH=1 #3369

ViralBShah opened this issue Jun 12, 2013 · 10 comments
Labels
building Build system, or building Julia or its dependencies system:mac Affects only macOS upstream The issue is with an upstream dependency, e.g. LLVM

Comments

@ViralBShah
Copy link
Member

When I build julia mac binaries, I set OPENBLAS_DYNAMIC_ARCH=1. I find that running peakflops() leads to this error and subsequent calls lead to a segfault.

julia> peakflops()
ERROR: stack overflow
 in gemm! at linalg/blas.jl:347
 in gemm_wrapper at linalg/matmul.jl:302
 in gemm_wrapper at linalg/matmul.jl:283
 in peakflops at util.jl:47
 in peakflops at no file

This does not happen if one disables multi-threading by using only one OpenBLAS thread. This also does not happen when OPENBLAS_DYNAMIC_ARCH is not being used.

I have filed an upstream issue (OpenMathLib/OpenBLAS#221), but the issue is a bit vague at this point.

@ViralBShah
Copy link
Member Author

Current mac binaries set OPENBLAS_NUM_THREADS=1 before startup as a temporary workaround. See 0e411ad

@ViralBShah
Copy link
Member Author

The openblas tests run fine for me but the basic matrix multiply with multi-threading turned on crashes in julia.

@JeffBezanson Is there a way to make ccall print some debugging information.

@ViralBShah
Copy link
Member Author

Also Cc: @xianyi

@staticfloat
Copy link
Member

A little late to the party, but yes, I can reproduce this using the latest on Homebrew. I'm going through the instructions provided by xianyi in the linked thread, specifically, trying the develop branch and with DEBUG=1 set.

@ViralBShah
Copy link
Member Author

@staticfloat Were you able to debug this further?

Do you think we should build two mac nightlies for now - one with openblas and one with Apple BLAS? Apple BLAS does work multi-threaded, but I have to try out how well it does with small problems and such.

@staticfloat
Copy link
Member

No, I wasn't. I got bogged down because of the inability of gcc's assembler to use AVX codes, (finally figured out that you need to use clang, but then I got sidetracked by other projects).

I can definitely build an Accelerate OSX binary as well..... but when you do this testing, could you post the .jl files you used to do the testing so I can put them into codespeed? That's exactly the kind of thing that I think it'd be fun to keep track of.

@ViralBShah
Copy link
Member Author

It may be time to write a BLAS performance test (#3566).

@ViralBShah
Copy link
Member Author

This is fixed by using 128 instead of 256 max threads in 1767dd9

@ViralBShah
Copy link
Member Author

Upstream issue remains filed - but julia related issue is addressed for now.

@staticfloat
Copy link
Member

Thanks for all this work, @ViralBShah!

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 system:mac Affects only macOS upstream The issue is with an upstream dependency, e.g. LLVM
Projects
None yet
Development

No branches or pull requests

2 participants