Skip to content

Commit ab20635

Browse files
Matrix dryruns from output of 'benchpark list experiments'
1 parent 0b29a79 commit ab20635

File tree

4 files changed

+225
-841
lines changed

4 files changed

+225
-841
lines changed

.github/actions/dynamic-dry-run/action.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
name: Dynamic dry run template
22

33
inputs:
4-
benchmark_name:
5-
required: true
6-
type: string
7-
benchmark_mode:
8-
required: true
9-
type: string
104
benchmark_spec:
115
required: true
126
type: string
13-
system_name:
14-
required: true
15-
type: string
167
system_spec:
178
required: true
189
type: string
1910

2011
runs:
2112
using: "composite"
2213
steps:
23-
- name: "${{ inputs.benchmark_name }}/${{ inputs.benchmark_mode }} ${{ inputs.system_name }} ${{ inputs.system_spec }}"
14+
- name: "${{ inputs.benchmark_spec }} ${{ inputs.system_spec }}"
2415
shell: bash
2516
run: |
2617
timestamp=$(date +%s)
27-
bn="${{ inputs.benchmark_name }}"
28-
bm="${{ inputs.benchmark_mode }}"
29-
benchmark="$bn-$bm-$timestamp"
30-
sn="${{ inputs.system_name }}"
31-
system="$sn-$timestamp"
18+
benchmark="b-$timestamp"
19+
system="s-$timestamp"
3220
./bin/benchpark system init --dest=$system ${{ inputs.system_spec }}
3321
./bin/benchpark experiment init --dest=$benchmark ${{ inputs.benchmark_spec }}
3422
./bin/benchpark setup ./$benchmark ./$system workspace/
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import subprocess
2+
import json
3+
4+
5+
# Original dictionary
6+
data = {
7+
"openmp": {"benchmark_spec": [], "system_spec": ["llnl-cluster cluster=ruby"]},
8+
"cuda": {"benchmark_spec": [], "system_spec": ["llnl-sierra"]},
9+
"rocm": {"benchmark_spec": [], "system_spec": ["llnl-elcapitan cluster=tioga"]},
10+
"weak": {"benchmark_spec": [], "system_spec": ["generic-x86"]},
11+
"strong": {"benchmark_spec": [], "system_spec": ["generic-x86"]},
12+
"single_node": {"benchmark_spec": [], "system_spec": ["generic-x86"]},
13+
"throughput": {"benchmark_spec": [], "system_spec": ["generic-x86"]},
14+
}
15+
16+
17+
def main():
18+
try:
19+
expr_cmd = subprocess.run(
20+
[
21+
"./bin/benchpark",
22+
"list",
23+
"experiments",
24+
],
25+
capture_output=True,
26+
check=True,
27+
)
28+
except subprocess.CalledProcessError as e:
29+
raise RuntimeError(f"Output: {e.stdout}\nError: {e.stderr}")
30+
expr_str = str(expr_cmd.stdout, "utf-8")
31+
experiments = expr_str.replace(" ", "").replace("\t", "").split("\n")
32+
experiments = [
33+
item for item in experiments if "+" in item
34+
]
35+
36+
for expr in experiments:
37+
name, mode = expr.split("+")
38+
data[mode]["benchmark_spec"].append(expr)
39+
40+
with open("matrix.json", "w") as f:
41+
json.dump(data, f)
42+
43+
44+
if __name__ == "__main__":
45+
main()

0 commit comments

Comments
 (0)