Skip to content

Commit fdd2e1a

Browse files
committed
Test
[only benchmarks]
1 parent 5251b6c commit fdd2e1a

File tree

4 files changed

+94
-4
lines changed

4 files changed

+94
-4
lines changed

.buildkite/pipeline.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,35 @@ steps:
123123
# continue_on_failure: true
124124

125125
- group: ":racehorse: Benchmarks"
126-
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.
126+
steps:
127+
- label: "Metal: Run Benchmarks"
128+
plugins:
129+
- JuliaCI/julia#v1:
130+
version: "1.10"
131+
command: |
132+
julia --project=perf -e '
133+
using Pkg
134+
135+
println("--- :julia: Instantiating project")
136+
Pkg.develop([PackageSpec(path=pwd())])
137+
Pkg.instantiate()
138+
push!(LOAD_PATH, @__DIR__)
139+
140+
println("+++ :julia: Benchmarking")
141+
include("perf/runbenchmarks.jl")'
142+
artifact_paths:
143+
- "benchmarkresults.json"
144+
agents:
145+
queue: "juliaecosystem"
146+
os: "macos"
147+
arch: "aarch64"
148+
if: |
149+
build.message =~ /\[only benchmarks\]/ ||
150+
build.message !~ /\[only/ && !build.pull_request.draft &&
151+
build.message !~ /\[skip benchmarks\]/
152+
timeout_in_minutes: 30
153+
154+
129155
- label: "Benchmarks (dry run)"
130156
plugins:
131157
- JuliaCI/julia#v1:

.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)