|
Quentin Spencer |
cdd562 |
Notes on the Fedora Extras version of ATLAS
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
by Quentin Spencer
|
|
Quentin Spencer |
2c4ed2 |
updated: October 4, 2005
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
Because ATLAS relies on compile-time optimizations to obtain improved
|
|
Quentin Spencer |
cdd562 |
performance over BLAS and LAPACK, the resulting binaries are closely
|
|
Quentin Spencer |
cdd562 |
tied to the hardware on which they are compiled, and can likely result
|
|
Quentin Spencer |
cdd562 |
in very poor performance on other hardware. For this reason,
|
|
Quentin Spencer |
cdd562 |
including a package like ATLAS in Fedora requires some compromises.
|
|
Quentin Spencer |
cdd562 |
Firstly, a binary ATLAS package must perform reasonably well on the
|
|
Quentin Spencer |
cdd562 |
entire range of hardware on which it could potentially be installed.
|
|
Quentin Spencer |
cdd562 |
Optimizing ATLAS for the most modern hardware can result in
|
|
Quentin Spencer |
cdd562 |
significant performance penalties for users using the same package on
|
|
Quentin Spencer |
cdd562 |
older hardware. Second, building from the same source package must
|
|
Quentin Spencer |
cdd562 |
result in identical binaries for any computer of a particular
|
|
Quentin Spencer |
2c4ed2 |
architecture. This is because the binaries installed on a user's
|
|
Quentin Spencer |
2c4ed2 |
computer are built on a computer in the Fedora Extras build system,
|
|
Quentin Spencer |
2c4ed2 |
which will have hardware different from the end user's hardware, and
|
|
Quentin Spencer |
2c4ed2 |
quite possibly different from other available hardware in the build
|
|
Quentin Spencer |
2c4ed2 |
system.
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
The Debian project was probably the first to distribute precompiled
|
|
Quentin Spencer |
cdd562 |
ATLAS libraries. Camm Maguire, the creator of the Debian ATLAS
|
|
Quentin Spencer |
cdd562 |
package, has found a way of dealing with both of these challenges.
|
|
Quentin Spencer |
cdd562 |
The system essentially consists of "recorded builds" where ATLAS is
|
|
Quentin Spencer |
cdd562 |
compiled on particular hardware such that the resulting binary has
|
|
Quentin Spencer |
cdd562 |
reasonable performance on a range of hardware. The build parameters
|
|
Quentin Spencer |
cdd562 |
from the resulting optimization are stored in the source package and
|
|
Quentin Spencer |
cdd562 |
"played back" when a binary package is built. This has the additional
|
|
Quentin Spencer |
cdd562 |
advantage that builds using this method can be completed in minutes
|
|
Quentin Spencer |
cdd562 |
rather than the hours required to complete the standard compile-time
|
|
Quentin Spencer |
cdd562 |
empirical tests.
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
A significant amount of research has been done to find the best
|
|
Quentin Spencer |
cdd562 |
compile parameters for the Debian packages, so the most sensible
|
|
Quentin Spencer |
cdd562 |
approach to making a package for Fedora is to make use of that
|
|
Quentin Spencer |
cdd562 |
research by applying the Debian patches directly to the source and to
|
|
Quentin Spencer |
cdd562 |
emulate the same build process. The spec file for this package does
|
|
Quentin Spencer |
cdd562 |
exactly that. The result is a set of libraries that will not
|
|
Quentin Spencer |
cdd562 |
necessarily achieve optimal performance on any given hardware but
|
|
Quentin Spencer |
cdd562 |
should still offer significant performance gains over the reference
|
|
Quentin Spencer |
cdd562 |
BLAS and LAPACK libraries on most hardware. The binary package
|
|
Quentin Spencer |
cdd562 |
includes the atlas libraries as well as binary-compatible blas and
|
|
Quentin Spencer |
cdd562 |
lapack libraries that should work as a drop-in replacement for the
|
|
Quentin Spencer |
cdd562 |
standard ones (they are installed in /usr/lib/atlas rather than
|
|
Quentin Spencer |
cdd562 |
/usr/lib).
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
This package is designed to build RPMs that are identical regardless
|
|
Quentin Spencer |
cdd562 |
of where they are compiled and that provide reasonable performance on
|
|
Quentin Spencer |
cdd562 |
a wide range of hardware. For users who want optimal performance on
|
|
Quentin Spencer |
cdd562 |
particular hardware, custom RPMs can be built from the source package
|
|
Quentin Spencer |
cdd562 |
by setting the RPM macro "enable_custom_atlas" to a value of 1. This
|
|
Quentin Spencer |
cdd562 |
can be done from the command line as in the following example:
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
rpmbuild -D "enable_custom_atlas 1" --rebuild atlas-3.6.0-1.src.rpm
|
|
Quentin Spencer |
cdd562 |
|
|
Quentin Spencer |
cdd562 |
This command will create an atlas package called atlas-custom, which
|
|
Quentin Spencer |
cdd562 |
installs the optimized atlas libraries in /usr/lib/custom and the
|
|
Quentin Spencer |
cdd562 |
blas-compatible libraries in /usr/lib/atlas/custom. It should also be
|
|
Quentin Spencer |
cdd562 |
noted here that because custom compilation enables all compile-time
|
|
Quentin Spencer |
cdd562 |
empirical tests instead of simply replaying a previous build, the
|
|
Quentin Spencer |
cdd562 |
compilation time will be considerably longer, and can require several
|
|
Quentin Spencer |
cdd562 |
hours to complete, depending on the hardware.
|