What's new in AOCL 3.1 (#27988)

* What's new in AOCL 3.1

1) AMD BLIS:
    1.a) Supports Dynamic Dispatch and AOCL Dynamic feature
    1.b) Improvements in DGEMM, ZGEMM, DTRSM, DSYRK, xGEMV, and DOTV
2) AMD libFLAME:
    2.a) Supports LAPACK 3.10.0 specification
    2.b) Optimized factorization and ZGEEV routines
3) AMD FFTW:
    3.a) Features like 'AMD application optimization layer', 'Fast MPI transpose algorithm' and 'Top N planner' are added
4) AMD LibM:
    4.a) Optimized exp2, log2 (Single and Double precision) scalar and vector
    4.b) Optimized log10f (scalar and vector) and powf vector variants to support WRF4.1.2 benchmark
5) AOCL-Sparse:
    5.a) New API for sparse matrix and dense matrix multiplication
6) AMD ScaLAPACK:
    6.a) ILP64 support has been enabled
7) AOCL enabled MUMPS library:
    7.a) CMake based build system on Windows for AOCL enabled MUMPS sparse solver library will be available shortly on GitHub
        7.a.i)	Refer https://github.com/amd/mumps-build
    7.b) Spack-based recipe on Linux for AOCL enabled MUMPS sparse solver library will be enabled shortly

* Fix invalid version range error

* Incorporated review comments

1) Restore to previous url value
2) Instead of if else statements, used spack's enable_or_disable feature

* Incorporated following review comments:

1. Use of satisfies() for spec checks
2. Seperate conflict statements to check for minimum and maximum GCC versions
3. Used CMakePackage helpers
4. Code rearrangement to have the directives listed before methods
This commit is contained in:
AMD Toolchain Support 2021-12-17 22:58:41 +05:30 committed by GitHub
parent 140e8085dd
commit 541ccd6669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 259 additions and 53 deletions

View File

@ -22,17 +22,50 @@ class Amdblis(BlisBase):
maintainers = ['amd-toolchain-support']
version('3.1', sha256='2891948925b9db99eec02a1917d9887a7bee9ad2afc5421c9ba58602a620f2bf')
version('3.0.1', sha256='dff643e6ef946846e91e8f81b75ff8fe21f1f2d227599aecd654d184d9beff3e')
version('3.0', sha256='ac848c040cd6c3550fe49148dbdf109216cad72d3235763ee7ee8134e1528517')
version('2.2', sha256='e1feb60ac919cf6d233c43c424f6a8a11eab2c62c2c6e3f2652c15ee9063c0c9')
variant(
'ilp64',
default=False,
description='Build with ILP64 support')
conflicts(
'+ilp64',
when='@:3.0.0',
msg='ilp64 is supported from amdblis 3.0.1 version onwards')
def configure_args(self):
spec = self.spec
args = super(Amdblis, self).configure_args()
if spec.satisfies('@3.0 %aocc'):
""" To enabled Fortran to C calling convention for
if spec.satisfies('+ilp64'):
args.append('--blas-int-size=64')
""" To enable Fortran to C calling convention for
complex types when compiling with aocc flang"""
if self.spec.satisfies("@3.0 %aocc"):
args.append('CFLAGS={0}'.format("-DAOCL_F2C"))
args.append('CXXFLAGS={0}'.format("-DAOCL_F2C"))
elif self.spec.satisfies("@3.0.1: %aocc"):
args.append('--complex-return=intel')
if self.spec.satisfies("@3.1:"):
args.append('--disable-aocl-dynamic')
return args
def configure(self, spec, prefix):
config_args = self.configure_args()
# "amdzen" - A fat binary or multiarchitecture binary
# support for 3.1 release onwards
if self.spec.satisfies("@3.1:"):
config_args.append("amdzen")
else:
config_args.append("auto")
configure("--prefix=" + prefix,
*config_args)

View File

@ -31,36 +31,150 @@ class Amdfftw(FftwBase):
maintainers = ['amd-toolchain-support']
version('3.1', sha256='3e777f3acef13fa1910db097e818b1d0d03a6a36ef41186247c6ab1ab0afc132')
version('3.0.1', sha256='87030c6bbb9c710f0a64f4f306ba6aa91dc4b182bb804c9022b35aef274d1a4c')
version('3.0', sha256='a69deaf45478a59a69f77c4f7e9872967f1cfe996592dd12beb6318f18ea0bcd')
version('2.2', sha256='de9d777236fb290c335860b458131678f75aa0799c641490c644c843f0e246f8')
variant('shared', default=True, description="Builds a shared version of the library")
variant('openmp', default=True, description="Enable OpenMP support")
variant('threads', default=False, description="Enable SMP threads support")
variant('debug', default=False, description="Builds a debug version of the library")
variant('shared', default=True,
description='Builds a shared version of the library')
variant('openmp', default=True,
description='Enable OpenMP support')
variant('threads', default=False,
description='Enable SMP threads support')
variant('debug', default=False,
description='Builds a debug version of the library')
variant(
'amd-fast-planner',
default=False,
description="Option to reduce the planning time without much"
"tradeoff in the performance. It is supported for"
"Float and double precisions only.")
description='Option to reduce the planning time without much'
'tradeoff in the performance. It is supported for'
'Float and double precisions only.')
variant(
'amd-top-n-planner',
default=False,
description='Build with amd-top-n-planner support')
variant(
'amd-mpi-vader-limit',
default=False,
description='Build with amd-mpi-vader-limit support')
variant(
'static',
default=False,
description='Build with static suppport')
variant(
'amd-trans',
default=False,
description='Build with amd-trans suppport')
variant(
'amd-app-opt',
default=False,
description='Build with amd-app-opt suppport')
depends_on('texinfo')
provides('fftw-api@3', when='@2:')
conflicts('precision=quad', when='@2.2 %aocc', msg="AOCC clang doesn't support quad precision")
conflicts('+debug', when='@2.2 %aocc', msg="AOCC clang doesn't support debug")
conflicts('%gcc@:7.2', when="@2.2:", msg="Required GCC version above 7.2 for AMDFFTW")
conflicts('+amd-fast-planner', when="@2.2", msg="amd-fast-planner is supported from 3.0 onwards")
conflicts(
'precision=quad',
when='@2.2 %aocc',
msg='Quad precision is not supported by AOCC clang version 2.2')
conflicts(
'+debug',
when='@2.2 %aocc',
msg='debug mode is not supported by AOCC clang version 2.2')
conflicts(
'%gcc@:7.2',
when='@2.2:',
msg='GCC version above 7.2 is required for AMDFFTW')
conflicts(
'+amd-fast-planner ',
when='+mpi',
msg='mpi thread is not supported with amd-fast-planner')
conflicts(
'+amd-fast-planner',
when='@2.2',
msg='amd-fast-planner is supported from 3.0 onwards')
conflicts(
'+amd-fast-planner',
when='precision=quad',
msg="amd-fast-planner doesn't support quad precision")
msg='Quad precision is not supported with amd-fast-planner')
conflicts(
'+amd-fast-planner',
when='precision=long_double',
msg="amd-fast-planner doesn't support long_double precision")
msg='long_double precision is not supported with amd-fast-planner')
conflicts(
'+amd-top-n-planner',
when='@:3.0.0',
msg='amd-top-n-planner is supported from 3.0.1 onwards')
conflicts(
'+amd-top-n-planner',
when='precision=long_double',
msg='long_double precision is not supported with amd-top-n-planner')
conflicts(
'+amd-top-n-planner',
when='precision=quad',
msg='Quad precision is not supported with amd-top-n-planner')
conflicts(
'+amd-top-n-planner',
when='+amd-fast-planner',
msg='amd-top-n-planner cannot be used with amd-fast-planner')
conflicts(
'+amd-top-n-planner',
when='+threads',
msg='amd-top-n-planner works only for single thread')
conflicts(
'+amd-top-n-planner',
when='+mpi',
msg='mpi thread is not supported with amd-top-n-planner')
conflicts(
'+amd-top-n-planner',
when='+openmp',
msg='openmp thread is not supported with amd-top-n-planner')
conflicts(
'+amd-mpi-vader-limit',
when='@:3.0.0',
msg='amd-mpi-vader-limit is supported from 3.0.1 onwards')
conflicts(
'+amd-mpi-vader-limit',
when='precision=quad',
msg='Quad precision is not supported with amd-mpi-vader-limit')
conflicts(
'+amd-trans',
when='+threads',
msg='amd-trans works only for single thread')
conflicts(
'+amd-trans',
when='+mpi',
msg='mpi thread is not supported with amd-trans')
conflicts(
'+amd-trans',
when='+openmp',
msg='openmp thread is not supported with amd-trans')
conflicts(
'+amd-trans',
when='precision=long_double',
msg='long_double precision is not supported with amd-trans')
conflicts(
'+amd-trans',
when='precision=quad',
msg='Quad precision is not supported with amd-trans')
conflicts(
'+amd-app-opt',
when='@:3.0.1',
msg='amd-app-opt is supported from 3.1 onwards')
conflicts(
'+amd-app-opt',
when='+mpi',
msg='mpi thread is not supported with amd-app-opt')
conflicts(
'+amd-app-opt',
when='precision=long_double',
msg='long_double precision is not supported with amd-app-opt')
conflicts(
'+amd-app-opt',
when='precision=quad',
msg='Quad precision is not supported with amd-app-opt')
def configure(self, spec, prefix):
"""Configure function"""
@ -72,28 +186,13 @@ def configure(self, spec, prefix):
# Check if compiler is AOCC
if '%aocc' in spec:
options.append("CC={0}".format(os.path.basename(spack_cc)))
options.append("FC={0}".format(os.path.basename(spack_fc)))
options.append("F77={0}".format(os.path.basename(spack_fc)))
if '+shared' in spec:
options.append('--enable-shared')
else:
options.append('--disable-shared')
options.append('CC={0}'.format(os.path.basename(spack_cc)))
options.append('FC={0}'.format(os.path.basename(spack_fc)))
options.append('F77={0}'.format(os.path.basename(spack_fc)))
if '+debug' in spec:
options.append('--enable-debug')
if '+openmp' in spec:
options.append('--enable-openmp')
else:
options.append('--disable-openmp')
if '+threads' in spec:
options.append('--enable-threads')
else:
options.append('--disable-threads')
if '+mpi' in spec:
options.append('--enable-mpi')
options.append('--enable-amd-mpifft')
@ -101,13 +200,18 @@ def configure(self, spec, prefix):
options.append('--disable-mpi')
options.append('--disable-amd-mpifft')
if '+amd-fast-planner' in spec:
options.append('--enable-amd-fast-planner')
else:
options.append('--disable-amd-fast-planner')
options.extend(self.enable_or_disable('shared'))
options.extend(self.enable_or_disable('openmp'))
options.extend(self.enable_or_disable('threads'))
options.extend(self.enable_or_disable('amd-fast-planner'))
options.extend(self.enable_or_disable('amd-top-n-planner'))
options.extend(self.enable_or_disable('amd-mpi-vader-limit'))
options.extend(self.enable_or_disable('static'))
options.extend(self.enable_or_disable('amd-trans'))
options.extend(self.enable_or_disable('amd-app-opt'))
if not self.compiler.f77 or not self.compiler.fc:
options.append("--disable-fortran")
options.append('--disable-fortran')
# Cross compilation is supported in amd-fftw by making use of target
# variable to set AMD_ARCH configure option.
@ -115,9 +219,9 @@ def configure(self, spec, prefix):
# use target variable to set appropriate -march option in AMD_ARCH.
arch = spec.architecture
options.append(
"AMD_ARCH={0}".format(
'AMD_ARCH={0}'.format(
arch.target.optimization_flags(
spec.compiler).split("=")[-1]))
spec.compiler).split('=')[-1]))
# Specific SIMD support.
# float and double precisions are supported

View File

@ -36,11 +36,22 @@ class Amdlibflame(LibflameBase):
maintainers = ['amd-toolchain-support']
version('3.1', sha256='97c74086306fa6dea9233a3730407c400c196b55f4461d4861364b1ac131ca42')
version('3.0.1', sha256='5859e7b39ffbe73115dd598b035f212d36310462cf3a45e555a5087301710776')
version('3.0', sha256='d94e08b688539748571e6d4c1ec1ce42732eac18bd75de989234983c33f01ced')
version('2.2', sha256='12b9c1f92d2c2fa637305aaa15cf706652406f210eaa5cbc17aaea9fcfa576dc')
variant('ilp64', default=False, description='Build with ILP64 support')
conflicts('+ilp64', when="@:3.0.0",
msg="ILP64 is supported from 3.0.1 onwards")
conflicts('threads=pthreads',
msg='pthread is not supported')
conflicts('threads=openmp',
msg='openmp is not supported')
patch('aocc-2.2.0.patch', when="@:2", level=1)
patch('cray-compiler-wrapper.patch')
patch('cray-compiler-wrapper.patch', when="@:3.0.0", level=1)
provides('flame@5.2', when='@2:')
@ -64,8 +75,29 @@ def configure_args(self):
if "@3.0: %aocc" in self.spec:
args.append("--enable-f2c-dotc")
if "@3.0.1: +ilp64" in self.spec:
args.append("--enable-ilp64")
if "@3.1: %aocc" in self.spec:
args.append("--enable-void-return-complex")
if "@3.1: " in self.spec:
args.append("--enable-blas-ext-gemmt")
return args
@run_after('build')
@on_package_attributes(run_tests=True)
def check(self):
"""make check for single and multithread"""
blas_flags = self.spec['blas'].libs.ld_flags
if self.spec.variants['threads'].value != 'none':
make('check',
'LIBBLAS = -fopenmp {0}'.format(blas_flags), parallel=False)
else:
make('check',
'LIBBLAS = {0}'.format(blas_flags), parallel=False)
def install(self, spec, prefix):
"""make install function"""
# make install in parallel fails with message 'File already exists'

View File

@ -25,6 +25,7 @@ class Amdlibm(SConsPackage):
# of master branch.
# To install amdlibm from latest master branch:
# spack install amdlibm ^amdlibm@master
version("3.1", branch="aocl-3.1")
version("3.0", branch="aocl-3.0")
version("2.2", commit="4033e022da428125747e118ccd6fdd9cee21c470")
@ -32,6 +33,7 @@ class Amdlibm(SConsPackage):
description="Building with verbosity")
# Mandatory dependencies
depends_on("python@3.6.2", when="%aocc@3.2.0:", type=("build", "run"))
depends_on("python@3.6.1:", type=("build", "run"))
depends_on("scons@3.1.2:", type=("build"))
depends_on("mpfr", type=("link"))
@ -39,25 +41,35 @@ class Amdlibm(SConsPackage):
patch("0001-libm-ose-Scripts-cleanup-pyc-files.patch", when="@2.2")
patch("0002-libm-ose-prevent-log-v3.c-from-building.patch", when="@2.2")
conflicts("%gcc@:9.1", msg="Minimum required GCC version is 9.2.0")
conflicts(
'%gcc@:9.1.0',
msg='Minimum required GCC version is 9.2.0')
conflicts(
'%gcc@11.2.0:',
msg='Maximum required GCC version is 11.1.0')
conflicts(
'%aocc@3.2.0',
when='@2.2:3.0',
msg='amdlibm 2.2 and 3.0 versions are not supported with AOCC 3.2.0')
def build_args(self, spec, prefix):
"""Setting build arguments for amdlibm """
args = ["--prefix={0}".format(prefix)]
if "%aocc" in spec:
args.append("--compiler=aocc")
# we are circumventing the use of
# Spacks compiler wrappers because
# SCons wipes out all environment variables.
args.append("CC={0}".format(self.compiler.cc))
args.append("CXX={0}".format(self.compiler.cxx))
if spec.satisfies("@:3.0 %aocc"):
args.append("--compiler=aocc")
var_prefix = '' if spec.satisfies("@:3.0") else 'ALM_'
args.append("{0}CC={1}".format(var_prefix, self.compiler.cc))
args.append("{0}CXX={1}".format(var_prefix, self.compiler.cxx))
if "+verbose" in spec:
args.append("verbose=1")
args.append("--verbose=1")
else:
args.append("verbose=0")
args.append("--verbose=0")
return args

View File

@ -20,11 +20,11 @@ class Amdscalapack(ScalapackBase):
_name = 'amdscalapack'
homepage = "https://developer.amd.com/amd-aocl/scalapack/"
url = "https://github.com/amd/scalapack/archive/3.0.tar.gz"
git = "https://github.com/amd/scalapack.git"
maintainers = ['amd-toolchain-support']
version('3.1', sha256='4c2ee2c44644a0feec0c6fc1b1a413fa9028f14d7035d43a398f5afcfdbacb98')
version('3.0', sha256='6e6f3578f44a8e64518d276e7580530599ecfa8729f568303ed2590688e7096f')
version('2.2', sha256='2d64926864fc6d12157b86e3f88eb1a5205e7fc157bf67e7577d0f18b9a7484c')
@ -33,6 +33,21 @@ class Amdscalapack(ScalapackBase):
default='Release',
description='CMake build type',
values=('Release', 'RelWithDebInfo'))
variant(
'ilp64',
default=False,
description='Build with ILP64 support')
conflicts('+ilp64', when="@:3.0",
msg="ILP64 is supported from 3.1 onwards")
def url_for_version(self, version):
if version == Version('3.1'):
return "https://github.com/amd/aocl-scalapack/archive/3.1.tar.gz"
elif version == Version('3.0'):
return "https://github.com/amd/scalapack/archive/3.0.tar.gz"
elif version == Version('2.2'):
return "https://github.com/amd/scalapack/archive/2.2.tar.gz"
def cmake_args(self):
""" cmake_args function"""
@ -47,8 +62,13 @@ def cmake_args(self):
args.extend(['-DUSE_DOTC_WRAPPER:BOOL=%s' % (
'ON' if spec.satisfies('%aocc ^amdblis') else 'OFF')])
# -DENABLE_ILP64:BOOL=ON
args.extend([self.define_from_variant('ENABLE_ILP64', 'ilp64')])
# -DUSE_F2C:BOOL=ON
args.extend([self.define('USE_F2C', spec.satisfies('@:3.0'))])
args.extend([
'-DUSE_F2C=ON',
'-DLAPACK_FOUND=true',
'-DCMAKE_C_COMPILER=%s' % spec['mpi'].mpicc,
'-DCMAKE_Fortran_COMPILER=%s' % spec['mpi'].mpifc,

View File

@ -20,6 +20,7 @@ class AoclSparse(CMakePackage):
maintainers = ['amd-toolchain-support']
version('3.1', sha256='8536f06095c95074d4297a3d2910654085dd91bce82e116c10368a9f87e9c7b9')
version('3.0', sha256='1d04ba16e04c065051af916b1ed9afce50296edfa9b1513211a7378e1d6b952e')
version('2.2', sha256='33c2ed6622cda61d2613ee63ff12c116a6cd209c62e54307b8fde986cd65f664')
@ -34,6 +35,7 @@ class AoclSparse(CMakePackage):
description='Build with ILP64 support')
depends_on('boost', when='@2.2')
depends_on('cmake@3.5:', type='build')
@property
def build_directory(self):

View File

@ -182,11 +182,14 @@ def write_makefile_inc(self):
optf.append('-qfixed')
# As of version 5.2.0, MUMPS is able to take advantage
# of the GEMMT BLAS extension. MKL is currently the only
# of the GEMMT BLAS extension. MKL and amdblis are the only
# known BLAS implementation supported.
if '@5.2.0: ^mkl' in self.spec:
optf.append('-DGEMMT_AVAILABLE')
if '@5.2.0: ^amdblis@3.0:' in self.spec:
optf.append('-DGEMMT_AVAILABLE')
if '+openmp' in self.spec:
optc.append(self.compiler.openmp_flag)
optf.append(self.compiler.openmp_flag)