Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Isambard-3 spack env and purify benchmark #356

Merged
merged 9 commits into from
Jan 17, 2025
64 changes: 58 additions & 6 deletions benchmarks/apps/purify/purify.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PurifyBase(SpackTest):
valid_systems = ['*']
valid_prog_environs = ['default']

spack_spec = 'purify@4.2.0+benchmarks'
spack_spec = 'purify@5.0.0+mpi+openmp+benchmarks ^fftw'
executable_opts = ['--benchmark_format=csv',
'--benchmark_out=purify_benchmark.out',
'--benchmark_out_format=csv']
Expand Down Expand Up @@ -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):
Expand All @@ -114,19 +114,71 @@ 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(["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'{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 = max(1,self.current_partition.processor.num_sockets)

@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,4,8,16])

executable = 'mpi_benchmark_algorithms'
time_limit = '60m'

algorithm = parameter([1,3])
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=PadmmFixtureMPI/'
f'ApplyAlgo{self.algorithm}'
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.
"""
omp_threads = parameter([16])
ort_threads = parameter([16])
tasks = parameter([1,2,4,8,16])

executable = 'mpi_benchmark_algorithms'
time_limit = '60m'

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'{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 = max(self.omp_threads, self.ort_threads)
self.num_tasks_per_node = max(1,self.current_partition.processor.num_sockets)
self.spack_spec = '[email protected]+mpi+openmp+benchmarks+onnxrt ^fftw'
46 changes: 34 additions & 12 deletions benchmarks/spack/isambard3/grace/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# configuration settings.
spack:
# add package specs to the `specs` list
specs:
- purify+mpi
view: false
include:
- ../../common.yaml
Expand All @@ -25,6 +23,18 @@ spack:
environment: {}
extra_rpaths: []
packages:
cmake:
externals:
- spec: [email protected]
prefix: /usr
python:
externals:
- spec: [email protected]+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
giordano marked this conversation as resolved.
Show resolved Hide resolved
- spec: [email protected]+bz2+crypt+ctypes+dbm+lzma+pyexpat+pythoncmd+readline+sqlite3+ssl+tix+tkinter+uuid+zlib
prefix: /opt/cray/pe/python/3.11.7
- spec: [email protected]+bz2+crypt+ctypes+dbm+lzma+pyexpat~pythoncmd+readline+sqlite3+ssl~tkinter+uuid+zlib
prefix: /usr
groff:
externals:
- spec: [email protected]
Expand Down Expand Up @@ -81,10 +91,6 @@ spack:
externals:
- spec: [email protected]
prefix: /usr
cmake:
externals:
- spec: [email protected]
prefix: /usr
pkg-config:
externals:
- spec: [email protected]
Expand Down Expand Up @@ -146,9 +152,25 @@ spack:
modules:
- craype-network-ofi
- cray-mpich/8.1.29
# cray-fftw:
# externals:
# - spec: [email protected]
# prefix: /opt/cray/pe/fftw/3.3.10.7/arm_grace/
# modules:
# - brics/cray-fftw/3.3.10.7
py-numpy:
externals:
- spec: [email protected]
modules:
- cray-python
prefix: /opt/cray/pe/python/3.11.7
buildable: false
py-scipy:
externals:
- spec: [email protected]
modules:
- cray-python
prefix: /opt/cray/pe/python/3.11.7
buildable: false
py-mpi4py:
externals:
- spec: [email protected]
modules:
- cray-python
prefix: /opt/cray/pe/python/3.11.7
buildable: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for using buildable: false for this packages? Also, I believe you want also to append ^ [email protected] to all these specs, to avoid making it match with other versions of python.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought buildable: false guarantees that the external will always get used. Is it too strong requirement? Happy to remove it if you think that's better. Adding the python version to the spec

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildable: false complicates environment resolution quite a bit whenever a package appears in the environment. I'd expect troubles for py-numpy and py-scipy because they're somewhat common, py-mpi4py less so and I'd hope spack links it to the right MPI library anyway.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for explaining. My builds seem fine after removing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, one problem could be the following: for some reason a package in the environment requires a specific version of python and that's not compatible with 3.11.7 (say 3.10 or 3.12), another package needs py-numpy, then you end up in the situation where you can't concretize the environment at all. We do use buildable: false for MPI, but we do really want to enforce using system MPI libraries only, I don't see that requirement being useful for python and python packages.

specs: []