<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Lightning Talk: Creating a Standardised Set of Batched BLAS Routines</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jack Dongarra</string-name>
          <email>dongarra@icl.utk.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sven Hammarling, Nicholas J. Higham, Samuel D. Relton,</string-name>
          <email>pedro.valero-lara, mawussi.zounon@manchester.ac.uk</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Innovative Computing Laboratory, University of Tennessee, Oak Ridge National Laboratory</institution>
          ,
          <addr-line>TN</addr-line>
          ,
          <country country="US">USA.</country>
          <institution>, School of Computer Science and School of Mathematics, The University of Manchester</institution>
          ,
          <addr-line>Manchester</addr-line>
          ,
          <country country="UK">UK.</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Pedro Valero-Lara and Mawussi Zounon, School of Mathematics, The University of Manchester</institution>
          ,
          <addr-line>Manchester, UK., sven.hammarling, nick.higham, samuel.relton</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>-One trend in modern high performance computing is to decompose a large linear algebra problem into thousands of small problems that can be solved independently. For this purpose we are developing a new BLAS standard (Batched BLAS), allowing users to perform thousands of small BLAS operations in parallel and making efficient use of their hardware. We discuss and introduce some details about how we are implementing this new scientific standard as well as some ideas about the upcoming processes that we plan to follow during its development. Index Terms-BLAS; Scientific Computing; High Performance Computing;</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        While high-performance computing typically aims to solve
increasingly large linear algebra problems efficiently, there is a
current trend towards splitting these into thousands of smaller
linear algebra problems which are solved concurrently [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The
solutions of these smaller problems are then combined to give
the solution to the original large problem.
      </p>
      <p>
        Examples of applications that can be decomposed in this
way include solving separable elliptic equations using the
algorithm by Swarztrauber [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], matrix-free finite element
methods [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], domain decomposition [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and image processing [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
Batched BLAS is already utilized in popular machine learning
libraries such as Theano and TensorFlow. Other examples of
such applications where the solution of many small problems
are required include metabolic networks [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], astrophysics [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
and computational fluid dynamics.
      </p>
      <p>There are many software libraries that provide Basic
Linear Algebra Subproblems (BLAS) such as Intel MKL and
NVIDIA CuBLAS, but these libraries are optimized for
solving large linear algebra problems. This means that applications
like the above typically run with suboptimal performance.</p>
      <p>The solution to this problem is to create a set of routines for
computing linear algebra operations on batches of small
matrices, building upon the BLAS. This Batched BLAS (BBLAS)
should be able to compute many small matrix operations in
parallel. For example, if we consider a GEMM operation over
This work is licensed under a CC-BY-4.0 license.
a batch of N matrices then we would like to compute, in
parallel,</p>
      <p>Ci
iAiBi + iCi;
i = 1 : N:</p>
      <p>Currently there is no standard interface for batched BLAS
operations and no complete implementation of all batched
BLAS routines. Intel MKL has support for batched GEMM
computation whilst NVIDIA CuBLAS supports batched
GEMM and TRSM (along with a small subset of LAPACK).
However, these two libraries do not follow the same API
design. The introduction of the BLAS standard was critical
to the sustainability, vendors and academics could both focus
on obtaining optimal performance and users could easily
switch between different implementations of the software.
We hope that a standard API for BBLAS will be similarly
transformative.</p>
      <p>II. TOWARDS A SUSTAINABLE BATCHED BLAS LIBRARY
Our medium term goals in this regard are as follows.
1) Propose a standard API for BBLAS routines.
2) Reach a consensus on the BBLAS API among vendors
and academics.
3) Have high quality HPC software available for computing</p>
      <p>BBLAS routines.
4) Increase uptake of BBLAS routines in HPC applications.</p>
      <p>Next we explain each point in detail. The lifecycle
containing all these points is illustrated in Figure 1. Note that, whilst
our description is focused on BBLAS, we believe that a similar
process could be used to define any computing standard to be
used by the wider community.</p>
      <p>
        –1– We have already proposed an initial draft BBLAS
API [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. For our particular scenario, since BBLAS is closely
related to BLAS, we attempt to follow the same conventions
as well as the programming style used in the latter. This can
ease the transition as the community becomes familiar with
the new API and resulting libraries.
      </p>
      <p>–2– When looking to obtain a standard API for BBLAS
routines it is vitally important to involve both academics
/se iton</p>
      <p>a
sca inm
tseT isseD
and vendors in the discussions. While academics may be
the primary users of the software, vendors such as Intel
and NVIDIA will likely provide optimized versions of the
functions and have considerable experience in creating
highquality mathematical software.</p>
      <p>Therefore, after proposing a draft specification for the
BBLAS API, in May 2016 our team organised a workshop
where world-leading academics from the linear algebra
community and experts from the vendors could discuss changes to
the draft. A number of ideas were proposed: from changing
the parameters in the function calls to change the layout of
the matrices in memory, with initial performance results given
in each case.</p>
      <p>
        Based upon this we have recently released a technical
report [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to review and compare these ideas, aiming to
conclusively show which combination(s) will perform well
in practical applications, paying particular attention to the
memory layout and how data is stored in memory. We have
realized that even the smallest changes to the API can have
a substantial impact on performance, which reflects the
importance that these preliminary studies have for the design of
scientific standards.
      </p>
      <p>This report has now been circulated to the vendors and the
wider scientific community, so that we can receive feedback
and any further suggestions they might have, which will then
be fed into a second draft specification for the BBLAS API.</p>
      <p>It is very important to spend the necessary time on this step
as future changes to the specification will force us to
reimplement the entire specification, which would require a significant
amount of engineering effort and generate frustration for the
users.</p>
      <p>–3– Once the vendors and the wider community are in
agreement on the BBLAS API, work can focus on obtaining
highly optimized implementations for different architectures.
In particular we hope to see extremely good performance on
GPUs and the new Knights Landing Xeon Phi models within
the next few years. Early efforts from Intel and NVIDIA in
this for batched GEMM operations look extremely promising.</p>
      <p>As HPC nodes become increasingly heterogeneous it is
interesting to postulate a more general library that can use all
the available computational resources concurrently. There are
a number of questions to answer in this area, including how
best to spread the workload among the available hardware. We
have some initial ideas on this which we hope to implement in
an open source library. This will allow interested members of
the community to obtain the maximal performance possible on
any HPC node. A well designed open source library, with good
documentation and examples, will allow application experts to
make use of our work easily, whilst allowing experts to add
optimized code for additional platforms.</p>
      <p>–4– Whilst batched GEMM is already used in some HPC
applications, we hope to increase the uptake of batched BLAS
in other areas. Whether or not this happens hinges upon the
availability of high quality and high performance software
for BBLAS routines. Allowing users to download our library
via a public repository can be very beneficial for increasing
the availability and dissemination of our library. Events such
as conferences, workshops and journal publications provide
another way to involve the community in our work.</p>
    </sec>
    <sec id="sec-2">
      <title>ACKNOWLEDGEMENTS</title>
      <p>This project is funded in part from the European Unions Horizon 2020
research and innovation programme under the NLAFET grant agreement No
671633.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>E.</given-names>
            <surname>Agullo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Demmel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Dongarra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hadri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Kurzak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Langou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Ltaief</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Luszczek</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Tomov</surname>
          </string-name>
          , “
          <article-title>Numerical linear algebra on emerging architectures: The PLASMA</article-title>
          and MAGMA projects,
          <source>” Journal of Physics: Conference Series</source>
          , vol.
          <volume>180</volume>
          , no.
          <issue>1</issue>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>P.</given-names>
            <surname>Valero-Lara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pinelli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Prieto-Matias</surname>
          </string-name>
          , “
          <article-title>Fast finite difference Poisson solvers on heterogeneous architectures,”</article-title>
          <source>Computer Physics Communications</source>
          , vol.
          <volume>185</volume>
          , no.
          <issue>4</issue>
          , pp.
          <fpage>1265</fpage>
          -
          <lpage>1272</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>K.</given-names>
            <surname>Ljungkvist</surname>
          </string-name>
          , “
          <article-title>Matrix-free finite-element operator application on graphics processing units,” in Euro-Par 2014: Parallel Processing Workshops - Euro-Par 2014 International Workshops</article-title>
          , Porto, Portugal,
          <source>August 25-26</source>
          ,
          <year>2014</year>
          ,
          <string-name>
            <given-names>Revised</given-names>
            <surname>Selected</surname>
          </string-name>
          <string-name>
            <given-names>Papers</given-names>
            ,
            <surname>Part</surname>
          </string-name>
          <string-name>
            <surname>II</surname>
          </string-name>
          ,
          <year>2014</year>
          , pp.
          <fpage>450</fpage>
          -
          <lpage>461</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>E.</given-names>
            <surname>Agullo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Giraud</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zounon</surname>
          </string-name>
          , “
          <article-title>On the resilience of parallel sparse hybrid solvers</article-title>
          ,
          <source>” in 22nd IEEE International Conference on High Performance Computing, HiPC</source>
          <year>2015</year>
          , Bengaluru, India,
          <source>December 16-19</source>
          ,
          <year>2015</year>
          ,
          <year>2015</year>
          , pp.
          <fpage>75</fpage>
          -
          <lpage>84</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>P.</given-names>
            <surname>Valero-Lara</surname>
          </string-name>
          ,
          <article-title>“Multi-GPU acceleration of DARTEL (early detection of alzheimer</article-title>
          ),
          <source>” in 2014 IEEE International Conference on Cluster Computing, CLUSTER</source>
          <year>2014</year>
          , Madrid, Spain,
          <source>September 22-26</source>
          ,
          <year>2014</year>
          ,
          <year>2014</year>
          , pp.
          <fpage>346</fpage>
          -
          <lpage>354</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.</given-names>
            <surname>Khodayari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. R.</given-names>
            <surname>Zomorrodi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. C.</given-names>
            <surname>Liao</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C. D.</given-names>
            <surname>Maranas</surname>
          </string-name>
          , “
          <article-title>A kinetic model of Escherichia coli core metabolism satisfying multiple sets of mutant flux data,” Metabolic Engineering</article-title>
          , vol.
          <volume>25</volume>
          , pp.
          <fpage>50</fpage>
          -
          <lpage>62</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>O. E. B.</given-names>
            <surname>Messer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Harris</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Parete-Koon</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Chertjkow</surname>
          </string-name>
          , “
          <article-title>Multicore and accelerator development for a leadership-class stellar astrophysics code</article-title>
          ,”
          <source>in Proceedings of ”PARA</source>
          <year>2012</year>
          :
          <article-title>State-of-the-Art in Scientific and Parallel Computing</article-title>
          .”,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Dongarra</surname>
          </string-name>
          , I. Duff,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gates</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Haidar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Hammarling</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N. J.</given-names>
            <surname>Higham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hogg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Valero-Lara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. D.</given-names>
            <surname>Relton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Tomov</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zounon</surname>
          </string-name>
          , “
          <article-title>A proposed API for batched basic linear algebra subprograms</article-title>
          ,” The University of Manchester, UK,
          <string-name>
            <surname>MIMS EPrint</surname>
          </string-name>
          <year>2016</year>
          .
          <volume>25</volume>
          ,
          <year>April 2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S. D.</given-names>
            <surname>Relton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Valero-Lara</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Zounon</surname>
          </string-name>
          , “
          <article-title>A comparison of potential interfaces for batched blas computations,” Manchester Institute for Mathematical Sciences</article-title>
          , The University of Manchester, UK,
          <source>MIMS Eprint</source>
          <year>2016</year>
          .
          <volume>42</volume>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>