Skip to content

Commit fbb9faf

Browse files
Print step summary again
1 parent d02b151 commit fbb9faf

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/scripts/csv_to_md.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
import sys
1+
import argparse
22
import csv
33
import tabulate as tab
44

5-
csv_benchmark = sys.argv[1]
6-
csv_baseline = sys.argv[2]
5+
parser = argparse.ArgumentParser()
6+
parser.add_argument('-b', '--baseline', required=True, help='Baseline CSV file')
7+
parser.add_argument('-c', '--current', required=True, help='Current CSV file')
8+
args = parser.parse_args()
79

810
pretty = lambda x : "{:.1f}".format(x) if x <= 0 else "+{:.1f}".format(x)
911

10-
with open(csv_benchmark) as csv_file:
12+
with open(args.baseline) as csv_file:
1113
csv_reader = csv.reader(csv_file)
1214
next(csv_reader)
13-
table_benchmark = [row for row in csv_reader]
14-
15-
with open(csv_baseline) as csv_file:
15+
table_baseline = [row for row in csv_reader]
16+
17+
with open(args.current) as csv_file:
1618
csv_reader = csv.reader(csv_file)
1719
next(csv_reader)
18-
table_baseline = [row for row in csv_reader]
20+
table_benchmark = [row for row in csv_reader]
1921

2022
table = []
2123
for benchmark, baseline in zip(table_benchmark, table_baseline):
@@ -26,7 +28,7 @@
2628
d = float(baseline[1]) - float(benchmark[1])
2729
emoji = ':red_circle:' if 0 < d else ':green_circle:'
2830
difference = pretty(d)
29-
percent = pretty(100 * d / float(baseline[1]))
31+
percent = pretty(0 if float(baseline[1]) == 0.0 else 100 * d / float(baseline[1]))
3032
table.append([name, time, stdev, emoji, difference, percent])
3133

3234
header = ["name", "time", "stdev", "", "difference", "percent"]

.github/workflows/standalone-benchmark.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
name: ${{ matrix.name }}
4040
steps:
4141
- name: Checkout Repository
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v6
4343

4444
- name: Download Files
4545
run: |
@@ -87,19 +87,19 @@ 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 42 --debug 1 --PROCtimingCSV ${BENCHMARK_CSV}
90+
${STANDALONE_DIR}/ca -e 50kHz -g --memSize 15000000000 --sync --runs 12 --debug 1 --PROCtimingCSV ${BENCHMARK_CSV}
9191
rm -rf ${STANDALONE_DIR}/events/50kHz ${STANDALONE_DIR}/build
9292
9393
- name: Display table on GitHub web
9494
run: |
9595
source /etc/profile.d/modules.sh
9696
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
9797
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}
98+
python3 ${GITHUB_WORKSPACE}/.github/scripts/csv_to_md.py --baseline ${STANDALONE_DIR}/baseline/${{ matrix.name }}.csv --current ${BENCHMARK_CSV} >> ${GITHUB_STEP_SUMMARY}
9999
rm -rf ${STANDALONE_DIR}/baseline
100100
101101
- name: Upload Artifact
102-
uses: actions/upload-artifact@v4
102+
uses: actions/upload-artifact@v6
103103
with:
104104
name: ${{ matrix.name }}-artifact
105105
path: /root/${{ matrix.name }}.csv

0 commit comments

Comments
 (0)