-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (84 loc) · 2.64 KB
/
run-on-runner.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
name: Run Benchmarks on EC2 Runner
on:
workflow_dispatch:
inputs:
runner_name:
required: true
type: string
instance_type:
required: true
type: string
enable_gpu:
required: true
type: string
provers:
required: false
type: string
default: 'sp1'
programs:
required: false
type: string
default: 'loop,fibonacci,tendermint,reth1,reth2'
filename:
required: false
type: string
default: 'benchmark'
trials:
required: false
type: string
default: '1'
sp1_ref:
required: false
type: string
default: '2e8b0a8'
additional_params:
required: false
type: string
default: '{"hashfns":"poseidon","shard_sizes":"22"}'
jobs:
run-benchmark:
runs-on: ${{ inputs.runner_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Parse additional parameters
id: parse-params
run: |
echo 'ADDITIONAL_PARAMS<<EOF' >> $GITHUB_ENV
echo '${{ inputs.additional_params }}' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Update SP1 and build
env:
SP1_REF: ${{ inputs.sp1_ref }}
RUN_BUILD: "true"
run: |
chmod +x update_sp1_and_build.sh
./update_sp1_and_build.sh
- name: Build Docker image
run: |
docker build -t zkvm-perf --platform linux/amd64 -f Dockerfile.gpu .
- name: Run benchmark
run: |
docker run ${{ inputs.enable_gpu == 'true' && '--gpus all' || '' }} --platform linux/amd64 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${{ github.workspace }}/benchmarks:/usr/src/app/benchmarks \
-e RUST_BACKTRACE=full \
--network host \
zkvm-perf \
python3 sweep.py \
--filename ${{ inputs.filename }} \
--trials ${{ inputs.trials }} \
--programs ${{ inputs.programs }} \
--provers ${{ inputs.provers }} \
--hashfns ${{ fromJson(env.ADDITIONAL_PARAMS).hashfns }} \
--shard-sizes ${{ fromJson(env.ADDITIONAL_PARAMS).shard_sizes }}
- name: Upload benchmark results
uses: actions/upload-artifact@v2
with:
name: benchmark-results-${{ inputs.instance_type }}
path: ${{ github.workspace }}/benchmarks/*.csv
- name: Print Results
run: |
cat ${{ github.workspace }}/benchmarks/*.csv