-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Matrix multiplication bug #114
Comments
Yes, the matrix multiplication really has a bug. I have a simpler example to show this: julia> x = ones(10^7, 4);
julia> y = x * ones(4);
julia> y[1:5]
5-element Array{Float64,1}:
8.0
8.0
8.0
8.0
8.0 The correct values of Version info:
|
The threshold for this bug appears to be 4194305: julia> y=ones(4_194_304, 4) *ones(4)
4194304-element Array{Float64,1}:
4.0
4.0
4.0
⋮
4.0
julia> y=ones(4_194_305, 4) *ones(4)
4194305-element Array{Float64,1}:
8.0
4.0
4.0
⋮
4.0 |
Threshold doesn't change for |
The threshold appears to be 2^21 * |
I think this is essentially JuliaLang/julia#5601, which I thought was fixed, but apparently only for some architectures. It must be a joy to maintain a BLAS. I have reopened OpenMathLib/OpenBLAS#340 |
Fails for me but with a different result. I am on a mac with core-i5 Haswell. Until openblas fixes this, we should probably avoid calling BLAS and use the generic Julia implementation. This is certainly a serious bug.
|
This is exactly JuliaLang/julia#5601, which I of course shouldn't have closed before we changed OpenBLAS version even though the issue has been fixed upstream. |
Can we close this issue then? It is fixed in base now, and will be automatically fixed when we update to 0.2.9. |
Ah. You have changed the |
I'm seeing a bug where when the size of a matrix gets big enough, matrix multiplication is incorrect. The issue occurs on a build of cde17b6a5ede76974b4dd16e66371228b8e23308 on OS X with all deps built from scratch and on Arch linux with some* system installed deps and some deps built from scratch.
Strangely, the issue does not occur when I use the julia package provided by pacman on arch, which is based on 3985890, but it does when I build julia from source based on the same commit. So I think this means the bug must be related to the openblas version that is being built.
*My
Make.user
on arch:All of the output below is from julia that I built from source, commit 3985890, on arch.
In the
weird
function below, I'm computing the row sums of ann \times 4
matrix withsum
and by multiplying it by a vector of ones, and returning the maximum difference, which should always be zero. Whenn
is large enough, I get a big deviation which tends to increase withn
. I think it might be linear inn
, but I haven't checked much.I'm pretty sure the issue is with
A_mul_B
and notsum
, because thealso_weird
function below should be approximately constant inn
, but blows up whenn
gets large enough.The text was updated successfully, but these errors were encountered: