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 all 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
36 changes: 36 additions & 0 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run benchmarks

on:
pull_request:
paths:
- 'EpiAware/**'
merge_group:
paths:
- 'EpiAware/**'

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

jobs:
Benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/cache@v1
- name: Install dependencies
run: |
julia --project=benchmark -e 'using Pkg;
Pkg.rm("EpiAware");
Pkg.rm("EpiAwarePipeline");
Pkg.resolve();
Pkg.instantiate();
Pkg.develop(path = "./EpiAware");
Pkg.develop(path = "./pipeline")'
- 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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,7 @@ docs/site/

#Ignore generated Pluto notebooks
EpiAware/docs/src/examples/*.md

# benchmark ignore
/.benchmarkci
/benchmark/*.json
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
8 changes: 8 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name = "Rtwithoutrenewal"
uuid = "5f18122a-2e46-11ef-2c26-2d57cbc8fe48"
authors = ["Samuel Abbott <[email protected]>", "Samuel Brand <[email protected]>", "Zachary Susswein <[email protected]>"]
version = "0.1.0-DEV"

[deps]
EpiAware = "b2eeebe4-5992-4301-9193-7ebc9f62c855"
EpiAwarePipeline = "66314692-3678-4cbb-b3ac-6fcb54505317"
7 changes: 7 additions & 0 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[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"
EpiAwarePipeline = "66314692-3678-4cbb-b3ac-6fcb54505317"
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d"
10 changes: 10 additions & 0 deletions 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 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 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 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")
)
6 changes: 6 additions & 0 deletions src/Rtwithoutrenewal.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Rtwithoutrenewal

using EpiAware
using EpiAwarePipeline

end
Loading