Skip to content

Commit d02b151

Browse files
Merge 40 runs and compute stdev
1 parent ee64896 commit d02b151

2 files changed

Lines changed: 18 additions & 16 deletions

File tree

.github/scripts/merge_runs.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import sys
1+
import argparse
22
import csv
33
import statistics
44

5-
in_csv = sys.argv[1]
6-
out_csv = sys.argv[2]
5+
parser = argparse.ArgumentParser()
6+
parser.add_argument('-d', '--discard', type=int, default=0, help='Number of initial measurements to discard')
7+
parser.add_argument('-i', '--input', required=True, help='Input CSV file')
8+
parser.add_argument('-o', '--output', required=True, help='Output CSV file')
9+
args = parser.parse_args()
710

811
time_dict = dict({})
9-
10-
with open(in_csv) as csv_file:
12+
with open(args.input) as csv_file:
1113
csv_reader = csv.reader(csv_file)
1214
next(csv_reader)
1315
for name, time, _, _ in csv_reader:
@@ -18,10 +20,10 @@
1820

1921
data = [["name", "time", "stdev"]]
2022
for name, time_list in time_dict.items():
21-
mean = statistics.mean(time_list)
22-
stdev = statistics.stdev(time_list)
23+
mean = statistics.mean(time_list[args.discard:])
24+
stdev = statistics.stdev(time_list[args.discard:])
2325
data.append([name, mean, stdev])
2426

25-
with open(out_csv, 'w') as csv_file:
27+
with open(args.output, 'w') as csv_file:
2628
csv_writer = csv.writer(csv_file)
2729
csv_writer.writerows(data)

.github/workflows/standalone-benchmark.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ jobs:
8787
source /etc/profile.d/modules.sh
8888
module load ninja/fortran-v1.11.1.g9-15 Vc/1.4.5-10 boost/v1.83.0-alice2-57 fmt/11.1.2-14 CMake/v3.31.6-10 ms_gsl/4.2.1-3 Clang/v20.1.7-9 TBB/v2022.3.0-3 ROOT/v6-36-04-alice9-15 ONNXRuntime/v1.22.0-71 GLFW/3.3.2-25
8989
cd ${STANDALONE_DIR}
90-
${STANDALONE_DIR}/ca -e 50kHz -g --memSize 15000000000 --sync --runs 20 --debug 1 --PROCtimingCSV ${BENCHMARK_CSV}
90+
${STANDALONE_DIR}/ca -e 50kHz -g --memSize 15000000000 --sync --runs 42 --debug 1 --PROCtimingCSV ${BENCHMARK_CSV}
9191
rm -rf ${STANDALONE_DIR}/events/50kHz ${STANDALONE_DIR}/build
9292
93-
# - name: Display table on GitHub web
94-
# run: |
95-
# source /etc/profile.d/modules.sh
96-
# module load ninja/fortran-v1.11.1.g9-15 Vc/1.4.5-10 boost/v1.83.0-alice2-57 fmt/11.1.2-14 CMake/v3.31.6-10 ms_gsl/4.2.1-3 Clang/v20.1.7-9 TBB/v2022.3.0-3 ROOT/v6-36-04-alice9-15 ONNXRuntime/v1.22.0-71 GLFW/3.3.2-25
97-
# python3 ${GITHUB_WORKSPACE}/.github/scripts/merge_runs.py ${BENCHMARK_CSV} ${BENCHMARK_CSV}
98-
# python3 ${GITHUB_WORKSPACE}/.github/scripts/csv_to_md.py ${BENCHMARK_CSV} ${STANDALONE_DIR}/baseline/${{ matrix.name }}.csv >> ${GITHUB_STEP_SUMMARY}
99-
# rm -rf ${STANDALONE_DIR}/baseline
93+
- name: Display table on GitHub web
94+
run: |
95+
source /etc/profile.d/modules.sh
96+
module load ninja/fortran-v1.11.1.g9-15 Vc/1.4.5-10 boost/v1.83.0-alice2-57 fmt/11.1.2-14 CMake/v3.31.6-10 ms_gsl/4.2.1-3 Clang/v20.1.7-9 TBB/v2022.3.0-3 ROOT/v6-36-04-alice9-15 ONNXRuntime/v1.22.0-71 GLFW/3.3.2-25
97+
python3 ${GITHUB_WORKSPACE}/.github/scripts/merge_runs.py --discard 2 --input ${BENCHMARK_CSV} --output ${BENCHMARK_CSV}
98+
#python3 ${GITHUB_WORKSPACE}/.github/scripts/csv_to_md.py ${BENCHMARK_CSV} ${STANDALONE_DIR}/baseline/${{ matrix.name }}.csv >> ${GITHUB_STEP_SUMMARY}
99+
rm -rf ${STANDALONE_DIR}/baseline
100100
101101
- name: Upload Artifact
102102
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)