AMD Optimized CPU Libraries: add v4.0 (#34681)

What's in AOCL 4.0:
1. amdblis
        LPGEMM variants with post-ops support
        AMD "Zen4" support for BLIS

2. amdlibflame
        Upgrade to LAPACK 3.10.1 specification
        Improvements in a few more variants of SVD and Eigen Value routines
        Multithread support enabled for selected APIs

3. amdfftw
        AVX-512 enablement of DFT kernels
        AVX-512 optimization of copy and transpose routines

5. amdlibm
        Black & Scholes support (logf, expf, erff, both scalar and vector)
        AVX-512 variants of vector functions

6. aocl-sparse
        New Iterative Solver APIs
        AVX-512 support for SPMV API

7. amdscalapack
        Upgrade to Netlib ScaLAPACK 2.2.0

Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
This commit is contained in:
AMD Toolchain Support 2023-01-16 16:35:31 +05:30 committed by GitHub
parent 55f71e41d5
commit b9048dbee9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 94 additions and 36 deletions

View File

@ -11,12 +11,20 @@ class AmdAocl(BundlePackage):
libraries tuned specifically for AMD EPYC processor family. They have a
simple interface to take advantage of the latest hardware innovations.
The tuned implementations of industry standard math libraries enable
fast development of scientific and high performance computing projects"""
fast development of scientific and high performance computing projects
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL license agreement.
You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/aocl-eula.html
https://www.amd.com/en/developer/aocl/aocl-4-0-eula.html
"""
homepage = "https://developer.amd.com/amd-aocl/"
maintainers = ["amd-toolchain-support"]
version("4.0")
version("3.2")
version("3.1")
version("3.0")
@ -24,7 +32,7 @@ class AmdAocl(BundlePackage):
variant("openmp", default=False, description="Enable OpenMP support.")
for vers in ["2.2", "3.0", "3.1", "3.2"]:
for vers in ["2.2", "3.0", "3.1", "3.2", "4.0"]:
depends_on("amdblis@{0} threads=openmp".format(vers), when="@{0} +openmp".format(vers))
depends_on("amdblis@{0} threads=none".format(vers), when="@{0} ~openmp".format(vers))
depends_on("amdfftw@{0} +openmp".format(vers), when="@{0} +openmp".format(vers))

View File

@ -2,6 +2,7 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack.package import *
@ -16,6 +17,12 @@ class Amdblis(BlisBase):
isolate essential kernels of computation that, when optimized, immediately
enable optimized implementations of most of its commonly used and
computationally intensive operations.
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-BLIS license
agreement. You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/blis/blis-4-0-eula.html
https://www.amd.com/en/developer/aocl/blis/blis-eula.html
"""
_name = "amdblis"
@ -25,6 +32,7 @@ class Amdblis(BlisBase):
maintainers = ["amd-toolchain-support"]
version("4.0", sha256="cddd31176834a932753ac0fc4c76332868feab3e9ac607fa197d8b44c1e74a41")
version("3.2", sha256="5a400ee4fc324e224e12f73cc37b915a00f92b400443b15ce3350278ad46fff6")
version("3.1", sha256="2891948925b9db99eec02a1917d9887a7bee9ad2afc5421c9ba58602a620f2bf")
version("3.0.1", sha256="dff643e6ef946846e91e8f81b75ff8fe21f1f2d227599aecd654d184d9beff3e")

View File

@ -22,6 +22,12 @@ class Amdfftw(FftwBase):
For single precision build, please use precision value as float.
Example : spack install amdfftw precision=float
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-FFTW license
agreement. You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/fftw/fftw-libraries-4-0-eula.html
https://www.amd.com/en/developer/aocl/fftw/fftw-libraries-eula.html
"""
_name = "amdfftw"
@ -31,6 +37,7 @@ class Amdfftw(FftwBase):
maintainers = ["amd-toolchain-support"]
version("4.0", sha256="5f02cb05f224bd86bd88ec6272b294c26dba3b1d22c7fb298745fd7b9d2271c0")
version("3.2", sha256="31cab17a93e03b5b606e88dd6116a1055b8f49542d7d0890dbfcca057087b8d0")
version("3.1", sha256="3e777f3acef13fa1910db097e818b1d0d03a6a36ef41186247c6ab1ab0afc132")
version("3.0.1", sha256="87030c6bbb9c710f0a64f4f306ba6aa91dc4b182bb804c9022b35aef274d1a4c")
@ -44,9 +51,9 @@ class Amdfftw(FftwBase):
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(
@ -210,7 +217,7 @@ def configure(self, spec, prefix):
# Specific SIMD support.
# float and double precisions are supported
simd_features = ["sse2", "avx", "avx2"]
simd_features = ["sse2", "avx", "avx2", "avx512"]
simd_options = []
for feature in simd_features:

View File

@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
# ----------------------------------------------------------------------------\
from spack.package import *
from spack.pkg.builtin.libflame import LibflameBase
@ -28,6 +29,12 @@ class Amdlibflame(LibflameBase):
In combination with BLIS library which includes optimizations
for the AMD EPYC processor family, libFLAME enables running
high performing LAPACK functionalities on AMD platform.
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-libFLAME license
agreement. You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/blis/libflame-4-0-eula.html
https://www.amd.com/en/developer/aocl/blis/libflame-eula.html
"""
_name = "amdlibflame"
@ -37,6 +44,7 @@ class Amdlibflame(LibflameBase):
maintainers = ["amd-toolchain-support"]
version("4.0", sha256="bcb05763aa1df1e88f0da5e43ff86d956826cbea1d9c5ff591d78a3e091c66a4")
version("3.2", sha256="6b5337fb668b82d0ed0a4ab4b5af4e2f72e4cedbeeb4a8b6eb9a3ef057fb749a")
version("3.1", sha256="4520fb93fcc89161f65a40810cae0fa1f87cecb242da4a69655f502545a53426")
version("3.0.1", sha256="5859e7b39ffbe73115dd598b035f212d36310462cf3a45e555a5087301710776")

View File

@ -14,21 +14,25 @@ class Amdlibm(SConsPackage):
many routines from the list of standard C99 math functions.
Applications can link into AMD LibM library and invoke math functions
instead of compiler's math functions for better accuracy and
performance."""
performance.
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-FFTW license
agreement. You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/libm/libm-4-0-eula.html
https://www.amd.com/en/developer/aocl/libm/libm-eula.html
"""
_name = "amdlibm"
homepage = "https://developer.amd.com/amd-aocl/amd-math-library-libm/"
git = "https://github.com/amd/aocl-libm-ose.git"
url = "https://github.com/amd/aocl-libm-ose/archive/refs/tags/3.0.tar.gz"
maintainers = ["amd-toolchain-support"]
# If a user who doesn't specify a version
# amdlibm installed for commit ID:4033e02
# of master branch.
# To install amdlibm from latest master branch:
# spack install amdlibm ^amdlibm@master
version("3.2", branch="aocl-3.2")
version("3.1", branch="aocl-3.1")
version("3.0", branch="aocl-3.0")
version("4.0", sha256="038c1eab544be77598eccda791b26553d3b9e2ee4ab3f5ad85fdd2a77d015a7d")
version("3.2", sha256="c75b287c38a3ce997066af1f5c8d2b19fc460d5e56678ea81f3ac33eb79ec890")
version("3.1", sha256="dee487cc2d89c2dc93508be2c67592670ffc1d02776c017e8907317003f48845")
version("3.0", sha256="eb26b5e174f43ce083928d0d8748a6d6d74853333bba37d50057aac2bef7c7aa")
version("2.2", commit="4033e022da428125747e118ccd6fdd9cee21c470")
variant("verbose", default=False, description="Building with verbosity")
@ -41,13 +45,10 @@ 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.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",
)
conflicts("%gcc@:9.1.0", msg="Minimum supported GCC version is 9.2.0")
conflicts("%gcc@12.2.0:", msg="Maximum supported GCC version is 12.1.0")
conflicts("%clang@9:", msg="Minimum supported Clang version is 9.0.0")
conflicts("%aocc@3.2.0", msg="dependency on python@3.6.2")
def build_args(self, spec, prefix):
"""Setting build arguments for amdlibm"""
@ -56,14 +57,14 @@ def build_args(self, spec, prefix):
# we are circumventing the use of
# Spacks compiler wrappers because
# SCons wipes out all environment variables.
if spec.satisfies("@:3.0 %aocc"):
if self.spec.satisfies("@:3.0 %aocc"):
args.append("--compiler=aocc")
var_prefix = "" if spec.satisfies("@:3.0") else "ALM_"
var_prefix = "" if self.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:
if "+verbose" in self.spec:
args.append("--verbose=1")
else:
args.append("--verbose=0")
@ -78,3 +79,6 @@ def create_symlink(self):
with working_dir(self.prefix.lib):
os.symlink("libalm.a", "libamdlibm.a")
os.symlink("libalm.so", "libamdlibm.so")
if self.spec.satisfies("@4.0:"):
os.symlink("libalmfast.a", "libamdlibmfast.a")
os.symlink("libalmfast.so", "libamdlibmfast.so")

View File

@ -16,6 +16,12 @@ class Amdscalapack(ScalapackBase):
AMD's optimized version of ScaLAPACK enables using BLIS and
LibFLAME library that have optimized dense matrix functions and
solvers for AMD EPYC processor family CPUs.
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-ScaLAPACK license
agreement. You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/scalapack/scalapack-libraries-4-0-eula.html
https://www.amd.com/en/developer/aocl/scalapack/scalapack-libraries-eula.html
"""
_name = "amdscalapack"
@ -24,6 +30,7 @@ class Amdscalapack(ScalapackBase):
maintainers = ["amd-toolchain-support"]
version("4.0", sha256="f02913b5984597b22cdb9a36198ed61039a1bf130308e778dc31b2a7eb88b33b")
version("3.2", sha256="9e00979bb1be39d627bdacb01774bc043029840d542fafc934d16fec3e3b0892")
version("3.1", sha256="4c2ee2c44644a0feec0c6fc1b1a413fa9028f14d7035d43a398f5afcfdbacb98")
version("3.0", sha256="6e6f3578f44a8e64518d276e7580530599ecfa8729f568303ed2590688e7096f")

View File

@ -12,21 +12,28 @@ class AoclSparse(CMakePackage):
"""AOCL-Sparse is a library that contains basic linear algebra subroutines
for sparse matrices and vectors optimized for AMD EPYC family of processors.
It is designed to be used with C and C++. Current functionality of sparse
library supports SPMV function with CSR and ELLPACK formats."""
library supports SPMV function with CSR and ELLPACK formats.
LICENSING INFORMATION: By downloading, installing and using this software,
you agree to the terms and conditions of the AMD AOCL-Sparse license agreement.
You may obtain a copy of this license agreement from
https://www.amd.com/en/developer/aocl/sparse/sparse-libraries-4-0-eula.html
https://www.amd.com/en/developer/aocl/sparse/sparse-libraries-eula.html
"""
_name = "aocl-sparse"
homepage = "https://developer.amd.com/amd-aocl/aocl-sparse/"
url = "https://github.com/amd/aocl-sparse/archive/3.0.tar.gz"
git = "https://github.com/amd/aocl-sparse.git"
maintainers = ["amd-toolchain-support"]
version("4.0", sha256="68524e441fdc7bb923333b98151005bed39154d9f4b5e8310b5c37de1d69c2c3")
version("3.2", sha256="db7d681a8697d6ef49acf3e97e8bec35b048ce0ad74549c3b738bbdff496618f")
version("3.1", sha256="8536f06095c95074d4297a3d2910654085dd91bce82e116c10368a9f87e9c7b9")
version("3.0", sha256="1d04ba16e04c065051af916b1ed9afce50296edfa9b1513211a7378e1d6b952e")
version("2.2", sha256="33c2ed6622cda61d2613ee63ff12c116a6cd209c62e54307b8fde986cd65f664")
conflicts("%gcc@:9.1", msg="Minimum required GCC version is 9.2.0")
variant(
"build_type",
default="Release",
@ -35,7 +42,17 @@ class AoclSparse(CMakePackage):
)
variant("shared", default=True, description="Build shared library")
variant("ilp64", default=False, description="Build with ILP64 support")
variant("examples", default=False, description="Build sparse examples")
variant("unit_tests", default=False, description="Build sparse unit tests")
variant("benchmarks", default=False, description="Build Build benchmarks")
variant(
"avx",
default=False,
when="@4.0: target=zen4:",
description="Enable experimental AVX512 support",
)
depends_on("boost", when="+benchmarks")
depends_on("boost", when="@2.2")
depends_on("cmake@3.5:", type="build")
@ -70,15 +87,14 @@ def cmake_args(self):
else:
args.append("-DCMAKE_BUILD_TYPE=Release")
args.extend(
[
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
"-DBUILD_CLIENTS_BENCHMARKS:BOOL=%s" % ("ON" if self.run_tests else "OFF"),
]
)
args.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
args.append(self.define_from_variant("BUILD_CLIENTS_SAMPLES", "examples"))
args.append(self.define_from_variant("BUILD_CLIENTS_TESTS", "unit_tests"))
args.append(self.define_from_variant("BUILD_CLIENTS_BENCHMARKS", "benchmarks"))
args.append(self.define_from_variant("USE_AVX512", "avx"))
if spec.satisfies("@3.0:"):
args.extend([self.define_from_variant("BUILD_ILP64", "ilp64")])
args.append(self.define_from_variant("BUILD_ILP64", "ilp64"))
return args