Giter Site home page Giter Site logo

netlib's Introduction

Gonum

Build status Build status codecov.io go.dev reference GoDoc Go Report Card stability-unstable

Installation

The core packages of the Gonum suite are written in pure Go with some assembly. Installation is done using go get.

go get -u gonum.org/v1/gonum/...

Supported Go versions

Gonum supports and tests using the gc compiler on the two most recent Go releases on Linux (386, amd64 and arm64), macOS and Windows (both on amd64).

Note that floating point behavior may differ between compiler versions and between architectures due to differences in floating point operation implementations.

Release schedule

The Gonum modules are released on a six-month release schedule, aligned with the Go releases. i.e.: when Go-1.x is released, Gonum-v0.n.0 is released around the same time. Six months after, Go-1.x+1 is released, and Gonum-v0.n+1.0 as well.

The release schedule, based on the current Go release schedule is thus:

  • Gonum-v0.n.0: February
  • Gonum-v0.n+1.0: August

Build tags

The Gonum packages use a variety of build tags to set non-standard build conditions. Building Gonum applications will work without knowing how to use these tags, but they can be used during testing and to control the use of assembly and CGO code.

The current list of non-internal tags is as follows:

  • safe — do not use assembly or unsafe
  • bounds — use bounds checks even in internal calls
  • noasm — do not use assembly implementations
  • tomita — use Tomita, Tanaka, Takahashi pivot choice for maximimal clique calculation, otherwise use random pivot (only in topo package)

Issues TODOs

If you find any bugs, feel free to file an issue on the github issue tracker. Discussions on API changes, added features, code review, or similar requests are preferred on the gonum-dev Google Group.

https://groups.google.com/forum/#!forum/gonum-dev

License

Original code is licensed under the Gonum License found in the LICENSE file. Portions of the code are subject to the additional licenses found in THIRD_PARTY_LICENSES. All third party code is licensed either under a BSD or MIT license.

Code in graph/formats/dot is dual licensed Public Domain Dedication and Gonum License, and users are free to choose the license which suits their needs for this code.

The W3C test suites in graph/formats/rdf are distributed under both the W3C Test Suite License and the W3C 3-clause BSD License.

netlib's People

Contributors

btracey avatar fhs avatar jonlawlor avatar kortschak avatar kunde21 avatar pontusmelke avatar sbinet avatar shawnps avatar vladimir-ch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netlib's Issues

Unable to get the package

What did you do?

go get gonum.org/v1/[email protected]

What did you expect to happen?

Package should be grepped.

What actually happened?

	gonum.org/v1/[email protected] requires
7
	modernc.org/[email protected]: reading modernc.org/cc/go.mod at revision v1.0.0: unknown revision v1.0.0
8
##[error]Process completed with exit code 1.

Does this issue reproduce with the current master?

Yes

blas,lapack: is it possible to specify single threaded C backend

What are you trying to do?

Inverse matrix calculation, using the gonum package.

What did you do?

Benchmark gonum performance with go-backend, and with netlib, using openBLAS.

package main

import (
	"fmt"
	"time"

	"gonum.org/v1/gonum/mat"
)

const (
	size       = 600
	iterations = 1000
)

func main() {
	matrix := mat.NewDense(size, size, nil)
	for i := 0; i < size; i++ {
		matrix.Set(i, i, 1)
	}

	start := time.Now()
	inverse := mat.NewDense(size, size, nil)

	for i := 0; i < iterations; i++ {
		err := inverse.Inverse(matrix)
		if err != nil {
			panic(err)
		}
	}
	fmt.Printf(
		"matrix (%dx%d) inverted %d times for %s (%f for 1s)",
		size, size, iterations, time.Since(start).String(), float64(iterations)/time.Since(start).Seconds(),
	)
}

vs

package main

import (
	"fmt"
	"time"

	"gonum.org/v1/gonum/blas/blas64"
	"gonum.org/v1/gonum/lapack/lapack64"
	"gonum.org/v1/gonum/mat"
	blas64NetLib "gonum.org/v1/netlib/blas/netlib"
	"gonum.org/v1/netlib/lapack/netlib"
)

const (
	size       = 600
	iterations = 1000
)

func main() {
	lapack64.Use(netlib.Implementation{})
	blas64.Use(blas64NetLib.Implementation{})

	matrix := mat.NewDense(size, size, nil)
	for i := 0; i < size; i++ {
		matrix.Set(i, i, 1)
	}

	start := time.Now()
	inverse := mat.NewDense(size, size, nil)

	for i := 0; i < iterations; i++ {
		err := inverse.Inverse(matrix)
		if err != nil {
			panic(err)
		}
	}
	fmt.Printf(
		"matrix (%dx%d) inverted %d times for %s (%f for 1s)",
		size, size, iterations, time.Since(start).String(), float64(iterations)/time.Since(start).Seconds(),
	)
}

What did you expect to happen?

Code, using c-backend is faster.

What actually happened?

go-backend matrix (600x600) inverted 1000 times for 19.108314289s (52.333232 for 1s)
c-backend  matrix (600x600) inverted 1000 times for 14.807496174s (67.533349 for 1s)

Code, that uses netlib is actually faster, but the native go code uses only one core, and code, using openBLAS uses all 8 cores.
The next benchmark was done, using all 8 cores with go code:

package main

import (
	"fmt"
	"runtime"
	"sync"
	"sync/atomic"
	"time"

	"gonum.org/v1/gonum/mat"
)

const (
	size       = 600
	iterations = 1000
)

func main() {
	matrix := mat.NewDense(size, size, nil)
	for i := 0; i < size; i++ {
		matrix.Set(i, i, 1)
	}

	var done int32
	start := time.Now()
	var wg sync.WaitGroup
	for c := 0; c < runtime.NumCPU(); c++ {
		wg.Add(1)
		go func() {
			defer wg.Done()
			inverse := mat.NewDense(size, size, nil)

			for i := 0; i < iterations; i++ {
				err := inverse.Inverse(matrix)
				if err != nil {
					panic(err)
				}
			}
			atomic.AddInt32(&done, iterations)
		}()
	}
	wg.Wait()
	fmt.Printf(
		"matrix (%dx%d) inverted %d times for %s (%f for 1s)",
		size, size, done, time.Since(start).String(), float64(done)/time.Since(start).Seconds(),
	)
}
go-backend, 8 routines matrix (600x600) inverted 8000 times for 20.541248958s (389.460197 for 1s)

Go backend, using 8 routines, is ~8 times faster, as expected.
But adding

	lapack64.Use(netlib.Implementation{})
	blas64.Use(blas64NetLib.Implementation{})

makes code much-much slower due to context switching.

c-backend, 8 routines matrix (600x600) inverted 80 times for 1m18.213372478s (1.022843 for 1s)

Is it possible to use OpenBLAS, without concurrency inside the C-code, to prevent useless context switching?

What version of Go, Gonum, Gonum/netlib and C implementation are you using?

go version go1.15.2 linux/amd64
Gonum - eea0b5cb5cc92420e0be3a49bbdaeb8aa32d309b
Gonum/netlib - 2390d26
OpenBLAS - ff16329cb780396521e14de7e2ebd673fbab674a

Does this issue reproduce with the current master?

yes

Installation failure

Trying to install the netlib packages following the instructions shown in the README file gives this errors, just as I go get gonum.org/v1/netlib/...

Is there anything else needed to make this work?

blas/netlib: crash during Dgemv test

Filed in case someone has an idea - this is from travis.

=== RUN   TestDgemv
SIGILL: illegal instruction
PC=0x7fc17ae571e2 m=0 sigcode=2
signal arrived during cgo execution

goroutine 18 [syscall, locked to thread]:
runtime.cgocall(0x550990, 0xc420045830, 0x18)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/runtime/cgocall.go:132 +0xe4 fp=0xc4200457c8 sp=0xc420045788 pc=0x407914
gonum.org/v1/netlib/blas/netlib._Cfunc_cblas_dgemv(0x7000000065, 0x500000003, 0x4020000000000000, 0xc42001d480, 0x5, 0xc42009a060, 0xc400000001, 0xc018000000000000, 0xc420019ad0, 0x1)
	gonum.org/v1/netlib/blas/netlib/_test/_obj_test/_cgo_gotypes.go:877 +0x45 fp=0xc420045830 sp=0xc4200457c8 pc=0x544dd5
gonum.org/v1/netlib/blas/netlib.Implementation.Dgemv(0x70, 0x3, 0x5, 0x4020000000000000, 0xc42001d480, 0xf, 0xf, 0x5, 0xc42009a060, 0x3, ...)
	/home/travis/gopath/src/gonum.org/v1/netlib/blas/netlib/blas.go:1789 +0x1b7 fp=0xc420045890 sp=0xc420045830 pc=0x549e97
gonum.org/v1/netlib/blas/netlib.(*Implementation).Dgemv(0x8c2cd8, 0x70, 0x3, 0x5, 0x4020000000000000, 0xc42001d480, 0xf, 0xf, 0x5, 0xc42009a060, ...)
	<autogenerated>:1 +0x135 fp=0xc420045928 sp=0xc420045890 pc=0x54e215
gonum.org/v1/gonum/blas/testblas.dgemvcomp.func1()
	/home/travis/gopath/src/gonum.org/v1/gonum/blas/testblas/dgemv.go:611 +0x13a fp=0xc4200459e8 sp=0xc420045928 pc=0x52d1da
gonum.org/v1/gonum/blas/testblas.panics(0xc420045bf8, 0x0)
	/home/travis/gopath/src/gonum.org/v1/gonum/blas/testblas/common.go:98 +0x52 fp=0xc420045a10 sp=0xc4200459e8 pc=0x4f6dc2
gonum.org/v1/gonum/blas/testblas.dgemvcomp(0xc42008ec30, 0x5ab730, 0x11, 0x3, 0x5, 0x883000, 0x3, 0x3, 0x70, 0x88d120, ...)
	/home/travis/gopath/src/gonum.org/v1/gonum/blas/testblas/dgemv.go:613 +0x341 fp=0xc420045cb8 sp=0xc420045a10 pc=0x4fab51
gonum.org/v1/gonum/blas/testblas.DgemvTest(0xc42008ec30, 0x88e9c0, 0x8c2cd8)
	/home/travis/gopath/src/gonum.org/v1/gonum/blas/testblas/dgemv.go:585 +0x13f fp=0xc420045f80 sp=0xc420045cb8 pc=0x4fa66f
gonum.org/v1/netlib/blas/netlib.TestDgemv(0xc42008ec30)
	/home/travis/gopath/src/gonum.org/v1/netlib/blas/netlib/level2double_test.go:14 +0x43 fp=0xc420045fa8 sp=0xc420045f80 pc=0x543933
testing.tRunner(0xc42008ec30, 0x5b4808)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:746 +0xd0 fp=0xc420045fd0 sp=0xc420045fa8 pc=0x4b8fb0
runtime.goexit()
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420045fd8 sp=0xc420045fd0 pc=0x45c601
created by testing.(*T).Run
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:789 +0x2de

goroutine 1 [chan receive]:
testing.(*T).Run(0xc42008e000, 0x5a9c65, 0x9, 0x5b4808, 0x46e301)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:790 +0x2fc
testing.runTests.func1(0xc42008e000)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:1004 +0x64
testing.tRunner(0xc42008e000, 0xc420057de0)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:746 +0xd0
testing.runTests(0xc42000c100, 0x8867a0, 0x23, 0x23, 0x0)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:1002 +0x2d8
testing.(*M).Run(0xc420057f18, 0xc420057f70)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/testing/testing.go:921 +0x111
main.main()
	gonum.org/v1/netlib/blas/netlib/_test/_testmain.go:514 +0xdb

rax    0x4
rbx    0x8
rcx    0xc420019ad0
rdx    0xc42009a060
rdi    0x0
rsi    0xc42001d4a8
rbp    0x4
rsp    0x7ffe23db8308
r8     0x7ffe23db83d8
r9     0xc42001d480
r10    0x7ffe23db84a0
r11    0x3
r12    0xc42001d480
r13    0xc42009a070
r14    0x5
r15    0xa0
rip    0x7fc17ae571e2
rflags 0x10246
cs     0x33
fs     0x0
gs     0x0
FAIL	gonum.org/v1/netlib/blas/netlib	0.010s

lapack/netlib: segfault in TestDgetrs

What are you trying to do?

Test repository.

What did you do?

In the root of the repo, run CGO_LDFLAGS="-L/usr/local/lib -lopenblas" go test -run TestDgetrs ./lapack/netlib.

What did you expect to happen?

Successful test.

What actually happened?

$ CGO_LDFLAGS="-L/usr/local/lib -lopenblas" go test -run TestDgetrs ./lapack/netlib
signal: segmentation fault (core dumped)
FAIL	gonum.org/v1/netlib/lapack/netlib	0.138s
FAIL

What version of Go, Gonum, Gonum/netlib and C implementation are you using?

gonum/gonum v0.9.0 (gonum/gonum@14aa307).
gonum/netlib ede9441

Does this issue reproduce with the current master?

Yes.

lapack/netlib/lapack.go: Missing implementation of method Dlampr

When trying to install the netlib package i get this error : # gonum.org/v1/netlib/lapack/netlib
../../../go/pkg/mod/gonum.org/v1/[email protected]/lapack/netlib/lapack.go:19:24: cannot use Implementation{} (value of type Implementation) as lapack.Float64 value in variable declaration: Implementation does not implement lapack.Float64 (missing method Dlapmr)
-the error seems to come from the gonum version required by netlib (v0.8.1-0.20200930085651-eea0b5cb5cc9) since the method Dlampr was added after v 0.11.0 , so it's fixed by holding the gonum to v0.11.0 or above

lapack/lapacke: go generate fails on macOS

... with the following error:

/usr/include/i386/_types.h:98:27: unexpected identifier __darwin_va_list, expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:31:43: unexpected '<', expected optional argument expression list or one of ['!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:186:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:187:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:188:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:189:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:190:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:191:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:219:10: cannot redefine macro using a different replacement list
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include/stdint.h:220:10: cannot redefine macro using a different replacement list
2017/11/24 17:31:03 too many errors
exit status 1
lapack/lapacke/generate.go:5: running "go": exit status 1

lapack/netlib: Dgelqf panics testlapack.DgelqfTest for medium work case

What are you trying to do?

Run netlib lapack tests as part of #51.

What did you do?

go test -run Dgelqf

What did you expect to happen?

Successful test.

What actually happened?

$ CGO_LDFLAGS="-L/usr/local -lopenblas" go test -run Dgelqf
--- FAIL: TestDgelqf (0.01s)
panic: runtime error: makeslice: len out of range [recovered]
	panic: runtime error: makeslice: len out of range

goroutine 19 [running]:
testing.tRunner.func1(0xc0000e4100)
	.../go/src/testing/testing.go:830 +0x388
panic(0x5f61a0, 0x6773f0)
	.../go/src/runtime/panic.go:522 +0x1b5
gonum.org/v1/gonum/lapack/testlapack.DgelqfTest(0xc0000e4100, 0x67a900, 0xa01f10)
	.../src/gonum.org/v1/gonum/lapack/testlapack/dgelqf.go:91 +0x3c0
gonum.org/v1/netlib/lapack/netlib.TestDgelqf(0xc0000e4100)
	.../src/gonum.org/v1/netlib/lapack/netlib/lapack_test.go:152 +0x43
testing.tRunner(0xc0000e4100, 0x633658)
	.../go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
	.../go/src/testing/testing.go:916 +0x357
exit status 2
FAIL	gonum.org/v1/netlib/lapack/netlib	0.018s

What version of Go, Gonum, Gonum/netlib and C implementation are you using?

gonum: 70a1e933af10e87000d2ccabdd509b87d8626153
netlib: b131843
OpenBLAS: 9e4d190f4f25c6e2e2a1ea1ed849c5b79513f9b7

Does this issue reproduce with the current master?

Yes.

Additional information

The failure happens when m is 10 for the medium work case; the lwork query call returns 10, so the lwork calculation, int(work[0]) - 2*m, gives -10 resulting the illegal makeslice length.

lapack/lapacke: change BLAS-related types to byte

In #38 we changed LAPACK-related types to byte because

  • the code generation cannot decide to what type it is should map a comp or job parameter based solely on its name and any other scheme is not practical
  • lapacke is a very low-level package and we don't have to or even should not provide any support in form of types and constants from the lapack package.

I think we should do the same for BLAS-related types and constants like blas.Side, blas.Transpose, blas.Uplo. The first point does not apply here but the second point is strong enough to justify the change of these types to byte.

blas: zero size matrix causes panic for Dgemv

When the netlib CGO BLAS implementation is used gonum/matrix/mat64 TestInverse fails with an index out of range.

This suggests that the indexing used by the native LAPACK implementation is not properly conditioned/vetted by the cgo wrapping code for blas; the stack trace shows this happening for n == 0

This presumably is a problem throughout.

CGO BLAS and native LAPACK.

$ cat $GOPATH/src/gonum.org/v1/gonum/matrix/mat64/cblas_test.go
// Copyright ©2015 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//+build cblas

package mat64

import (
	"gonum.org/v1/gonum/blas/blas64"
	"gonum.org/v1/netlib/blas"
)

func init() {
	blas64.Use(blas.Implementation{})
}
$ CGO_LDFLAGS="-L/usr/local -lopenblas" go test -tags cblas -run TestInverse gonum.org/v1/gonum/matrix/mat64
--- FAIL: TestInverse (0.00s)
panic: runtime error: index out of range [recovered]
	panic: runtime error: index out of range

goroutine 6 [running]:
testing.tRunner.func1(0xc4200771e0)
	/home/daniel/go/src/testing/testing.go:622 +0x29d
panic(0x684e80, 0x9be090)
	/home/daniel/go/src/runtime/panic.go:489 +0x2cf
gonum.org/v1/netlib/blas.Implementation.Dgemv(0x6f, 0x3, 0x0, 0xbff0000000000000, 0xc420019288, 0x6, 0x6, 0x3, 0xc42001a600, 0x0, ...)
	/home/daniel/src/gonum.org/v1/netlib/blas/blas.go:1418 +0x1e9
gonum.org/v1/netlib/blas.(*Implementation).Dgemv(0x9f9268, 0x6f, 0x3, 0x0, 0xbff0000000000000, 0xc420019288, 0x6, 0x6, 0x3, 0xc42001a600, ...)
	<autogenerated>:55 +0x141
gonum.org/v1/gonum/lapack/native.Implementation.Dgetri(0x3, 0xc420019270, 0x9, 0x9, 0x3, 0xc42000cfc0, 0x3, 0x3, 0xc42001a600, 0xc0, ...)
	/home/daniel/src/gonum.org/v1/gonum/lapack/native/dgetri.go:66 +0x54f
gonum.org/v1/gonum/lapack/native.(*Implementation).Dgetri(0x9f9040, 0x3, 0xc420019270, 0x9, 0x9, 0x3, 0xc42000cfc0, 0x3, 0x3, 0xc42001a600, ...)
	<autogenerated>:22 +0xe5
gonum.org/v1/gonum/lapack/lapack64.Getri(0x3, 0x3, 0x3, 0xc420019270, 0x9, 0x9, 0xc42000cfc0, 0x3, 0x3, 0xc42001a600, ...)
	/home/daniel/src/gonum.org/v1/gonum/lapack/lapack64/lapack64.go:229 +0xd5
gonum.org/v1/gonum/matrix/mat64.(*Dense).Inverse(0xc4200e0540, 0x9cb560, 0xc4200e0000, 0x40, 0x40)
	/home/daniel/src/gonum.org/v1/gonum/matrix/mat64/dense_arithmetic.go:245 +0x32f
gonum.org/v1/gonum/matrix/mat64.TestInverse(0xc4200771e0)
	/home/daniel/src/gonum.org/v1/gonum/matrix/mat64/dense_test.go:1813 +0xdc0
testing.tRunner(0xc4200771e0, 0x6c9c90)
	/home/daniel/go/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
	/home/daniel/go/src/testing/testing.go:697 +0x2ca
FAIL	gonum.org/v1/gonum/matrix/mat64	0.013s

The approach used in the lapacke CGO wrapping code is to conditionally take addresses. Alternatively, we can return early for n == 0 or m == 0. I think I prefer the lapacke approach since it is obviously correct for all sets of parameters.

lapack/netlib: Dlantr test suddenly fails on master

Recently Dlantr test started to fail again on master:

    dlantr.go:137: norm=I,uplo=U,diag=N,m=2,n=5,lda=5: unexpected result; got 2.435339754899317, want 3.4353397548993168
    dlantr.go:137: norm=I,uplo=U,diag=N,m=2,n=10,lda=10: unexpected result; got 6.8962476950598015, want 7.896247695059803
    dlantr.go:137: norm=I,uplo=U,diag=N,m=3,n=5,lda=5: unexpected result; got 1.9631817230235244, want 2.8302732144124496
    dlantr.go:137: norm=I,uplo=U,diag=N,m=3,n=10,lda=10: unexpected result; got 5.167011030416932, want 6.1670110304169325
    dlantr.go:137: norm=I,uplo=U,diag=N,m=4,n=5,lda=5: unexpected result; got 2.1200546627902757, want 3.0503567512831555
    dlantr.go:137: norm=I,uplo=U,diag=N,m=4,n=10,lda=10: unexpected result; got 7.514745198287458, want 8.514745198287459

All failing cases are: inf norm, upper triangular matrix with non-unit diagonal, m < n, n=5 or 10, and lda=n. However, not all test cases which fit these conditions fail. As is usual, I cannot reproduce it locally.

lapack/netlib: Dgesvd fails sporadically on travis

What are you trying to do?

Run tests on travis

What did you do?

This is sporadic, so just run tests.

What did you expect to happen?

Tests pass.

What actually happened?

=== RUN   TestDgesvd
--- FAIL: TestDgesvd (22.21s)
	dgesvd.go:280: Case m=300,n=150,work=minimum,mtype=5,job=NoneU-NoneVT: singular values differ between full and partial SVD
		[9.979201547673596e+291 9.912673537355772e+291 9.846145527037948e+291 9.779617516720131e+291 9.713089506402294e+291 9.646561496084475e+291 9.58003348576665e+291 9.513505475448824e+291 9.446977465131015e+291 9.380449454813184e+291 9.313921444495359e+291 9.247393434177529e+291 9.180865423859704e+291 9.114337413541888e+291 9.047809403224055e+291 8.981281392906233e+291 8.914753382588414e+291 8.848225372270582e+291 8.78169736195276e+291 8.715169351634937e+291 8.648641341317112e+291 8.582113330999292e+291 8.515585320681462e+291 8.449057310363651e+291 8.38252930004582e+291 8.316001289727993e+291 8.249473279410173e+291 8.182945269092347e+291 8.116417258774523e+291 8.049889248456703e+291 7.983361238138882e+291 7.916833227821053e+291 7.850305217503229e+291 7.783777207185413e+291 7.717249196867579e+291 7.650721186549755e+291 7.584193176231936e+291 7.517665165914115e+291 7.451137155596282e+291 7.384609145278459e+291 7.31808113496064e+291 7.251553124642813e+291 7.18502511432499e+291 7.118497104007166e+291 7.051969093689343e+291 6.985441083371521e+291 6.918913073053692e+291 6.852385062735869e+291 6.785857052418048e+291 6.719329042100225e+291 6.652801031782399e+291 6.586273021464578e+291 6.51974501114675e+291 6.45321700082893e+291 6.3866889905111e+291 6.320160980193282e+291 6.25363296987546e+291 6.187104959557632e+291 6.120576949239806e+291 6.054048938921988e+291 5.987520928604158e+291 5.920992918286338e+291 5.854464907968514e+291 5.787936897650688e+291 5.721408887332862e+291 5.654880877015039e+291 5.58835286669722e+291 5.521824856379398e+291 5.455296846061568e+291 5.388768835743747e+291 5.322240825425919e+291 5.255712815108098e+291 5.189184804790275e+291 5.122656794472448e+291 5.056128784154621e+291 4.9896007738368e+291 4.923072763518977e+291 4.8565447532011496e+291 4.7900167428833285e+291 4.7234887325655013e+291 4.6569607222476785e+291 4.5904327119298547e+291 4.5239047016120347e+291 4.457376691294204e+291 4.3908486809763825e+291 4.3243206706585586e+291 4.257792660340736e+291 4.19126465002291e+291 4.1247366397050876e+291 4.058208629387263e+291 3.9916806190694426e+291 3.925152608751615e+291 3.85862459843379e+291 3.792096588115969e+291 3.7255685777981444e+291 3.659040567480318e+291 3.592512557162495e+291 3.525984546844669e+291 3.4594565365268483e+291 3.392928526209022e+291 3.326400515891201e+291 3.259872505573379e+291 3.193344495255551e+291 3.126816484937728e+291 3.0602884746199035e+291 2.99376046430208e+291 2.9272324539842563e+291 2.8607044436664324e+291 2.794176433348609e+291 2.727648423030785e+291 2.6611204127129597e+291 2.5945924023951364e+291 2.528064392077313e+291 2.4615363817594898e+291 2.395008371441664e+291 2.3284803611238404e+291 2.261952350806016e+291 2.195424340488192e+291 2.1288963301703688e+291 2.0623683198525446e+291 1.9958403095347208e+291 1.9293122992168955e+291 1.8627842888990716e+291 1.7962562785812486e+291 1.7297282682634242e+291 1.6632002579456e+291 1.5966722476277756e+291 1.5301442373099517e+291 1.4636162269921276e+291 1.397088216674304e+291 1.330560206356479e+291 1.2640321960386543e+291 1.1975041857208318e+291 1.130976175403008e+291 1.064448165085184e+291 9.979201547673598e+290 9.313921444495358e+290 8.648641341317117e+290 7.983361238138882e+290 7.318081134960634e+290 6.652801031782398e+290 5.98752092860416e+290 5.322240825425917e+290 4.656960722247682e+290 3.991680619069446e+290 3.326400515891196e+290 2.6611204127129575e+290 1.9958403095347247e+290 1.330560206356472e+290 6.652801031782416e+289]
		[9.979201547673592e+291 9.912673537355789e+291 9.846145527037951e+291 9.779617516720115e+291 9.713089506402288e+291 9.646561496084495e+291 9.580033485766665e+291 9.513505475448798e+291 9.446977465130997e+291 9.380449454813188e+291 9.313921444495348e+291 9.247393434177519e+291 9.180865423859719e+291 9.114337413541878e+291 9.047809403224083e+291 8.981281392906244e+291 8.914753382588416e+291 8.8482253722706e+291 8.781697361952769e+291 8.715169351634926e+291 8.648641341317105e+291 8.582113330999301e+291 8.515585320681462e+291 8.449057310363647e+291 8.382529300045821e+291 8.316001289728003e+291 8.249473279410178e+291 8.182945269092372e+291 8.116417258774521e+291 8.049889248456695e+291 7.983361238138865e+291 7.916833227821076e+291 7.850305217503233e+291 7.783777207185418e+291 7.717249196867592e+291 7.650721186549764e+291 7.584193176231934e+291 7.51766516591411e+291 7.451137155596281e+291 7.384609145278462e+291 7.318081134960634e+291 7.25155312464282e+291 7.185025114324988e+291 7.118497104007171e+291 7.051969093689353e+291 6.985441083371527e+291 6.918913073053709e+291 6.85238506273588e+291 6.785857052418045e+291 6.719329042100219e+291 6.6528010317824e+291 6.586273021464575e+291 6.519745011146751e+291 6.453217000828928e+291 6.386688990511104e+291 6.3201609801933e+291 6.25363296987546e+291 6.187104959557637e+291 6.1205769492398e+291 6.054048938921985e+291 5.987520928604175e+291 5.920992918286336e+291 5.854464907968505e+291 5.787936897650686e+291 5.721408887332857e+291 5.654880877015043e+291 5.588352866697216e+291 5.521824856379395e+291 5.455296846061567e+291 5.388768835743743e+291 5.322240825425919e+291 5.255712815108099e+291 5.189184804790271e+291 5.122656794472444e+291 5.05612878415462e+291 4.989600773836802e+291 4.9230727635189707e+291 4.8565447532011496e+291 4.790016742883332e+291 4.7234887325655e+291 4.656960722247673e+291 4.590432711929848e+291 4.5239047016120347e+291 4.457376691294208e+291 4.3908486809763764e+291 4.32432067065856e+291 4.257792660340731e+291 4.191264650022911e+291 4.1247366397050876e+291 4.058208629387262e+291 3.9916806190694393e+291 3.9251526087516115e+291 3.858624598433784e+291 3.792096588115969e+291 3.7255685777981455e+291 3.6590405674803183e+291 3.5925125571624966e+291 3.525984546844667e+291 3.459456536526841e+291 3.3929285262090206e+291 3.3264005158911973e+291 3.2598725055733734e+291 3.1933444952555457e+291 3.12681648493773e+291 3.0602884746199007e+291 2.99376046430208e+291 2.927232453984253e+291 2.8607044436664335e+291 2.7941764333486097e+291 2.727648423030785e+291 2.6611204127129614e+291 2.594592402395137e+291 2.5280643920773136e+291 2.461536381759483e+291 2.3950083714416623e+291 2.3284803611238384e+291 2.2619523508060112e+291 2.1954243404881896e+291 2.128896330170368e+291 2.062368319852541e+291 1.9958403095347208e+291 1.9293122992168974e+291 1.8627842888990725e+291 1.7962562785812453e+291 1.7297282682634225e+291 1.6632002579455984e+291 1.596672247627775e+291 1.5301442373099515e+291 1.463616226992128e+291 1.3970882166743046e+291 1.330560206356478e+291 1.2640321960386552e+291 1.1975041857208321e+291 1.1309761754030083e+291 1.0644481650851831e+291 9.979201547673584e+290 9.313921444495355e+290 8.648641341317111e+290 7.983361238138878e+290 7.318081134960634e+290 6.652801031782395e+290 5.9875209286041606e+290 5.322240825425924e+290 4.6569607222476846e+290 3.9916806190694446e+290 3.3264005158911934e+290 2.6611204127129568e+290 1.995840309534721e+290 1.3305602063564732e+290 6.65280103178235e+289]
	dgesvd.go:280: Case m=300,n=150,work=medium,mtype=5,job=NoneU-NoneVT: singular values differ between full and partial SVD
		[9.9792015476736e+291 9.912673537355772e+291 9.84614552703796e+291 9.779617516720141e+291 9.713089506402309e+291 9.646561496084488e+291 9.580033485766658e+291 9.513505475448833e+291 9.446977465131016e+291 9.380449454813189e+291 9.313921444495371e+291 9.24739343417753e+291 9.18086542385971e+291 9.114337413541885e+291 9.047809403224058e+291 8.981281392906233e+291 8.914753382588416e+291 8.848225372270585e+291 8.781697361952766e+291 8.715169351634938e+291 8.648641341317114e+291 8.582113330999295e+291 8.515585320681465e+291 8.449057310363648e+291 8.382529300045816e+291 8.316001289727993e+291 8.249473279410171e+291 8.182945269092349e+291 8.116417258774523e+291 8.0498892484567e+291 7.983361238138877e+291 7.916833227821048e+291 7.850305217503224e+291 7.78377720718541e+291 7.717249196867574e+291 7.650721186549754e+291 7.584193176231931e+291 7.517665165914112e+291 7.451137155596279e+291 7.384609145278455e+291 7.318081134960635e+291 7.251553124642812e+291 7.185025114324987e+291 7.118497104007164e+291 7.051969093689344e+291 6.985441083371521e+291 6.918913073053692e+291 6.852385062735868e+291 6.785857052418047e+291 6.719329042100223e+291 6.652801031782397e+291 6.586273021464578e+291 6.519745011146751e+291 6.453217000828927e+291 6.386688990511099e+291 6.320160980193281e+291 6.253632969875458e+291 6.187104959557632e+291 6.120576949239806e+291 6.054048938921988e+291 5.987520928604159e+291 5.920992918286338e+291 5.854464907968513e+291 5.787936897650688e+291 5.721408887332865e+291 5.65488087701504e+291 5.58835286669722e+291 5.521824856379395e+291 5.45529684606157e+291 5.388768835743747e+291 5.32224082542592e+291 5.255712815108099e+291 5.189184804790275e+291 5.122656794472448e+291 5.056128784154621e+291 4.9896007738368e+291 4.923072763518977e+291 4.8565447532011496e+291 4.790016742883328e+291 4.723488732565503e+291 4.6569607222476785e+291 4.5904327119298547e+291 4.5239047016120313e+291 4.457376691294207e+291 4.390848680976381e+291 4.324320670658558e+291 4.2577926603407353e+291 4.19126465002291e+291 4.1247366397050865e+291 4.058208629387266e+291 3.991680619069442e+291 3.9251526087516143e+291 3.8586245984337904e+291 3.792096588115969e+291 3.725568577798143e+291 3.659040567480318e+291 3.592512557162494e+291 3.525984546844669e+291 3.4594565365268483e+291 3.3929285262090234e+291 3.326400515891201e+291 3.2598725055733773e+291 3.1933444952555495e+291 3.126816484937728e+291 3.060288474619903e+291 2.99376046430208e+291 2.927232453984257e+291 2.8607044436664324e+291 2.794176433348608e+291 2.727648423030785e+291 2.66112041271296e+291 2.5945924023951375e+291 2.5280643920773136e+291 2.4615363817594906e+291 2.3950083714416637e+291 2.3284803611238406e+291 2.2619523508060154e+291 2.1954243404881912e+291 2.128896330170368e+291 2.062368319852544e+291 1.9958403095347194e+291 1.9293122992168952e+291 1.862784288899071e+291 1.7962562785812475e+291 1.729728268263423e+291 1.6632002579455992e+291 1.5966722476277748e+291 1.530144237309951e+291 1.4636162269921268e+291 1.3970882166743023e+291 1.3305602063564785e+291 1.2640321960386543e+291 1.1975041857208314e+291 1.1309761754030078e+291 1.0644481650851829e+291 9.979201547673597e+290 9.313921444495354e+290 8.648641341317113e+290 7.98336123813888e+290 7.318081134960632e+290 6.652801031782392e+290 5.987520928604153e+290 5.3222408254259115e+290 4.656960722247676e+290 3.991680619069444e+290 3.326400515891196e+290 2.661120412712955e+290 1.9958403095347188e+290 1.3305602063564744e+290 6.652801031782429e+289]
		[9.979201547673623e+291 9.912673537355772e+291 9.846145527037935e+291 9.77961751672012e+291 9.713089506402302e+291 9.646561496084487e+291 9.580033485766671e+291 9.513505475448816e+291 9.44697746513101e+291 9.380449454813158e+291 9.313921444495355e+291 9.247393434177519e+291 9.1808654238597e+291 9.114337413541882e+291 9.047809403224076e+291 8.981281392906227e+291 8.914753382588417e+291 8.848225372270592e+291 8.781697361952758e+291 8.715169351634923e+291 8.648641341317102e+291 8.582113330999294e+291 8.51558532068145e+291 8.449057310363632e+291 8.382529300045824e+291 8.316001289727993e+291 8.249473279410174e+291 8.182945269092349e+291 8.116417258774524e+291 8.049889248456707e+291 7.983361238138884e+291 7.916833227821051e+291 7.850305217503221e+291 7.783777207185395e+291 7.717249196867579e+291 7.65072118654975e+291 7.584193176231924e+291 7.517665165914109e+291 7.451137155596269e+291 7.384609145278451e+291 7.318081134960647e+291 7.25155312464281e+291 7.185025114324981e+291 7.118497104007172e+291 7.051969093689343e+291 6.985441083371524e+291 6.918913073053686e+291 6.852385062735867e+291 6.785857052418038e+291 6.71932904210022e+291 6.652801031782395e+291 6.586273021464579e+291 6.519745011146748e+291 6.453217000828933e+291 6.386688990511086e+291 6.320160980193271e+291 6.253632969875448e+291 6.187104959557635e+291 6.120576949239814e+291 6.054048938921989e+291 5.987520928604148e+291 5.920992918286341e+291 5.854464907968516e+291 5.787936897650685e+291 5.721408887332871e+291 5.654880877015036e+291 5.588352866697227e+291 5.521824856379403e+291 5.45529684606157e+291 5.388768835743743e+291 5.322240825425913e+291 5.255712815108099e+291 5.189184804790274e+291 5.122656794472447e+291 5.056128784154617e+291 4.989600773836794e+291 4.923072763518973e+291 4.856544753201146e+291 4.790016742883332e+291 4.7234887325655e+291 4.6569607222476796e+291 4.590432711929865e+291 4.5239047016120286e+291 4.4573766912942047e+291 4.3908486809763803e+291 4.324320670658553e+291 4.257792660340729e+291 4.1912646500229087e+291 4.1247366397050826e+291 4.058208629387271e+291 3.991680619069445e+291 3.92515260875162e+291 3.8586245984337916e+291 3.7920965881159705e+291 3.7255685777981405e+291 3.6590405674803166e+291 3.592512557162496e+291 3.5259845468446694e+291 3.4594565365268483e+291 3.3929285262090234e+291 3.3264005158912045e+291 3.25987250557338e+291 3.193344495255549e+291 3.126816484937728e+291 3.060288474619904e+291 2.9937604643020835e+291 2.927232453984253e+291 2.860704443666435e+291 2.7941764333486074e+291 2.727648423030784e+291 2.6611204127129586e+291 2.594592402395135e+291 2.5280643920773114e+291 2.4615363817594867e+291 2.3950083714416629e+291 2.3284803611238384e+291 2.2619523508060135e+291 2.1954243404881901e+291 2.1288963301703657e+291 2.0623683198525466e+291 1.9958403095347208e+291 1.929312299216895e+291 1.8627842888990697e+291 1.7962562785812467e+291 1.7297282682634228e+291 1.6632002579455962e+291 1.5966722476277762e+291 1.530144237309948e+291 1.463616226992124e+291 1.3970882166743012e+291 1.330560206356479e+291 1.264032196038656e+291 1.1975041857208336e+291 1.1309761754030081e+291 1.0644481650851837e+291 9.979201547673612e+290 9.313921444495354e+290 8.648641341317124e+290 7.983361238138884e+290 7.318081134960634e+290 6.6528010317824e+290 5.987520928604157e+290 5.322240825425916e+290 4.6569607222476756e+290 3.991680619069448e+290 3.326400515891198e+290 2.6611204127129554e+290 1.9958403095347185e+290 1.3305602063564767e+290 6.652801031782502e+289]
	dgesvd.go:280: Case m=300,n=150,work=optimum,mtype=5,job=NoneU-NoneVT: singular values differ between full and partial SVD
		[9.9792015476736e+291 9.912673537355772e+291 9.84614552703796e+291 9.779617516720141e+291 9.713089506402309e+291 9.646561496084488e+291 9.580033485766658e+291 9.513505475448833e+291 9.446977465131016e+291 9.380449454813189e+291 9.313921444495371e+291 9.24739343417753e+291 9.18086542385971e+291 9.114337413541885e+291 9.047809403224058e+291 8.981281392906233e+291 8.914753382588416e+291 8.848225372270585e+291 8.781697361952766e+291 8.715169351634938e+291 8.648641341317114e+291 8.582113330999295e+291 8.515585320681465e+291 8.449057310363648e+291 8.382529300045816e+291 8.316001289727993e

We never see this with the gonum implementation, also note that the output truncates (this happens elsewhen as well - without this marked failure - and it suggests to me that OpenBLAS is doing something very bad behind the scenes).

What version of Go, Gonum, Gonum/netlib and C implementation are you using?

This was in the go1.9.x tests for #56, but I have restarted it.

Does this issue reproduce with the current master?

Yes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.