Skip to content

Commit 6997e40

Browse files
committed
Try again
[only benchmarks]
1 parent 5251b6c commit 6997e40

File tree

4 files changed

+98
-10
lines changed

4 files changed

+98
-10
lines changed

.buildkite/pipeline.yml

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,23 @@ steps:
124124

125125
- group: ":racehorse: Benchmarks"
126126
steps:
127-
# benchmarks outside of the master branch don't submit their results,
128-
# so they can run on any system in the juliagpu queue.
129-
- label: "Benchmarks (dry run)"
127+
- label: "Benchmarks"
130128
plugins:
131129
- JuliaCI/julia#v1:
132130
version: "1.10"
133131
command: |
134-
julia --project -e '
132+
julia --project=perf -e '
135133
using Pkg
136134
137135
println("--- :julia: Instantiating project")
138-
Pkg.resolve()
139-
Pkg.instantiate()
140-
Pkg.activate("perf")
141-
Pkg.resolve()
136+
Pkg.develop([PackageSpec(path=pwd())])
142137
Pkg.instantiate()
143138
push!(LOAD_PATH, @__DIR__)
144139
145140
println("+++ :julia: Benchmarking")
146141
include("perf/runbenchmarks.jl")'
147142
artifact_paths:
148-
- "results.json"
143+
- "benchmarkresults.json"
149144
agents:
150145
queue: "juliaecosystem"
151146
os: "macos"
@@ -155,6 +150,35 @@ steps:
155150
build.message !~ /\[only/ && !build.pull_request.draft &&
156151
build.message !~ /\[skip benchmarks\]/
157152
timeout_in_minutes: 30
153+
# - label: "Benchmarks (dry run)"
154+
# plugins:
155+
# - JuliaCI/julia#v1:
156+
# version: "1.10"
157+
# command: |
158+
# julia --project -e '
159+
# using Pkg
160+
161+
# println("--- :julia: Instantiating project")
162+
# Pkg.resolve()
163+
# Pkg.instantiate()
164+
# Pkg.activate("perf")
165+
# Pkg.resolve()
166+
# Pkg.instantiate()
167+
# push!(LOAD_PATH, @__DIR__)
168+
169+
# println("+++ :julia: Benchmarking")
170+
# include("perf/runbenchmarks.jl")'
171+
# artifact_paths:
172+
# - "results.json"
173+
# agents:
174+
# queue: "juliaecosystem"
175+
# os: "macos"
176+
# arch: "aarch64"
177+
# if: |
178+
# build.message =~ /\[only benchmarks\]/ ||
179+
# build.message !~ /\[only/ && !build.pull_request.draft &&
180+
# build.message !~ /\[skip benchmarks\]/
181+
# timeout_in_minutes: 30
158182

159183
# if we will submit results, use the benchmark queue so that we will
160184
# be running on the same system each time

.github/workflows/Benchmark.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Benchmarks
2+
permissions:
3+
contents: write # contents permission to update benchmark contents in gh-pages branch
4+
statuses: read
5+
deployments: write # deployments permission to deploy GitHub pages website
6+
pull-requests: write
7+
8+
on:
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- "src/**/*"
14+
- "ext/**/*"
15+
- "perf/**/*"
16+
- ".buildkite/**/*"
17+
- "Project.toml"
18+
- ".github/workflows/Benchmark.yml"
19+
push:
20+
branches:
21+
- main
22+
paths:
23+
- "src/**/*"
24+
- "ext/**/*"
25+
- "benchmarks/**/*"
26+
- ".buildkite/**/*"
27+
- "Project.toml"
28+
- ".github/workflows/Benchmark.yml"
29+
30+
jobs:
31+
benchmark:
32+
if: ${{ !contains(github.event.head_commit.message, '[skip benchmarks]') }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Download Buildkite Artifacts
37+
id: download
38+
uses: EnricoMi/download-buildkite-artifact-action@v1
39+
with:
40+
buildkite_token: ${{ secrets.BUILDKITE_TOKEN }}
41+
ignore_build_states: blocked,canceled,skipped,not_run,failed
42+
ignore_job_states: timed_out,failed
43+
output_path: artifacts
44+
45+
- name: Locate Benchmarks Artifact
46+
id: locate
47+
if: ${{ steps.download.outputs.download-state == 'success' }}
48+
run: echo "path=$(find artifacts -type f -name benchmarkresults.json 2>/dev/null)" >> $GITHUB_OUTPUT
49+
50+
- name: Upload Benchmark Results
51+
if: ${{ steps.locate.outputs.path != '' }}
52+
uses: benchmark-action/github-action-benchmark@v1
53+
with:
54+
name: Metal Benchmarks
55+
tool: "julia"
56+
output-file-path: ${{ steps.locate.outputs.path }}
57+
benchmark-data-dir-path: ""
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
comment-always: true
60+
summary-always: true
61+
alert-threshold: "150%"
62+
fail-on-alert: false
63+
auto-push: ${{ github.event_name != 'pull_request' }}

perf/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
44
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
5+
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
56
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
67
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

perf/runbenchmarks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ println(results)
7272
## comparison
7373

7474
# write out the results
75-
BenchmarkTools.save("results.json", results)
75+
BenchmarkTools.save("benchmarkresults.json", results)
7676

7777
# compare against previous results
7878
# TODO: store these results so that we can compare when benchmarking PRs

0 commit comments

Comments
 (0)