From a412403d7be86a372d6231cb0c6b73d1e141cdb5 Mon Sep 17 00:00:00 2001 From: Taillefumier Mathieu <29380261+mtaillefumier@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:02:50 +0200 Subject: Update cosma and a few related recipes (#35615) * Add maintainers * Updated cosma archive checksum and costa version - updated cosma version (in the cosma build system) - updated costa version - use the default generic url for downloading packages - do not build tiled-mm when the cpu only version is needed Signed-off-by: Dr. Mathieu Taillefumier Co-authored-by: Rocco Meli Co-authored-by: Harmen Stoppels --- var/spack/repos/builtin/packages/cosma/package.py | 55 +++++++++++++++------- var/spack/repos/builtin/packages/costa/package.py | 28 ++++++----- .../repos/builtin/packages/semiprof/package.py | 27 +++++++++++ .../repos/builtin/packages/tiled-mm/package.py | 46 ++++++++++++++++++ 4 files changed, 128 insertions(+), 28 deletions(-) create mode 100644 var/spack/repos/builtin/packages/semiprof/package.py create mode 100644 var/spack/repos/builtin/packages/tiled-mm/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/cosma/package.py b/var/spack/repos/builtin/packages/cosma/package.py index 04c126f439..2fccafe187 100644 --- a/var/spack/repos/builtin/packages/cosma/package.py +++ b/var/spack/repos/builtin/packages/cosma/package.py @@ -12,14 +12,20 @@ class Cosma(CMakePackage): Distributed Communication-Optimal Matrix-Matrix Multiplication Library """ - maintainers("haampie", "kabicm", "teonnik") + maintainers("haampie", "kabicm", "teonnik", "simonpintarelli", "mtaillefumier") homepage = "https://github.com/eth-cscs/COSMA" - url = "https://github.com/eth-cscs/COSMA/releases/download/v2.5.1/COSMA-v2.5.1.tar.gz" + url = "https://github.com/eth-cscs/COSMA/archive/refs/tags/v2.6.6.tar.gz" git = "https://github.com/eth-cscs/COSMA.git" # note: The default archives produced with github do not have the archives # of the submodules. - version("master", branch="master", submodules=True) + version("master", branch="master", submodules=False) + version("2.6.6", sha256="1604be101e77192fbcc5551236bc87888d336e402f5409bbdd9dea900401cc37") + version("2.6.5", sha256="10d9b7ecc1ce44ec5b9e0c0bf89278a63029912ec3ea99661be8576b553ececf") + version("2.6.4", sha256="6d7bd5e3005874af9542a329c93e7ccd29ca1a5573dae27618fac2704fa2b6ab") + version("2.6.3", sha256="8ca96ca41458f1e9d0da70d524c5a03c677dba7238d23a578f852163b6d45ac9") + version("2.6.2", sha256="2debb5123cc35aeebc5fd2f8a46cfd6356d1e27618c9bb57129ecd09aa400940") + version("2.6.1", sha256="69aa6634a030674f0d9be61e7b0bf0dc17acf0fc9e7a90b40e3179e2254c8d67") version("2.5.1", sha256="085b7787597374244bbb1eb89bc69bf58c35f6c85be805e881e1c0b25166c3ce") version("2.5.0", sha256="7f68bb0ee5c80f9b8df858afcbd017ad4ed87ac09439d13d7d890844dbdd3d54") version("2.4.0", sha256="5714315ce06d48037f86cfee2d7f19340643fee95e9d7f1e92dc1b623b67e395") @@ -34,23 +40,36 @@ class Cosma(CMakePackage): variant("rocm", default=False, description="Build with rocBLAS support") variant("scalapack", default=False, description="Build with ScaLAPACK API") variant("shared", default=False, description="Build the shared library version") + variant("tests", default=False, description="Build tests") + variant("apps", default=False, description="Build miniapp") + variant("profiling", default=False, description="Enable profiling") + variant("gpu_direct", default=False, description="GPU aware MPI") - depends_on("cmake@3.12:", type="build") + with when("+cuda"): + variant("nccl", default=False, description="Use cuda nccl") + + depends_on("cmake@3.22:", type="build") depends_on("mpi@3:") depends_on("blas", when="~cuda ~rocm") depends_on("scalapack", when="+scalapack") depends_on("cuda", when="+cuda") depends_on("rocblas", when="+rocm") - def url_for_version(self, version): - if version <= Version("2.3.0"): - return "https://github.com/eth-cscs/COSMA/releases/download/v{0}/cosma.tar.gz".format( - version - ) + with when("@2.6.3:"): + depends_on("tiled-mm@2.2:+cuda", when="+cuda") + depends_on("tiled-mm@2.2:+rocm", when="+rocm") - return "https://github.com/eth-cscs/COSMA/releases/download/v{0}/COSMA-v{1}.tar.gz".format( - version, version - ) + with when("@2.6.1:2.6.2"): + depends_on("tiled-mm@2.0+rocm", when="+rocm") + depends_on("tiled-mm@2.0+cuda", when="+cuda") + + with when("@2.6.1:"): + depends_on("costa") + depends_on("costa+scalapack", when="+scalapack") + depends_on("cxxopts", when="+apps") + depends_on("cxxopts", when="+tests") + depends_on("semiprof", when="+profiling") + depends_on("costa+profiling", when="+profiling") def setup_build_environment(self, env): if "+cuda" in self.spec: @@ -58,13 +77,13 @@ class Cosma(CMakePackage): def cosma_blas_cmake_arg(self): query_to_cmake_arg = [ + ("+cuda", "CUDA"), + ("+rocm", "ROCM"), ("^intel-mkl", "MKL"), ("^intel-oneapi-mkl", "MKL"), ("^cray-libsci", "CRAY_LIBSCI"), ("^netlib-lapack", "CUSTOM"), ("^openblas", "OPENBLAS"), - ("+cuda", "CUDA"), - ("+rocm", "ROCM"), ] if self.version >= Version("2.4.0"): @@ -92,9 +111,11 @@ class Cosma(CMakePackage): def cmake_args(self): return [ - self.define("COSMA_WITH_TESTS", False), - self.define("COSMA_WITH_APPS", False), - self.define("COSMA_WITH_PROFILING", False), + self.define_from_variant("COSMA_WITH_TESTS", "tests"), + self.define_from_variant("COSMA_WITH_APPS", "apps"), + self.define_from_variant("COSMA_WITH_NCCL", "nccl"), + self.define_from_variant("COSMA_WITH_GPU_AWARE_MPI", "gpu_direct"), + self.define_from_variant("COSMA_WITH_PROFILING", "profiling"), self.define("COSMA_WITH_BENCHMARKS", False), self.define("COSMA_BLAS", self.cosma_blas_cmake_arg()), self.define("COSMA_SCALAPACK", self.cosma_scalapack_cmake_arg()), diff --git a/var/spack/repos/builtin/packages/costa/package.py b/var/spack/repos/builtin/packages/costa/package.py index 48a6fb8ec9..62e001fc39 100644 --- a/var/spack/repos/builtin/packages/costa/package.py +++ b/var/spack/repos/builtin/packages/costa/package.py @@ -13,32 +13,38 @@ class Costa(CMakePackage): Based on the paper: https://arxiv.org/abs/2106.06601 """ - maintainers("haampie", "kabicm", "RMeli") + maintainers("haampie", "kabicm", "RMeli", "mtaillefumier") homepage = "https://github.com/eth-cscs/COSTA" git = "https://github.com/eth-cscs/COSTA.git" # note: The default archives produced with github do not have the archives # of the submodules. version("master", branch="master", submodules=True) + version("2.2.2", sha256="e87bc37aad14ac0c5922237be5d5390145c9ac6aef0350ed17d86cb2d994e67c") + version("2.2.1", sha256="aa8aa2a4a79de094f857c22293825de270ff72becd6bd736ff9f2dd8c192446d") + version("2.2", sha256="3e7333f012af76ec3508276ea90800313f6136504667021fe229e710bf6acdc7") version("2.1", sha256="c1e86452415083f7470b292d93ec60708b7c8dbafc2bac383636bb4b28135866") version("2.0", sha256="de250197f31f7d23226c6956a687c3ff46fb0ff6c621a932428236c3f7925fe4") variant("scalapack", default=False, description="Build with ScaLAPACK API") variant("shared", default=False, description="Build shared libraries") + variant("profiling", default=False, description="Enable profiling") + variant("tests", default=False, description="Enable tests") + variant("apps", default=False, description="Enable miniapp") + variant("benchmarks", default=False, description="Enable benchmarks") - depends_on("cmake@3.12:", type="build") + depends_on("cmake@3.22:", type="build") depends_on("mpi@3:") depends_on("scalapack", when="+scalapack") + depends_on("cxxopts", when="+apps") + depends_on("semiprof", when="+profiling") def url_for_version(self, version): if version == Version("2.0"): return "https://github.com/eth-cscs/COSTA/releases/download/v{0}/COSTA-v{1}.tar.gz".format( version, version ) - else: - return "https://github.com/eth-cscs/COSTA/archive/refs/tags/v{0}.tar.gz".format( - version - ) + return "https://github.com/eth-cscs/COSTA/archive/refs/tags/v{0}.tar.gz".format(version) def setup_build_environment(self, env): return @@ -57,10 +63,10 @@ class Costa(CMakePackage): def cmake_args(self): return [ - self.define("COSTA_WITH_BENCHMARKS", "OFF"), - self.define("COSTA_WITH_APPS", "OFF"), - self.define("COSTA_WITH_TESTS", "OFF"), - self.define("COSTA_WITH_PROFILING", "OFF"), + self.define_from_variant("COSTA_WITH_BENCHMARKS", "benchmarks"), + self.define_from_variant("COSTA_WITH_APPS", "apps"), + self.define_from_variant("COSTA_WITH_TESTS", "tests"), + self.define_from_variant("COSTA_WITH_PROFILING", "profiling"), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define("COSTA_SCALAPACK", self.costa_scalapack_cmake_arg()), - self.define("BUILD_SHARED_LIBS", "+shared" in self.spec), ] diff --git a/var/spack/repos/builtin/packages/semiprof/package.py b/var/spack/repos/builtin/packages/semiprof/package.py new file mode 100644 index 0000000000..0506ecf7a3 --- /dev/null +++ b/var/spack/repos/builtin/packages/semiprof/package.py @@ -0,0 +1,27 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Semiprof(CMakePackage): + """Simple thread safe annotation based C++ profiler.""" + + homepage = "https://github.com/bcumming/semiprof" + url = "https://github.com/bcumming/semiprof/archive/refs/tags/v0.1.tar.gz" + + maintainers = ["simonpintarelli"] + + variant("examples", default=False) + variant("shared", default=True) + + version("0.1", sha256="4fb3823c65a4f5dfbe05e8cbe1911dfd25cd7740597f82c7b3a84472de26f0dc") + + def cmake_args(self): + return [ + self.define("SEMIPROF_WITH_INSTALL", True), + self.define_from_variant("SEMIPROF_WITH_EXAMPLES", "examples"), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + ] diff --git a/var/spack/repos/builtin/packages/tiled-mm/package.py b/var/spack/repos/builtin/packages/tiled-mm/package.py new file mode 100644 index 0000000000..c10b7a74fe --- /dev/null +++ b/var/spack/repos/builtin/packages/tiled-mm/package.py @@ -0,0 +1,46 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class TiledMm(CMakePackage, CudaPackage, ROCmPackage): + """Matrix multiplication on GPUs for matrices stored on a CPU. Similar to cublasXt, + but ported to both NVIDIA and AMD GPUs.""" + + maintainers = ["mtaillefumier", "simonpintarelli"] + homepage = "https://github.com/eth-cscs/Tiled-MM/" + url = "https://github.com/eth-cscs/Tiled-MM/archive/refs/tags/v2.0.tar.gz" + git = "https://github.com/eth-cscs/Tiled-MM.git" + + version("master", branch="master") + version("2.2", sha256="6d0b49c9588ece744166822fd44a7bc5bec3dc666b836de8bf4bf1a7bb675aac") + version("2.0", sha256="ea554aea8c53d7c8e40044e6d478c0e8137d7e8b09d7cb9650703430d92cf32e") + + variant("shared", default=True) + variant("examples", default=False) + variant("tests", default=False) + + depends_on("rocblas", when="+rocm") + depends_on("cxxopts", when="+tests") + depends_on("cxxopts", when="+examples") + + conflicts("~cuda~rocm") + conflicts("+cuda", when="+rocm") + + def cmake_args(self): + args = [ + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("TIELDMM_WITH_EXAMPLES", "examples"), + self.define_from_variant("TIELDMM_WITH_TESTS", "tests"), + ] + + if "+rocm" in self.spec: + args.extend([self.define("TILEDMM_GPU_BACKEND", "ROCM")]) + + if "+cuda" in self.spec: + args.extend([self.define("TILEDMM_GPU_BACKEND", "CUDA")]) + + return args -- cgit v1.2.3-60-g2f50