Page 1 of 1

BLAS routine AXPBY

PostPosted: Sat Jul 06, 2019 11:43 pm
by pa33
I am trying to understand whether the routine xAXPBY is part of the official BLAS standard. According to Chapter 2 of http://www.netlib.org/blas/blast-forum/, it should be a standard Level 1 BLAS routine. In fact, I could find no mention of the AXPY routines in that document, and the header file http://www.netlib.org/blas/blast-forum/blas_dense_proto.h does contain prototypes for AXPBY and not AXPY.

So, according to the BLAST documents, AXPBY should be an official Level 1 BLAS function. However, the reference implementation at http://www.netlib.org/blas/ provides AXPY and not AXPBY. Furthermore, the widely known ATLAS library provides cblas_daxpy and not cblas_daxpby. It does however provide catlas_daxpby (which doesn't follow the standard naming convention).

So in summary, the BLAS standard documents have removed AXPY and replaced it with AXPBY. But several of the widely used BLAS libraries are still providing AXPY but not AXPBY. Furthermore, LAPACK 3.8.0 performs many calls to AXPY but no calls to AXPBY.

Can someone shed some light on this situation? Basically I want to know if I can use AXPBY in my code and trust that standard BLAS libraries will support it.

Re: BLAS routine AXPBY

PostPosted: Sun Jul 07, 2019 9:02 am
by Julien Langou
Hi Patrick.

I was not involved with any of this but here is what I understand.

1) I think ( newBLAS / BLAST ) was meant as an addition to the (legacy) BLAS (not a replacement). So it did make sense to not list AXPY in ( newBLAS / BLAST ) since AXPY is already in BLAS. This is not surprising and this does not mean that AXPBY would replace AXPY. Simply that AXPBY would be added.

2) ( newBLAS / BLAST ) was made of many projects: XBLAS (extended precision), Sparse BLAS, (chapter 2 - more conventional extension of BLAS), etc. Committees met and decided on some interfaces. Implementations of XBLAS and Sparse BLAS were done following these interfaces. I do not know a reference implementation (and associated testings) of the (chapter 2 - more conventional extension of BLAS) part. (AXPBY is in the (chapter 2 - more conventional extension of BLAS).)

3) I would personally not rely on a BLAS library to have AXPBY. (Any BLAS library should have AXPY.)

4) It could be good to do a census survey of which BLAS library offers AXPBY. I was surprised to read ATLAS does. (Although the name is a little off.) This is great. I wonder how many other BLAS libraries offer these types of ( newBLAS / BLAST ) subroutines.

Cheers,
Julien.

Re: BLAS routine AXPBY

PostPosted: Sun Jul 07, 2019 4:07 pm
by pa33
Thanks Julien,

This makes sense. I checked MKL and OpenBLAS and both of those libraries contain cblas_daxpby (with the correct naming). But its a little worrying that ATLAS doesn't provide the routine with the correct name, which makes me reluctant to rely on it.

It would be nice if the BLAS committees could make a unified standard (unifying Legacy BLAS and the nice/useful extensions) and then encourage the major BLAS lilbrary developers to implement it. The updated BLAST document is dated 2001 and yet the major BLAS libraries are still not supporting all of the routines in there. I think MKL and OpenBLAS have implemented some of the new routines but maybe not all?

The Sparse BLAS standard is quite interesting, but I don't think it has been widely adopted. A major difference between dense/sparse BLAS, is that dense BLAS libraries don't need to worry about the construction or memory allocation issues. You just allocate a rectangular chunk of memory, call it a matrix, and pass it into the dense BLAS routines. Sparse BLAS on the other hand, needs to support quite different data structures depending on the sparse matrix format (CSC, CSR, COO, RSB, ...), and multiplying two sparse matrices may require on-the-fly allocations of the various arrays involved, which isn't needed in dense matrix multiplication. I don't have the answers to these issues but I would guess this is why the sparse BLAS is not widely adopted.