diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e32d2d75..6522a5809 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: - '.github/**' - 'bin/**' - 'configs/**' + - 'checkout-versions.yaml' - 'experiments/**' - 'repo/**' license: diff --git a/.github/workflows/requirements/docs.txt b/.github/workflows/requirements/docs.txt index f29aa14db..f49db2129 100644 --- a/.github/workflows/requirements/docs.txt +++ b/.github/workflows/requirements/docs.txt @@ -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 diff --git a/.github/workflows/requirements/style.txt b/.github/workflows/requirements/style.txt index de8aea164..2c06c97ef 100644 --- a/.github/workflows/requirements/style.txt +++ b/.github/workflows/requirements/style.txt @@ -1,4 +1,4 @@ -black==24.3.0 +black==24.4.0 flake8==7.0.0 isort==5.13.2 codespell==2.2.6 diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 96d68abd7..0be114140 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -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/ diff --git a/bin/benchpark b/bin/benchpark index 1cfb4f654..a5359a2e9 100755 --- a/bin/benchpark +++ b/bin/benchpark @@ -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): @@ -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" ) @@ -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): diff --git a/checkout-versions.yaml b/checkout-versions.yaml index 828ea1038..2d7d07ce6 100644 --- a/checkout-versions.yaml +++ b/checkout-versions.yaml @@ -4,5 +4,5 @@ # SPDX-License-Identifier: Apache-2.0 versions: - ramble: 3d6d2670435c704ca815ae13abe49b10c5111638 + ramble: bb664f142b2cbdb2b2ea39e70a8535c9f27c1179 spack: 31de670bd26beca979ebd75dcb0ce90c535a78c4 diff --git a/configs/LLNL-Magma-Penguin-icelake-OmniPath/auxiliary_software_files/packages.yaml b/configs/LLNL-Magma-Penguin-icelake-OmniPath/auxiliary_software_files/packages.yaml index dc0af79db..0cb4fc3b5 100644 --- a/configs/LLNL-Magma-Penguin-icelake-OmniPath/auxiliary_software_files/packages.yaml +++ b/configs/LLNL-Magma-Penguin-icelake-OmniPath/auxiliary_software_files/packages.yaml @@ -4,6 +4,11 @@ # SPDX-License-Identifier: Apache-2.0 packages: + papi: + externals: + - spec: papi@6.0.0.1 + prefix: /usr/tce/packages/papi/papi-6.0.0.1 + buildable: false tar: externals: - spec: tar@1.30 diff --git a/configs/LLNL-Pascal-Penguin-broadwell-P100-OmniPath/auxiliary_software_files/packages.yaml b/configs/LLNL-Pascal-Penguin-broadwell-P100-OmniPath/auxiliary_software_files/packages.yaml index 1daf4b719..1b64a0ee3 100644 --- a/configs/LLNL-Pascal-Penguin-broadwell-P100-OmniPath/auxiliary_software_files/packages.yaml +++ b/configs/LLNL-Pascal-Penguin-broadwell-P100-OmniPath/auxiliary_software_files/packages.yaml @@ -4,6 +4,11 @@ # SPDX-License-Identifier: Apache-2.0 packages: + papi: + externals: + - spec: papi@6.0.0.1 + prefix: /usr/tce/packages/papi/papi-6.0.0.1 + buildable: false tar: externals: - spec: tar@1.30 @@ -27,6 +32,11 @@ packages: externals: - spec: autoconf@2.69 prefix: /usr + python: + externals: + - spec: python@3.9.12 + prefix: /usr/tce/packages/python/python-3.9.12/ + buildable: false mpi: buildable: false mvapich2: diff --git a/modifiers/caliper-cuda/configs/modifier.yaml b/modifiers/caliper-cuda/configs/modifier.yaml new file mode 100644 index 000000000..7b5434837 --- /dev/null +++ b/modifiers/caliper-cuda/configs/modifier.yaml @@ -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} + diff --git a/modifiers/caliper-cuda/modifier.py b/modifiers/caliper-cuda/modifier.py new file mode 100644 index 000000000..7761a467e --- /dev/null +++ b/modifiers/caliper-cuda/modifier.py @@ -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"], + ) diff --git a/modifiers/caliper-topdown/configs/modifier.yaml b/modifiers/caliper-topdown/configs/modifier.yaml new file mode 100644 index 000000000..a6badbb04 --- /dev/null +++ b/modifiers/caliper-topdown/configs/modifier.yaml @@ -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 + diff --git a/modifiers/caliper-topdown/modifier.py b/modifiers/caliper-topdown/modifier.py new file mode 100644 index 000000000..d980e5b52 --- /dev/null +++ b/modifiers/caliper-topdown/modifier.py @@ -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"], + ) diff --git a/requirements.txt b/requirements.txt index c3726e8bf..5a20fb83f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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