Skip to content

Commit

Permalink
RAJAPerf experiment class (#524)
Browse files Browse the repository at this point in the history
* initial progress on raja-perf

* adding complete experiment.py class

* adding dryrun

* lint

* lint

* Fix caliper

* adding tioga and ruby dryruns

---------

Co-authored-by: august-knox <[email protected]>
Co-authored-by: Riyaz Haque <[email protected]>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent 32d34d1 commit 9c72b1f
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,43 @@ jobs:
--disable-logger \
workspace setup --dry-run
- name: Dry run dynamic raja-perf/mpi with dynamic CTS ruby
run: |
./bin/benchpark experiment init --dest=raja-perf raja-perf
./bin/benchpark setup ./raja-perf ./ruby-system workspace/
system_id=$(./bin/benchpark system id ./ruby-system)
. workspace/setup.sh
ramble \
--workspace-dir "workspace/raja-perf/$system_id/workspace" \
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run
- name: Dry run dynamic raja-perf/mpi with dynamic CTS tioga
run: |
./bin/benchpark experiment init --dest=raja-perf-tioga raja-perf
./bin/benchpark setup ./raja-perf-tioga ./tioga-system workspace/
system_id=$(./bin/benchpark system id ./tioga-system)
. workspace/setup.sh
ramble \
--workspace-dir "workspace/raja-perf-tioga/$system_id/workspace" \
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run
- name: Dry run dynamic raja-perf/mpi with dynamic CTS lassen
run: |
./bin/benchpark experiment init --dest=raja-perf-lassen raja-perf
./bin/benchpark system init --dest=lassen-clang llnl-sierra compiler=clang
./bin/benchpark setup ./raja-perf-lassen ./lassen-clang workspace/
system_id=$(./bin/benchpark system id ./lassen-clang)
. workspace/setup.sh
ramble \
--workspace-dir "workspace/raja-perf-lassen/$system_id/workspace" \
--disable-progress-bar \
--disable-logger \
workspace setup --dry-run
- name: Dry run dynamic genesis/openmp with dynamic CTS ruby
run: |
system_id=$(./bin/benchpark system id ./ruby-system)
Expand Down
77 changes: 77 additions & 0 deletions experiments/raja-perf/experiment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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 benchpark.directives import variant
from benchpark.experiment import Experiment
from benchpark.scaling import StrongScaling
from benchpark.openmp import OpenMPExperiment
from benchpark.cuda import CudaExperiment
from benchpark.rocm import ROCmExperiment
from benchpark.expr.builtin.caliper import Caliper


class RajaPerf(
Experiment,
StrongScaling,
CudaExperiment,
ROCmExperiment,
OpenMPExperiment,
Caliper,
):
variant(
"workload",
default="suite",
description="base Rajaperf suite or other problem",
)

variant(
"version",
default="develop",
description="app version",
)

def compute_applications_section(self):

n_resources = {"n_ranks": 1}

if self.spec.satisfies("+single_node"):
for pk, pv in n_resources.items():
n_resources = pv

elif self.spec.satisfies("+strong"):
scaled_variables = self.generate_strong_scaling_params(
{tuple(n_resources.keys()): list(n_resources.values())},
int(self.spec.variants["scaling-factor"][0]),
int(self.spec.variants["scaling-iterations"][0]),
)
n_resources = scaled_variables["n_ranks"]

if self.spec.satisfies("+cuda") or self.spec.satisfies("+rocm"):
self.add_experiment_variable("n_gpus", n_resources, True)
elif self.spec.satisfies("+openmp"):
self.add_experiment_variable("n_ranks", n_resources, True)
self.add_experiment_variable("n_threads_per_proc", 1, True)
else:
self.add_experiment_variable("n_ranks", n_resources, True)

def compute_spack_section(self):
# get package version
app_version = self.spec.variants["version"][0]

system_specs = {}
system_specs["compiler"] = "default-compiler"
system_specs["mpi"] = "default-mpi"

if self.spec.satisfies("+cuda"):
system_specs["cuda_version"] = "{default_cuda_version}"
system_specs["cuda_arch"] = "{cuda_arch}"
if self.spec.satisfies("+rocm"):
system_specs["rocm_arch"] = "{rocm_arch}"

self.add_spack_spec(system_specs["mpi"])

self.add_spack_spec(
self.name, [f"raja-perf@{app_version}", system_specs["compiler"]]
)
9 changes: 4 additions & 5 deletions repo/raja-perf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ class RajaPerf(CachedCMakePackage, CudaPackage, ROCmPackage):
conflicts("~openmp", when="+openmp_target", msg="OpenMP target requires OpenMP")
conflicts("+cuda", when="+openmp_target", msg="Cuda may not be activated when openmp_target is ON")

depends_on("caliper@master",when="+caliper")
depends_on("caliper@master +cuda",when="+caliper +cuda")
depends_on("caliper@master +rocm",when="+caliper +rocm")
depends_on("caliper", when="+caliper")
depends_on("[email protected]:", when="+caliper")

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

Expand Down Expand Up @@ -352,12 +351,12 @@ def initconfig_package_entries(self):
entries.append(cmake_cache_option("ENABLE_TESTS", not "tests=none" in spec or self.run_tests))

entries.append(cmake_cache_option("RAJA_PERFSUITE_USE_CALIPER","+caliper" in spec))
if "caliper" in self.spec:
if "+caliper" in self.spec:
entries.append(cmake_cache_path("caliper_DIR", spec["caliper"].prefix+"/share/cmake/caliper/"))
entries.append(cmake_cache_path("adiak_DIR", spec["adiak"].prefix+"/lib/cmake/adiak/"))

return entries

def cmake_args(self):
options = []
options = [f"-DMPI_CXX_LINK_FLAGS='{self.spec['mpi'].libs.ld_flags}'"]
return options
2 changes: 1 addition & 1 deletion systems/llnl-elcapitan/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def compiler_weighting_cfg(self):
packages:
all:
require:
- one_of: ["%cce", "@:"]
- one_of: ["%cce", "%gcc"]
"""
elif compiler == "gcc":
return """\
Expand Down

0 comments on commit 9c72b1f

Please sign in to comment.