-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (121 loc) · 4.32 KB
/
linux-benchmarks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright 2020-2024, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
name: Linux benchmarks / LLVM 17.0
permissions: read-all
on:
pull_request_target:
branches: ['main']
push:
branches:
- 'main'
- '**test_bench**'
workflow_dispatch:
env:
LLVM_VERSION: "17.0"
LLVM_REPO: https://github.com/ispc/ispc.dependencies
LLVM_TAR: llvm-17.0.6-ubuntu18.04-Release+Asserts-x86.arm.wasm.tar.xz
jobs:
linux-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
.github/workflows/scripts/install-build-deps.sh
- name: Check environment
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
run: |
[ -z "$CALCITE_TOKEN" ] && echo "CALCITE_TOKEN is empty" && exit 1 || echo "CALCITE_TOKEN is NOT empty"
which -a clang
cat /proc/cpuinfo
- name: Build package
run: |
echo PATH=$PATH
cmake -B build -DISPC_PREPARE_PACKAGE=ON -DISPC_INCLUDE_BENCHMARKS=ON -DBENCHMARK_ENABLE_INSTALL=ON -DISPC_PACKAGE_NAME=ispc-trunk-linux
cmake --build build --target package -j4
- name: Sanity testing (make check-all, make test)
run: |
cd build
bin/check_isa
bin/ispc --support-matrix
make check-all
make ispc_benchmarks && make test
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: ispc_llvm17_linux_bench
path: build/ispc-trunk-linux.tar.gz
benchmarks:
continue-on-error: true
runs-on: [self-hosted, linux, bench]
needs: linux-build
steps:
- name: Download package
uses: actions/download-artifact@v4
with:
name: ispc_llvm17_linux_bench
- name: Install dependencies and unpack artifacts
run: |
tar xvf ispc-trunk-linux.tar.gz
echo "${GITHUB_WORKSPACE}/ispc-trunk-linux/bin" >> $GITHUB_PATH
echo "LLVM_HOME=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "ISPC_HOME=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
- name: Check environment
run: cat /proc/cpuinfo
- name: Tune system for benchmarking
run: curl http://$StabilizerServer:7373/acquire
if: always()
- name: Running benchmarks
run: |
mkdir -p out
export LD_LIBRARY_PATH=../lib
for exec in $(find . -type f -perm -u+x); do $exec --benchmark_out=out/$(basename $exec).json $BENCH_SETTINGS ; done
working-directory: ispc-trunk-linux/benchmarks/
env:
BENCH_SETTINGS: '--benchmark_repetitions=10'
- name: Reset system performance
run: curl http://$StabilizerServer:7373/release
if: always()
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: ispc_llvm17_linux_bench_results
path: ispc-trunk-linux/benchmarks/out/*.json
- name: Clean self-hosted runner
run: rm -rf ${GITHUB_WORKSPACE:?}/* ${HOME:?}/*
if: always()
calcite:
continue-on-error: true
needs: benchmarks
runs-on: ubuntu-20.04
env:
CALCITE_CLI: '@siliceum/[email protected]'
steps:
- uses: actions/checkout@v4
- name: Download benchmarks results
uses: actions/download-artifact@v4
with:
name: ispc_llvm17_linux_bench_results
- name: Upload bench datasets to calcite
working-directory: .calcite
run: |
npx ${{env.CALCITE_CLI}} upload calcite.config.js
env:
BENCH_OUTPUT_FILES: ${{github.workspace}}
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
- name: Trigger calcite workflow (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && success()
working-directory: .calcite
run: npx ${{env.CALCITE_CLI}} trigger ${{github.event.before}} -tt push_main
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}
# Unused for now, until we have tokenless / new token management (never triggered since using pull_request_target)
- name: Trigger calcite workflow (PR)
if: github.event_name == 'pull_request' && success()
working-directory: .calcite
run: npx ${{env.CALCITE_CLI}} trigger $(git cat-file -p HEAD | awk 'NR > 1 {if(/^parent/){print $2;}{exit}}') -tt pullrequest
env:
CALCITE_TOKEN: ${{ secrets.CALCITE_TOKEN }}