-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Wrong result for complex matrix multiplication on some Windows systems #117
Comments
I cannot reproduce this on my mac or a Windows server. However, it could architecture specific. What is your |
Hi Andreas, Thanks for the quick answer. I just tried the random matrices program in ubuntu12.10 running in But below I show the result of running the code in julia 3.0 dev (with Can it be related with the compiler used in windows (or with cross compiling?) Best regards Jose
############################################# On 5/29/14, Andreas Noack Jensen [email protected] wrote:
|
Hello again, Sorry, I forgot the systeminfo. It goes attached, with a few personal Yhanks again and best regards. Jose On 5/29/14, Andreas Noack Jensen [email protected] wrote:
|
Thank you for testing it on Ubuntu. I should have written On your Windows machine, could you please try to run |
Hello Andreas, Before I do what you suggest (I can only do that tomorrow at my At home I also have a windows7 machine, running on a AMD A8-3850 APU Just now I've tried the code with the random matrices, and it happens The result of versioninfo() here at my home PC is also shown below. Just to summarize, my home processor has 4 cores, my work processor Finnally, thank you very much again for your interest and effort. Jose julia> versioninfo() julia 0.2.1 at home PC ###### runs ok4 0 0 0 0 4 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im 0.0 + 0.0im On 5/29/14, Andreas Noack Jensen [email protected] wrote:
|
Hello Andreas, More info about my workplace Windows 7 machine. I ran the random-matrix-test with julia021 and julia03-dev after Finally, below are the results of versioninfo() in julia 0.2.1 and Kind Regards Jose ############### | | || | | | (| | | Version 0.2.1 (2014-02-11 06:30 UTC) julia> versioninfo()
/ |__'|||'_| | Commit b57777f* (3 days old master) julia> versioninfo() On 5/29/14, Andreas Noack Jensen [email protected] wrote:
|
@jasax Let's keep the discussion of this issue. (I have updated the name). Are you able to compile fortran programs on your work Windows machine? |
Hi Andreas, I never tried compiling fortran. But I have mingw installed in my win7 In fact I learned programming using Basic and Fortran in a IBM 360 I still am a bit literate in Fortran basics; I think I'll be able to Best regards Jose On 6/1/14, Andreas Noack Jensen [email protected] wrote:
|
Keeping up... Did use gemm() from BLAS and gave exactly the same errors (I think the matrix product in julia recurs to this gemm() function, isn't it?) using Base.LinAlg.BLAS Meanwhile tried to use a vectorized LoopLU using dotu() in the test program with random matrices; DotLU=zeros(Complex{Float64},N,N) and it gives the following error (doesn't find dotu()... but is in julia's manual...): ERROR: dotu not defined The most bizarre thing happened when I replaced in the above loop dotu() (dot product for complex numbers) by dot() (used for float vectors). With dot() the program ends gracefully in the loop without finishing the execution of the remaining code and without throwing any error or exception B-( |
I think where @andreasnoackjensen was going is, can you reproduce the incorrect results just using gemm from a small Fortran example? Then you can report this bug upstream to OpenBLAS's issue tracker. |
Please try to compile the program below. You can do so by saving the program in the file test.f90 in a folder together with a copy of libopenblas.dll from julia\bin and the run the commands
|
Hi, I used this gfortran version (most recent TDM-mingw) $ gfortran --version Here is the result. It seems OK. I used the libopenblas.dll both from If wnat to test more code, please send it. Best regards Jose ########### $ a.exe On 6/3/14, Andreas Noack Jensen [email protected] wrote:
|
Thanks. The right result is |
What output did you get for test.f90? |
Me? I got
|
I've got one from 4-24 here http://sourceforge.net/projects/juliadeps-win/files/openblas-47b22763f8ab0219-x86_64-w64-mingw32.7z/download I can build a newer one, sure, give me half an hour or so |
There has been some changes to OpenBLAS lately, so it would be great if you could make a new one. |
Hello, It seems I didn't guess the correct result. In fact I didn't look with If you think its useful, I can try the fortran code in my home machine Meanwhile, in my quest to get complex algebra working in julia in Below is the test code and result. Shall I post a separate entry in Best Regards Jose ################ N=4 MR = rand(Float64,N,N) SpMR=sparse(MR) F=lufact(SpM) println(F[:L]) ############################# C:\Users...>julia bug4.jl F ERROR: no method umf_extract(UmfpackLU{Complex{Float64},Int64},) ################################ On 6/3/14, Andreas Noack Jensen [email protected] wrote:
|
Alright, took more like an hour to build openblas. @jasax try with this dll http://sourceforge.net/projects/juliadeps-win/files/openblas-0ac073fa9415571d-x86_64-w64-mingw32.7z/download The complex umfpack issue is worth opening a separate issue on. I checked that the same issue occurs as of 0c3de45. Looks like umfpack is capable of handling complex matrices but linalg/umfpack.jl is missing a few methods for them? |
Hi all. The error persists, so it seems... Results below. I'll fill a new issue about umfpack in the dev mailing list. Thank you Andreas and Tony. Jose JAugusto@THOR /c/Users/.../OPenBLAS_Tests $ gfortran test.f90 -L . -lopenblas $ a.exe On 6/3/14, Tony Kelman [email protected] wrote:
|
Don't send the umfpack issue to the mailing list, open a separate issue here on Github. |
@jasax Thank you for the feedback so far. Could you also try this line in Julia?
|
Hi Tony, I already did. Issue JuliaLang/julia#7098. Thanks Jose On 6/3/14, Tony Kelman [email protected] wrote:
|
Issue filed: OpenMathLib/OpenBLAS#380 |
Hi, Image attached. I think the error persists. (0+8im is the result...) Best Jose On 6/3/14, Andreas Noack Jensen [email protected] wrote:
|
Hi again, Run the line in the same machine which has Win7-64bits, but this time Now I have to leave for a few hours... ;-) Best Jose On 6/3/14, Andreas Noack Jensen [email protected] wrote:
|
Just FYI, image attachments to email replies don't come through to Github. You can drag-and-drop images if you use the Github comment interface, or upload the file to somewhere like imgur and include a link in your message. |
I know that Werner ;-) So my surprise when Intel coretypes were successful while others didn't. Best regards Jose
On 7/1/14, wernsaar [email protected] wrote:
|
<ed: snip> Hi, if you have compiled for dynamic arch and you run a program, if the Best regards |
Is it right to say the the short version of this is that @jasax has Piledriver cores, but the tests fails when OpenBLAS' Piledriver kernels are used? Our problem is to figure out which call is actually causing the error because the original problem of this thread is solved, right? I have pushed some debug options to |
On 02.07.2014 13:12, Andreas Noack Jensen wrote:
I think, that it's possible, that the operating system has no full Best regards |
Yep that's how I see it.
Right, the recent fixes to OpenBLAS have solved the vast majority of the problems, there are just a couple stragglers left that it'd be nice to pin down.
👍 thanks those look good
From @jasax's results above, Bulldozer appeared to have the same failure as Piledriver, Barcelona passed. |
Hi, Only tomorrow I'll be near the machine. Here are some answers to First thing, I don't compile from sources (I tried a week ago or so, I recall that Piledriver and Bulldozer had test errors; Barcelona I suppose the new linalg4.jl with debug options will be already Finally, I started this issue a few weeks ago after seeing errors in Regards Jose On 7/2/14, Tony Kelman [email protected] wrote:
|
Hello, Results of linalg4.jl tests with debug=true for Piledriver, Bulldozer Success only with Barcelona. Piledriver and Bulldozer crash in the same place: Bidiagonal matrices, Results below. Please indicate further tests/debugs. Kind Regards Jose ############## Microsoft Windows [Version 6.1.7601] E:\math\Julia-0.3.0-prerelease\share\julia\test>ls E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 julia> quit() E:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Piledriver E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 E:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Bulldozer E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 E:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Barcelona E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 E:\math\Julia-0.3.0-prerelease\share\julia\test> ############## On 7/2/14, Andreas Noack Jensen [email protected] wrote:
|
Please try with |
Hello, With debug=false and println("v1:", v1, "v2:", Results below for no coretype (i.e. dynamic core recognition, which is Only Barcelona passes... Regards Jose ############ e:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 julia> quit() e:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4
-0.32831332 0.002901593 e:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Piledriver e:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4
-0.32831332 0.002901593 e:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Bulldozer e:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4
-0.32831332 0.002901593 e:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Barcelona e:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4
-0.32831332 0.002901593
-0.570325 -0.51456445 0.0 0.0 0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.004931789583317615 0.0 0.9771640868482832 0.7300027229314479 -0.17571968182923173 e:\math\Julia-0.3.0-prerelease\share\julia\test> ############ On 7/3/14, Andreas Noack Jensen [email protected] wrote:
|
I found and fixed a bug in the daxpy kernel under Windows. Only Best regards |
Binary build from Werner's branch posted here http://sourceforge.net/projects/juliadeps-win/files/openblas-13348b21373848f3-x86_64-w64-mingw32.7z @jasax you know the drill, hopefully we're all set now |
Hi Werner, I could not build the sources with mingw a couple weeks ago when I tried. Best Regards Jose On 7/6/14, wernsaar [email protected] wrote:
|
@jasax that's exactly what I did - http://sourceforge.net/projects/juliadeps-win/files/openblas-13348b21373848f3-x86_64-w64-mingw32.7z |
Hi, I now have published the dll for windows at sourceforge as version Best regards On 07.07.2014 05:09, jasax wrote:
|
@wernsaar, I don't run Windows, but just wanted to comment: thanks for the fix! |
Ditto to what @timholy said (except that I use both Windows and Linux), these fixes are much appreciated. For these BLAS/LAPACK tests especially, I think it could make an interesting project to try auto-generating from Julia a C-reproduction of the inputs to tests that fail involving a ccall. Assuming this updated version passes tests on the problematic AMD processor (I went and verified that it doesn't cause any regressions on Windows Haswell or Sandy Bridge either), @wernsaar would you recommend that we apply the fixes across all architectures, or would these latest changes only effect Windows? |
Hi, I think, you can safely apply the fixes to all x86_64 architectures and Best regards On 07.07.2014 13:36, Tony Kelman wrote:
|
Hi all, Sorry, I hadn't read the message when I replied about not having the .dll. OK, to summarize the results below, it seems the issue is solved now. Congratulations to all. Report below, with the output truncated. My messages are enclosed in Best Regards jose ################# | | | | | | |/ ` | | julia> quit() XXXXXXXXX TEST with today's 0.3 dev DLL => Still Gives Error XXXXXXXXX E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 0.0 0.0 0.0 0.0 0.0 0.0 -0.0 0.0 -0.0 0.7573401233330379 XXXXXXX FROM NOW ON I REPLACED 0.3-dev libopenblas.dll XXXXXXXXXXX E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 ............................................................... 5257 0.8493899270733373 0.0 E:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Bulldozer E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4
0.128535142207157 -0.03796500118018003 0.0558528170695982 E:\math\Julia-0.3.0-prerelease\share\julia\test>set OPENBLAS_CORETYPE=Piledriver E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 ................................................................... 5257 0.8493899270733373 0.0 E:\math\Julia-0.3.0-prerelease\share\julia\test> ################# On 7/7/14, Tony Kelman [email protected] wrote:
|
🍻 fantastic, thanks for being such a champ and testing this repeatedly. As soon as there's a v0.2.10.rc2 to bump to, we can close this one (5th most commented issue yet). |
Hi all, My pleasure. I'll try to resume working with and learning :-) Julia in Best Regards, Jose On 7/7/14, Andreas Noack Jensen [email protected] wrote:
|
This is a really amazing bugfix. A big thanks to all who tracked it down and fixed it. |
Julia is now bumped to use openblas v0.2.10.rc2 that has this bugfix. @jasax if you can verify in a couple of days with the nightlies that use this, we can finally close this issue. |
Hi Viral, I'll try in a few hours with this night's build of julia 0.3-dev and report. Best regards Jose On 7/9/14, Viral B. Shah [email protected] wrote:
|
@jasax may as well run the entire test set, if you don't mind. I expect a failure at spawn that looks like |
Hi, Just installed the most recent julia 0.3-dev 64 bits for windows. Test to "linalg4" only has success. Report below. Best Regards Jose
_ _ ()_ | A fresh approach to technical computing julia> quit() E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg4 E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl all On 7/9/14, Tony Kelman [email protected] wrote:
|
Hello, Upgrade results on tests. I retried twice the test to "linalg" and this time it was successfull Since the previous error was an "access violation", can it be the case Regards Jose ############## E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg E:\math\Julia-0.3.0-prerelease\share\julia\test>julia3 runtests.jl linalg E:\math\Julia-0.3.0-prerelease\share\julia\test> ############## On 7/9/14, Tony Kelman [email protected] wrote:
|
Yes, the stack backtrace shows that it failed in the gc mark pass. |
Let's have a new issue for the memory violation. I am closing this one. |
The issue appears in Windows7-64 bit, both in 0.2.1 and 3.0 dev Julia versions. below I send only the log from 0.2.1 which is more readable. It is observed in several circuits (its related with a basic circuit simulator).
I'm implementing a linear AC circuit solver using complex matrices and vectors.
When solving a resistive circuit, all the data and the solution are real. However, in one example I got (surprisingly) a complex solution. That triggered a detailed analysis of the results.
The workflow is:
I want to solve
M*X=b
forX
in complex values.We have a
Complex{Float64}
matrixM=MR+J*W*MI
whereMR
andMI
areFloat64
matrices,J=sqrt(-1)
andW
is a real frequency value.In the example below, however,
MI
is zero and thusM
,X
andb
should all be real.The observed error (or misbehavior) is the following:
I factorize
M
withlu()
such thatL,U,p=lu(M)
Then I calculate, using regular matrix multiplication,
LU=L*U
On the other hand I build a triple loop to calculate the product
L*U
element by element which leads to the LoopLU matrix (code below)...Then, the difference
LU-LoopLU
should be zero, but it is not!!! The elements[1,5]
and[2,5]
are approximately0+0.3im
Difference
LoopLU-L*U
By examinng the log in the end, it is seen that despite
L
andU
being real matrices its product is complex!!! ( elements[1,5]
and[2,5]
again)REMARKS
## RANDOM MATRICES HIGHLIGHTING THE ERROR
###### COMPLETE PROGRAM
## COMPLETE LOG OF CIRCUIT OUTPUT in Julia 0.2.1
circuit has 5 vars
Results from
L,U,p=lu(M)
Difference
LoopLU-L*U
The text was updated successfully, but these errors were encountered: