Skip to content

Commit f961e62

Browse files
committed
Add benchmark gate for GraalWasm.
1 parent 6797e61 commit f961e62

File tree

3 files changed

+81
-21
lines changed

3 files changed

+81
-21
lines changed

wasm/ci.jsonnet

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,20 @@ local common = import 'ci_common/common.jsonnet';
22

33
{
44
builds: [
5-
common.jdk8_gate_linux_eclipse_jdt + common.gate_graalwasm + {environment+: {SUITE: 'wasm', GATE_TAGS: 'style,fullbuild'}} + {name: 'gate-graalwasm-style-fullbuild-linux-amd64'},
6-
common.jdk8_gate_linux_wabt + common.gate_graalwasm_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'build,wasmtest'}} + {name: 'gate-graalwasm-unittest-linux-amd64'},
7-
common.jdk8_gate_linux_wabt_emsdk + common.gate_graalwasm_emsdk_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'buildall,wasmextratest'}} + {name: 'gate-graalwasm-extra-unittest-linux-amd64'},
8-
common.jdk8_gate_linux_wabt_emsdk + common.gate_graalwasm_emsdk_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'buildall,wasmbenchtest'}} + {name: 'gate-graalwasm-benchtest-linux-amd64'},
5+
# Gates.
6+
common.jdk8_gate_linux_eclipse_jdt + common.gate_graalwasm + {environment+: {SUITE: 'wasm', GATE_TAGS: 'style,fullbuild'}} + {name: 'gate-graalwasm-style-fullbuild-linux-amd64'},
7+
common.jdk8_gate_linux_wabt + common.gate_graalwasm_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'build,wasmtest'}} + {name: 'gate-graalwasm-unittest-linux-amd64'},
8+
common.jdk8_gate_linux_wabt_emsdk + common.gate_graalwasm_emsdk_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'buildall,wasmextratest'}} + {name: 'gate-graalwasm-extra-unittest-linux-amd64'},
9+
common.jdk8_gate_linux_wabt_emsdk + common.gate_graalwasm_emsdk_jvmci + {environment+: {SUITE: 'wasm', GATE_TAGS: 'buildall,wasmbenchtest'}} + {name: 'gate-graalwasm-benchtest-linux-amd64'},
10+
11+
# Benchmark jobs.
12+
common.jdk8_bench_linux_wabt_emsdk + common.bench_graalwasm_emsdk_jvmci + {
13+
name: 'gate-graalwasm-benchtest-linux-amd64',
14+
environment+: {
15+
BENCH_RUNNER: 'run_micro_benchmarks.sh',
16+
BENCH_VM: 'server',
17+
BENCH_VM_CONFIG: 'graal-core',
18+
},
19+
},
920
],
1021
}

wasm/ci_common/common.jsonnet

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
gate: {targets+: ['gate']},
1212

13+
bench: {targets+: ['bench', 'post-merge']},
14+
1315
common: {
1416
packages+: {
1517
'00:pip:logilab-common': '==1.4.4',
@@ -66,11 +68,31 @@
6668
local gate_cmd = ['mx', '--strict-compliance', 'gate', '--strict-mode', '--tags', '${GATE_TAGS}'],
6769
local gate_cmd_jvmci = ['mx', '--strict-compliance', '--dynamicimports', '/compiler', '--jdk', 'jvmci', 'gate', '--strict-mode', '--tags', '${GATE_TAGS}'],
6870

69-
gate_graalwasm: {
71+
setup_common: {
7072
setup+: [
7173
['cd', 'wasm'],
7274
['mx', 'sversions'],
7375
],
76+
},
77+
78+
setup_emsdk: {
79+
setup+: [
80+
['set-export', 'ROOT_DIR', ['pwd']],
81+
['set-export', 'EM_CONFIG', '$ROOT_DIR/.emscripten-config'],
82+
['cd', '$SUITE'],
83+
[
84+
'./generate_em_config',
85+
'$EM_CONFIG',
86+
'$EMSDK_DIR/myfastcomp/emscripten-fastcomp/bin/',
87+
'$EMSDK_DIR/myfastcomp/old-binaryen/',
88+
'$EMSDK_DIR/fastcomp/emscripten/',
89+
['which', 'node'],
90+
],
91+
['mx', 'sversions'],
92+
],
93+
},
94+
95+
gate_graalwasm: self.setup_common + {
7496
run+: [
7597
gate_cmd,
7698
],
@@ -88,28 +110,31 @@
88110
timelimit: '35:00',
89111
},
90112

91-
gate_graalwasm_emsdk_jvmci: {
92-
setup+: [
93-
['set-export', 'ROOT_DIR', ['pwd']],
94-
['set-export', 'EM_CONFIG', '$ROOT_DIR/.emscripten-config'],
95-
['cd', '$SUITE'],
96-
[
97-
'./generate_em_config',
98-
'$EM_CONFIG',
99-
'$EMSDK_DIR/myfastcomp/emscripten-fastcomp/bin/',
100-
'$EMSDK_DIR/myfastcomp/old-binaryen/',
101-
'$EMSDK_DIR/fastcomp/emscripten/',
102-
['which', 'node'],
103-
],
104-
['mx', 'sversions'],
105-
],
113+
gate_graalwasm_emsdk_jvmci: self.setup_emsdk + {
106114
run+: [
107115
gate_cmd_jvmci
108116
],
109117
timelimit: '35:00',
110118
},
111119

120+
bench_graalwasm_emsdk_jvmci: self.setup_emsdk + {
121+
environment+: {
122+
BENCH_RESULTS_FILE_PATH : 'bench-results.json',
123+
},
124+
setup+: [
125+
['mx', '--dy', '/compiler', 'build', '--all'],
126+
],
127+
run+: [
128+
'scripts/${BENCH_RUNNER}',
129+
'${BENCH_RESULTS_FILE_PATH}',
130+
'${BENCH_VM}',
131+
'${BENCH_VM_CONFIG}',
132+
'bench-uploader.py',
133+
],
134+
},
135+
136+
jdk8_gate_linux_eclipse_jdt : self.jdk8 + self.gate + self.linux + self.eclipse + self.jdt,
112137
jdk8_gate_linux_wabt : self.jdk8 + self.gate + self.linux + self.wabt,
113138
jdk8_gate_linux_wabt_emsdk : self.jdk8 + self.gate + self.linux + self.wabt + self.emsdk,
114-
jdk8_gate_linux_eclipse_jdt : self.jdk8 + self.gate + self.linux + self.eclipse + self.jdt,
139+
jdk8_bench_linux_wabt_emsdk : self.jdk8 + self.bench + self.linux + self.wabt + self.emsdk,
115140
}

wasm/scripts/run_micro_benchmarks.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
# Runs all benchmarks from the microbenchmark suite.
4+
5+
set -e
6+
7+
RESULTS_FILE_PATH=$1
8+
VM=$2
9+
VM_CONFIG=$3
10+
UPLOAD_CMD=$4
11+
12+
for benchmark in cdf digitron event-sim fft
13+
do
14+
mx --dy /compiler --kill-with-sigquit benchmark \
15+
"--machine-name=${MACHINE_NAME}" \
16+
"--results-file=${RESULTS_FILE}" \
17+
wasm:WASM_BENCHMARKCASES -- \
18+
--jvm ${VM} --jvm-config ${VM_CONFIG} \
19+
-Dwasmbench.benchmarkName=1$benchmark -Dwasmtest.keepTempFiles=true -- \
20+
CMicroBenchmarkSuite
21+
22+
${UPLOAD_CMD} "${RESULTS_FILE_PATH}"
23+
done
24+

0 commit comments

Comments
 (0)