From ff6f1f51c68c85d45dbd533e511feabbe2fe11ae Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Mon, 26 Feb 2024 09:52:07 +0100 Subject: [PATCH 1/6] revert: change matrix size in test --- tests/pdgemm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pdgemm.cpp b/tests/pdgemm.cpp index facf477..ebdbb78 100644 --- a/tests/pdgemm.cpp +++ b/tests/pdgemm.cpp @@ -685,7 +685,7 @@ INSTANTIATE_TEST_CASE_P( // matrix dimensions 43176, 217, // matrix A 43176, 217, // matrix B - 217, 217, // matrix C + 2176, 217, // matrix C // block sizes 1696, 108, // matrix A From e7fc842fe3f0dae5723a1244ba050481ca32fc95 Mon Sep 17 00:00:00 2001 From: Marko Kabic Date: Wed, 7 Feb 2024 01:52:24 +0100 Subject: [PATCH 2/6] Fixed the wrong results bug in the GPU backend. --- libs/Tiled-MM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/Tiled-MM b/libs/Tiled-MM index fce5dc1..85331eb 160000 --- a/libs/Tiled-MM +++ b/libs/Tiled-MM @@ -1 +1 @@ -Subproject commit fce5dc1b1021febd2b70cf9a506cb75ac23b0684 +Subproject commit 85331eb36ec45e644761e9d44604090a92e6c4d2 From c539d8dd7ef384608bba67c2c1416b1890a3e017 Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Tue, 25 Jun 2024 11:17:38 +0200 Subject: [PATCH 3/6] use only 1 stream --- ci/cscs-daint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/cscs-daint.yml b/ci/cscs-daint.yml index 96780a6..6a212cd 100644 --- a/ci/cscs-daint.yml +++ b/ci/cscs-daint.yml @@ -89,6 +89,7 @@ pdgemm: variables: SLURM_JOB_NUM_NODES: 2 SLURM_NTASKS: 16 + COSMA_GPU_STREAMS: 1 USE_MPI: 'YES' multiply: From df5ad6716dcbb11b285ee3462808d86145196275 Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Tue, 25 Jun 2024 16:20:33 +0200 Subject: [PATCH 4/6] add tiled-mm recipe to local repo --- spack/packages/tiled-mm/package.py | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 spack/packages/tiled-mm/package.py diff --git a/spack/packages/tiled-mm/package.py b/spack/packages/tiled-mm/package.py new file mode 100644 index 0000000..c057a35 --- /dev/null +++ b/spack/packages/tiled-mm/package.py @@ -0,0 +1,52 @@ +# Copyright 2013-2024 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.""" + + 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" + + maintainers("mtaillefumier", "simonpintarelli", "RMeli") + + license("BSD-3-Clause") + + version("master", branch="master") + + version("2.3.1", sha256="68914a483e62f796b790ea428210b1d5ef5943d6289e53d1aa62f56a20fbccc8") + version("2.3", sha256="504c6201f5a9be9741c55036bf8e2656ae3f4bc19996295b264ee5e303c9253c") + version("2.2", sha256="6d0b49c9588ece744166822fd44a7bc5bec3dc666b836de8bf4bf1a7bb675aac") + version("2.0", sha256="ea554aea8c53d7c8e40044e6d478c0e8137d7e8b09d7cb9650703430d92cf32e") + + variant("shared", default=True, description="Build shared libraries") + variant("examples", default=False, description="Enable examples") + variant("tests", default=False, description="Enable tests") + + 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("TILEDMM_WITH_EXAMPLES", "examples"), + self.define_from_variant("TILEDMM_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 From 8e424419e55faf12535282986b56d567992cacbd Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Tue, 25 Jun 2024 16:20:44 +0200 Subject: [PATCH 5/6] Revert "use only 1 stream" This reverts commit 61a339e50fe3862ff9b122b5f3dab3d079ccd108. --- ci/cscs-daint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/cscs-daint.yml b/ci/cscs-daint.yml index 6a212cd..96780a6 100644 --- a/ci/cscs-daint.yml +++ b/ci/cscs-daint.yml @@ -89,7 +89,6 @@ pdgemm: variables: SLURM_JOB_NUM_NODES: 2 SLURM_NTASKS: 16 - COSMA_GPU_STREAMS: 1 USE_MPI: 'YES' multiply: From a7f19d413ba14ffba879ae423f87c57d74612e4b Mon Sep 17 00:00:00 2001 From: Simon Pintarelli Date: Thu, 27 Jun 2024 15:05:00 +0200 Subject: [PATCH 6/6] tiled-mm 2.3.1 --- ci/baseimage.cuda.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/baseimage.cuda.Dockerfile b/ci/baseimage.cuda.Dockerfile index 288d682..a022c37 100644 --- a/ci/baseimage.cuda.Dockerfile +++ b/ci/baseimage.cuda.Dockerfile @@ -63,7 +63,7 @@ RUN ldconfig # create environments for several configurations and install dependencies RUN spack env create -d /cosma-env-cuda && \ spack -e /cosma-env-cuda add "cosma@master %gcc +cuda +tests +scalapack +shared ^mpich" && \ - spack -e /cosma-env-cuda add "tiled-mm@master" && \ + spack -e /cosma-env-cuda add "tiled-mm@2.3.1" && \ spack -e /cosma-env-cuda develop -p /src cosma@master && \ spack -e /cosma-env-cuda install --only=dependencies --fail-fast @@ -75,7 +75,7 @@ RUN spack env create -d /cosma-env-cuda-gpu-direct && \ RUN spack env create -d /cosma-env-cuda-nccl && \ spack -e /cosma-env-cuda-nccl add "cosma@master %gcc +cuda +tests +scalapack +shared +nccl ^mpich " && \ - spack -e /cosma-env-cuda-nccl add "tiled-mm@master" && \ + spack -e /cosma-env-cuda-nccl add "tiled-mm@2.3.1" && \ spack -e /cosma-env-cuda-nccl develop -p /src cosma@master && \ spack -e /cosma-env-cuda-nccl install --only=dependencies --fail-fast