Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 274: Add continuous benchmark structure #298

Merged
merged 26 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/benchmark-EpiAware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run EpiAware benchmarks

on:
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: EpiAware
sparse-checkout-cone-mode: false
- name: Move EpiAware to root
run: mv EpiAware/* .
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- name: Setup benchmark environment
run: julia --project=benchmark -e 'using Pkg; Pkg.activate("benchmark-run"; shared = true)'
- name: Run benchmarks
run: julia --project=benchmark -e 'using BenchmarkCI; BenchmarkCI.judge(baseline = "origin/main")'
- name: Post results
run: julia --project=benchmark -e 'using BenchmarkCI; BenchmarkCI.postjudge()'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions EpiAware/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ docs/build
*.zip

.DS_Store

# benchmark ignore
/.benchmarkci
/benchmark/*.json
6 changes: 6 additions & 0 deletions EpiAware/benchmark/Project.toml
seabbs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
BenchmarkCI = "20533458-34a3-403d-a444-e18f38190b5b"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
EpiAware = "b2eeebe4-5992-4301-9193-7ebc9f62c855"
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
10 changes: 10 additions & 0 deletions EpiAware/benchmark/bench/EpiAwareUtils/EpiAwareUtils.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module BenchEpiAwareUtils

using BenchmarkTools, EpiAware

suite = BenchmarkGroup()

include("censored_pmf.jl")

end
BenchEpiAwareUtils.suite
5 changes: 5 additions & 0 deletions EpiAware/benchmark/bench/EpiAwareUtils/censored_pmf.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let
using Distributions
dist = Exponential(1.0)
suite["censored_pmf"] = @benchmarkable(censored_pmf($dist, Δd = 1.0, D = 3.0))
end
11 changes: 11 additions & 0 deletions EpiAware/benchmark/benchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using BenchmarkTools
SUITE = BenchmarkGroup()
for folder in readdir(joinpath(@__DIR__, "bench"))
if isdir(joinpath(@__DIR__, "bench", folder))
suite_name = basename(folder)
suite_file = joinpath(@__DIR__, "bench", folder, "$suite_name.jl")
if isfile(suite_file)
SUITE[suite_name] = include(suite_file)
end
end
end
11 changes: 11 additions & 0 deletions EpiAware/benchmark/runbenchmarks.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using PkgBenchmark
benchmarkpkg(
dirname(@__DIR__),
BenchmarkConfig(
env = Dict(
"JULIA_NUM_THREADS" => "1",
"OMP_NUM_THREADS" => "1"
),
),
resultfile = joinpath(@__DIR__, "result.json")
)
Loading