Skip to content

Commit

Permalink
moving experiment class to new loaction
Browse files Browse the repository at this point in the history
  • Loading branch information
august-knox committed Nov 4, 2024
2 parents 3770038 + 436d28e commit 4933893
Show file tree
Hide file tree
Showing 173 changed files with 1,262 additions and 924 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bin/license
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def list_files(root):
SPDX_MISMATCH, GENERAL_MISMATCH, COPYRIGHT_YEAR_MISMATCH = range(1, 4)

#: Latest year that copyright applies. UPDATE THIS when bumping copyright.
latest_year = 2023
latest_year = "202[34]"
strict_date = r"Copyright %s" % latest_year

#: regexes for valid license lines at tops of files
license_line_regexes = [
r"Copyright (%d|[0-9]{4}) Lawrence Livermore National Security, LLC and other"
r"Copyright (%s|[0-9]{4}) Lawrence Livermore National Security, LLC and other"
% latest_year,
r"Benchpark Project Developers. See the top-level COPYRIGHT file for details.",
r"SPDX-License-Identifier: Apache-2.0",
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:

- name: Dry run dynamic amg2023-openmp on Dane with allocation modifier
run: |
./bin/benchpark experiment init --dest=amg2023-openmp amg2023 programming_model=openmp
./bin/benchpark experiment init --dest=amg2023-openmp amg2023 openmp=oui
./bin/benchpark setup ./amg2023-openmp LLNL-Dane-DELL-sapphirerapids-OmniPath workspace/
. workspace/setup.sh
ramble \
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:

- name: Dry run dynamic kripke-openmp on nosite-x86_64 with allocation modifier
run: |
./bin/benchpark experiment init --dest=kripke-openmp kripke programming_model=openmp
./bin/benchpark experiment init --dest=kripke-openmp kripke openmp=oui
./bin/benchpark setup ./kripke-openmp nosite-x86_64 workspace/
. workspace/setup.sh
ramble \
Expand All @@ -154,7 +154,7 @@ jobs:

- name: Dry run dynamic kripke-rocm on LLNL-Tioga-HPECray-zen3-MI250X-Slingshot with allocation modifier
run: |
./bin/benchpark experiment init --dest=kripke-rocm kripke programming_model=rocm
./bin/benchpark experiment init --dest=kripke-rocm kripke rocm=oui
./bin/benchpark setup ./kripke-openmp LLNL-Tioga-HPECray-zen3-MI250X-Slingshot workspace/
. workspace/setup.sh
ramble \
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:

- name: Dry run dynamic saxpy/rocm with static Tioga
run: |
./bin/benchpark experiment init --dest=saxpy-rocm saxpy programming_model=rocm
./bin/benchpark experiment init --dest=saxpy-rocm saxpy rocm=oui
./bin/benchpark setup ./saxpy-rocm LLNL-Tioga-HPECray-zen3-MI250X-Slingshot workspace/
. workspace/setup.sh
ramble \
Expand All @@ -198,7 +198,7 @@ jobs:
- name: Dry run dynamic saxpy/rocm with dynamic Tioga
run: |
./bin/benchpark system init --dest=tioga-system2 tioga rocm=551 compiler=cce ~gtl
./bin/benchpark experiment init --dest=saxpy-rocm2 saxpy programming_model=rocm
./bin/benchpark experiment init --dest=saxpy-rocm2 saxpy rocm=oui
./bin/benchpark setup ./saxpy-rocm2 ./tioga-system2 workspace/
. workspace/setup.sh
ramble \
Expand All @@ -210,7 +210,7 @@ jobs:
- name: Dry run dynamic saxpy/cuda with dynamic Sierra
run: |
./bin/benchpark system init --dest=sierra-system sierra cuda=10-1-243 compiler=xl
./bin/benchpark experiment init --dest=saxpy-cuda saxpy programming_model=cuda
./bin/benchpark experiment init --dest=saxpy-cuda saxpy cuda=oui
./bin/benchpark setup ./saxpy-cuda ./sierra-system workspace/
. workspace/setup.sh
ramble \
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:

- name: Dry run dynamic quicksilver-openmp on nosite-x86_64 with allocation modifier
run: |
./bin/benchpark experiment init --dest=quicksilver-openmp quicksilver experiment=weak
./bin/benchpark experiment init --dest=quicksilver-openmp quicksilver openmp=oui experiment=weak
./bin/benchpark setup ./quicksilver-openmp nosite-x86_64 workspace/
. workspace/setup.sh
ramble \
Expand Down Expand Up @@ -333,7 +333,7 @@ jobs:
- name: Dry run dynamic saxpy/openmp with dynamic CTS ruby
run: |
./bin/benchpark system init --dest=ruby-system cts cluster=ruby
./bin/benchpark experiment init --dest=saxpy-openmp saxpy programming_model=openmp
./bin/benchpark experiment init --dest=saxpy-openmp saxpy openmp=oui
./bin/benchpark setup ./saxpy-openmp ./ruby-system workspace/
. workspace/setup.sh
ramble \
Expand All @@ -345,7 +345,7 @@ jobs:
- name: Dry run dynamic saxpy/openmp with dynamic CTS dane
run: |
./bin/benchpark system init --dest=dane-system cts cluster=dane
./bin/benchpark experiment init --dest=saxpy-openmp2 saxpy programming_model=openmp
./bin/benchpark experiment init --dest=saxpy-openmp2 saxpy openmp=oui
./bin/benchpark setup ./saxpy-openmp2 ./dane-system workspace/
. workspace/setup.sh
ramble \
Expand All @@ -357,7 +357,7 @@ jobs:
- name: Dry run dynamic saxpy/openmp with dynamic CTS magma
run: |
./bin/benchpark system init --dest=magma-system cts cluster=magma
./bin/benchpark experiment init --dest=saxpy-openmp3 saxpy programming_model=openmp
./bin/benchpark experiment init --dest=saxpy-openmp3 saxpy openmp=oui
./bin/benchpark setup ./saxpy-openmp3 ./magma-system workspace/
. workspace/setup.sh
ramble \
Expand All @@ -369,7 +369,7 @@ jobs:
- name: Dry run dynamic saxpy/openmp with dynamic generic x86
run: |
./bin/benchpark system init --dest=x86-system genericx86
./bin/benchpark experiment init --dest=saxpy-omp-generic saxpy programming_model=openmp
./bin/benchpark experiment init --dest=saxpy-omp-generic saxpy openmp=oui
./bin/benchpark setup ./saxpy-omp-generic ./x86-system workspace/
. workspace/setup.sh
ramble \
Expand Down
16 changes: 7 additions & 9 deletions docs/add-a-system-config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,31 +53,29 @@ Editing an Existing System to Match
make all these x86 example. Automate the directory structure?
If you want to add support for a new system you can add a class definition
for that system in a separate directory in ``var/sys_repo/systems/``.
for that system in a separate directory in ``systems/``.
The best way is to copy the system.py for the most similar system identified above, and then paste it in a new directory and update it.
For example the genericx86 system is defined in::

$benchpark
├── var
├── sys_repo
├── systems
├── genericx86
├── system.py
├── systems
├── genericx86
├── system.py


The System base class defined in ``/lib/benchpark/system.py`` is shown below, some or all of the functions can be overridden to define custom system behavior.

.. literalinclude:: ../lib/benchpark/system.py
:language: python

The main driver for configuring a system is done by defining a subclass for that system in a ``var/sys_repo/{SYSTEM}/system.py`` file, which inherits from the System base class.
The main driver for configuring a system is done by defining a subclass for that system in a ``systems/{SYSTEM}/system.py`` file, which inherits from the System base class.

As is, the generic_x86 system subclass should run on most x86_64 systems, but we mostly provide it as a starting point for modifying or testing.
Potential common changes might be to edit the scheduler or number of cores per node, adding a GPU configuration, or adding other external compilers or packages.

To make these changes, we provided an example below, where we start with the generic_x86 system.py, and make a system called Modifiedx86.

1. First, make a copy of the system.py file in generic_x86 folder and move it into a new folder, e.g., ``var/sys_repo/modified_x86/system.py``.
1. First, make a copy of the system.py file in generic_x86 folder and move it into a new folder, e.g., ``systems/modified_x86/system.py``.
Then, update the class name to ``Modifiedx86``.::
class Modifiedx86(System):
Expand All @@ -92,7 +90,7 @@ Then, update the class name to ``Modifiedx86``.::
self.sys_gpus_per_node = "2"

3. Let's say the new system's GPUs are NVIDIA, we can add a variant that allows us to specify the version of CUDA we want to use, and the location of those CUDA installations on our system.
We then add the spack package configuration for our CUDA installations into the ``var/sys_repo/systems/modified_x86/externals/cuda`` directory (examples in Siera and Tioga systems).
We then add the spack package configuration for our CUDA installations into the ``systems/modified_x86/externals/cuda`` directory (examples in Siera and Tioga systems).
::
# import the variant feature at the top of your system.py
from benchpark.directives import variant
Expand Down
16 changes: 7 additions & 9 deletions docs/add-all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ with command line arguments.
Using System API to Generate a System Description
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

System classes are defined in ``var/sys_repo``; once the class has been
System classes are defined in ``systems/``; once the class has been
defined, you can invoke ``benchpark system init`` to generate a system
configuration directory that can then be passed to ``benchpark setup``::

Expand All @@ -60,20 +60,18 @@ where "tioga rocm=551 compiler=cce ~gtl" describes a config for Tioga that
uses ROCm 5.5.1 components, a CCE compiler, and MPI without GTL support.

If you want to add support for a new system you can add a class definition
for that system in a separate directory in ``var/sys_repo/systems/``. For
for that system in a separate directory in ``/systems/``. For
example the Tioga system is defined in::

$benchpark
├── var
├── sys_repo
├── systems
├── tioga
├── system.py
├── systems
├── tioga
├── system.py

Static System Configurations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``benchpark/configs`` contains a number of static, manually-generated system
``benchpark/legacy/systems`` contains a number of static, manually-generated system
definitions. As an alternative to implementing a new ``System`` class, you
can add a new directory with a name which identifies the system.

Expand Down Expand Up @@ -114,7 +112,7 @@ Benchpark has definitions for the following site-specific systems:
- LLNL-Tioga-HPECray-zen3-MI250X-Slingshot


The following files are required for each nosite system ``benchpark/configs/${SYSTEM}``:
The following files are required for each nosite system ``benchpark/legacy/systems/${SYSTEM}``:

1. ``system_definition.yaml`` describes the system hardware, including the integrator (and the name of the product node or cluster type), the processor, (optionally) the accelerator, and the network; the information included here is what you will typically see recorded about the system on Top500.org. We intend to make the system definitions in Benchpark searchable, and will add a schema to enforce consistency; until then, please copy the file and fill out all of the fields without changing the keys. Also listed is the specific system the config was developed and tested on, as well as the known systems with the same hardware so that the users of those systems can find this system specification.

Expand Down
4 changes: 2 additions & 2 deletions docs/add-an-experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This guide is intended for those wanting to define a new set of experiment param
Similar to systems, Benchpark also provides an API where you can represent experiments
as objects and customize their description with command line arguments.

Experiment specifications are created with ``experiment.py`` files each located in the experiment repo: ``benchpark/var/exp_repo/experiments/${Benchmark1}``.
Experiment specifications are created with ``experiment.py`` files each located in the experiment repo: ``benchpark/experiments/${Benchmark1}``.

* If you are adding experiments to an existing benchmark, it is best to extend the current experiment.py for that benchmark in the experiment repo.

Expand All @@ -34,7 +34,7 @@ Some or all of the functions in the Experiment base class can be overridden to d
This will change and need updates
Variants of the experiment can be added to utilize different *ProgrammingModels* used for on-node parallelization,
e.g., ``benchpark/var/exp_repo/experiments/amg2023/experiment.py`` has variant ``programming_model``, which can be
e.g., ``benchpark/experiments/amg2023/experiment.py`` has variant ``programming_model``, which can be
set to ``cuda`` for an experiment using CUDA (on an NVIDIA GPU),
or ``openmp`` for an experiment using OpenMP (on a CPU).::

Expand Down
10 changes: 5 additions & 5 deletions docs/benchpark-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ To setup an experiment workspace you must first initialize both an experiment an
Any system or experiment variants are specified at the end of the command as shown below.
The order of the two init commands does not matter, but they both need to be run before the setup command.::

benchpark system init --dest=</output/path/to/system_root> <SystemName> compiler=<Compiler>
benchpark experiment init --dest=</output/path/to/experiments_root> <Benchmark> experiment=<Experiment> programming_model=<ProgrammingModel>
benchpark system init --dest=</output/path/to/system_def_dir> <SystemName> compiler=<Compiler>
benchpark experiment init --dest=</output/path/to/experiment_def_dir> <Benchmark> experiment=<Experiment> programming_model=<ProgrammingModel>


Once you have a benchmark experiment to run, along with the programming model to use, and a system to run them on.
Also choose a directory for your experiment::

benchpark setup </output/path/to/experiments_root> </output/path/to/system_root> </output/path/to/workspace>
benchpark setup </output/path/to/experiment_def> </output/path/to/system_def> </output/path/to/workspace>

where:

Expand All @@ -36,8 +36,8 @@ with the following directory structure::
<System>/
workspace/
configs/
(everything from source/configs/<System>)
(everything from source/experiments/<Benchmark/ProgrammingModel>)
(everything from system_def_dir)
(everything from experiment_def_dir>)

``benchpark setup`` will output instructions to follow::

Expand Down
4 changes: 2 additions & 2 deletions docs/build-experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Ramble will build the source code and set up the following workspace directory s
<System>/
workspace/
configs/
(everything from source/configs/<System>)
(everything from source/experiments/<Benchmark/ProgrammingModel>)
(everything from system_def_dir)
(everything from experiment_def_dir)
experiments/
<Benchmark>/
<Problem>/
Expand Down
4 changes: 2 additions & 2 deletions docs/experiments_root_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ to build and run the experiment::
<system>/
workspace/
configs/
(everything from source/configs/<system>)
(everything from source/experiments/<benchmark>)
(everything from system_def_dir)
(everything from experiment_def_dir)
experiments/
<benchmark>/
<problem>/
Expand Down
2 changes: 1 addition & 1 deletion docs/generate-benchmark-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def construct_tag_groups(tag_groups, tag_dicts, dictionary):


def benchpark_benchmarks(benchmarks):
experiments_dir = "../experiments"
experiments_dir = "../legacy/experiments"
for x in os.listdir(experiments_dir):
benchmarks.append(f"{x}")
return benchmarks
Expand Down
2 changes: 1 addition & 1 deletion docs/generate-sys-defs-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def main():
sysconfig_yaml_files = glob.glob(
"../configs/**/system_definition.yaml", recursive=True
"../legacy/systems/**/system_definition.yaml", recursive=True
)

df_list = []
Expand Down
41 changes: 21 additions & 20 deletions docs/legacy-getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,22 @@ Editing the experiment (optional)
Benchpark configuration files are organized as follows::

$benchpark
├── configs
│ ├── ${SYSTEM1}
│ │ ├── auxiliary_software_files
│ │ │ ├── compilers.yaml
│ │ │ └── packages.yaml
│ │ ├── software.yaml
│ │ └── variables.yaml
├── experiments
│ ├── ${BENCHMARK1}
│ │ ├── ${ProgrammingModel1}
│ │ │ ├── execute_experiment.tpl
│ │ │ └── ramble.yaml
│ │ ├── ${ProgrammingModel1}
│ │ │ ├── execute_experiment.tpl
│ │ │ └── ramble.yaml
├── legacy
│ ├── systems
│ │ ├── ${SYSTEM1}
│ │ │ ├── auxiliary_software_files
│ │ │ │ ├── compilers.yaml
│ │ │ │ └── packages.yaml
│ │ │ ├── software.yaml
│ │ │ └── variables.yaml
│ └── experiments
│ ├── ${BENCHMARK1}
│ │ ├── ${ProgrammingModel1}
│ │ │ ├── execute_experiment.tpl
│ │ │ └── ramble.yaml
│ │ ├── ${ProgrammingModel1}
│ │ │ ├── execute_experiment.tpl
│ │ │ └── ramble.yaml
└── repo
├── ${BENCHMARK1}
│ ├── application.py
Expand All @@ -110,7 +111,7 @@ You can edit these configuration files to change the behavior of your experiment

System Specification
~~~~~~~~~~~~~~~~~~~~
Files under ``benchpark/configs/${SYSTEM}`` provide the specification
Files under ``benchpark/legacy/systems/${SYSTEM}`` provide the specification
of the software stack on your system
(see :ref:`legacy-add-system` for details).

Expand Down Expand Up @@ -281,8 +282,8 @@ with the following directory structure::
<System>/
workspace/
configs/
(everything from source/configs/<System>)
(everything from source/experiments/<Benchmark/ProgrammingModel>)
(everything from system_def_dir)
(everything from experiment_def_dir)

``benchpark setup`` will output instructions to follow::

Expand Down Expand Up @@ -316,8 +317,8 @@ Ramble will build the source code and set up the following workspace directory s
<System>/
workspace/
configs/
(everything from source/configs/<System>)
(everything from source/experiments/<Benchmark/ProgrammingModel>)
(everything from system_def_dir)
(everything from experiment_def_dir>)
experiments/
<Benchmark>/
<Problem>/
Expand Down
Loading

0 comments on commit 4933893

Please sign in to comment.