-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 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,25 @@ | ||
name: Run benchmarks | ||
|
||
on: | ||
pull_request: | ||
types: [labeled, opened, synchronize, reopened] | ||
|
||
# Only trigger the benchmark job when you add `run benchmark` label to the PR | ||
jobs: | ||
Benchmark: | ||
runs-on: ubuntu-latest | ||
if: contains(github.event.pull_request.labels.*.name, 'run benchmark') | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: 1 | ||
- uses: julia-actions/julia-buildpkg@latest | ||
- name: Install dependencies | ||
run: julia -e 'using Pkg; pkg"add PkgBenchmark [email protected]"' | ||
- name: Run benchmarks | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge()' | ||
- name: Post results | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.postjudge()' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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,12 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125" | ||
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d" | ||
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" | ||
|
||
[compat] | ||
Krylov = "0.9.0" | ||
LinearOperators = "2.4.0" | ||
PkgBenchmark = "0.2" |
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,63 @@ | ||
using BenchmarkTools | ||
using Kylov, LinearAlgebra | ||
using PartitionedVectors | ||
|
||
const SUITE = BenchmarkGroup() | ||
|
||
N = 5 | ||
n = 8 | ||
element_variables = [[1, 2, 3, 4], [3, 4, 5, 6], [5, 6, 7], [5, 6, 8], Int[]] | ||
|
||
epv = PS.create_epv(element_variables; type = Float32, n) | ||
pv_x = PartitionedVector(element_variables; T = Float32, n) | ||
|
||
epm = PS.epm_from_epv(epv) | ||
PS.update!(epm, epv, Float32(2.0) * epv; verbose = false) | ||
lo_epm = LinearOperators.LinearOperator(epm) | ||
|
||
solver = Krylov.CgSolver(pv_x) | ||
|
||
pv_gradient = PartitionedVector(element_variables; T = Float32, n) | ||
for i = 1:N | ||
nie = pv_gradient[i].nie | ||
pv_gradient[i] = rand(Float32, nie) | ||
end | ||
|
||
res = similar(pv_x) | ||
|
||
Krylov.solve!(solver, lo_epm, -pv_gradient) | ||
SUITE["Krylov small PartitionedVectors"] = BenchmarkGroup() | ||
SUITE["Krylov small PartitionedVectors"] = @benchmarkable Krylov.solve!(solver, lo_epm, -pv_gradient) | ||
|
||
SUITE["small broadcast"] = BenchmarkGroup() | ||
SUITE["small broadcast"] = @benchmarkable res .= pv_gradient .+ 3 .* pv_gradient | ||
|
||
|
||
N = 1500 | ||
n = 20000 | ||
nie = 15 | ||
element_variables = map((i -> sample(1:n, nie, replace = false)), 1:N) | ||
|
||
epv = PS.create_epv(element_variables; type = Float32, n) | ||
pv_x = PartitionedVector(element_variables; T = Float32, n) | ||
|
||
epm = PS.epm_from_epv(epv) | ||
PS.update!(epm, epv, Float32(2.0) * epv; verbose = false) | ||
lo_epm = LinearOperators.LinearOperator(epm) | ||
|
||
solver = Krylov.CgSolver(pv_x) | ||
|
||
pv_gradient = PartitionedVector(element_variables; T = Float32, n) | ||
for i = 1:N | ||
nie = pv_gradient[i].nie | ||
pv_gradient[i] = rand(Float32, nie) | ||
end | ||
|
||
res = similar(pv_x) | ||
|
||
Krylov.solve!(solver, lo_epm, -pv_gradient) | ||
SUITE["Krylov big PartitionedVectors"] = BenchmarkGroup() | ||
SUITE["Krylov big PartitionedVectors"] = @benchmarkable Krylov.solve!(solver, lo_epm, -pv_gradient) | ||
|
||
SUITE["big broadcast"] = BenchmarkGroup() | ||
SUITE["big broadcast"] = @benchmarkable res .= pv_gradient .+ 3 .* pv_gradient |
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,7 @@ | ||
using PkgBenchmark | ||
|
||
commit = benchmarkpkg("Partitionedvectors") #dernier commit sur la branche sur laquelle on se trouve | ||
master = benchmarkpkg("Partitionedvectors", "master") # branche master | ||
judgement = judge(commit, master) | ||
|
||
export_markdown("benchmark/judgement.md", judgement) |