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

Stream consistency #198

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ packages:
prefix: /usr/tce/packages/fftw/fftw-3.3.10
buildable: false
mpi:
buildable: false
externals:
- spec: [email protected]
- spec: [email protected]%[email protected]
prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1
buildable: false
extra_attributes:
ldflags: "-L/usr/tce/packages/mvapich2/mvapich2-2.3.7-gcc-12.1.1/lib -lmpi"
- spec: [email protected]
- spec: [email protected]%[email protected]
prefix: /usr/tce/packages/mvapich2/mvapich2-2.3.7-intel-classic-2021.6.0
buildable: false
extra_attributes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ spack:
spack_spec: clang@=14.0.6
mpi-clang:
spack_spec: [email protected]
mpi-gcc:
spack_spec: [email protected]
blas:
spack_spec: [email protected]
cublas-cuda:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@ packages:
prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-clang-16.0.6-cuda-11.8.0-gcc-11.2.1
extra_attributes:
ldflags: "-lmpiprofilesupport -lmpi_ibm_usempi -lmpi_ibm_mpifh -lmpi_ibm"
- spec: [email protected]
prefix: /usr/tce/packages/spectrum-mpi/spectrum-mpi-rolling-release-gcc-8.3.1
buildable: false
2 changes: 2 additions & 0 deletions configs/LLNL-Sierra-IBM-power9-V100-Infiniband/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ spack:
spack_spec: [email protected]{default_cuda_version}
mpi-clang:
spack_spec: [email protected]{default_cuda_version}
mpi-gcc:
spack_spec: [email protected]
blas:
spack_spec: [email protected]
cublas-cuda:
Expand Down
2 changes: 2 additions & 0 deletions configs/LLNL-Tioga-HPECray-zen3-MI250X-Slingshot/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spack:
spack_spec: cce@16
compiler-amdclang:
spack_spec: [email protected]
compiler-gcc:
spack_spec: [email protected]
blas-rocm:
spack_spec: [email protected]
blas:
Expand Down
27 changes: 15 additions & 12 deletions experiments/streamc/openmp/ramble.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ramble:
include:
- ./configs/spack.yaml
- ./configs/variables.yaml
- ./configs/modifier.yaml

config:
deprecated: true
Expand All @@ -15,35 +16,37 @@ ramble:
concretize: '-U -f'

variables:
n_times: ['20', '35']
array_size: ['80000000', '1280000000']
n: ['35', '35', '35', '35']
s: ['32000000', '64000000', '128000000', '256000000']
o: ['0', '0', '0', '0']

applications:
streamc:
stream:
workloads:
streamc:
stream:
env_vars:
set:
OMP_NUM_THREADS: '{n_threads}'
variables:
n_ranks: '1'
experiments:
stream_{array_size}_{n_times}_{n_threads}:
stream_{s}_{o}_{n}_{n_threads}:
variables:
env_name: 'stream_{array_size}_{n_times}'
env_name: 'stream'
processes_per_node: '1'
n_nodes: '1'
n_threads: ['8', '16', '32']
n_threads: ['16', '32']
matrix:
- n_threads

spack:
concretized: true
packages:
stream_{array_size}_{n_times}:
spack_spec: '[email protected] +openmp stream_array_size={array_size} ntimes={n_times} cflags="-mcmodel=medium -Ofast -flto"'
compiler: default-compiler
stream:
spack_spec: '[email protected]-caliper+mpi{modifier_spack_variant}'
compiler: compiler-gcc
environments:
stream_{array_size}_{n_times}:
stream:
packages:
- stream_{array_size}_{n_times}
- stream
- '{modifier_package_name}'
16 changes: 16 additions & 0 deletions repo/mpi-consistency/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Lawrence Livermore National Security, LLC and other
# Benchpark Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: Apache-2.0

from spack.package import *
from spack.package_base import PackageBase


class MpiConsistency(PackageBase):
with when("+mpi%gcc"):
for implementation in ["mvapich2", "mpich", "cray-mpich"]:
for ver in [
"12.1.1",
]:
depends_on(f"{implementation}%gcc@{ver}", when=f"%gcc@{ver} ^{implementation}")
104 changes: 104 additions & 0 deletions repo/stream/application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Copyright 2023 Lawrence Livermore National Security, LLC and other
# Benchpark Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: Apache-2.0

import os
from ramble.appkit import *
from ramble.expander import Expander


class Stream(SpackApplication):
'''Define STREAM application'''
name = 'stream'

maintainers('dodecatheon')

tags('memorybenchmark', 'microbenchmark', 'memory-benchmark', 'micro-benchmark')

default_compiler('gcc12', spack_spec='[email protected]')

software_spec('stream',
spack_spec='[email protected] +openmp cflags="-O3 -DSTREAM_ARRAY_SIZE=80000000 -DNTIMES=20"',
compiler='gcc12')

required_package('stream')

executable('execute', 'stream -n {n} -s {s} -o {o}', use_mpi=True)

workload('stream', executable='execute')

workload_variable('n', default='10', description='NTIMES', workloads=['stream'])
workload_variable('s', default='10000000', description='STREAM_ARRAY_SIZE', workloads=['stream'])
workload_variable('o', default='0', description='OFFSET', workloads=['stream'])

log_file = os.path.join(Expander.expansion_str('experiment_run_dir'),
Expander.expansion_str('experiment_name') + '.out')

success_criteria('valid', mode='string',
match=r'Solution Validates: avg error less than 1.000000e-13 on all three arrays',
file=log_file)

figure_of_merit("Array size",
log_file=log_file,
fom_regex=r'Array size\s+\=\s+(?P<array_size>[0-9]+)',
group_name='array_size',
units='elements')

figure_of_merit("Array memory",
log_file=log_file,
fom_regex=r'Memory per array\s+\=\s+(?P<array_mem>[0-9]+)\.*[0-9]*',
group_name='array_mem',
units='MiB')

figure_of_merit("Total memory",
log_file=log_file,
fom_regex=r'Total memory required\s+\=\s+(?P<total_mem>[0-9]+\.*[0-9]*)',
group_name='total_mem',
units='MiB')

figure_of_merit("Number of iterations per thread",
log_file=log_file,
fom_regex=r'Each kernel will be executed\s+(?P<n_times>[0-9]+)',
group_name='n_times',
units='')

figure_of_merit("Number of threads",
log_file=log_file,
fom_regex=r'Number of Threads counted\s+\=\s+(?P<n_threads>[0-9]+\.*[0-9]*)',
group_name='n_threads',
units='')

for opName in ['Copy', 'Scale', 'Add', 'Triad']:

opname = opName.lower()

opregex = (r'^' + opName + r':' +
r'\s+(?P<' + opname + r'_top_rate>[0-9]+\.[0-9]*)' +
r'\s+(?P<' + opname + r'_avg_time>[0-9]+\.[0-9]*)' +
r'\s+(?P<' + opname + r'_min_time>[0-9]+\.[0-9]*)' +
r'\s+(?P<' + opname + r'_max_time>[0-9]+\.[0-9]*)')

figure_of_merit(opName + ' top rate',
log_file=log_file,
fom_regex=opregex,
group_name=(opname + '_top_rate'),
units='MB/s')

figure_of_merit(opName + ' average time',
log_file=log_file,
fom_regex=opregex,
group_name=(opname + '_avg_time'),
units='s')

figure_of_merit(opName + ' min time',
log_file=log_file,
fom_regex=opregex,
group_name=(opname + '_min_time'),
units='s')

figure_of_merit(opName + ' max time',
log_file=log_file,
fom_regex=opregex,
group_name=(opname + '_max_time'),
units='s')
39 changes: 39 additions & 0 deletions repo/stream/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2023 Lawrence Livermore National Security, LLC and other
# Benchpark Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: Apache-2.0

from spack.package import *
from spack.pkg.benchpark.mpi_consistency import MpiConsistency as MpiConsistency

class Stream(CMakePackage, MpiConsistency):
"""The STREAM benchmark is a simple synthetic benchmark program that
measures sustainable memory bandwidth (in MB/s) and the corresponding
computation rate for simple vector kernels.

This package builds a fork of the official code with Caliper support,
a CMake build system, and the ability to configure settings
(array size, iterations, offset) at runtime via the command line."""

homepage = "https://www.cs.virginia.edu/stream/ref.html"
git = "https://github.com/daboehme/STREAM.git"

version("5.10-caliper", git="https://github.com/daboehme/STREAM.git",
branch="caliper-benchpark")

variant("caliper", default=False, description="Enable Caliper/Adiak support")
variant("mpi", default=True, description="Enable MPI support")

requires("@5.10-caliper", when="+caliper")

depends_on("caliper", when="+caliper")
depends_on("[email protected]:", when="+caliper")

depends_on("mpi", when="+mpi")

def cmake_args(self):
args = [
self.define_from_variant("STREAM_ENABLE_CALIPER", "caliper")
]

return args