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
67 changes: 64 additions & 3 deletions experiments/kripke/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class Kripke(
description="Enable single memory space model in rocm",
)

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

variant(
"other",
default=False,
Expand Down Expand Up @@ -98,6 +105,7 @@ def compute_applications_section(self):
if self.spec.satisfies("+throughput"):
problem_spec = {
"nzx": [
64,
80,
100,
120,
Expand All @@ -106,8 +114,13 @@ def compute_applications_section(self):
180,
200,
220,
240,
260,
280,
300,
],
"nzy": [
64,
80,
100,
120,
Expand All @@ -116,8 +129,13 @@ def compute_applications_section(self):
180,
200,
220,
240,
260,
280,
300,
],
"nzz": [
32,
40,
50,
60,
Expand All @@ -126,11 +144,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 +166,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
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
8 changes: 7 additions & 1 deletion repos/spack_repo/benchpark/packages/kripke/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ class Kripke(CMakePackage, CudaPackage, ROCmPackage):
depends_on("cxx", type="build")
depends_on("fortran", type="build")

depends_on("chai@2025.12.0+raja", when="@develop")
depends_on("camp@main", when="@develop")
depends_on("chai@develop+raja cxxstd=20", when="@develop")
depends_on("raja@develop cxxstd=20", when="@develop")
depends_on("umpire@develop", when="@develop")

depends_on("chai@2025.12.0+raja", when="@2025.12.0")
depends_on("fmt@9.1", when=f"^chai@2024.07.0")
depends_on("chai@2024.07.0+raja", when="@:2025.07.0")
Expand Down Expand Up @@ -123,6 +127,7 @@ def setup_run_environment(self, env):
def cmake_args(self):
spec = self.spec
args = []
blt_cxx_std = "20" if spec.satisfies("@develop") else "17"

if "+rocm" in spec or "+cuda" in spec:
enable_chai = "ON"
Expand All @@ -140,6 +145,7 @@ def cmake_args(self):
"-Dchai_DIR=%s" % self.spec["chai"].prefix,
"-DENABLE_CHAI=%s" % enable_chai,
"-DENABLE_CHAI_SINGLE_MEMORY=%s" % enable_chai_single_memory,
"-DBLT_CXX_STD=%s" % f"c++{blt_cxx_std}",
"-DMPI_CXX_LINK_FLAGS='%s'" % self.spec['mpi'].libs.ld_flags,
]
)
Expand Down
Loading