From 1141060fc433eee436f7de1f7f23ed164045011a Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 8 Nov 2024 15:58:10 +0000 Subject: [PATCH 1/8] Update purify to run with changes I'm working on --- benchmarks/apps/purify/purify.py | 33 ++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/benchmarks/apps/purify/purify.py b/benchmarks/apps/purify/purify.py index 0f2c6e61..1024ddc9 100644 --- a/benchmarks/apps/purify/purify.py +++ b/benchmarks/apps/purify/purify.py @@ -114,17 +114,42 @@ class PurifyPADMMBenchmark_PratleyEtAl(PurifyBase): threads = 16 tasks = parameter([1,2,3,4,8,12]) - executable = 'mpi_benchmark_PADMM' + executable = 'mpi_benchmark_algorithms' time_limit = '60m' - algorithm = parameter([1,3]) + algorithm = parameter(["DistributeImage", "DistributeGrid"]) numberOfVisibilities = parameter([10**6, 10**7]) imgsize = parameter([1024]) @run_after('setup') def filter_benchmarks(self): - self.executable_opts.append(f'--benchmark_filter=PadmmFixtureMPI/' - f'ApplyAlgo{self.algorithm}' + self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' + f'Padmm{self.algorithm}' + f'/{self.imgsize}/{self.numberOfVisibilities}/') + self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' + self.num_tasks = self.tasks + self.num_cpus_per_task = self.threads + self.num_tasks_per_node = 1 + +@rfm.simple_test +class PurifyForwardBackwardBenchmark(PurifyBase): + """ + This benchmark uses the Forward Backward algorithm, otherwise it's similar to PurifyPADMMBenchmark. + """ + threads = 16 + tasks = parameter([1,2,3,4,8,12]) + + executable = 'mpi_benchmark_algorithms' + time_limit = '60m' + + algorithm = parameter([1,2]) + numberOfVisibilities = parameter([10**6, 10**7]) + imgsize = parameter([1024]) + + @run_after('setup') + def filter_benchmarks(self): + self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' + f'Fb{self.algorithm}' f'/{self.imgsize}/{self.numberOfVisibilities}/') self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' self.num_tasks = self.tasks From 34dac4137c74d2e71b57a031941d3293e96ac8de Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 8 Nov 2024 16:19:26 +0000 Subject: [PATCH 2/8] Fix algorithm in FB --- benchmarks/apps/purify/purify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/apps/purify/purify.py b/benchmarks/apps/purify/purify.py index 1024ddc9..283a2a8b 100644 --- a/benchmarks/apps/purify/purify.py +++ b/benchmarks/apps/purify/purify.py @@ -142,7 +142,7 @@ class PurifyForwardBackwardBenchmark(PurifyBase): executable = 'mpi_benchmark_algorithms' time_limit = '60m' - algorithm = parameter([1,2]) + algorithm = parameter(["DistributeImage", "DistributeGrid"]) numberOfVisibilities = parameter([10**6, 10**7]) imgsize = parameter([1024]) From 9d704c54983e2c1ef7318cf11d77425ee977a521 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Thu, 12 Dec 2024 11:23:01 +0000 Subject: [PATCH 3/8] Add FB Onnx benchmark --- benchmarks/apps/purify/purify.py | 38 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/benchmarks/apps/purify/purify.py b/benchmarks/apps/purify/purify.py index 283a2a8b..02960b3a 100644 --- a/benchmarks/apps/purify/purify.py +++ b/benchmarks/apps/purify/purify.py @@ -10,7 +10,7 @@ class PurifyBase(SpackTest): valid_systems = ['*'] valid_prog_environs = ['default'] - spack_spec = 'purify@4.2.0+benchmarks' + spack_spec = 'purify@4.2.0+benchmarks+mpi+openmp' executable_opts = ['--benchmark_format=csv', '--benchmark_out=purify_benchmark.out', '--benchmark_out_format=csv'] @@ -117,14 +117,14 @@ class PurifyPADMMBenchmark_PratleyEtAl(PurifyBase): executable = 'mpi_benchmark_algorithms' time_limit = '60m' - algorithm = parameter(["DistributeImage", "DistributeGrid"]) + algorithm = parameter(["PadmmDistributeImage", "PadmmDistributeGrid"]) numberOfVisibilities = parameter([10**6, 10**7]) imgsize = parameter([1024]) @run_after('setup') def filter_benchmarks(self): self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' - f'Padmm{self.algorithm}' + f'{self.algorithm}' f'/{self.imgsize}/{self.numberOfVisibilities}/') self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' self.num_tasks = self.tasks @@ -137,21 +137,47 @@ class PurifyForwardBackwardBenchmark(PurifyBase): This benchmark uses the Forward Backward algorithm, otherwise it's similar to PurifyPADMMBenchmark. """ threads = 16 - tasks = parameter([1,2,3,4,8,12]) + tasks = parameter([1,2,4,8,16]) + + executable = 'mpi_benchmark_algorithms' + time_limit = '60m' + algorithm = parameter(["FbDistributeImage", "FbDistributeGrid"]) + numberOfVisibilities = parameter([10**6, 10**7]) + imgsize = parameter([1024]) + + @run_after('setup') + def filter_benchmarks(self): + self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' + f'{self.algorithm}' + f'/{self.imgsize}/{self.numberOfVisibilities}/') + self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' + self.num_tasks = self.tasks + self.num_cpus_per_task = self.threads + self.num_tasks_per_node = 1 + +@rfm.simple_test +class PurifyForwardBackwardOnnxBenchmark(PurifyBase): + """ + This benchmark uses the Forward Backward algorithm, otherwise it's similar to PurifyPADMMBenchmark. + """ + threads = 16 + tasks = parameter([1,2,4,8,16]) + executable = 'mpi_benchmark_algorithms' time_limit = '60m' - algorithm = parameter(["DistributeImage", "DistributeGrid"]) + algorithm = parameter(["FbOnnxDistributeImage", "FbOnnxDistributeGrid"]) numberOfVisibilities = parameter([10**6, 10**7]) imgsize = parameter([1024]) @run_after('setup') def filter_benchmarks(self): self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' - f'Fb{self.algorithm}' + f'{self.algorithm}' f'/{self.imgsize}/{self.numberOfVisibilities}/') self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' self.num_tasks = self.tasks self.num_cpus_per_task = self.threads self.num_tasks_per_node = 1 + self.spack_spec = self.spack_spec + '+onnxrt' From 7b4aee6ba8beb2496f291239615bc67563c2d25b Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 17 Jan 2025 14:21:15 +0000 Subject: [PATCH 4/8] Isambard-3 env update --- benchmarks/spack/isambard3/grace/spack.yaml | 46 +++++++++++++++------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/benchmarks/spack/isambard3/grace/spack.yaml b/benchmarks/spack/isambard3/grace/spack.yaml index c4f36602..a8a27011 100644 --- a/benchmarks/spack/isambard3/grace/spack.yaml +++ b/benchmarks/spack/isambard3/grace/spack.yaml @@ -4,8 +4,6 @@ # configuration settings. spack: # add package specs to the `specs` list - specs: - - purify+mpi view: false include: - ../../common.yaml @@ -25,6 +23,18 @@ spack: environment: {} extra_rpaths: [] packages: + cmake: + externals: + - spec: cmake@3.20.4 + prefix: /usr + python: + externals: + - spec: python@3.11.7+bz2+crypt+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib + prefix: /lfs1i3/home/lexci-i3/tkoskela.lexci-i3/python_envs/test + - spec: python@3.11.7+bz2+crypt+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib + prefix: /opt/cray/pe/python/3.11.7 + - spec: python@3.6.15+bz2+crypt+ctypes+dbm+lzma+pyexpat~pythoncmd+readline+sqlite3+ssl~tkinter+uuid+zlib + prefix: /usr groff: externals: - spec: groff@1.22.4 @@ -81,10 +91,6 @@ spack: externals: - spec: automake@1.15.1 prefix: /usr - cmake: - externals: - - spec: cmake@3.20.4 - prefix: /usr pkg-config: externals: - spec: pkg-config@0.29.2 @@ -146,9 +152,25 @@ spack: modules: - craype-network-ofi - cray-mpich/8.1.29 - # cray-fftw: - # externals: - # - spec: cray-fftw@3.3.10.7 - # prefix: /opt/cray/pe/fftw/3.3.10.7/arm_grace/ - # modules: - # - brics/cray-fftw/3.3.10.7 + py-numpy: + externals: + - spec: py-numpy@1.24.4 + modules: + - cray-python + prefix: /opt/cray/pe/python/3.11.7 + buildable: false + py-scipy: + externals: + - spec: py-scipy@1.10.1 + modules: + - cray-python + prefix: /opt/cray/pe/python/3.11.7 + buildable: false + py-mpi4py: + externals: + - spec: py-mpi4py@3.1.4 + modules: + - cray-python + prefix: /opt/cray/pe/python/3.11.7 + buildable: false + specs: [] From efe8c2d054888d3064eb2420954cc40fbee07ea2 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 17 Jan 2025 14:28:26 +0000 Subject: [PATCH 5/8] Use latest release and add some checks --- benchmarks/apps/purify/purify.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/benchmarks/apps/purify/purify.py b/benchmarks/apps/purify/purify.py index 02960b3a..f6d8b252 100644 --- a/benchmarks/apps/purify/purify.py +++ b/benchmarks/apps/purify/purify.py @@ -10,7 +10,7 @@ class PurifyBase(SpackTest): valid_systems = ['*'] valid_prog_environs = ['default'] - spack_spec = 'purify@4.2.0+benchmarks+mpi+openmp' + spack_spec = 'purify@5.0.0+mpi+openmp+benchmarks ^fftw' executable_opts = ['--benchmark_format=csv', '--benchmark_out=purify_benchmark.out', '--benchmark_out_format=csv'] @@ -104,7 +104,7 @@ def filter_benchmarks(self): self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' self.num_tasks = self.tasks self.num_cpus_per_task = self.threads - self.num_tasks_per_node = 1 + self.num_tasks_per_node = max(1,self.current_partition.processor.num_sockets) @rfm.simple_test class PurifyPADMMBenchmark_PratleyEtAl(PurifyBase): @@ -129,7 +129,7 @@ def filter_benchmarks(self): self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' self.num_tasks = self.tasks self.num_cpus_per_task = self.threads - self.num_tasks_per_node = 1 + self.num_tasks_per_node = max(1,self.current_partition.processor.num_sockets) @rfm.simple_test class PurifyForwardBackwardBenchmark(PurifyBase): @@ -161,7 +161,8 @@ class PurifyForwardBackwardOnnxBenchmark(PurifyBase): """ This benchmark uses the Forward Backward algorithm, otherwise it's similar to PurifyPADMMBenchmark. """ - threads = 16 + omp_threads = parameter([16]) + ort_threads = parameter([16]) tasks = parameter([1,2,4,8,16]) executable = 'mpi_benchmark_algorithms' @@ -174,10 +175,10 @@ class PurifyForwardBackwardOnnxBenchmark(PurifyBase): @run_after('setup') def filter_benchmarks(self): self.executable_opts.append(f'--benchmark_filter=AlgoFixtureMPI/' - f'{self.algorithm}' - f'/{self.imgsize}/{self.numberOfVisibilities}/') - self.env_vars['OMP_NUM_THREADS'] = f'{self.threads}' + f'{self.algorithm}/{self.imgsize}/{self.numberOfVisibilities}/') + self.env_vars['OMP_NUM_THREADS'] = f'{self.omp_threads}' + self.env_vars['ORT_NUM_THREADS'] = f'{self.ort_threads}' self.num_tasks = self.tasks - self.num_cpus_per_task = self.threads - self.num_tasks_per_node = 1 - self.spack_spec = self.spack_spec + '+onnxrt' + self.num_cpus_per_task = max(self.omp_threads, self.ort_threads) + self.num_tasks_per_node = max(1,self.current_partition.processor.num_sockets) + self.spack_spec = 'purify@5.0.0+mpi+openmp+benchmarks+onnxrt ^fftw' From 29bf30ea50d9c2af8f157609a965e47503389b57 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 17 Jan 2025 14:41:50 +0000 Subject: [PATCH 6/8] remove private python package --- benchmarks/spack/isambard3/grace/spack.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/benchmarks/spack/isambard3/grace/spack.yaml b/benchmarks/spack/isambard3/grace/spack.yaml index a8a27011..8ef279fd 100644 --- a/benchmarks/spack/isambard3/grace/spack.yaml +++ b/benchmarks/spack/isambard3/grace/spack.yaml @@ -29,8 +29,6 @@ spack: prefix: /usr python: externals: - - spec: python@3.11.7+bz2+crypt+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib - prefix: /lfs1i3/home/lexci-i3/tkoskela.lexci-i3/python_envs/test - spec: python@3.11.7+bz2+crypt+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib prefix: /opt/cray/pe/python/3.11.7 - spec: python@3.6.15+bz2+crypt+ctypes+dbm+lzma+pyexpat~pythoncmd+readline+sqlite3+ssl~tkinter+uuid+zlib From 124bf16db706b584e1c9668fe8a4c7b84fdbf594 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 17 Jan 2025 14:59:56 +0000 Subject: [PATCH 7/8] add python version dependency to specs to avoid version clashes --- benchmarks/spack/isambard3/grace/spack.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/spack/isambard3/grace/spack.yaml b/benchmarks/spack/isambard3/grace/spack.yaml index 8ef279fd..d5cd9e97 100644 --- a/benchmarks/spack/isambard3/grace/spack.yaml +++ b/benchmarks/spack/isambard3/grace/spack.yaml @@ -152,21 +152,21 @@ spack: - cray-mpich/8.1.29 py-numpy: externals: - - spec: py-numpy@1.24.4 + - spec: py-numpy@1.24.4 ^python@3.11.7 modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 buildable: false py-scipy: externals: - - spec: py-scipy@1.10.1 + - spec: py-scipy@1.10.1 ^python@3.11.7 modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 buildable: false py-mpi4py: externals: - - spec: py-mpi4py@3.1.4 + - spec: py-mpi4py@3.1.4 ^python@3.11.7 modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 From 38c1506a3d23a1174e53634f0d6f2fca883a1db0 Mon Sep 17 00:00:00 2001 From: Tuomas Koskela Date: Fri, 17 Jan 2025 15:09:14 +0000 Subject: [PATCH 8/8] remove buildable:false to simplify environment resolution --- benchmarks/spack/isambard3/grace/spack.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/benchmarks/spack/isambard3/grace/spack.yaml b/benchmarks/spack/isambard3/grace/spack.yaml index d5cd9e97..90f36543 100644 --- a/benchmarks/spack/isambard3/grace/spack.yaml +++ b/benchmarks/spack/isambard3/grace/spack.yaml @@ -156,19 +156,17 @@ spack: modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 - buildable: false py-scipy: externals: - spec: py-scipy@1.10.1 ^python@3.11.7 modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 - buildable: false py-mpi4py: externals: - spec: py-mpi4py@3.1.4 ^python@3.11.7 modules: - cray-python prefix: /opt/cray/pe/python/3.11.7 - buildable: false - specs: [] + specs: + - purify+onnxrt