-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from albertomercurio/dev/patch-3
Add benchmark tracking
- Loading branch information
Showing
4 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Benchmark Tracking | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths-ignore: | ||
- 'docs/**' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths-ignore: | ||
- 'docs/**' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
permissions: | ||
actions: write | ||
contents: write | ||
deployments: write | ||
|
||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
if: ${{ !github.event.pull_request.draft }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: '1' | ||
arch: x64 | ||
- uses: julia-actions/cache@v1 | ||
- name: Run benchmark | ||
run: | | ||
cd benchmarks | ||
julia --project --threads=2 --color=yes -e ' | ||
using Pkg; | ||
Pkg.develop(PackageSpec(path=joinpath(pwd(), ".."))); | ||
Pkg.instantiate(); | ||
include("runbenchmarks.jl")' | ||
- name: Parse & Upload Benchmark Results | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Benchmark results | ||
tool: "julia" | ||
output-file-path: benchmarks/benchmarks_output.json | ||
summary-always: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
comment-always: true | ||
alert-threshold: "200%" | ||
fail-on-alert: true | ||
benchmark-data-dir-path: benchmarks | ||
auto-push: ${{ github.event_name != 'pull_request' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
.DS_Store | ||
|
||
*.jl.*.cov | ||
*.jl.cov | ||
*.jl.mem | ||
Manifest.toml | ||
docs/build/ | ||
.vscode | ||
|
||
.vscode | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
QuantumToolbox = "6c2fb7c5-b903-41d2-bc5e-5a7c320b9fab" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using BenchmarkTools | ||
using QuantumToolbox | ||
|
||
suite = BenchmarkGroup() | ||
|
||
suite["steadystate"] = BenchmarkGroup(["steadystate"]) | ||
|
||
|
||
## steadystate ## | ||
|
||
N = 50 | ||
Δ = 0.1 | ||
F = 2 | ||
γ = 1 | ||
a = destroy(N) | ||
H = Δ * a' * a + F * (a + a') | ||
c_ops = [sqrt(γ) * a] | ||
|
||
suite["steadystate"]["driven-dissipative harmonic oscillator"] = @benchmarkable steadystate($H, $c_ops) | ||
|
||
## end ## | ||
|
||
|
||
BenchmarkTools.tune!(suite) | ||
results = run(suite, verbose = true) | ||
display(median(results)) | ||
|
||
BenchmarkTools.save(joinpath(@__DIR__, "benchmarks_output.json"), median(results)) |