-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (164 loc) · 5.16 KB
/
benchmark.yaml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Benchmark and Publish
on:
push:
branches:
- master
workflow_dispatch:
# Add concurrency control
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
benchmark:
name: Run Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-01-02
- name: Clean Previous Benchmark Data
run: |
if [ -d ./target/criterion ]; then
rm -rf ./target/criterion
fi
- name: Cache Benchmark Data
uses: actions/cache@v3
id: cache-bench
with:
path: ./target/criterion
key: ${{ runner.os }}-bench-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bench-
- name: Run Benchmarks
run: cargo bench --bench tensor_ops
- name: Prepare Benchmark Results
run: |
# Create the benchmarks directory structure
mkdir -p processed_benchmarks/benchmarks
cp -r target/criterion/* processed_benchmarks/benchmarks/
# Rename long directories to shorter versions if needed
cd processed_benchmarks/benchmarks
if [ -d "TensorAdd_verification" ]; then
mv "TensorAdd_verification" "verify"
fi
if [ -d "TensorAdd_proving" ]; then
mv "TensorAdd_proving" "prove"
fi
if [ -d "TensorAdd_tracing" ]; then
mv "TensorAdd_tracing" "trace"
fi
- name: Create Custom Index Template
run: |
mkdir -p processed_benchmarks
cat > processed_benchmarks/index.html << 'EOL'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>LuminAIR Benchmark, by Giza</title>
<style>
.footer { display: none !important; }
body {
font-family: Arial, sans-serif;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
h1 {
font-size: 2.5em;
text-align: center;
color: #333;
margin-bottom: 0.5em;
}
.header {
text-align: center;
margin-bottom: 2em;
border-bottom: 2px solid #eee;
padding-bottom: 1em;
}
.content {
margin-top: 2em;
}
.benchmark-list {
list-style: none;
padding: 0;
}
.benchmark-list li {
margin: 1em 0;
padding: 1em;
background: #f8f9fa;
border-radius: 4px;
}
.benchmark-list a {
color: #0366d6;
text-decoration: none;
font-size: 1.1em;
}
.benchmark-list a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="header">
<h1>Performance Metrics on Supported Operators</h1>
<p>Performance benchmarks for tensor operators (stwo-backend support)</p>
</div>
<div class="content">
<ul class="benchmark-list">
{{#each benchmarks}}
<li><a href="{{this.path}}">{{this.name}}</a></li>
{{/each}}
</ul>
</div>
</body>
</html>
EOL
- name: Process Benchmark Results
uses: joshua-auchincloss/criterion-pages@v1
with:
path: "./processed_benchmarks"
config: |
{
"title": "LuminAIR Benchmark, by Giza",
"template": {
"index": "index.html"
},
"css": {
"footer": {
"display": "none"
},
"body": {
"font-family": "Arial, sans-serif"
},
"h1": {
"text-align": "center",
"font-size": "2.5em",
"color": "#333"
}
}
}
- name: Setup GitHub Pages
uses: actions/configure-pages@v3
- name: Upload Benchmark Artifact
uses: actions/upload-pages-artifact@v2
with:
path: "./processed_benchmarks"
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: benchmark
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy Benchmark Results
id: deployment
uses: actions/deploy-pages@v2