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

At_mul_B and gemv is broken on Travis #3851

Closed
lindahua opened this issue Jul 27, 2013 · 3 comments
Closed

At_mul_B and gemv is broken on Travis #3851

lindahua opened this issue Jul 27, 2013 · 3 comments
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@lindahua
Copy link
Contributor

In these two days, I observe unusual travis failure in several packages, including NumericExtensions and Distributions. The failing part passes tests perfectly in my local machines.

Examining the codes, I found that those parts that suddenly failed recently involve the calling to either At_mul_B or gemv. So I specially created a gemvbug branch on NumericExtensions.jl and added the simple test as follows, and see whether it can pass travis.

using Base.Test

m = 7
n = 8
x = rand(m, n)
a = rand(m)

# a slow but safe function to compute At_mul_B
function my_mul(x::Matrix{Float64}, a::Vector{Float64})
    m = size(x, 1)
    n = size(x, 2)

    r = zeros(n)
    for j = 1:n
        s = 0.
        for i = 1:m
            s += x[i,j] * a[i]
        end
        r[j] = s
    end
    return r
end

function blas_mul(x::Matrix{Float64}, a::Vector{Float64})
    n = size(x, 2)
    r = Array(Float64, n)
    At_mul_B(r, x, a)
    r
end

println("x = $x")
println("a = $a")

r0 = my_mul(x, a)
println("my_mul => $r0")

r1 = blas_mul(x, a)
println("blas_mul => $r1")

@test_approx_eq r0 r1  # this failed tests

The implementation is correct and it passes local testing. But travis failed.
Here is what travis produces:

my_mul => [1.6623387959220757,1.021323256792092,1.3800204235755555,1.9019911669465768,1.4643172831039295,1.9058177790830482,2.1335438803632534,1.6529451897943939]
blas_mul => [1.6623387959220757,0.42876508001595803,1.3800204235755555,1.508452276637747,1.4643172831039297,1.91331093372259,2.1335438803632534,0.9207130848734909]
ERROR: assertion failed: |r0 - r1| <= 7.579870528087629e-11
  r0 = [1.6623387959220757,1.021323256792092,1.3800204235755555,1.9019911669465768,1.4643172831039295,1.9058177790830482,2.1335438803632534,1.6529451897943939]
  r1 = [1.6623387959220757,0.42876508001595803,1.3800204235755555,1.508452276637747,1.4643172831039297,1.91331093372259,2.1335438803632534,0.9207130848734909]
  difference = 0.732232104920903 > 7.579870528087629e-11

Travis page: https://travis-ci.org/lindahua/NumericExtensions.jl (build #19).

Clearly, At_mul_B generates correct results in r1[1], r1[3], ..., and incorrect results in r1[2], r1[4], .... The difference is 0.7322, which is obviously not just because of numerical truncation.

I am not completely sure what is the culprit -- perhaps the openblas installed in Travis?

gemv yields obviously incorrect results is a serious bug that affects a lot of computation, which needs to be fixed soon.

cc: @staticfloat @ViralBShah

@staticfloat
Copy link
Sponsor Member

@lindahua; you are just a little too fast for me! I think I've found an (unsatisfying) solution to this. OpenBLAS just got a bunch of new AMD Piledriver-optimized codes, and Travis uses Piledriver CPUs. These codes seem to have some bugs in them, so I'm currently figuring out the best way to recompile OpenBLAS without using Piledriver codes.

@timholy
Copy link
Sponsor Member

timholy commented Jul 27, 2013

You folks are amazing.

@lindahua
Copy link
Contributor Author

It is working now.

KristofferC pushed a commit that referenced this issue Jul 26, 2024
Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 6b4394914
New commit: e4a6723bf
Julia version: 1.12.0-DEV
Pkg version: 1.12.0
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@6b43949...e4a6723

```
$ git log --oneline 6b4394914..e4a6723bf
e4a6723bf Use `Base.TOML.Parser{Dates}` for TOML parsing w/ Dates support (#3938)
8c1f45d98 Append bundled depots to places where we empty it during tests (#3807)
2fdfabaf5 Test fixes (#3972)
34bb51ece fix bad depot path setting (#3971)
3715685b9 fix suggestions threshold for printing (#3968)
3f81d6c4d feat: add JULIA_PKG_GC_AUTO env var (#3642)
fad26d7f2 check `project_file` isa String (#3967)
8875120ad fix not hardcoding "Project.toml" when fixing up extensions in manifest (#3851)
90d42a1b0 Make manifest usage log errors non-fatal (#3962)
```

Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
lazarusA pushed a commit to lazarusA/julia that referenced this issue Aug 17, 2024
…#55258)

Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 6b4394914
New commit: e4a6723bf
Julia version: 1.12.0-DEV
Pkg version: 1.12.0
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@6b43949...e4a6723

```
$ git log --oneline 6b4394914..e4a6723bf
e4a6723bf Use `Base.TOML.Parser{Dates}` for TOML parsing w/ Dates support (JuliaLang#3938)
8c1f45d98 Append bundled depots to places where we empty it during tests (JuliaLang#3807)
2fdfabaf5 Test fixes (JuliaLang#3972)
34bb51ece fix bad depot path setting (JuliaLang#3971)
3715685b9 fix suggestions threshold for printing (JuliaLang#3968)
3f81d6c4d feat: add JULIA_PKG_GC_AUTO env var (JuliaLang#3642)
fad26d7f2 check `project_file` isa String (JuliaLang#3967)
8875120ad fix not hardcoding "Project.toml" when fixing up extensions in manifest (JuliaLang#3851)
90d42a1b0 Make manifest usage log errors non-fatal (JuliaLang#3962)
```

Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants