Skip to content

Commit

Permalink
Merge branch 'develop' into docs/caliper-modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
pearce8 authored Apr 16, 2024
2 parents 2c75d07 + cc7e69e commit efef62d
Show file tree
Hide file tree
Showing 13 changed files with 182 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- '.github/**'
- 'bin/**'
- 'configs/**'
- 'checkout-versions.yaml'
- 'experiments/**'
- 'repo/**'
license:
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
sphinx==7.2.6
sphinx-rtd-theme==2.0.0
codespell==2.2.6
pandas==2.2.1
pandas==2.2.2
pyyaml==6.0.1
sphinxcontrib-programoutput==0.17
# The remaining requirements are from Ramble
pytest
flake8
google-cloud-storage # for gcs fetch test
google-api-core # for gcs fetch error .exceptions
coverage
pre-commit
graphlib-backport;python_version<"3.9"
urllib3==1.26.18;python_version<="3.6"
protobuf;python_version>"3.6"
protobuf==3.19.4;python_version<="3.6"
pyarrow==3.0.0;python_version<="3.6"
google-cloud-bigquery
tqdm
deprecation
2 changes: 1 addition & 1 deletion .github/workflows/requirements/style.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==24.3.0
black==24.4.0
flake8==7.0.0
isort==5.13.2
codespell==2.2.6
4 changes: 4 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
- name: Checkout Benchpark
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633

- name: Add needed Python libs
run: |
pip install -r ./requirements.txt
- name: Build Saxpy Workspace
run: |
./bin/benchpark setup saxpy/openmp nosite-x86_64 workspace/
Expand Down
12 changes: 9 additions & 3 deletions bin/benchpark
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,20 @@ def benchpark_setup(subparsers, actions_dict):


def run_command(command_str, env=None):
result = subprocess.run(
proc = subprocess.Popen(
shlex.split(command_str),
env=env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise RuntimeError(
f"Failed command: {command_str}\nOutput: {stdout}\nError: {stderr}"
)

return (result.stdout, result.stderr)
return (stdout, stderr)


def benchpark_tags(subparsers, actions_dict):
Expand Down Expand Up @@ -348,6 +352,7 @@ def benchpark_setup_handler(args):

ramble_workspace_dir = workspace_dir / "workspace"
ramble_configs_dir = ramble_workspace_dir / "configs"
ramble_logs_dir = ramble_workspace_dir / "logs"
ramble_spack_experiment_configs_dir = (
ramble_configs_dir / "auxiliary_software_files"
)
Expand All @@ -358,6 +363,7 @@ def benchpark_setup_handler(args):
experiment_src_dir = source_dir / "experiments" / benchmark
modifier_config_dir = source_dir / "modifiers" / modifier / "configs"
ramble_configs_dir.mkdir(parents=True)
ramble_logs_dir.mkdir(parents=True)
ramble_spack_experiment_configs_dir.mkdir(parents=True)

def include_fn(fname):
Expand Down
2 changes: 1 addition & 1 deletion checkout-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# SPDX-License-Identifier: Apache-2.0

versions:
ramble: 3d6d2670435c704ca815ae13abe49b10c5111638
ramble: bb664f142b2cbdb2b2ea39e70a8535c9f27c1179
spack: 31de670bd26beca979ebd75dcb0ce90c535a78c4
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# SPDX-License-Identifier: Apache-2.0

packages:
papi:
externals:
- spec: [email protected]
prefix: /usr/tce/packages/papi/papi-6.0.0.1
buildable: false
tar:
externals:
- spec: [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# SPDX-License-Identifier: Apache-2.0

packages:
papi:
externals:
- spec: [email protected]
prefix: /usr/tce/packages/papi/papi-6.0.0.1
buildable: false
tar:
externals:
- spec: [email protected]
Expand All @@ -27,6 +32,11 @@ packages:
externals:
- spec: [email protected]
prefix: /usr
python:
externals:
- spec: [email protected]
prefix: /usr/tce/packages/python/python-3.9.12/
buildable: false
mpi:
buildable: false
mvapich2:
Expand Down
18 changes: 18 additions & 0 deletions modifiers/caliper-cuda/configs/modifier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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

variables:
modifier_package_name: 'caliper-cuda'
modifier_spack_variant: '+caliper'

modifiers:
- name: caliper-cuda
mode: cuda

spack:
packages:
caliper-cuda:
spack_spec: caliper+adiak+mpi~libunwind~libdw~papi+cuda cuda_arch=={cuda_arch}

27 changes: 27 additions & 0 deletions modifiers/caliper-cuda/modifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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 ramble.modkit import *
from ramble.mod.benchpark.caliper import Caliper as CaliperBase


class CaliperCuda(CaliperBase):
"""Define a modifier for Caliper"""

name = "caliper-cuda"

mode(
"cuda",
description="Profile CUDA API functions",
)

_cali_datafile = CaliperBase._cali_datafile

env_var_modification(
"CALI_CONFIG",
"spot(output={}, profile.cuda)".format(_cali_datafile),
method="set",
modes=["cuda"],
)
18 changes: 18 additions & 0 deletions modifiers/caliper-topdown/configs/modifier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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

variables:
modifier_package_name: 'caliper-topdown'
modifier_spack_variant: '+caliper'

modifiers:
- name: caliper-topdown
mode: topdown-all

spack:
packages:
caliper-topdown:
spack_spec: caliper+adiak+mpi~libunwind~libdw+papi

57 changes: 57 additions & 0 deletions modifiers/caliper-topdown/modifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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 ramble.modkit import *
from ramble.mod.benchpark.caliper import Caliper as CaliperBase


class CaliperTopdown(CaliperBase):
"""Define a modifier for Caliper"""

name = "caliper-topdown"

mode(
"topdown-counters-all",
description="Raw counter values for Intel top-down analysis (all levels)",
)
mode(
"topdown-counters-toplevel",
description="Raw counter values for Intel top-down analysis (top level)",
)
mode(
"topdown-all",
description="Top-down analysis for Intel CPUs (all levels)",
)
mode(
"topdown-toplevel",
description="Top-down analysis for Intel CPUs (top level)",
)

_cali_datafile = CaliperBase._cali_datafile

env_var_modification(
"CALI_CONFIG",
"spot(output={}, topdown-counters.all)".format(_cali_datafile),
method="set",
modes=["topdown-counters-all"],
)
env_var_modification(
"CALI_CONFIG",
"spot(output={}, topdown-counters.toplevel)".format(_cali_datafile),
method="set",
modes=["topdown-counters-toplevel"],
)
env_var_modification(
"CALI_CONFIG",
"spot(output={}, topdown.all)".format(_cali_datafile),
method="set",
modes=["topdown-all"],
)
env_var_modification(
"CALI_CONFIG",
"spot(output={}, topdown.toplevel)".format(_cali_datafile),
method="set",
modes=["topdown-toplevel"],
)
15 changes: 15 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
pyyaml
# The remaining requirements are from Ramble
pytest
flake8
google-cloud-storage # for gcs fetch test
google-api-core # for gcs fetch error .exceptions
coverage
pre-commit
graphlib-backport;python_version<"3.9"
urllib3==1.26.18;python_version<="3.6"
protobuf;python_version>"3.6"
protobuf==3.19.4;python_version<="3.6"
pyarrow==3.0.0;python_version<="3.6"
google-cloud-bigquery
tqdm
deprecation

0 comments on commit efef62d

Please sign in to comment.