Goto Blas.

109 views
Skip to first unread message

Thierry Dumont

unread,
Dec 7, 2010, 1:05:29 AM12/7/10
to sage-...@googlegroups.com
The Goto Blas are now under BSD license.

http://www.tacc.utexas.edu/tacc-projects/gotoblas2/
This could be a replacement for Atlas (these blas are supposed to be
faster).

t.d.

tdumont.vcf

Jason Grout

unread,
Dec 7, 2010, 8:19:20 AM12/7/10
to sage-...@googlegroups.com


How active is the project? The second sentence in the above page is:

"This product is no longer under active development by TACC, but it is
being made available to the community to use, study, and extend."

Thanks,

Jason


Jason Grout

unread,
Dec 7, 2010, 8:22:40 AM12/7/10
to sage-...@googlegroups.com
On 12/7/10 12:05 AM, Thierry Dumont wrote:


According to the developer's wikipedia page [1], Kazushige Gotō joined
Microsoft's Technical Computing Group in 2010. I wonder if that's why
the library appears to be abandoned to the open source community.

Thanks,

Jason

[1] http://en.wikipedia.org/wiki/Kazushige_Goto

Thierry Dumont

unread,
Dec 7, 2010, 10:44:06 AM12/7/10
to sage-...@googlegroups.com

According to a colleague of mine; there is a ticket to include the Goto
blas in a forthcoming Debian distribution. And according to many friends
doing numerics, these blas are faster than atlas blas.

But may be the question, for Sage, is: how long does it takes to install
Goto blas, compared to atlas ?

t.d.

Francois Bissey

unread,
Dec 7, 2010, 3:06:15 PM12/7/10
to sage-...@googlegroups.com

.....
It is active, but there is now a gotoblas2 which is active as far as I
know:
http://www.tacc.utexas.edu/tacc-projects/#blas

From memory gotoBlas (version 1) was compiling faster on my old machine
than the latest atlas. We had to remove gotoblas-1 source from the gentoo
tree because TACC didn't want us to redistribute them anymore.

The next thing to check is whether it provides both cblas and f77blas.
Version 1 only provided f77blas and we need cblas as well.

Francois

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

winmail.dat

Francois Bissey

unread,
Dec 7, 2010, 6:42:46 PM12/7/10
to sage-...@googlegroups.com
Seems like I didn't dig deep enough.

So it isn't actively developed by the TACC
anymore, it is given to the community to
maintain and take over development.

It only provides f77blas. I guess it would
be possible to create a cblas interface using
f2c but it is not really something anyone would
want to maintain.

So unless someone can suggest an alternative
cblas implementation as well, gotoblas is not
a viable alternative.

winmail.dat

Bill Hart

unread,
Dec 9, 2010, 7:39:35 PM12/9/10
to sage-devel, flint-devel
This is *fantastic* news that GotoBlas has been BSD licensed. I've
wanted to use it in FLINT for years, and we've just been discussing
highly optimised matrix routines (Fredrik Johansson has been writing
lots of code too).

But I am slightly confused over the CBLAS interface thing.

It seems that the original BLAS reference implementation was in
Fortran f77. In fact, a reference implementation seems to be provided,
in Fortran, in the reference directory of GotoBlas. There is also some
Fortran test code (presumably to compare the results of the optimised
BLAS routines with the reference implementation). From what I can tell
most of the GotoBLAS is implemented in C and assembly.

From what I read here:

http://www.inf.bv.tum.de/~heisserer/softwarelab04/doc/blas_report.pdf

the usual problem is you have a BLAS written in Fortran, and you want
to call it from C. So you have two options:

1) Link your C program against the BLAS (implemented in Fortran) and
use the Fortran function names in your C program. (I'm unclear on
whether some matrix transposes are also required.) This is possible
because of a 1-1 correspondence between Fortran and C conventions.
There's some name mangling required, Fortran calls by reference, and a
few other differences with C.

2) Use a CBLAS implementation, which provides the same functionality,
but with C function names and prototypes which wrap the original
Fortran implementation. I understand such a CBLAS interface is
provided by ATLAS. So one can link against libatlas and use the C
function names without having to worry about the 1-1 correspondence
with the Fortran code.

E.g:

* using method 1 you'd have dgemm_("n", "n", &m ,&n ,&k ,&alpha,
B[0],&ldb, A[0],&lda,&beta, C[0],&ldc); which calls the Fortran
function directly from C, mangling everything appropriately.

* using method 2 you'd have cblas_dgemm(Order, TransA, TransB, m, n,
k, alpha, a, lda, b, ldb, beta, c, ldc); which calls the C function.

So let's look at which GotoBLAS provides, by looking in it's CBlas
interface, in the file cblas.h:

void cblas_dgemm(enum CBLAS_ORDER Order, enum CBLAS_TRANSPOSE TransA,
enum CBLAS_TRANSPOSE TransB, blasint M, blasint N, blasint K,
double alpha, double *A, blasint lda, double *B, blasint ldb,
double beta, double *C, blasint ldc);

So what am I missing here?

I also notice that much of the GotoBLAS functionality seems to be in
(hand?) written assembly and C. That is, both the kernel and the
(Fortran) interface actually seem to be implemented in C (Is this a
case of: a determined programmer can write Fortran in any language?
LOL.).

Sorry if I am being completely ignorant here. I've never actually
directly used ATLAS, GotoBLAS, f77 BLAS or CBLAS myself, as Sage just
provides it for me, so I have no clue what I'm talking about. Is there
additional functionality provided by a CBLAS interface not provided by
Goto's BLAS? I did read somewhere that ATLAS provides some functions
from LAPACK... ah yes, I think I have that right. That is on the ATLAS
homepage. Do we use any of those?

Anyhow, big +1 for using Goto if it is at all possible. I'm sure I'll
certainly be using snippets of code from Goto in FLINT, assuming I can
get the bits I need to compile without a Fortran compiler.

Bill.

On Dec 7, 11:42 pm, Francois Bissey <francois.bis...@canterbury.ac.nz>
wrote:
>  winmail.dat
> 3KViewDownload

Bill Hart

unread,
Dec 9, 2010, 8:04:45 PM12/9/10
to sage-devel, flint-devel
Sorry, that should say Fortran _interface_, not Fortran _code_. It
looks like the BLAS in ATLAS is _implemented_ in C and assembly and
provides both a Fortran and (proper) CBLAS _interface_. So it is also
an unusual BLAS in that it is not actually implemented in Fortran
itself.

Bill Hart

unread,
Dec 9, 2010, 8:21:52 PM12/9/10
to sage-devel
So I don't know what is considered a fast time to build BLAS, but on
my machine it was straightforward. I just typed make and it detected
the number of cores, the architecture and built a multithreaded BLAS
and LAPACK (which it automatically downloaded for me). It took about
90s to build and automatically run some tests (though I have 16 cores
on that machine and it seemed to use them also for the whole build
process automatically).

The LAPACK it downloaded also seems to be BSD licensed. It's written
in Fortran I believe.

The documentation says you can customise the build process in various
ways.

Bill.

Francois Bissey

unread,
Dec 9, 2010, 10:45:04 PM12/9/10
to sage-...@googlegroups.com
-----Original Message-----
From: sage-...@googlegroups.com on behalf of Bill Hart
Sent: Fri 12/10/2010 2:21 PM
To: sage-devel
Subject: [sage-devel] Re: Goto Blas.

So I don't know what is considered a fast time to build BLAS, but on
my machine it was straightforward. I just typed make and it detected
the number of cores, the architecture and built a multithreaded BLAS
and LAPACK (which it automatically downloaded for me). It took about
90s to build and automatically run some tests (though I have 16 cores
on that machine and it seemed to use them also for the whole build
process automatically).

The LAPACK it downloaded also seems to be BSD licensed. It's written
in Fortran I believe.

The documentation says you can customise the build process in various
ways.

.....

Lapack is indeed Fortran, there are two CLapack implementation floating around
one produced by ATLAS and an f2c version of the netlib reference fortran implementation.

Francois

This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

winmail.dat

Dima Pasechnik

unread,
Dec 11, 2010, 12:50:06 AM12/11/10
to sage-devel
on a 4-years old x86 laptop I have, I usually just cannot build Atlas
in Sage. It fails, as it's
unable to perform their (in)famous tuning precisely enough.

A replacement for Atlas would be nice, therefore...

Mike Witt

unread,
Dec 11, 2010, 5:09:01 AM12/11/10
to sage-...@googlegroups.com
I also can't build atlas on my (fairly) new but low-powered portable.
So, I second that (although I admit I don't understand what all the
issues are that might be involved.)

-Mike

> --
> To post to this group, send an email to sage-...@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
>


Emil Widmann

unread,
Feb 5, 2011, 8:18:14 AM2/5/11
to sage-devel
I know this thread is a bit outdated, but I had problems to compile
Atlas in an experiment
and wanted to ask if anybody has tried to use GotoBlas instead of
Atlas in the meantime?
Reply all
Reply to author
Forward
0 new messages