Roger-luo / MAGMA.jl

A Julia binding for MAGMA, don't drink it
MIT License
10 stars 2 forks source link

Weird bug happened in testing gesv_rbt #33

Open JerryChen97 opened 5 years ago

JerryChen97 commented 5 years ago

In the recent commit 242586b031c901bb15cc5acdfb97ea943443cd85, the gesv_rbt works well at most time but sometimes will end up with an infinite answer which is apparently wrong. This seems only to happen in the ComplexF32 wrapper right now.


(MAGMA) pkg> test
   Testing MAGMA
 Resolving package versions...
elty = Complex{Float32}: Test Failed at /home/jerry/Documents/MAGMA.jl/test/dense/linearsystemsolver.jl:121
  Expression: A_backup * Matrix(B) ≈ B_backup
   Evaluated: Complex{Float32}[-1.01416e14-4.68972e13im -1.19209e-7-1.19209e-7im; -4.58256e13+4.87894e13im 1.0-5.96046e-8im] ≈ Complex{Float32}[1.0+0.0im 0.0+0.0im; 0.0+0.0im 1.0+0.0im]
Stacktrace:
 [1] top-level scope at /home/jerry/Documents/MAGMA.jl/test/dense/linearsystemsolver.jl:121
 [2] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1156
 [3] top-level scope at /home/jerry/Documents/MAGMA.jl/test/dense/linearsystemsolver.jl:112
 [4] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
 [5] top-level scope at /home/jerry/Documents/MAGMA.jl/test/dense/linearsystemsolver.jl:112
Test Summary:                                   | Pass  Fail  Total
dense linear algebra                            |  139     1    140
  test svd Float32 by gesvd CPU                 |    1            1
  test svd Float32 by gesvd GPU                 |    1            1
  test svd Float64 by gesvd CPU                 |    1            1
  test svd Float64 by gesvd GPU                 |    1            1
  test svd Complex{Float32} by gesvd CPU        |    1            1
  test svd Complex{Float32} by gesvd GPU        |    1            1
  test svd Complex{Float64} by gesvd CPU        |    1            1
  test svd Complex{Float64} by gesvd GPU        |    1            1
  test svd Float32 by gesdd CPU                 |    1            1
  test svd Float32 by gesdd GPU                 |    1            1
  test svd Float64 by gesdd CPU                 |    1            1
  test svd Float64 by gesdd GPU                 |    1            1
  test svd Complex{Float32} by gesdd CPU        |    1            1
  test svd Complex{Float32} by gesdd GPU        |    1            1
  test svd Complex{Float64} by gesdd CPU        |    1            1
  test svd Complex{Float64} by gesdd GPU        |    1            1
  test svd Float32 by gebrd CPU                 |    5            5
  test svd Float32 by gebrd GPU                 |    5            5
  test svd Float64 by gebrd CPU                 |    5            5
  test svd Float64 by gebrd GPU                 |    5            5
  test svd Complex{Float32} by gebrd CPU        |    5            5
  test svd Complex{Float32} by gebrd GPU        |    5            5
  test svd Complex{Float64} by gebrd CPU        |    5            5
  test svd Complex{Float64} by gebrd GPU        |    5            5
  test magma_gels! Float32 by gels CPU          |    3            3
  test magma_gels! Float32 by gels GPU          |    3            3
  test magma_gels! Float64 by gels CPU          |    3            3
  test magma_gels! Float64 by gels GPU          |    3            3
  test magma_gels! Complex{Float32} by gels CPU |    3            3
  test magma_gels! Complex{Float32} by gels GPU |    3            3
  test magma_gels! Complex{Float64} by gels CPU |    3            3
  test magma_gels! Complex{Float64} by gels GPU |    3            3
  test magma_gesv! Float32 by gesv CPU          |    3            3
  test magma_gesv! Float32 by gesv GPU          |    3            3
  test magma_gesv! Float64 by gesv CPU          |    3            3
  test magma_gesv! Float64 by gesv GPU          |    3            3
  test magma_gesv! Complex{Float32} by gesv CPU |    3            3
  test magma_gesv! Complex{Float32} by gesv GPU |    3            3
  test magma_gesv! Complex{Float64} by gesv CPU |    3            3
  test magma_gesv! Complex{Float64} by gesv GPU |    3            3
  getrf/getri                                   |    8            8
  getrs                                         |    8            8
  getrf                                         |   16           16
  gesv_rbt                                      |    3     1      4
    elty = Float32                              |    1            1
    elty = Float64                              |    1            1
    elty = Complex{Float32}                     |          1      1
    elty = Complex{Float64}                     |    1            1
ERROR: LoadError: Some tests did not pass: 139 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /home/jerry/Documents/MAGMA.jl/test/runtests.jl:6
ERROR: Package MAGMA errored during testing
JerryChen97 commented 5 years ago

Reminder: sometimes Z type (Complex64) also shows this bug

Roger-luo commented 5 years ago

Please use markdown code block to quote your error msg.

It seems B_backup is not calculated at all. Is this always happening or occasionally ?

JerryChen97 commented 5 years ago

Please use markdown code block to quote your error msg.

It seems B_backup is not calculated at all. Is this always happening or occasionally ?

Oh B_backup is actually the rhs of the equation, which has already been set as the identity by me for convenience so that the right answer can also be referred by inv(A) directly.

BTW for Float32 and Float64 it works well all the time, while for complex situations bugs occasionally come up.