BLIS vs BLAS

736 views
Skip to first unread message

Delip Rao

unread,
May 21, 2016, 4:17:42 PM5/21/16
to blis-discuss
Hello,

I have a dependency on openBLAS. I'm reading a lot of good things about BLIS. I don't know much about either. Is BLIS a drop in replacement to openBLAS for downstream softwares? Anything else I should be aware of? Any guidance in this is highly appreciated.

Thanks,
Delip

Jeff Hammond

unread,
May 21, 2016, 5:04:43 PM5/21/16
to Delip Rao, blis-discuss
What is your dependency? BLIS has a BLAS interface. Did you try it?

Jeff

Sent from my iPhone
> --
> You received this message because you are subscribed to the Google Groups "blis-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to blis-discuss...@googlegroups.com.
> To post to this group, send email to blis-d...@googlegroups.com.
> Visit this group at https://groups.google.com/group/blis-discuss.
> For more options, visit https://groups.google.com/d/optout.

Delip Rao

unread,
May 21, 2016, 5:48:41 PM5/21/16
to Jeff Hammond, blis-discuss
Jeff, I am trying replace OpenBLAS dependency of Caffe with BLIS. Not aware of the BLAS interface to BLIS. Can you please point me to it?

Thanks,
Delip

Jeff Hammond

unread,
May 21, 2016, 6:35:35 PM5/21/16
to Delip Rao, blis-discuss
If you run "./configure --help", you will see the options to enable BLAS and CBLAS interfaces.  The BLAS one is enabled by default while the CBLAS one is not.

The specifics of using the BLAS/CBLAS interface are not explicitly documented on https://github.com/flame/blis/wiki/BuildSystem, which I'll try to fix once I figure them out.

Since you almost certainly want to build with threads enabled, see https://github.com/flame/blis/wiki/Multithreading.  If you use Mac, the build-in Clang compiler doesn't support OpenMP, so you will need to use Pthreads.  If you use e.g. clang-omp or a properly configured GCC build from Homebrew, you'll get OpenMP support.  Intel compilers for Mac also support OpenMP.

On Linux, you should have no problem getting OpenMP from GCC or Intel compilers.  You can, of course, install Clang with OpenMP support yourself, but I don't think the package manager builds of Clang support it.  Finally, for completeness, you can use Pthreads on Linux as well.

Please make sure you choose the right architecture to get good performance.  If you have an Intel system, you probably want "haswell" or "sandybridge".  There are obviously BLIS build configurations for other architectures, but I don't have a need to use them so they aren't in cache.

Since you indicated you intend to use Caffe, it is possible that https://github.com/intelcaffe/caffe is of interest.  Please note that while I am affiliated with this project on Github, setting up the Github project was literally my only contribution, so please just create Github issues if you have any problems.

Best,

Jeff

Field G. Van Zee

unread,
May 23, 2016, 11:48:19 AM5/23/16
to blis-d...@googlegroups.com
Jeff: Thanks for pointing Delip in the right direction.

However, I'm not sure what you mean by "the specifics of using the BLAS/CBLAS
interface". Once enabled, those APIs should work just like any other BLAS or
CBLAS implementation. The only detail I can think of is the BLAS/CBLAS integer
type size, which defaults to 32, but can be changed to 64.

Delip: If you only use OpenBLAS as BLAS, and don't reference any
OpenBLAS-specific APIs or symbols, then BLIS should work just fine. However,
be aware that BLIS has only limited automatic hardware detection in its
configure script (./configure auto). Also, BLIS does not yet have many of the
optimized kernels present in OpenBLAS, especially for trsm and level-2
operations. I encourage you to take some time and read the content on the BLIS
website, including some of the wikis and/or papers, especially if you would
like a deeper understanding of BLIS.

regards,
Field
> <mailto:deli...@gmail.com>> wrote:
>
> __
> Jeff, I am trying replace OpenBLAS dependency of Caffe with BLIS. Not
> aware of the BLAS interface to BLIS. Can you please point me to it?
>
> Thanks,
> Delip
>
>
>
> On Sat, May 21, 2016 2:04 PM, Jeff Hammond jeff.s...@gmail.com
> <mailto:jeff.s...@gmail.com> wrote:
>
> __
>
> What is your dependency? BLIS has a BLAS interface. Did you try it?
>
>
> Jeff
>
>
> Sent from my iPhone
>
>
> > On May 21, 2016, at 1:17 PM, Delip Rao <deli...@gmail.com
> <mailto:deli...@gmail.com>> wrote:
>
> >
>
> > Hello,
>
> >
>
> > I have a dependency on openBLAS. I'm reading a lot of good things
> about BLIS. I don't know much about either. Is BLIS a drop in
> replacement to openBLAS for downstream softwares? Anything else I
> should be aware of? Any guidance in this is highly appreciated.
>
> >
>
> > Thanks,
>
> > Delip
>
> >
>
> > --
>
> > You received this message because you are subscribed to the Google
> Groups "blis-discuss" group.
>
> > To unsubscribe from this group and stop receiving emails from it,
> send an email to blis-discuss...@googlegroups.com
> <mailto:blis-discuss%2Bunsu...@googlegroups.com>.
>
> > To post to this group, send email to blis-d...@googlegroups.com
> <mailto:blis-d...@googlegroups.com>.
>
> > Visit this group at https://groups.google.com/group/blis-discuss.
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
> --
> Jeff Hammond
> jeff.s...@gmail.com <mailto:jeff.s...@gmail.com>
> http://jeffhammond.github.io/
>
> --
> You received this message because you are subscribed to the Google Groups
> "blis-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to blis-discuss...@googlegroups.com
> <mailto:blis-discuss...@googlegroups.com>.
> To post to this group, send email to blis-d...@googlegroups.com
> <mailto:blis-d...@googlegroups.com>.

Jeff Hammond

unread,
May 23, 2016, 12:07:09 PM5/23/16
to Field G. Van Zee, blis-d...@googlegroups.com

> On May 23, 2016, at 8:48 AM, Field G. Van Zee <fi...@cs.utexas.edu> wrote:
>
> Jeff: Thanks for pointing Delip in the right direction.
>
> However, I'm not sure what you mean by "the specifics of using the BLAS/CBLAS interface".

For example, the configure options that exist. As I recall it, one of these two interfaces wasn't even mentioned in the build system docs (maybe it's on another page). That means a browser of Github will never know it's there unless they download. But if thinking it is not there prevents them from downloading...

> Once enabled, those APIs should work just like any other BLAS or CBLAS implementation.

Do they require extra lib or not? It may be obvious to you but not others. Some implementations have separate libcblas while others do not. Sure, user can determine via trial and error, but better not to.

> The only detail I can think of is the BLAS/CBLAS integer type size, which defaults to 32, but can be changed to 64.

I want to document this very clearly for Fortran users, since this topic can be the source of much suffering thanks to the horrors of Fortran.

Anyways, I enjoy writing documentation, especially targeting the non-expert HPC user.

Best,

Jeff
> To unsubscribe from this group and stop receiving emails from it, send an email to blis-discuss...@googlegroups.com.
> To post to this group, send email to blis-d...@googlegroups.com.

Field G. Van Zee

unread,
May 23, 2016, 12:13:50 PM5/23/16
to blis-d...@googlegroups.com


On 05/23/16 11:07, Jeff Hammond wrote:
>
>> On May 23, 2016, at 8:48 AM, Field G. Van Zee <fi...@cs.utexas.edu>
>> wrote:
>>
>> Jeff: Thanks for pointing Delip in the right direction.
>>
>> However, I'm not sure what you mean by "the specifics of using the
>> BLAS/CBLAS interface".
>
> For example, the configure options that exist. As I recall it, one of these
> two interfaces wasn't even mentioned in the build system docs (maybe it's
> on another page). That means a browser of Github will never know it's there
> unless they download. But if thinking it is not there prevents them from
> downloading...

Admittedly, the BuildSystem and ConfigurationHowTo wikis needs to be updated
in light of Devin's enhancements to the configure script, most notably the new
options recognized by configure and its auto-generation of bli_config.h.

>
>> Once enabled, those APIs should work just like any other BLAS or CBLAS
>> implementation.
>
> Do they require extra lib or not? It may be obvious to you but not others.
> Some implementations have separate libcblas while others do not. Sure,
> user can determine via trial and error, but better not to.

Point taken, but the answer is no: no extra libraries are required. (Unless
you count libm.)

>
>> The only detail I can think of is the BLAS/CBLAS integer type size, which
>> defaults to 32, but can be changed to 64.
>
> I want to document this very clearly for Fortran users, since this topic
> can be the source of much suffering thanks to the horrors of Fortran.
>
> Anyways, I enjoy writing documentation, especially targeting the non-expert
> HPC user.

Thanks. Feel free to add/contribute to the wikis. Let me know if you encounter
permission issues.

>
> Best,
>
> Jeff
>

Jeff Hammond

unread,
May 23, 2016, 12:25:36 PM5/23/16
to Field G. Van Zee, blis-d...@googlegroups.com


> On May 23, 2016, at 9:13 AM, Field G. Van Zee <fi...@cs.utexas.edu> wrote:
>
>
>
>> On 05/23/16 11:07, Jeff Hammond wrote:
>>
>>> On May 23, 2016, at 8:48 AM, Field G. Van Zee <fi...@cs.utexas.edu>
>>> wrote:
>>>
>>> Jeff: Thanks for pointing Delip in the right direction.
>>>
>>> However, I'm not sure what you mean by "the specifics of using the
>>> BLAS/CBLAS interface".
>>
>> For example, the configure options that exist. As I recall it, one of these
>> two interfaces wasn't even mentioned in the build system docs (maybe it's
>> on another page). That means a browser of Github will never know it's there
>> unless they download. But if thinking it is not there prevents them from
>> downloading...
>
> Admittedly, the BuildSystem and ConfigurationHowTo wikis needs to be updated in light of Devin's enhancements to the configure script, most notably the new options recognized by configure and its auto-generation of bli_config.h.
>
>>
>>> Once enabled, those APIs should work just like any other BLAS or CBLAS
>>> implementation.
>>
>> Do they require extra lib or not? It may be obvious to you but not others.
>> Some implementations have separate libcblas while others do not. Sure,
>> user can determine via trial and error, but better not to.
>
> Point taken, but the answer is no: no extra libraries are required. (Unless you count libm.)
>

Thanks. I'll add a DGEMM "hello, world" example for CBLAS in C and for BLAS in C and Fortran, maybe on a new wiki page. In particular, I'll try to demonstrate what happens when one mixes LP64 and ILP64 Fortran ABI, because that can be nasty to debug in some cases (especially big endian, IIRC).

>>
>>> The only detail I can think of is the BLAS/CBLAS integer type size, which
>>> defaults to 32, but can be changed to 64.
>>
>> I want to document this very clearly for Fortran users, since this topic
>> can be the source of much suffering thanks to the horrors of Fortran.
>>
>> Anyways, I enjoy writing documentation, especially targeting the non-expert
>> HPC user.
>
> Thanks. Feel free to add/contribute to the wikis. Let me know if you encounter permission issues.

I was able to update README.md directly yesterday so I have plenty of permissions.

Thanks,

Jeff

>> Best,
>>
>> Jeff
Reply all
Reply to author
Forward
0 new messages