Skip to content

Commit ba59bac

Browse files
author
ripley
committed
notes on BLAS 3.12.1 changes and implications
git-svn-id: https://svn.r-project.org/R/trunk@87875 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 4330897 commit ba59bac

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

doc/NEWS.Rd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@
207207
\I{Ella Kaye}, \I{Heather Turner}, and \I{Kristen Gorman}.
208208

209209
\item The bundled BLAS and LAPACK sources have been updated to
210-
those shipped with LAPACK 3.12.1. This is almost entirely bug
211-
fixes, but includes a handful of new ancillary routines.
210+
those shipped with LAPACK 3.12.1. This is mainly bug fixes, but
211+
includes a handful of new ancillary routines, including two new
212+
BLAS routines \code{dgemmtr} and \code{zgemmtr} which are now used
213+
by LAPACK routines. So an external BLAS to be used with the
214+
internal LAPACK (unusual) needs to provide those routines.
212215
}
213216
}
214217

doc/manual/R-admin.texi

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,6 +3634,14 @@ algebra libraries without explaining their downsides.
36343634
An external BLAS library has to be explicitly requested at configure
36353635
time.
36363636

3637+
@strong{NB:} For decades@footnote{The level 3 rroutines were added in
3638+
1988. A 2001 `standard' is available at
3639+
@uref{https://www.netlib.org/blas/blast-forum/blas-report.pdf}.} the set
3640+
of BLAS routines was unchanged: this changed in Jan 2025 when routines
3641+
such as @code{dgemmtr} were added as part of LAPACK 3.12.1 and used in
3642+
some low-level LAPACK routines. This complicates the idea of swapping
3643+
external BLASes.
3644+
36373645
You can specify a particular @acronym{BLAS} library @emph{via} a value
36383646
for the configuration option @option{--with-blas}. If this is given
36393647
with no @code{=}, its value is taken from the
@@ -3758,6 +3766,9 @@ virtual core per physical CPU. (For the Fedora libraries the
37583766
compile-time flag specifies 4 threads.)
37593767
@c https://math-atlas.sourceforge.net/atlas_install/node21.html
37603768

3769+
ATLAS appears no longer to be under development: at the time of writing
3770+
the latest release was from 2016,
3771+
37613772
@node OpenBLAS and BLIS
37623773
@subsubsection @I{OpenBLAS} and @I{BLIS}
37633774

@@ -3797,7 +3808,7 @@ second and third the number of threads is controlled by
37973808
@abbr{OpenMP}) respectively.
37983809

37993810
These and their Debian equivalents contain a complete LAPACK
3800-
implementation.
3811+
implementation: that is the default for a build from the sources.
38013812

38023813
Note that building @R{} on Linux against distributed libraries may need
38033814
@samp{-devel} or @samp{-dev} packages installed.
@@ -3807,6 +3818,8 @@ For @cputype{ix86} and @cputype{x86_64} CPUs most distributed libraries
38073818
contain several alternatives for different CPU microarchitectures with
38083819
the choice being made at run time.
38093820

3821+
@I{OpenBLAS} provides @code{dgemmtr} as from version 0.3.29.
3822+
38103823
Another descendant project is @I{BLIS}
38113824
(@uref{https://github.com/flame/blis}). This has (in Fedora) shared
38123825
libraries
@@ -3818,7 +3831,15 @@ libbliso.so
38183831
@noindent
38193832
(@code{p} for `threads', @code{o} for @abbr{OpenMP} as for @I{OpenBLAS}) which can
38203833
also be used as a shared BLAS. The Fedora builds do not include LAPACK
3821-
in the @I{BLIS} libraries.
3834+
in the @I{BLIS} libraries and so cannot currently be used with internal
3835+
LAPACK as they do not provide @code{dgemmtr}.
3836+
3837+
AMD maintaint a branch of @I{BLIS} optimized for their CPUS called
3838+
@I{AOCL}.
3839+
@c https://www.amd.com/en/developer/aocl.html
3840+
@c https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms calls
3841+
@c it a branch of BLIS.
3842+
38223843

38233844
@node MKL
38243845
@subsubsection Intel @I{MKL}
@@ -3962,6 +3983,10 @@ It is easy to change the @acronym{BLAS} without needing to re-install
39623983
Note though that any dynamic libraries the replacement links to will
39633984
need to be found by the linker: this may need the library path to be
39643985
changed in @file{@var{R_HOME}/etc/ldpaths}.
3986+
3987+
This becasme less easy in 2025: swapping the BLAS is only possible to
3988+
one compatible with the LAPACK in use. For the LAPACK shipped with @R{}
3989+
4.5.0 that means one containing @code{dgemmtr} and @code{zgemmtr}.
39653990
@end itemize
39663991

39673992
Another option to change the @acronym{BLAS} in use is to symlink a
@@ -4094,7 +4119,7 @@ path if an enhanced BLAS is installed).
40944119
As with all libraries, you need to ensure that they and @R{} were
40954120
compiled with compatible compilers and flags. For example, this has
40964121
meant that on Sun @I{Sparc} using the Oracle compilers the flag
4097-
@option{-dalign} is needed if @code{sunperf} is to be used.
4122+
@option{-dalign} was needed if @code{sunperf} is to be used.
40984123

40994124
On some systems it has been necessary that an external
41004125
@acronym{BLAS}/LAPACK was built with the same Fortran compiler used to

0 commit comments

Comments
 (0)