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

[1.7.0-b4] segfault on m1 #42176

Closed
mryodo opened this issue Sep 9, 2021 · 9 comments
Closed

[1.7.0-b4] segfault on m1 #42176

mryodo opened this issue Sep 9, 2021 · 9 comments
Labels
linear algebra Linear algebra system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips

Comments

@mryodo
Copy link

mryodo commented Sep 9, 2021

Hi!
Sorry for that if it is my fault, but I'm getting a segfault on the clean install of 1.7.0-b4 on m1 mac with the eig for the simplest matrices. mwe:

julia> using LinearAlgebra;

julia> A=rand(10, 10);

julia> eigen(A)

signal (11): Segmentation fault: 11
in expression starting at REPL[3]:1
.Ldgemm_tcopy_L8_M8_20 at /Applications/Julia-1.7.app/Contents/Resources/julia/lib/julia/libopenblas64_.dylib (unknown line)
Allocations: 1721957 (Pool: 1721200; Big: 757); GC: 2

Version info:

Julia Version 1.7.0-beta4
Commit d0c90f37ba (2021-08-24 12:35 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin20.5.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

have a suspicion that something happened upon the transition from macOS 12b5 to b6.
Sorry if this is a waste of time!

@jeremiahpslewis
Copy link
Contributor

I can confirm that it segfaults on my machine with the same setup.

Julia Version 1.7.0-beta4
Commit d0c90f37ba (2021-08-24 12:35 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin20.5.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

@mryodo
Copy link
Author

mryodo commented Sep 16, 2021

the issue is still preset in v1.7.0-rc1's binary
probably should close in favour of #42184

@mryodo
Copy link
Author

mryodo commented Sep 17, 2021

okay, so #42293 by @jeremiahpslewis (kudos) fixes the build problem with julia on cmake12
unfortunately, OpenBLAS problem is still present even after build; one maybe wants to pull from OpenMathLib/OpenBLAS#3383 (apparently I am not able to figure out how)

@domschl
Copy link

domschl commented Sep 17, 2021

Ideally Julia shouldn't use OpenBLAS on Apple M1. By using Apple's proprietary BLAS implementation (via Accelerate), a speed-up of 2x - 4x can be observed, since Apple's implementation uses their undocumented matrix multiplier hardware.
That will probably not be possible to achieve via OpenBLAS in the foreseeable future...

@jeremiahpslewis
Copy link
Contributor

@domschl This is super interesting, but probably worth opening a new issue on?

@KristofferC
Copy link
Member

Ideally Julia shouldn't use OpenBLAS on Apple M1

Julia can easily change the BLAS used (on 1.7+) see https://github.com/staticfloat/libblastrampoline and https://discourse.julialang.org/t/does-mac-m1-in-multithreads-is-slower-that-in-single-thread/61114/12?u=kristoffer.carlsson

@mryodo
Copy link
Author

mryodo commented Sep 19, 2021

Ideally Julia shouldn't use OpenBLAS on Apple M1

Julia can easily change the BLAS used (on 1.7+) see https://github.com/staticfloat/libblastrampoline and https://discourse.julialang.org/t/does-mac-m1-in-multithreads-is-slower-that-in-single-thread/61114/12?u=kristoffer.carlsson

Thanks, it's quite an interesting discussion...
Although the need for the wrapper for the simple * imply that it would be hard to push this through out all the packages, no?
If so, it seems like some kind of a at least temporary workaround for openblas is still a good idea?

@domschl
Copy link

domschl commented Sep 19, 2021

I made a new issue #42312 for Apple M1 BLAS HW-acceleration discussions as suggested so that the discussion can continue there...

@ViralBShah ViralBShah added linear algebra Linear algebra system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips labels Sep 19, 2021
@mryodo
Copy link
Author

mryodo commented Sep 22, 2021

Okay, let me close this one: the segfault is gone in macos12-beta7 (guess, they did it again, ***) on the latest dev version.

If somebody still has the same problem, feel free to comment here (also, even before temporary workaround through LBT were working sort of fine)

Have a nice day, check the discussion above!

@mryodo mryodo closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips
Projects
None yet
Development

No branches or pull requests

5 participants