Skip to content
Draft
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
97 changes: 80 additions & 17 deletions experiments/kripke/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,24 @@ class Kripke(
)

variant(
"single_memory",
"gpu-aware-mpi",
default=False,
description="Enable single memory space model in rocm",
values=(True, False),
description="Enable GPU-aware MPI",
)

variant(
"other",
default=False,
"problem_size",
default="large",
values=("large", "medium", "small"),
description="Problem size",
)

variant(
"chai",
default=True,
values=(True, False),
description="Set other input/environment variables",
description="Enable CHAI",
)

maintainers("pearce8")
Expand Down Expand Up @@ -98,6 +106,7 @@ def compute_applications_section(self):
if self.spec.satisfies("+throughput"):
problem_spec = {
"nzx": [
64,
80,
100,
120,
Expand All @@ -106,8 +115,13 @@ def compute_applications_section(self):
180,
200,
220,
240,
260,
280,
300,
],
"nzy": [
64,
80,
100,
120,
Expand All @@ -116,8 +130,13 @@ def compute_applications_section(self):
180,
200,
220,
240,
260,
280,
300,
],
"nzz": [
32,
40,
50,
60,
Expand All @@ -126,11 +145,15 @@ def compute_applications_section(self):
90,
100,
110,
120,
130,
140,
150,
],
"pool": 120,
"npx": [2, 2, 2, 2, 2, 2, 2, 2],
"npy": [2, 2, 2, 2, 2, 2, 2, 2],
"npz": [1, 1, 1, 1, 1, 1, 1, 1],
"npx": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
"npy": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
"npz": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"ngroups": 48,
"gs": 1,
"nquad": 80,
Expand All @@ -144,6 +167,45 @@ def compute_applications_section(self):
"throughput_n": None,
"throughput_p": None,
}
elif self.spec.satisfies("+weak"):
problem_spec = {
"nzx": 80,
"nzy": 80,
"nzz": 40,
"pool": 120,
"npx": 2,
"npy": 2,
"npz": 1,
"ngroups": 48,
"gs": 1,
"nquad": 80,
"ds": 80,
"lorder": 4,
"layout": "GDZ",
"strong_n": None,
"strong_p": None,
"weak_n": lambda var, itr, dim, scaling_factor: var.val(dim)
* scaling_factor,
"weak_p": lambda var, itr, dim, scaling_factor: var.val(dim)
* scaling_factor,
"throughput_n": None,
"throughput_p": None,
}
if self.spec.satisfies("problem_size=large"):
problem_spec["nzx"] = 220
problem_spec["nzy"] = 220
problem_spec["nzz"] = 110
problem_spec["pool"] = 105
if self.spec.satisfies("problem_size=medium"):
problem_spec["nzx"] = 200
problem_spec["nzy"] = 200
problem_spec["nzz"] = 100
problem_spec["pool"] = 77
if self.spec.satisfies("problem_size=small"):
problem_spec["nzx"] = 188
problem_spec["nzy"] = 188
problem_spec["nzz"] = 94
problem_spec["pool"] = 70
else:
problem_spec = {
"nzx": 80,
Expand Down Expand Up @@ -199,9 +261,6 @@ def compute_applications_section(self):
self.add_experiment_variable("layout", problem_spec["layout"], True)
self.add_experiment_variable("pool", problem_spec["pool"], True)

if self.spec.satisfies("+other"):
self.set_environment_variable("HSA_XNACK", 1)

# Set the variables required by the experiment
self.set_required_variables(
n_resources="{npx}*{npy}*{npz}",
Expand Down Expand Up @@ -251,12 +310,16 @@ def compute_applications_section(self):
self.add_experiment_variable("n_ranks", "{n_resources}", True)

def compute_package_section(self):
# get package version
single_memory = (
"+single_memory"
if self.spec.variants["single_memory"][0]
else "~single_memory"
gam = (
"+gpu-aware-mpi"
if self.spec.variants["gpu-aware-mpi"][0]
else "~gpu-aware-mpi"
)
chai = (
"+chai"
if self.spec.variants["chai"][0]
else "~chai"
)
self.add_package_spec(
self.name, [f"kripke{self.determine_version()} {single_memory} +mpi"]
self.name, [f"kripke{self.determine_version()} {gam} {chai} +mpi"]
)
27 changes: 25 additions & 2 deletions repos/spack_repo/benchpark/packages/chai/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@
# SPDX-License-Identifier: Apache-2.0

from spack.package import *
from spack_repo.builtin.build_systems.cached_cmake import cmake_cache_option
from spack_repo.builtin.build_systems.cached_cmake import (
cmake_cache_option,
cmake_cache_string,
)
from spack_repo.builtin.packages.chai.package import Chai as BuiltinChai


class Chai(BuiltinChai):
variant("single_memory", default=False, description="Enable single memory space model")

variant(
"cxxstd",
default="17",
values=("11", "14", "17", "20"),
description="C++ standard to build with",
)

conflicts("+single_memory", when="~rocm")

version(
Expand All @@ -19,7 +29,11 @@ class Chai(BuiltinChai):
commit="26d5646707e1848b0524379b12a7716e4a830a27",
submodules=False,
)


@property
def cxx_std(self):
return self.spec.variants.get("cxxstd").value

def initconfig_hardware_entries(self):
spec = self.spec
entries = super().initconfig_hardware_entries()
Expand All @@ -29,3 +43,12 @@ def initconfig_hardware_entries(self):
entries.append(cmake_cache_option("CHAI_DISABLE_RM", True))

return entries

def initconfig_package_entries(self):
spec = self.spec
entries = super().initconfig_package_entries()

# C++ standard
entries.append(cmake_cache_string("BLT_CXX_STD", f"c++{self.cxx_std}"))

return entries
Loading
Loading